Skip to content

Commit c9137b0

Browse files
authored
Modify Comments: Configuration.StrictMap<V> put(String key, V value) … (#2854)
* Modify Comments: Configuration.StrictMap<V> put(String key, V value) comments update. * Modify Comments: Configuration.StrictMap<V> put(String key, V value) comments update. * Modify Comments: Configuration.StrictMap<V> put(String key, V value) comments update.
1 parent 9e43552 commit c9137b0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/org/apache/ibatis/session/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ public StrictMap<V> conflictMessageProducer(BiFunction<V, V, String> conflictMes
10671067
@SuppressWarnings("unchecked")
10681068
public V put(String key, V value) {
10691069
if (containsKey(key)) {
1070-
throw new IllegalArgumentException(name + " already contains value for " + key
1070+
throw new IllegalArgumentException(name + " already contains key " + key
10711071
+ (conflictMessageProducer == null ? "" : conflictMessageProducer.apply(super.get(key), value)));
10721072
}
10731073
if (key.contains(".")) {

src/test/java/org/apache/ibatis/session/SqlSessionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void shouldFailToAddDueToNameConflict() {
127127
c.addCache(cache);
128128
fail("Exception expected.");
129129
} catch (Exception e) {
130-
assertTrue(e.getMessage().contains("already contains value"));
130+
assertTrue(e.getMessage().contains("already contains key"));
131131
}
132132
}
133133

@@ -441,7 +441,7 @@ void shouldThrowExceptionIfTryingToAddStatementWithSameNameInXml() {
441441
fail("Expected exception to be thrown due to statement that already exists.");
442442
} catch (Exception e) {
443443
assertTrue(e.getMessage().contains(
444-
"already contains value for org.apache.ibatis.domain.blog.mappers.BlogMapper.selectBlogWithPostsUsingSubSelect. please check org/apache/ibatis/builder/BlogMapper.xml and org/mybatis/TestMapper.xml"));
444+
"already contains key org.apache.ibatis.domain.blog.mappers.BlogMapper.selectBlogWithPostsUsingSubSelect. please check org/apache/ibatis/builder/BlogMapper.xml and org/mybatis/TestMapper.xml"));
445445
}
446446
}
447447

@@ -456,7 +456,7 @@ void shouldThrowExceptionIfTryingToAddStatementWithSameNameInAnnotation() {
456456
fail("Expected exception to be thrown due to statement that already exists.");
457457
} catch (Exception e) {
458458
assertTrue(e.getMessage().contains(
459-
"already contains value for org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor2. please check org/apache/ibatis/domain/blog/mappers/AuthorMapper.java (best guess) and org/mybatis/TestMapper.xml"));
459+
"already contains key org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor2. please check org/apache/ibatis/domain/blog/mappers/AuthorMapper.java (best guess) and org/mybatis/TestMapper.xml"));
460460
}
461461
}
462462

src/test/java/org/apache/ibatis/submitted/results_id/IdConflictTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void shouldFailOnDuplicatedId() {
2929
Configuration configuration = new Configuration();
3030
when(() -> configuration.addMapper(IdConflictMapper.class));
3131
then(caughtException()).isInstanceOf(RuntimeException.class).hasMessage(
32-
"Result Maps collection already contains value for org.apache.ibatis.submitted.results_id.IdConflictMapper.userResult");
32+
"Result Maps collection already contains key org.apache.ibatis.submitted.results_id.IdConflictMapper.userResult");
3333
}
3434

3535
}

0 commit comments

Comments
 (0)