[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: UnwrapValueUnitTestCase.testCollectionUnwrap failure on

adrian@jboss.org do-not-reply at jboss.com
Thu Nov 20 08:10:04 EST 2008


"alesj" wrote : 
  | So, JBMAN-38 is purely JBREFLECT-7's result.
  | Who's gonna bite into JBREFLECT-7, Adrian? :-)

What makes you think JBREFLECT-7 is causing this?

The toString() of the parameterized types are clearly different so they
shouldn't conflict in the cache.

I added some System.out.printlns to DefaultMetaTypeFactory

  | Index: src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java
  | ===================================================================
  | --- src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java  (revision 81358)
  | +++ src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java  (working copy)
  | @@ -133,10 +133,14 @@
  |        {
  |           // Generate it
  |           result = generate(typeInfo);
  | +
  | +System.out.println(typeInfo + " ==> " + result);         
  |           
  |           // Cache it
  |           typeInfo.setAttachment(MetaType.class.getName(), result);
  |        }
  | +
  | +System.out.println(typeInfo + " <== " + result);         
  |        
  |        // Return the result 
  |        return result;
  | 

And modified the test to just the Set retrieval you point to.
The output I get is:

  | 0 DEBUG [UnwrapValueUnitTestCase] ==== Starting testCollectionUnwrap ====
  | ReflectClassInfoImpl at 3570b0{name=java.lang.Object} ==> MutableCompositeMetaType{java.lang.Object}
  | ReflectClassInfoImpl at 3570b0{name=java.lang.Object} <== MutableCompositeMetaType{java.lang.Object}
  | ReflectClassInfoImpl at 982589{name=java.util.HashSet} ==> CollectionMetaType{type=java.util.HashSet elementType=MutableCompositeMetaType{java.
  | lang.Object}
  | ReflectClassInfoImpl at 982589{name=java.util.HashSet} <== CollectionMetaType{type=java.util.HashSet elementType=MutableCompositeMetaType{java.
  | lang.Object}
  | java.lang.Integer ==> SimpleMetaType:java.lang.Integer
  | java.lang.Integer <== SimpleMetaType:java.lang.Integer
  | ReflectClassInfoImpl at 982589{name=java.util.HashSet} <== CollectionMetaType{type=java.util.HashSet elementType=MutableCompositeMetaType{java.
  | lang.Object}
  | java.lang.Integer <== SimpleMetaType:java.lang.Integer
  | ReflectClassInfoImpl at 3570b0{name=java.lang.Object} <== MutableCompositeMetaType{java.lang.Object}
  | ReflectClassInfoImpl at a9c09e{name=java.util.Set} ==> CollectionMetaType{type=java.util.Set elementType=MutableCompositeMetaType{java.lang.Obj
  | ect}
  | ReflectClassInfoImpl at a9c09e{name=java.util.Set} <== CollectionMetaType{type=java.util.Set elementType=MutableCompositeMetaType{java.lang.Obj
  | ect}
  | java.lang.Integer <== SimpleMetaType:java.lang.Integer
  | java.lang.Integer <== SimpleMetaType:java.lang.Integer
  | 
  | HERE you can see the parameterized type for Set<Integer>
  | 
  | ParameterizedClassInfo at a4e743{java.util.Set<java.lang.Integer>} ==> CollectionMetaType{type=java.util.Set elementType=SimpleMetaType:java.la
  | ng.Integer
  | ParameterizedClassInfo at a4e743{java.util.Set<java.lang.Integer>} <== CollectionMetaType{type=java.util.Set elementType=SimpleMetaType:java.la
  | ng.Integer
  | java.lang.Integer <== SimpleMetaType:java.lang.Integer
  | ReflectClassInfoImpl at 982589{name=java.util.HashSet} <== CollectionMetaType{type=java.util.HashSet elementType=MutableCompositeMetaType{java.
  | lang.Object}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} ==> org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | ReflectClassInfoImpl at 982589{name=java.util.HashSet} <== CollectionMetaType{type=java.util.HashSet elementType=MutableCompositeMetaType{java.
  | lang.Object}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | ReflectClassInfoImpl at a9c09e{name=java.util.Set} <== CollectionMetaType{type=java.util.Set elementType=MutableCompositeMetaType{java.lang.Obj
  | ect}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | 
  | HERE you can see the parameterized type for Set<TestEnum>
  | 
  | ParameterizedClassInfo at 1cbfe9d{java.util.Set<org.jboss.test.metatype.values.factory.support.TestEnum>} ==> CollectionMetaType{type=java.util
  | .Set elementType=org.jboss.test.metatype.values.factory.support.TestEnum{[ONE, TWO, THREE]}
  | ParameterizedClassInfo at 1cbfe9d{java.util.Set<org.jboss.test.metatype.values.factory.support.TestEnum>} <== CollectionMetaType{type=java.util
  | .Set elementType=org.jboss.test.metatype.values.factory.support.TestEnum{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | EnumInfoImpl at 14c194d{name=org.jboss.test.metatype.values.factory.support.TestEnum} <== org.jboss.test.metatype.values.factory.support.TestEn
  | um{[ONE, TWO, THREE]}
  | 88 DEBUG [UnwrapValueUnitTestCase] testCollectionUnwrap took 87ms
  | 88 DEBUG [UnwrapValueUnitTestCase] ==== Stopping testCollectionUnwrap ====
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190871#4190871

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190871



More information about the jboss-dev-forums mailing list