No effective change - remove unused BindValue comment

This commit is contained in:
Robin Bygrave
2015-07-31 23:09:31 +12:00
parent 498f567e37
commit 39cb85fda6
3 changed files with 17 additions and 56 deletions
@@ -1,7 +1,5 @@
package com.avaje.ebeaninternal.server.persist;
import java.sql.SQLException;
/**
* Handles the processing required after batch execution.
* <p>
@@ -7,8 +7,6 @@ import java.util.ArrayList;
*/
public class BindValues {
int commentCount;
final ArrayList<Value> list = new ArrayList<Value>();
/**
@@ -21,7 +19,7 @@ public class BindValues {
* Return the number of bind values.
*/
public int size() {
return list.size() - commentCount;
return list.size();
}
/**
@@ -34,11 +32,6 @@ public class BindValues {
list.add(new Value(value, dbType, name));
}
public void addComment(String comment){
++commentCount;
list.add(new Value(comment));
}
/**
* List of bind values.
*/
@@ -56,38 +49,16 @@ public class BindValues {
private final int dbType;
private final String name;
private final boolean isComment;
/**
* Create a comment. This is so that comments can be put into
* the bind log.
*/
public Value(String comment) {
this.name = comment;
this.isComment = true;
value = null;
dbType = 0;
}
/**
* Create the value.
*/
public Value(Object value, int dbType, String name) {
this.isComment = false;
this.value = value;
this.dbType = dbType;
this.name = name;
}
/**
* This is a comment for the bind log and NOT an actual bind value.
*/
public boolean isComment() {
return isComment;
}
/**
* Return the type as per java.sql.Types.
*/
@@ -43,30 +43,22 @@ public class Binder {
ArrayList<BindValues.Value> list = bindValues.values();
for (int i = 0; i < list.size(); i++) {
BindValues.Value bindValue = list.get(i);
if (bindValue.isComment()) {
if (bindBuf != null) {
bindBuf.append(bindValue.getName());
if (logPrefix.equals("")) {
logPrefix = ", ";
}
}
} else {
Object val = bindValue.getValue();
int dt = bindValue.getDbType();
bindObject(dataBind, val, dt);
if (bindBuf != null) {
bindBuf.append(logPrefix);
if (logPrefix.equals("")) {
logPrefix = ", ";
}
bindBuf.append(bindValue.getName());
bindBuf.append("=");
if (isLob(dt)) {
bindBuf.append("[LOB]");
} else {
bindBuf.append(String.valueOf(val));
}
Object val = bindValue.getValue();
int dt = bindValue.getDbType();
bindObject(dataBind, val, dt);
if (bindBuf != null) {
bindBuf.append(logPrefix);
if (logPrefix.equals("")) {
logPrefix = ", ";
}
bindBuf.append(bindValue.getName());
bindBuf.append("=");
if (isLob(dt)) {
bindBuf.append("[LOB]");
} else {
bindBuf.append(String.valueOf(val));
}
}
}