Skip to content

Commit 26b5d2e

Browse files
committed
Fix error message
fix gh-842
1 parent 32c4f18 commit 26b5d2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ private void parseCacheRef() {
203203
Class<?> refType = cacheDomainRef.value();
204204
String refName = cacheDomainRef.name();
205205
if (refType == void.class && refName.isEmpty()) {
206-
throw new BuilderException("Should be specified either value() and namespace() attribute in the @CacheNamespaceRef");
206+
throw new BuilderException("Should be specified either value() or name() attribute in the @CacheNamespaceRef");
207207
}
208208
if (refType != void.class && !refName.isEmpty()) {
209-
throw new BuilderException("Cannot use both value() and namespace() attribute in the @CacheNamespaceRef");
209+
throw new BuilderException("Cannot use both value() and name() attribute in the @CacheNamespaceRef");
210210
}
211211
String namespace = (refType != void.class) ? refType.getName() : refName;
212212
assistant.useCacheRef(namespace);

src/test/java/org/apache/ibatis/submitted/cache/CacheTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public void shouldErrorUnsupportedProperties() {
358358
@Test
359359
public void shouldErrorInvalidCacheNamespaceRefAttributesSpecifyBoth() {
360360
expectedException.expect(BuilderException.class);
361-
expectedException.expectMessage("Cannot use both value() and namespace() attribute in the @CacheNamespaceRef");
361+
expectedException.expectMessage("Cannot use both value() and name() attribute in the @CacheNamespaceRef");
362362

363363
sqlSessionFactory.getConfiguration().getMapperRegistry()
364364
.addMapper(InvalidCacheNamespaceRefBothMapper.class);
@@ -367,7 +367,7 @@ public void shouldErrorInvalidCacheNamespaceRefAttributesSpecifyBoth() {
367367
@Test
368368
public void shouldErrorInvalidCacheNamespaceRefAttributesIsEmpty() {
369369
expectedException.expect(BuilderException.class);
370-
expectedException.expectMessage("Should be specified either value() and namespace() attribute in the @CacheNamespaceRef");
370+
expectedException.expectMessage("Should be specified either value() or name() attribute in the @CacheNamespaceRef");
371371

372372
sqlSessionFactory.getConfiguration().getMapperRegistry()
373373
.addMapper(InvalidCacheNamespaceRefEmptyMapper.class);

0 commit comments

Comments
 (0)