@@ -88,7 +88,8 @@ public TemplateRegistry(TemplateRegistry registry) {
8888 }
8989 chain = createTemplateBuilderChain ();
9090 cache = new HashMap <Type , Template <Type >>();
91- genericCache = parent .genericCache ;
91+ //genericCache = parent.genericCache;
92+ genericCache = new HashMap <Type , GenericTemplate >();
9293 registerTemplatesWhichRefersRegistry ();
9394 }
9495
@@ -130,14 +131,9 @@ private void registerTemplates() {
130131 register (byte [].class , ByteArrayTemplate .getInstance ());
131132 register (ByteBuffer .class , ByteBufferTemplate .getInstance ());
132133 register (Value .class , ValueTemplate .getInstance ());
134+
133135 registerTemplatesWhichRefersRegistry ();
134- /*register(List.class, new ListTemplate(AnyTemplate.getInstance(this)));
135- register(Collection.class,new CollectionTemplate(AnyTemplate.getInstance(this)));
136- register(Map.class,new MapTemplate(AnyTemplate.getInstance(this), AnyTemplate.getInstance(this)));
137- */
138- registerGeneric (List .class , new GenericCollectionTemplate (this , ListTemplate .class ));
139- registerGeneric (Collection .class , new GenericCollectionTemplate (this , CollectionTemplate .class ));
140- registerGeneric (Map .class , new GenericMapTemplate (this , MapTemplate .class ));
136+
141137 }
142138
143139
@@ -147,10 +143,10 @@ protected void registerTemplatesWhichRefersRegistry() {
147143 register (List .class , new ListTemplate (anyTemplate ));//new ListTemplate(AnyTemplate.getInstance(this)));
148144 register (Collection .class ,new CollectionTemplate (anyTemplate ));//new CollectionTemplate(AnyTemplate.getInstance(this)));
149145 register (Map .class ,new MapTemplate (anyTemplate ,anyTemplate ));//new MapTemplate(AnyTemplate.getInstance(this), AnyTemplate.getInstance(this)));
150- /*
146+
151147 registerGeneric (List .class , new GenericCollectionTemplate (this , ListTemplate .class ));
152148 registerGeneric (Collection .class , new GenericCollectionTemplate (this , CollectionTemplate .class ));
153- registerGeneric(Map.class, new GenericMapTemplate(this, MapTemplate.class));*/
149+ registerGeneric (Map .class , new GenericMapTemplate (this , MapTemplate .class ));
154150 }
155151
156152 public void register (final Class <?> targetClass ) {
0 commit comments