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:
Shawn Pearce
2013-11-05 11:14:11 -08:00
3 changed files with 17 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Calendar;
import java.util.Map;
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 {
ps.setObject(col, value);
ps.setObject(col, value, Types.JAVA_OBJECT);
}
Funnel<K> funnel() {
@@ -488,7 +489,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> {
}
try {
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(4, new Timestamp(System.currentTimeMillis()));
c.put.executeUpdate();

View File

@@ -41,6 +41,19 @@ public class AddBranchResult {
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 enum Type {
/** The branch cannot be created because the given branch name is invalid. */

View File

@@ -582,7 +582,7 @@ limitations under the License.
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.44-1</version>
<version>0.1.50</version>
</dependency>
<dependency>