@@ -77,7 +77,7 @@ public class Configuration {
77
77
protected final TypeHandlerRegistry typeHandlerRegistry = new TypeHandlerRegistry ();
78
78
protected final TypeAliasRegistry typeAliasRegistry = new TypeAliasRegistry ();
79
79
protected final Map <String , MappedStatement > mappedStatements = new StrictMap <String , MappedStatement >("Mapped Statements collection" );
80
- protected final Map <String , Cache > caches = new CacheMap <String , Cache >("Caches collection" );
80
+ protected final Map <String , Cache > caches = new StrictMap <String , Cache >("Caches collection" );
81
81
protected final Map <String , ResultMap > resultMaps = new StrictMap <String , ResultMap >("Result Maps collection" );
82
82
protected final Map <String , ParameterMap > parameterMaps = new StrictMap <String , ParameterMap >("Parameter Maps collection" );
83
83
protected final Map <String , KeyGenerator > keyGenerators = new StrictMap <String , KeyGenerator >("Key Generators collection" );
@@ -511,26 +511,26 @@ protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm) {
511
511
}
512
512
}
513
513
514
- protected static class CacheMap <J extends String , K extends Object > extends HashMap <J , K > {
514
+ protected static class StrictMap <J extends String , K extends Object > extends HashMap <J , K > {
515
515
516
516
private String name ;
517
517
518
- public CacheMap (String name , int initialCapacity , float loadFactor ) {
518
+ public StrictMap (String name , int initialCapacity , float loadFactor ) {
519
519
super (initialCapacity , loadFactor );
520
520
this .name = name ;
521
521
}
522
522
523
- public CacheMap (String name , int initialCapacity ) {
523
+ public StrictMap (String name , int initialCapacity ) {
524
524
super (initialCapacity );
525
525
this .name = name ;
526
526
}
527
527
528
- public CacheMap (String name ) {
528
+ public StrictMap (String name ) {
529
529
super ();
530
530
this .name = name ;
531
531
}
532
532
533
- public CacheMap (String name , Map <? extends J , ? extends K > m ) {
533
+ public StrictMap (String name , Map <? extends J , ? extends K > m ) {
534
534
super (m );
535
535
this .name = name ;
536
536
}
@@ -551,10 +551,7 @@ public K put(J key, K value) {
551
551
public K get (Object key ) {
552
552
K value = super .get (key );
553
553
if (value == null ) {
554
- value = super .get (getShortName ((J )key ));
555
- if (value == null ) {
556
- throw new IllegalArgumentException (name + " does not contain value for " + key );
557
- }
554
+ throw new IllegalArgumentException (name + " does not contain value for " + key );
558
555
}
559
556
if (value instanceof Ambiguity ) {
560
557
throw new IllegalArgumentException (((Ambiguity )value ).getSubject ()
@@ -579,43 +576,5 @@ public String getSubject() {
579
576
}
580
577
}
581
578
}
582
-
583
- protected static class StrictMap <J extends String , K extends Object > extends HashMap <J , K > {
584
579
585
- private String name ;
586
-
587
- public StrictMap (String name , int initialCapacity , float loadFactor ) {
588
- super (initialCapacity , loadFactor );
589
- this .name = name ;
590
- }
591
-
592
- public StrictMap (String name , int initialCapacity ) {
593
- super (initialCapacity );
594
- this .name = name ;
595
- }
596
-
597
- public StrictMap (String name ) {
598
- super ();
599
- this .name = name ;
600
- }
601
-
602
- public StrictMap (String name , Map <? extends J , ? extends K > m ) {
603
- super (m );
604
- this .name = name ;
605
- }
606
-
607
- public K put (J key , K value ) {
608
- if (containsKey (key ))
609
- throw new IllegalArgumentException (name + " already contains value for " + key );
610
- return super .put (key , value );
611
- }
612
-
613
- public K get (Object key ) {
614
- K value = super .get (key );
615
- if (value == null ) {
616
- throw new IllegalArgumentException (name + " does not contain value for " + key );
617
- }
618
- return value ;
619
- }
620
- }
621
580
}
0 commit comments