Merge branch 'stable-2.6' into stable-2.7
* stable-2.6: Bump JSch to 1.5.0 to fix Java7 compatibility Extend AddBranchResult with toString method implementation Get rid of JdbcSQLException while numbers are read from cache
This commit is contained in:
@@ -27,6 +27,7 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.sql.Types;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
@@ -267,7 +268,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(PreparedStatement ps, int col, K value) throws SQLException {
|
void set(PreparedStatement ps, int col, K value) throws SQLException {
|
||||||
ps.setObject(col, value);
|
ps.setObject(col, value, Types.JAVA_OBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
Funnel<K> funnel() {
|
Funnel<K> funnel() {
|
||||||
@@ -488,7 +489,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
keyType.set(c.put, 1, key);
|
keyType.set(c.put, 1, key);
|
||||||
c.put.setObject(2, holder.value);
|
c.put.setObject(2, holder.value, Types.JAVA_OBJECT);
|
||||||
c.put.setTimestamp(3, new Timestamp(holder.created));
|
c.put.setTimestamp(3, new Timestamp(holder.created));
|
||||||
c.put.setTimestamp(4, new Timestamp(System.currentTimeMillis()));
|
c.put.setTimestamp(4, new Timestamp(System.currentTimeMillis()));
|
||||||
c.put.executeUpdate();
|
c.put.executeUpdate();
|
||||||
|
@@ -41,6 +41,19 @@ public class AddBranchResult {
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
if (hasError()) {
|
||||||
|
return getError().toString();
|
||||||
|
}
|
||||||
|
if (getListBranchesResult() != null) {
|
||||||
|
return "succeed, no repository: "
|
||||||
|
+ getListBranchesResult().getNoRepository() + ", can add: "
|
||||||
|
+ getListBranchesResult().getCanAdd();
|
||||||
|
}
|
||||||
|
return "succeed";
|
||||||
|
}
|
||||||
|
|
||||||
public static class Error {
|
public static class Error {
|
||||||
public static enum Type {
|
public static enum Type {
|
||||||
/** The branch cannot be created because the given branch name is invalid. */
|
/** The branch cannot be created because the given branch name is invalid. */
|
||||||
|
2
pom.xml
2
pom.xml
@@ -582,7 +582,7 @@ limitations under the License.
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.jcraft</groupId>
|
||||||
<artifactId>jsch</artifactId>
|
<artifactId>jsch</artifactId>
|
||||||
<version>0.1.44-1</version>
|
<version>0.1.50</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
Reference in New Issue
Block a user