Skip to content

Commit 9ee2547

Browse files
committed
Polish messages
1 parent 94566be commit 9ee2547

File tree

3 files changed

+620
-386
lines changed

3 files changed

+620
-386
lines changed

src/main/java/org/seasar/doma/internal/jdbc/scalar/Scalars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public final class Scalars {
7373
if (result == null) {
7474
result = wrapEnumObject(value, boxedClass, optional);
7575
if (result == null) {
76-
throw new ScalarException(Message.DOMA1007, valueClass.getName(), value);
76+
throw new ScalarException(Message.DOMA1007, valueClass.getName());
7777
}
7878
}
7979
}

src/main/java/org/seasar/doma/internal/jdbc/sql/NodePreparedSqlBuilder.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public Void visitLiteralVariableNode(final LiteralVariableNode node, Context p)
232232
location.getSql(),
233233
location.getLineNumber(),
234234
location.getPosition(),
235-
node.getText());
235+
node.getVariableName());
236236
}
237237
};
238238
return visitValueNode(node, p, validator.andThen(p::addLiteralValue));
@@ -286,31 +286,31 @@ public Void visitEmbeddedVariableNode(EmbeddedVariableNode node, Context p) {
286286
location.getSql(),
287287
location.getLineNumber(),
288288
location.getPosition(),
289-
node.getText());
289+
node.getVariableName());
290290
}
291291
if (fragment.indexOf(';') > -1) {
292292
throw new JdbcException(
293293
Message.DOMA2117,
294294
location.getSql(),
295295
location.getLineNumber(),
296296
location.getPosition(),
297-
node.getText());
297+
node.getVariableName());
298298
}
299299
if (fragment.indexOf("--") > -1) {
300300
throw new JdbcException(
301301
Message.DOMA2122,
302302
location.getSql(),
303303
location.getLineNumber(),
304304
location.getPosition(),
305-
node.getText());
305+
node.getVariableName());
306306
}
307307
if (fragment.indexOf("/*") > -1) {
308308
throw new JdbcException(
309309
Message.DOMA2123,
310310
location.getSql(),
311311
location.getLineNumber(),
312312
location.getPosition(),
313-
node.getText());
313+
node.getVariableName());
314314
}
315315
if (!startsWithClauseKeyword(fragment)) {
316316
p.setAvailable(true);
@@ -335,7 +335,8 @@ protected Void handleSingleValueNode(
335335
Object value,
336336
Class<?> valueClass,
337337
Consumer<Scalar<?, ?>> consumer) {
338-
Supplier<Scalar<?, ?>> supplier = wrap(node.getLocation(), node.getText(), value, valueClass);
338+
Supplier<Scalar<?, ?>> supplier =
339+
wrap(node.getLocation(), node.getVariableName(), value, valueClass);
339340
consumer.accept(supplier.get());
340341
return null;
341342
}
@@ -355,10 +356,11 @@ protected void handleIterableValueNode(
355356
location.getSql(),
356357
location.getLineNumber(),
357358
location.getPosition(),
358-
node.getText(),
359+
node.getVariableName(),
359360
index);
360361
}
361-
Supplier<Scalar<?, ?>> supplier = wrap(node.getLocation(), node.getText(), v, v.getClass());
362+
Supplier<Scalar<?, ?>> supplier =
363+
wrap(node.getLocation(), node.getVariableName(), v, v.getClass());
362364
consumer.accept(supplier.get());
363365
p.appendRawSql(", ");
364366
p.appendFormattedSql(", ");

0 commit comments

Comments
 (0)