anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: apache/shardingsphere
Issue: error when Logic table have the same name as Actual table .

### update
it looks like a driver compatibility problem with `mysql-connector-java` of 6.0.6 or above
the issue title should updated in some days
---
i just use database sharding not table sharding, but when Logic table have the same name as Actual table, some error occurs
``` 
Caused by: java.sql.SQLException: Column name pattern can not be NULL or empty.
```
here is my config of yaml
```yaml
shardingRule:
  tables:
   # same name as Actual table， but when i use ms_ds${1..2}.t_user1, it will be ok
   # but when i change table name in mysql to t_user1，then ms_ds${1..2}.t_user1 does not work either
    t_user:
      actualDataNodes: ms_ds${1..2}.t_user
      databaseStrategy:
        inline:
          shardingColumn: id
          algorithmExpression: ms_ds${id % 2 + 1}

      keyGeneratorColumnName: id
```

i think it may be a bug



Changed files:
sharding-core/src/main/java/io/shardingsphere/core/metadata/table/executor/TableMetaDataLoader.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/metadata/table/executor/TableMetaDataLoader.java b/sharding-core/src/main/java/io/shardingsphere/core/metadata/table/executor/TableMetaDataLoader.java
index db34b6f2696..19cda450549 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/metadata/table/executor/TableMetaDataLoader.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/metadata/table/executor/TableMetaDataLoader.java
@@ -133,7 +133,7 @@ public final class TableMetaDataLoader {
     private List<ColumnMetaData> getColumnMetaDataList(final Connection connection, final String catalog, final String actualTableName) throws SQLException {
         List<ColumnMetaData> result = new LinkedList<>();
         Collection<String> primaryKeys = getPrimaryKeys(connection, catalog, actualTableName);
-        try (ResultSet resultSet = connection.getMetaData().getColumns(catalog, null, actualTableName, null)) {
+        try (ResultSet resultSet = connection.getMetaData().getColumns(catalog, null, actualTableName, "%")) {
             while (resultSet.next()) {
                 String columnName = resultSet.getString("COLUMN_NAME");
                 String columnType = resultSet.getString("TYPE_NAME");
Repository: apache/shardingsphere
Issue: OpenTracingSQLExecutionHook.toStringList NullPointerException

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/sharding-sphere/sharding-sphere/issues).
- Read documentation: [ShardingSphere Doc](http://shardingsphere.io/document/current/en/overview/).

Please pay attention on issues you submitted, because we maybe need more details. 
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of ShardingSphere did you use?
3.0.1
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
### Expected behavior
sharding-opentracing log trace without effect main execute
### Actual behavior
log trace throw NullPointerException effect sql execute
### Reason analyze (If you can)
OpenTracingSQLExecutionHook.toStringList method, when params has null, such as insert, call guava Joiner.toString throw NullPointerException 
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
As above
### Example codes for reproduce this issue (such as a github link).
As above

Changed files:
sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHook.java

diff --git a/sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHook.java b/sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHook.java
index 0e2589543c7..edd0ad6018a 100644
--- a/sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHook.java
+++ b/sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHook.java
@@ -64,7 +64,7 @@ public final class OpenTracingSQLExecutionHook implements SQLExecutionHook {
         if (null == parameterSets || parameterSets.isEmpty()) {
             return "";
         }
-        return String.format("[%s]", Joiner.on(", ").join(parameterSets));
+        return String.format("[%s]", Joiner.on(", ").useForNull("Null").join(parameterSets));
     }
     
     @Override
Repository: apache/shardingsphere
Issue: Table name of no sharding is set low-case defaultly

### Which version of Sharding-Sphere do you using?
2.0.3

### Expected behavior
insert data correctly

### Actual behavior
can't insert data, throw exception "Table 'test' doesn't exist"

### Reason analyze
Database is case-sensitive and table name is in upper-case. a part of tables is sharing, and other part of tables is not sharding, when insert data into no sharding table, it throw exception "Table 'test' doesn't exist".
The reason is that sharding-jdbc set table name low-case defaultly.

Changed files:
sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java b/sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java
index 1114f15583b..3ff955fccb9 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java
@@ -133,7 +133,7 @@ public final class ShardingRule {
             return tableRule.get();
         }
         if (!Strings.isNullOrEmpty(shardingDataSourceNames.getDefaultDataSourceName())) {
-            return createTableRuleWithDefaultDataSource(logicTableName.toLowerCase());
+            return createTableRuleWithDefaultDataSource(logicTableName);
         }
         throw new ShardingConfigurationException("Cannot find table rule and default data source with logic table: '%s'", logicTableName);
     }
Repository: apache/shardingsphere
Issue: Mysql aurora version not supported

## Bug Report
jdbcUrl = jdbc:mysql:aurora://host:3306/..
Then throws exception: "The URL of JDBC is not supported. Please refer to this pattern: jdbc:mysql://([\\w\\-\\.]+):?([0-9]*)/([\\w\\-]+);?\\S* "

See: https://github.com/sharding-sphere/sharding-sphere/blob/dev/sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java#L44



Changed files:
sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java b/sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java
index f9a202c76c0..00a79826cc3 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/metadata/datasource/dialect/MySQLDataSourceMetaData.java
@@ -41,14 +41,14 @@ public final class MySQLDataSourceMetaData implements DataSourceMetaData {
     
     private final String schemeName;
     
-    private final Pattern pattern = Pattern.compile("jdbc:mysql://([\\\\w\\\\-\\\\.]+):?([0-9]*)/([\\\\w\\\\-]+);?\\\\S*", Pattern.CASE_INSENSITIVE);
+    private final Pattern pattern = Pattern.compile("jdbc:mysql:(\\\\w*:)?//([\\\\w\\\\-\\\\.]+):?([0-9]*)/([\\\\w\\\\-]+);?\\\\S*", Pattern.CASE_INSENSITIVE);
     
     public MySQLDataSourceMetaData(final String url) {
         Matcher matcher = pattern.matcher(url);
         if (matcher.find()) {
-            hostName = matcher.group(1);
-            port = Strings.isNullOrEmpty(matcher.group(2)) ? DEFAULT_PORT : Integer.valueOf(matcher.group(2));
-            schemeName = matcher.group(3);
+            hostName = matcher.group(2);
+            port = Strings.isNullOrEmpty(matcher.group(3)) ? DEFAULT_PORT : Integer.valueOf(matcher.group(3));
+            schemeName = matcher.group(4);
         } else {
             throw new ShardingException("The URL of JDBC is not supported. Please refer to this pattern: %s.", pattern.pattern());
         }
Repository: apache/shardingsphere
Issue: 4.0.0.M1-SNAPSHOT report a error :  current logic schema is null

The version using sharding-sphere is 4.0.0.M1-SNAPSHOT.
I use sharding-Proxy.
I configure a config-sharding file, there is no problem in querying data with java code, but I will get an error when connecting to the service with navicat.

     Unknown exception: current logic schema is null







Changed files:
sharding-proxy/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/ComQueryBackendHandlerFactory.java

diff --git a/sharding-proxy/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/ComQueryBackendHandlerFactory.java b/sharding-proxy/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/ComQueryBackendHandlerFactory.java
index 7d55f1389d0..f874705f857 100644
--- a/sharding-proxy/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/ComQueryBackendHandlerFactory.java
+++ b/sharding-proxy/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/ComQueryBackendHandlerFactory.java
@@ -39,6 +39,9 @@ import org.apache.shardingsphere.shardingproxy.backend.text.transaction.SkipBack
 import org.apache.shardingsphere.shardingproxy.backend.text.transaction.TransactionBackendHandler;
 import org.apache.shardingsphere.transaction.core.TransactionOperationType;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * Com query backend handler factory.
  *
@@ -53,9 +56,7 @@ public final class ComQueryBackendHandlerFactory {
     
     private static final String SET_AUTOCOMMIT_1 = "SET AUTOCOMMIT=1";
     
-    private static final String GUI_SET_NAMES = "SET NAMES";
-    
-    private static final String GUI_SHOW_VARIABLES = "SHOW VARIABLES LIKE";
+    private static final List<String> GUI_SQL = Arrays.asList("SET NAMES", "SHOW VARIABLES LIKE", "SHOW CHARACTER SET", "SHOW COLLATION");
     
     /**
      * Create new text protocol backend handler instance.
@@ -81,10 +82,13 @@ public final class ComQueryBackendHandlerFactory {
         return SQLType.DAL == sqlStatement.getType() ? createDALBackendHandler(sqlStatement, sql, backendConnection) : new QueryBackendHandler(sql, backendConnection);
     }
     
-    private static TextProtocolBackendHandler createDALBackendHandler(
-            final SQLStatement sqlStatement, final String sql, final BackendConnection backendConnection) {
-        if (null == backendConnection.getLogicSchema() && (sql.toUpperCase().startsWith(GUI_SET_NAMES) || sql.toUpperCase().startsWith(GUI_SHOW_VARIABLES))) {
-            return new GUICompatibilityBackendHandler();
+    private static TextProtocolBackendHandler createDALBackendHandler(final SQLStatement sqlStatement, final String sql, final BackendConnection backendConnection) {
+        if (null == backendConnection.getLogicSchema()) {
+            for (String each : GUI_SQL) {
+                if (sql.toUpperCase().startsWith(each)) {
+                    return new GUICompatibilityBackendHandler();
+                }
+            }
         }
         if (sqlStatement instanceof SetStatement) {
             return new BroadcastBackendHandler(sql, backendConnection);
Repository: apache/shardingsphere
Issue: ShardingConnection commit 时，持有的 Connection commit 异常时，后面的 Connection 无法提交

ShardingConnection 继承自 AbstractConnectionAdapter， commit 代码如下：

```Java
// AbstractConnectionAdapter.java

    @Override
    public final void commit() throws SQLException {
        for (Connection each : getConnections()) {
            each.commit();
        }
    }
    
    @Override
    public final void rollback() throws SQLException {
        Collection<SQLException> exceptions = new LinkedList<>();
        for (Connection each : getConnections()) {
            try {
                each.rollback();
            } catch (final SQLException ex) {
                exceptions.add(ex);
            }
        }
        throwSQLExceptionIfNecessary(exceptions);
    }
```

* 未对 `Connection#commit()` 异常进行捕获，导致异常时，后面的 Connection 无法提交

参考 `#rollback()` 方法修改如下：

``` Java
    @Override
    public final void commit() throws SQLException {
        Collection<SQLException> exceptions = new LinkedList<>();
        for (Connection each : getConnections()) {
            try {
                each.commit();
            } catch (final SQLException ex) {
                exceptions.add(ex);
            }
        }
        throwSQLExceptionIfNecessary(exceptions);
    }
```

已经提交 pr。

Changed files:
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/jdbc/adapter/AbstractConnectionAdapter.java

diff --git a/sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/jdbc/adapter/AbstractConnectionAdapter.java b/sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/jdbc/adapter/AbstractConnectionAdapter.java
index e21c6fd1c3e..fc26e005572 100644
--- a/sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/jdbc/adapter/AbstractConnectionAdapter.java
+++ b/sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/jdbc/adapter/AbstractConnectionAdapter.java
@@ -63,9 +63,15 @@ public abstract class AbstractConnectionAdapter extends AbstractUnsupportedOpera
     
     @Override
     public final void commit() throws SQLException {
+        Collection<SQLException> exceptions = new LinkedList<>();
         for (Connection each : getConnections()) {
-            each.commit();
+            try {
+                each.commit();
+            } catch (final SQLException ex) {
+                exceptions.add(ex);
+            }
         }
+        throwSQLExceptionIfNecessary(exceptions);
     }
     
     @Override
Repository: apache/shardingsphere
Issue: can't get partition key value 

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/sharding-sphere/sharding-sphere/issues).
- Read documentation: [ShardingSphere Doc](http://shardingsphere.io/document/current/en/overview/).

Please pay attention on issues you submitted, because we maybe need more details. 
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of ShardingSphere did you use?
3.1.0
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-Proxy
### Expected behavior
    ps = connection.prepareStatement("select * from t_order where merc_no='1234567891' and tx_dt in ('20190102', '20190103') limit 0,10 ");



08:38:35.467 [main] INFO MyComplexKeysShardingAlgorithm - collection:["ds_0","ds_1","ds_2","ds_3"],shardingValues:[{"columnName":"merc_no","logicTableName":"t_order","values"**:[-1]**},{"columnName":"tx_dt","logicTableName":"t_order",**"values":[-1,-1]}**]
t_order:
  databaseStrategy:
    complex:
      shardingColumns: merc_no, tx_dt
      algorithmClassName: MyComplexKeysShardingAlgorithm
  tableStrategy:
    inline:
      shardingColumn: tx_dt
      algorithmExpression: t_order_${tx_dt}

### Actual behavior

### Reason analyze (If you can)

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

### Example codes for reproduce this issue (such as a github link).


Changed files:
sharding-core/src/main/java/io/shardingsphere/core/parsing/antlr/sql/segment/expr/CommonExpressionSegment.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/parsing/antlr/sql/segment/expr/CommonExpressionSegment.java b/sharding-core/src/main/java/io/shardingsphere/core/parsing/antlr/sql/segment/expr/CommonExpressionSegment.java
index d1e0e029c8f..13a4ed01a43 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/parsing/antlr/sql/segment/expr/CommonExpressionSegment.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/parsing/antlr/sql/segment/expr/CommonExpressionSegment.java
@@ -37,5 +37,5 @@ public final class CommonExpressionSegment extends ExpressionWithAliasSegment {
     
     private int index = -1;
     
-    private Number value = -1;
+    private Number value;
 }
Repository: apache/shardingsphere
Issue: mysql workbench cannot connect in 3.0.0

I config username and password and can connect in mysql wordbench in **3.0.0.M2**.

But i cannot connect in **3.0.0**, return is
_"Failed to Connect to MySQL at 127.0.0.1:3307 with user root
Unknown database '`sharding_db`'"_


Changed files:
sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/SchemaIgnoreBackendHandler.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/SchemaIgnoreBackendHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/SchemaIgnoreBackendHandler.java
index 3f70ebe653a..a5c52c37db4 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/SchemaIgnoreBackendHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/SchemaIgnoreBackendHandler.java
@@ -22,6 +22,7 @@ import io.shardingsphere.core.merger.dal.show.ShowDatabasesMergedResult;
 import io.shardingsphere.core.parsing.parser.dialect.mysql.statement.ShowDatabasesStatement;
 import io.shardingsphere.core.parsing.parser.dialect.mysql.statement.UseStatement;
 import io.shardingsphere.core.parsing.parser.sql.SQLStatement;
+import io.shardingsphere.core.util.SQLUtil;
 import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
 import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
 import io.shardingsphere.shardingproxy.transport.mysql.constant.ColumnType;
@@ -90,7 +91,7 @@ public final class SchemaIgnoreBackendHandler implements BackendHandler {
     }
     
     private CommandResponsePackets handleUseStatement(final UseStatement useStatement, final FrontendHandler frontendHandler) {
-        String schema = useStatement.getSchema();
+        String schema = SQLUtil.getExactlyValue(useStatement.getSchema());
         if (!GLOBAL_REGISTRY.schemaExists(schema)) {
             return new CommandResponsePackets(new ErrPacket(1, ServerErrorCode.ER_BAD_DB_ERROR, schema));
         }
Repository: apache/shardingsphere
Issue: Proxy gets NULL Pointer exception when disable datasource from registry.

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/sharding-sphere/sharding-sphere/issues).
- Read documentation: [Sharding-Sphere Doc](http://shardingsphere.io/document/current/en/overview/).

Please pay attention on issues you submitted, because we maybe need more details. 
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of Sharding-Sphere did you use?
3.0.0.M5
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-Proxy

### The problem is:
If  we have no disabled datasource in registry, the proxy will renew the datasource map, but will get null exception.

Changed files:
sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
index c2f905f8b79..aade829a5dc 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
@@ -36,6 +36,7 @@ import lombok.AccessLevel;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 
+import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -196,7 +197,15 @@ public final class GlobalRegistry {
     @Subscribe
     public void renewDisabledDataSourceNames(final ProxyDisabledStateEventBusEvent disabledStateEventBusEvent) {
         for (Entry<String, ShardingSchema> entry : shardingSchemas.entrySet()) {
-            entry.getValue().getBackendDataSource().setAvailableDataSources(disabledStateEventBusEvent.getDisabledSchemaDataSourceMap().get(entry.getKey()));
+            entry.getValue().getBackendDataSource().setAvailableDataSources(getDisabledDataSourceNames(disabledStateEventBusEvent.getDisabledSchemaDataSourceMap(), entry.getKey()));
         }
     }
+    
+    private Collection<String> getDisabledDataSourceNames(final Map<String, Collection<String>> disabledSchemaDataSourceMap, final String shardingSchemaName) {
+        Collection<String> result = new LinkedList<>();
+        if (disabledSchemaDataSourceMap.containsKey(shardingSchemaName)) {
+            result.addAll(disabledSchemaDataSourceMap.get(shardingSchemaName));
+        }
+        return result;
+    }
 }
Repository: apache/shardingsphere
Issue: Reuse PreparedStatement cause cache of route result do not clean

Please answer these questions before submitting your issue. Thanks!

### Which version of Sharding-Jdbc do you using?
1.5.3
### Expected behavior
使用mybaits作为orm框架
开启spring事物支持时，在mybaits的settings中将defaultExecutorType设置为REUSE,
在同一个事物中查询时，即使路由不同的表查询正常
### Actual behavior
开启事物
路由到同一张表是则查询正常，路由不同的表则异常
### Steps to reproduce the behavior
1.启动项目
2Controller包下的的方法
3.点击控制台打印的路径 http://localhot:8081/select
若想不产生这个bug可以采取如下两种方法之一
1.关闭事物
2.开启事物则需将mybatisConfig.xml的defaultExecutorType设置为SIMPLE

### Please provide the reproduce example codes (such as github link) if possible.
https://git.oschina.net/lxhs/com.study.demo.git

Changed files:
sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatement.java

diff --git a/sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatement.java b/sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatement.java
index ea4e92a00b1..83d11abbf82 100644
--- a/sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatement.java
+++ b/sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatement.java
@@ -129,6 +129,7 @@ public final class ShardingPreparedStatement extends AbstractShardingPreparedSta
     
     @Override
     public ResultSet executeQuery() throws SQLException {
+        routedStatements.clear();
         ResultSet result;
         try {
             Collection<PreparedStatementUnit> preparedStatementUnits = route();
@@ -150,6 +151,7 @@ public final class ShardingPreparedStatement extends AbstractShardingPreparedSta
     
     @Override
     public int executeUpdate() throws SQLException {
+        routedStatements.clear();
         try {
             Collection<PreparedStatementUnit> preparedStatementUnits = route();
             return new PreparedStatementExecutor(
@@ -164,6 +166,7 @@ public final class ShardingPreparedStatement extends AbstractShardingPreparedSta
     
     @Override
     public boolean execute() throws SQLException {
+        routedStatements.clear();
         try {
             Collection<PreparedStatementUnit> preparedStatementUnits = route();
             return new PreparedStatementExecutor(
Repository: apache/shardingsphere
Issue: Support parsing numbers beginning with minus and decimal (e.g. `-.12`)

**BUG**

当前最新分支上，io.shardingjdbc.core.parsing.lexer.Lexer中代码：
```java
private boolean isNumberBegin() {
        return CharType.isDigital(getCurrentChar(0)) || ('.' == getCurrentChar(0) && CharType.isDigital(getCurrentChar(1)) && !isIdentifierBegin(getCurrentChar(-1))
                || ('-' == getCurrentChar(0) && ('.' == getCurrentChar(0) || CharType.isDigital(getCurrentChar(1)))));
    }
```
最后一个判断负数的逻辑，应该是 `('-' == getCurrentChar(0) && ('.' == getCurrentChar(1) || CharType.isDigital(getCurrentChar(1))))`，才能解析出 `-.12` 这种情况



Changed files:
sharding-jdbc-core/src/test/java/io/shardingjdbc/core/parsing/lexer/LexerTest.java
sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/lexer/Lexer.java

diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/lexer/Lexer.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/lexer/Lexer.java
index 93c8e3e68fb..aaaac141f63 100755
--- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/lexer/Lexer.java
+++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/lexer/Lexer.java
@@ -119,7 +119,7 @@ public class Lexer {
     
     private boolean isNumberBegin() {
         return CharType.isDigital(getCurrentChar(0)) || ('.' == getCurrentChar(0) && CharType.isDigital(getCurrentChar(1)) && !isIdentifierBegin(getCurrentChar(-1))
-                || ('-' == getCurrentChar(0) && ('.' == getCurrentChar(0) || CharType.isDigital(getCurrentChar(1)))));
+                || ('-' == getCurrentChar(0) && ('.' == getCurrentChar(1) || CharType.isDigital(getCurrentChar(1)))));
     }
     
     private boolean isSymbolBegin() {
diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/core/parsing/lexer/LexerTest.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/core/parsing/lexer/LexerTest.java
index 708faf2381a..9bb1968c843 100644
--- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/core/parsing/lexer/LexerTest.java
+++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/core/parsing/lexer/LexerTest.java
@@ -74,6 +74,7 @@ public final class LexerTest {
         assertNextTokenForNumber("0x-1e", Literals.HEX);
         assertNextTokenForNumber("123", Literals.INT);
         assertNextTokenForNumber("-123", Literals.INT);
+        assertNextTokenForNumber("-.123", Literals.FLOAT);
         assertNextTokenForNumber("123.0", Literals.FLOAT);
         assertNextTokenForNumber("123e4", Literals.FLOAT);
         assertNextTokenForNumber("123E4", Literals.FLOAT);
Repository: apache/shardingsphere
Issue: sharding-proxy测试问题（中文乱码，应用死锁等）

Please answer these questions before submitting your issue. Thanks!
开源不易，我们希望将精力放在完成新功能和解决有价值的问题上，为了让大家的配合更具有效率，请填写以下列出的全部问题

### Which version of Sharding-Sphere do you using?（您使用的Sharding-Sphere版本为？）
windows 10
mysql5.5
sharding-proxy-3.0.0.M1
### Expected behavior （您预期的结果是）
1、中文正常
2、能马上返回错误
3、shardingColumn大小写忽略
### Actual behavior （实际运行的结果是）
1、中文乱码
2、应用死锁
3、shardingColumn需大小写一致
### Steps to reproduce the behavior （可重现问题的操作步骤）
1、springboot配置了sharding-proxy的数据源，如下：
spring.datasource.slave2.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.slave2.url=jdbc:mysql://127.0.0.1:3307/sharding_db?characterEncoding=utf8
spring.datasource.slave2.username=root
spring.datasource.slave2.password=sa
在insert时，中文为乱码。（不用sharding-proxy正常） 不知道还需要在哪里配置？

2、insert插入时shardingColumn在config.yaml中无法获取到dataSources，应用死锁。

3、shardingColumn需要严格大小写一致，实际上有些数据库是不区分大小写。

### Please provide the reproduce example codes (such as github link)，otherwise we will label the issue as Invalid and close it.（为了节省复现问题的时间，请务必提供可重现的代码，否则我们会将issue直接标记为invalid并关闭）

Code should based on https://github.com/sharding-sphere/sharding-sphere-example
（代码请基于 https://github.com/sharding-sphere/sharding-sphere-example）


Changed files:
sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLExecuteBackendHandler.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLExecuteBackendHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLExecuteBackendHandler.java
index ade62d7cc16..8096c64f002 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLExecuteBackendHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLExecuteBackendHandler.java
@@ -106,7 +106,7 @@ public final class SQLExecuteBackendHandler implements BackendHandler {
                 return executeForSharding();
             }
         } catch (final Exception ex) {
-            return new CommandResponsePackets(new ErrPacket(1, 0, "", "", ex.getMessage()));
+            return new CommandResponsePackets(new ErrPacket(1, 0, "", "", "" + ex.getMessage()));
         }
     }
Repository: apache/shardingsphere
Issue: SelectItem should be annotated by EqualsAndHashCode

I found that there are several subclasses implement  `SelectItem`. They are used as container elements in  `Set` collection(io.shardingjdbc.core.parsing.parser.sql.dql.select.SelectStatement#items), but I only see the `AggregationSelectItem` has `EqualsAndHashCode` annotation. the others are forgotten?

Changed files:
sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/StarSelectItem.java
sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/CommonSelectItem.java

diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/CommonSelectItem.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/CommonSelectItem.java
index 0014848d29c..aafe561f10c 100644
--- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/CommonSelectItem.java
+++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/CommonSelectItem.java
@@ -18,6 +18,7 @@
 package io.shardingjdbc.core.parsing.parser.context.selectitem;
 
 import com.google.common.base.Optional;
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import lombok.ToString;
@@ -29,6 +30,7 @@ import lombok.ToString;
  */
 @RequiredArgsConstructor
 @Getter
+@EqualsAndHashCode
 @ToString
 public final class CommonSelectItem implements SelectItem {
     
diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/StarSelectItem.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/StarSelectItem.java
index 21ddd52e409..629b6df34a7 100644
--- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/StarSelectItem.java
+++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/context/selectitem/StarSelectItem.java
@@ -19,6 +19,7 @@ package io.shardingjdbc.core.parsing.parser.context.selectitem;
 
 import io.shardingjdbc.core.parsing.lexer.token.Symbol;
 import com.google.common.base.Optional;
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import lombok.ToString;
@@ -30,6 +31,7 @@ import lombok.ToString;
  */
 @RequiredArgsConstructor
 @Getter
+@EqualsAndHashCode
 @ToString
 public final class StarSelectItem implements SelectItem {
Repository: apache/shardingsphere
Issue: RoundRobinMasterSlaveLoadBalanceAlgorithm throw an ArrayIndexOutOfBoundsException

For English only, other languages we will close it directly.

Please answer these questions before submitting your issue. Thanks!

Before submit a new issue, please check existed issue first, to make sure your issue is not a duplicated one.

### Which version of Sharding-Sphere do you using?
3.0.0.M3

### Which project do you using? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC

### Expected behavior
RoundRobinMasterSlaveLoadBalance always be OK

### Actual behavior
after roundrobin Integer.MAX_VALUE times,  will  throw an ArrayIndexOutOfBoundsException.

### Reason analyze
the AtomicInteger's getAndIncrement() may produce an negative numbers.

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc

### For bug report, please *MUST* provide the reproduce example codes (such as a github link).


Changed files:
sharding-core/src/main/java/io/shardingsphere/core/api/algorithm/masterslave/RoundRobinMasterSlaveLoadBalanceAlgorithm.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/api/algorithm/masterslave/RoundRobinMasterSlaveLoadBalanceAlgorithm.java b/sharding-core/src/main/java/io/shardingsphere/core/api/algorithm/masterslave/RoundRobinMasterSlaveLoadBalanceAlgorithm.java
index 955c8c71b03..fe7effb48b0 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/api/algorithm/masterslave/RoundRobinMasterSlaveLoadBalanceAlgorithm.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/api/algorithm/masterslave/RoundRobinMasterSlaveLoadBalanceAlgorithm.java
@@ -35,6 +35,6 @@ public final class RoundRobinMasterSlaveLoadBalanceAlgorithm implements MasterSl
         AtomicInteger count = COUNT_MAP.containsKey(name) ? COUNT_MAP.get(name) : new AtomicInteger(0);
         COUNT_MAP.putIfAbsent(name, count);
         count.compareAndSet(slaveDataSourceNames.size(), 0);
-        return slaveDataSourceNames.get(count.getAndIncrement() % slaveDataSourceNames.size());
+        return slaveDataSourceNames.get(Math.abs(count.getAndIncrement()) % slaveDataSourceNames.size());
     }
 }
Repository: apache/shardingsphere
Issue: autogen key sharding-column can't be routed succeed while using default sharding strategy

## Bug Report

### Which version of ShardingSphere did you use?
4.0.0.M1-SNAPSHOT

### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC

### Expected behavior
order_id use SNOWFLAKE algorithm, which is the table sharding-colum.
`INSERT INTO t_order (user_id, status) VALUES (?, ?) ` should be routed to
t_order_0 or t_order_1

### Actual behavior
route to t_order_0 and t_order_1

### Reason analyze (If you can)
OptimizeEngine haven't make autogen sharding-column as `ShardingCondition`

### Example codes for reproduce this issue (such as a github link).
following unit test case of sharding-example project.
`io.shardingsphere.example.jdbc.nodep.JavaConfigurationExampleTest#assertShardingTables`


Changed files:
sharding-core/src/main/java/org/apache/shardingsphere/core/optimizer/engine/sharding/insert/InsertOptimizeEngine.java

diff --git a/sharding-core/src/main/java/org/apache/shardingsphere/core/optimizer/engine/sharding/insert/InsertOptimizeEngine.java b/sharding-core/src/main/java/org/apache/shardingsphere/core/optimizer/engine/sharding/insert/InsertOptimizeEngine.java
index a8f4861efd8..a0b06b63037 100644
--- a/sharding-core/src/main/java/org/apache/shardingsphere/core/optimizer/engine/sharding/insert/InsertOptimizeEngine.java
+++ b/sharding-core/src/main/java/org/apache/shardingsphere/core/optimizer/engine/sharding/insert/InsertOptimizeEngine.java
@@ -179,13 +179,9 @@ public final class InsertOptimizeEngine implements OptimizeEngine {
     
     private void fillShardingCondition(final ShardingCondition shardingCondition, final Comparable<?> currentGeneratedKey) {
         Column generateKeyColumn = shardingRule.findGenerateKeyColumn(insertStatement.getTables().getSingleTableName()).get();
-        if (isShardingColumn(generateKeyColumn)) {
+        if (shardingRule.isShardingColumn(generateKeyColumn)) {
             shardingCondition.getShardingValues().add(new ListRouteValue<>(generateKeyColumn, new GeneratedKeyCondition(generateKeyColumn, -1, currentGeneratedKey).getConditionValues(parameters)));
         }
         insertStatement.setContainGenerateKey(true);
     }
-    
-    private boolean isShardingColumn(final Column generateKeyColumn) {
-        return shardingRule.getTableRule(generateKeyColumn.getTableName()).getAllShardingColumns().contains(generateKeyColumn.getName());
-    }
 }
Repository: apache/shardingsphere
Issue: CommandExecutor.writeMoreResults deadlock

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/sharding-sphere/sharding-sphere/issues).
- Read documentation: [ShardingSphere Doc](http://shardingsphere.io/document/current/en/overview/).

Please pay attention on issues you submitted, because we maybe need more details. 
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of ShardingSphere did you use?
3.1.0-SNAPSHOT

### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-Proxy

### Expected behavior
When flag isWritable turn to false, it can turn back to ture in future.

### Actual behavior
When flag isWritable turn to false, it can't turn back to ture in future.

### Reason analyze (If you can)
When flag isWritable turn to false, the data that has been written didn't flush. So the client can't read any data, this cause the water level high.

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
set proxy.frontend.flush.threshold: 1000000

### Example codes for reproduce this issue (such as a github link).
N.A.

Changed files:
sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/CommandExecutor.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/CommandExecutor.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/CommandExecutor.java
index 3c3d9cf89d1..a6b0e4e5cdc 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/CommandExecutor.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/CommandExecutor.java
@@ -105,6 +105,7 @@ public final class CommandExecutor implements Runnable {
         while (queryCommandPacket.next()) {
             count++;
             while (!context.channel().isWritable() && context.channel().isActive()) {
+                context.flush();
                 synchronized (frontendHandler) {
                     try {
                         frontendHandler.wait();
Repository: ibotpeaches/apktool
Issue: Could not decode res(arsc)

### Information
1. **Apktool Version (`2.2.3`)** -
2. **Operating System (Windows)** -
3. **APK From? I don't know.** -

### Stacktrace/Logcat
```
I: Using Apktool 2.2.3 on test.zip
I: Loading resource table...
W: null
Exception in thread "main" java.lang.NullPointerException
        at brut.androlib.res.data.value.ResValueFactory.factory(ResValueFactory.java:74)
        at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:315)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:241)
        at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:226)
        at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:156)
        at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:118)
        at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:80)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:562)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:72)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:64)
        at brut.androlib.Androlib.getResTable(Androlib.java:68)
        at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:207)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:109)
        at brut.apktool.Main.cmdDecode(Main.java:166)
        at brut.apktool.Main.main(Main.java:81)
```

### Steps to Reproduce
1. `apktool d -s test.zip `


### APK
[test.zip](https://github.com/iBotPeaches/Apktool/files/1157951/test.zip)



Changed files:
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java

diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java
index c8d30b85..e3db655f 100644
--- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java
+++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java
@@ -71,6 +71,9 @@ public class ResValueFactory {
     }
 
     public ResIntBasedValue factory(String value, int rawValue) {
+        if (value == null) {
+            return new ResFileValue("", rawValue);
+        }
         if (value.startsWith("res/")) {
             return new ResFileValue(value, rawValue);
         }
Repository: ibotpeaches/apktool
Issue: Regression: if frame-path does not exist

https://github.com/iBotPeaches/Apktool/blob/3ec4f360ab09782421e47d16f88a95dd7f7d2058/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java#L793

Ten lines further down the directory is created if it does not exist already.

Changed files:
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java

diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java
index 05c8e840..76aea94f 100644
--- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java
+++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java
@@ -790,7 +790,7 @@ final public class AndrolibResources {
 
         File dir = new File(path);
 
-        if (!dir.isDirectory()) {
+        if (!dir.isDirectory() && dir.isFile()) {
             throw new AndrolibException("--frame-path is set to a file, not a directory.");
         }
Repository: ibotpeaches/apktool
Issue: I found a problem while unpacking a apk named by “xxx  .apk” --- with the blank space at the end of the apk name. 

hi, I found a problem while unpacking a apk named by “xxx  .apk” --- with the blank space at the end of the apk name.   (apktool V2.0.3  on Win7 )

```
F:\\test>apktool.bat d -f "test  .apk"
I: Using Apktool 2.1.0-a64a03-SNAPSHOT on test  .apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.io.FileNotFoundException: test  \\AndroidManifest.xml (系统找
不到指定的路径。)
        at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecode
r.java:142)
        at brut.androlib.res.AndrolibResources.decodeManifestWithResources(Andro
libResources.java:199)
        at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:142)

        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:100)
        at brut.apktool.Main.cmdDecode(Main.java:165)
        at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: tes
t  \\AndroidManifest.xml (系统找不到指定的路径。)
        at brut.directory.FileDirectory.getFileOutputLocal(FileDirectory.java:64
)
        at brut.directory.AbstractDirectory.getFileOutput(AbstractDirectory.java
:115)
        at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecode
r.java:138)
        ... 5 more
Caused by: java.io.FileNotFoundException: test  \\AndroidManifest.xml (系统找不到
指定的路径。)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at brut.directory.FileDirectory.getFileOutputLocal(FileDirectory.java:62
)
        ... 7 more
```

---

But, It is OK with the param "-o"

F:\\test>apktool.bat d -f "test  .apk" -o test

so,  Apktool do not handle the path correctly ?


Changed files:
brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java

diff --git a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java
index 2256ca9e..eac49618 100644
--- a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java
+++ b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java
@@ -151,7 +151,7 @@ public class Main {
             // make out folder manually using name of apk
             String outName = apkName;
             outName = outName.endsWith(".apk") ? outName.substring(0,
-                    outName.length() - 4) : outName + ".out";
+                    outName.length() - 4).trim() : outName + ".out";
 
             // make file from path
             outName = new File(outName).getName();
Repository: appium/appium
Issue: Android button click returns false on success

When clicking a button on Android, uiautomator always returns false even though it was a successful click. Other buttons return the expected `true` value when clicked.


Changed files:
android/bootstrap/src/io/appium/android/bootstrap/handler/Click.java

diff --git a/android/bootstrap/src/io/appium/android/bootstrap/handler/Click.java b/android/bootstrap/src/io/appium/android/bootstrap/handler/Click.java
index ee0e21e6d..599184020 100644
--- a/android/bootstrap/src/io/appium/android/bootstrap/handler/Click.java
+++ b/android/bootstrap/src/io/appium/android/bootstrap/handler/Click.java
@@ -39,8 +39,8 @@ public class Click extends CommandHandler {
     if (command.isElementCommand()) {
       try {
         final AndroidElement el = command.getElement();
-        final boolean res = el.click();
-        return getSuccessResult(res);
+        el.click();
+        return getSuccessResult(true);
       } catch (final UiObjectNotFoundException e) {
         return new AndroidCommandResult(WDStatus.NO_SUCH_ELEMENT,
             e.getMessage());
Repository: appium/appium
Issue: Source is broken

```
warn: remote object '/data/local/tmp/dump.xml' does not exist
```

I'm seeing this when testing on a local emulator.

> info: [ADB STDOUT] Error in testRunServer:
> info: [ADB STDOUT] java.lang.IllegalStateException: UiAutomationService not connected. Did you call #register()?

The response to dump is strange.

> adb -s emulator-5554 shell uiautomator dump /data/local/tmp/dump.xml
> Killed 


Changed files:
android/bootstrap/src/io/appium/android/bootstrap/SocketServer.java

diff --git a/android/bootstrap/src/io/appium/android/bootstrap/SocketServer.java b/android/bootstrap/src/io/appium/android/bootstrap/SocketServer.java
index d77c243d4..f5b659265 100644
--- a/android/bootstrap/src/io/appium/android/bootstrap/SocketServer.java
+++ b/android/bootstrap/src/io/appium/android/bootstrap/SocketServer.java
@@ -117,7 +117,7 @@ class SocketServer {
     final TimerTask updateWatchers = new TimerTask() {
       @Override
       public void run() {
-        watchers.check();
+        try { watchers.check(); } catch (Exception e) {}
       }
     };
     timer.scheduleAtFixedRate(updateWatchers, 100, 100);
Repository: appium/appium
Issue: finding android.webkit.WebView object fails

I am trying to find the android.webkit.WebView element in my hybrid android app.

I am using XPATH "//web" to find_element. Appium server is searching for "android.widget.WebView" instead of "android.webkit.WebView" and fails.

AndroidElementClassMap seems to look only in android.widget namespace.

Used android 4.2 OS to test this.

Thanks in advance.
-Vishwanath 


Changed files:
android/bootstrap/src/io/appium/android/bootstrap/AndroidElementClassMap.java

diff --git a/android/bootstrap/src/io/appium/android/bootstrap/AndroidElementClassMap.java b/android/bootstrap/src/io/appium/android/bootstrap/AndroidElementClassMap.java
index 2a56eafad..6d306a0d6 100644
--- a/android/bootstrap/src/io/appium/android/bootstrap/AndroidElementClassMap.java
+++ b/android/bootstrap/src/io/appium/android/bootstrap/AndroidElementClassMap.java
@@ -134,7 +134,7 @@ public class AndroidElementClassMap {
     map.put("viewpager", "ViewPager");
     map.put("viewstub", "ViewStub");
     map.put("viewswitcher", "ViewSwitcher");
-    map.put("web", "WebView");
+    map.put("web", "android.webkit.WebView");
     map.put("window", "FrameLayout");
     map.put("zoom", "ZoomButton");
     map.put("zoomcontrols", "ZoomControls");