Skip to content

Commit e4bf9c3

Browse files
author
chengyitian
committed
AJ-465、AJ-467: fix replaceColName issue and optimize error info;
1 parent 3dad83f commit e4bf9c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/com/xxdb/data/BasicTable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ public void setColName (final List<String> colNames) {
130130
*/
131131
public void replaceColName(String originalColName, String newColName) {
132132
if (Utils.isEmpty(originalColName) || Utils.isEmpty(newColName))
133-
throw new RuntimeException("The param 'newColName' cannot be null or empty.");
133+
throw new RuntimeException("The param 'originalColName' or 'newColName' cannot be null or empty.");
134134

135-
if (!this.colNames.contains(originalColName) && this.colNames.contains(newColName))
135+
if (this.colNames.contains(newColName))
136136
throw new RuntimeException("The newColName '" + newColName +"' already exists in table. Column names cannot be duplicated.");
137137

138138
if (this.colNames.contains(originalColName)) {

0 commit comments

Comments
 (0)