Skip to content

Commit ed04bbc

Browse files
author
chengyitian
committed
AJ-470: code review, optimize code;
1 parent 0c4d77c commit ed04bbc

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,18 +617,24 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress,
617617
this.mutex_ = new ReentrantLock();
618618
}
619619

620+
/**
621+
* This method has been deprecated since 'Java API 1.30.22.4' and will be disabled in the next version: 'Java API 1.30.22.4'.
622+
* @param asynchronousTask
623+
* @param useSSL
624+
* @param compress
625+
* @param usePython
626+
* @param isUrgent
627+
* @param isReverseStreaming
628+
* @param sqlStd
629+
*/
620630
@Deprecated
621631
public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, boolean isReverseStreaming, SqlStdEnum sqlStd){
622632
this.conn_ = new DBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, isReverseStreaming, sqlStd);
623633
this.mutex_ = new ReentrantLock();
624634
}
625635

626636
public static DBConnection internalCreateEnableReverseStreamingDBConnection(boolean asynchronousTask, boolean useSSL, boolean compress, boolean usePython, boolean isUrgent, SqlStdEnum sqlStd) {
627-
DBConnection dbConnection = new DBConnection();
628-
dbConnection.conn_ = dbConnection.createEnableReverseStreamingDBConnectionImpl(asynchronousTask, useSSL, compress, usePython, isUrgent, sqlStd);
629-
dbConnection.mutex_ = new ReentrantLock();
630-
631-
return dbConnection;
637+
return new DBConnection(asynchronousTask, useSSL, compress, usePython, isUrgent, true, sqlStd);
632638
}
633639

634640
public boolean isBusy() {

src/com/xxdb/data/BasicDecimal128Vector.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,7 @@ public void Append(Scalar value) throws Exception{
451451
if (scale_ < 0)
452452
throw new RuntimeException("Please set scale first.");
453453

454-
if(value.getDataType() == DT_DECIMAL128)
455-
add(value.getString());
456-
else
457-
add(value.getNumber().toString());
454+
add(value.getString());
458455
}
459456

460457
@Override

src/com/xxdb/data/BasicDecimal32Vector.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,7 @@ public void Append(Scalar value) throws Exception{
334334
throw new RuntimeException("Please set scale first.");
335335
}
336336

337-
if(value.getDataType() == DT_DECIMAL32)
338-
add(value.getString());
339-
else
340-
add(value.getNumber().doubleValue());
337+
add(value.getString());
341338
}
342339

343340
@Override

src/com/xxdb/data/BasicDecimal64Vector.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,7 @@ public void Append(Scalar value) throws Exception{
339339
if (scale_ < 0)
340340
throw new RuntimeException("Please set scale first.");
341341

342-
if(value.getDataType() == DT_DECIMAL64)
343-
add(value.getString());
344-
else
345-
add(value.getNumber().doubleValue());
342+
add(value.getString());
346343
}
347344

348345
@Override

0 commit comments

Comments
 (0)