File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/org/apache/ibatis/session Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1155,7 +1155,7 @@ public V put(String key, V value) {
1155
1155
if (super .get (shortKey ) == null ) {
1156
1156
super .put (shortKey , value );
1157
1157
} else {
1158
- super .put (shortKey , (V ) new Ambiguity ( shortKey ) );
1158
+ super .put (shortKey , (V ) Ambiguity . INSTANCE );
1159
1159
}
1160
1160
}
1161
1161
return super .put (key , value );
@@ -1177,13 +1177,16 @@ public V get(Object key) {
1177
1177
throw new IllegalArgumentException (name + " does not contain value for " + key );
1178
1178
}
1179
1179
if (value instanceof Ambiguity ) {
1180
- throw new IllegalArgumentException ((( Ambiguity ) value ). getSubject () + " is ambiguous in " + name
1180
+ throw new IllegalArgumentException (key + " is ambiguous in " + name
1181
1181
+ " (try using the full name including the namespace, or rename one of the entries)" );
1182
1182
}
1183
1183
return value ;
1184
1184
}
1185
1185
1186
1186
protected static class Ambiguity {
1187
+
1188
+ protected static Ambiguity INSTANCE = new Ambiguity ("ambiguity" );
1189
+
1187
1190
private final String subject ;
1188
1191
1189
1192
public Ambiguity (String subject ) {
You can’t perform that action at this time.
0 commit comments