[jboss-svn-commits] JBoss Common SVN: r2913 - in jbossxb/trunk/src: main/java/org/jboss/xb/binding/group and 36 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Sep 9 09:19:01 EDT 2008
Author: alex.loubyansky at jboss.com
Date: 2008-09-09 09:19:00 -0400 (Tue, 09 Sep 2008)
New Revision: 2913
Modified:
jbossxb/trunk/src/main/java/org/jboss/xb/binding/AbstractMarshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/AttributesImpl.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/Content.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelFactory.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelProvider.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/DtdMarshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/GenericValueContainer.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/Immutable.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelFactory.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelProvider.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/Marshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/NamespaceRegistry.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/ObjectModelBuilder.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessMarshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessObjectModelFactory.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallerFactory.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallingContext.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/Util.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/XercesXsMarshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListInitializer.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfo.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfos.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/FieldInfo.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/SchemaMetaData.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/XsdElement.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/parser/sax/SaxJBossXBParser.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/DefaultAttributeMarshaller.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/MarshallerImpl.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AllBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/CharactersHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ChoiceBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/DefaultSchemaResolver.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ModelGroupBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaResolverConfig.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SequenceBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/TypeBinding.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/UnmarshallingContext.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ValueAdapter.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/XsdBinder.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtCharactersHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtElementHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtUtil.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionInterceptor.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionWildcardHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java
jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java
jbossxb/trunk/src/main/java/org/jboss/xb/util/Dom2Sax.java
jbossxb/trunk/src/main/java/org/jboss/xb/util/NoopMap.java
jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java
jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/spec/MethodsMetaData.java
jbossxb/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/ejb/AbstractEJBEverythingTest.java
jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java
jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java
jbossxb/trunk/src/test/java/org/jboss/test/resolver/DefaultSchemaResolverUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/javatypeadapter/support/Root.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/wrapper/support/Foo.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/test/JBossXmlCollectionUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCollectionMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractKernelDeployment.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/CardinalityValueAdapter.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerModeValueAdapter.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerStateValueAdapter.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AbstractMCTest.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AliasTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AnnotationTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ArrayTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/CollectionTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DemandTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DeploymentTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InjectionTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InstallTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ListTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/MapTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ParameterTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/PropertyTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SetTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SupplyTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ValueTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/XMLTestDelegate.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/AbstractJBossXBTest.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/AttributesUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/BeforeMarshalAfterUnmarshalHandlerTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionOverridePropertyUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionsUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/EnumUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/GlobalGroupUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/IgnorableWhitespaceUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/JBossXBTestDelegate.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/MappingTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/MapsUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/MiscUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/ModelGroupBindingUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/MultispacedUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerTestBase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaBindingInitializerUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaImportUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SharedElementUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleContentUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/SundayUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/TopLevelValueAdapterUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardUnresolvedElementsUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardWrapperUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/XOPUnitTestCase.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/XmlDiff.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/book/Book.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/choice/Root.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/collections/Collections.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/config/Config.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/immutable/Parent.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/multispaced/XMBeanMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/person/Person.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/po/PurchaseOrder.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/SimpleBeanImpl.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/deployment/AbstractKernelDeployment.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractAnnotationMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractBeanMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractCollectionMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractConstructorMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractFeatureMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractLifecycleMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractListMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractMapMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractSetMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AnnotationMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/BeanMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/ConstructorMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/GenericBeanFactory.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/LifecycleMetaData.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/MetaDataVisitorNode.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Choice3.java
jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Root.java
Log:
JBXB-156 update the codebase to add type arguments to generic types
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/AbstractMarshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/AbstractMarshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/AbstractMarshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -49,13 +49,13 @@
protected String version = VERSION;
protected String encoding = ENCODING;
- protected List rootQNames = new ArrayList();
+ protected List<QName> rootQNames = new ArrayList<QName>();
protected NamespaceRegistry nsRegistry = new NamespaceRegistry();
- private Map classMappings = Collections.EMPTY_MAP;
- protected Map field2WildcardMap = Collections.EMPTY_MAP;
- protected Map cls2TypeMap = Collections.EMPTY_MAP;
+ private Map<Class<?>, ClassMapping> classMappings = Collections.emptyMap();
+ protected Map<Class<?>, FieldToWildcardMapping> field2WildcardMap = Collections.emptyMap();
+ protected Map<Class<?>, QName> cls2TypeMap = Collections.emptyMap();
/**
* Content the result is written to
@@ -66,7 +66,7 @@
// Marshaller implementation
- public void mapClassToGlobalElement(Class cls,
+ public void mapClassToGlobalElement(Class<?> cls,
String localName,
String namespaceUri,
String schemaUrl,
@@ -91,7 +91,7 @@
addClassMapping(mapping);
}
- public void mapClassToGlobalType(Class cls,
+ public void mapClassToGlobalType(Class<?> cls,
String localName,
String nsUri,
String schemaUrl,
@@ -110,39 +110,23 @@
addClassMapping(mapping);
}
- public void mapFieldToWildcard(Class cls, String field, ObjectLocalMarshaller marshaller)
+ public void mapFieldToWildcard(Class<?> cls, String field, ObjectLocalMarshaller marshaller)
{
FieldToWildcardMapping mapping = new FieldToWildcardMapping(cls, field, marshaller);
- switch(field2WildcardMap.size())
- {
- case 0:
- field2WildcardMap = Collections.singletonMap(cls, mapping);
- break;
- case 1:
- field2WildcardMap = new HashMap(field2WildcardMap);
- default:
- field2WildcardMap.put(cls, mapping);
- }
+ if(field2WildcardMap.isEmpty())
+ field2WildcardMap = new HashMap<Class<?>, FieldToWildcardMapping>(field2WildcardMap);
+ field2WildcardMap.put(cls, mapping);
}
- public void mapClassToXsiType(Class cls, String typeNs, String typeLocalPart)
+ public void mapClassToXsiType(Class<?> cls, String typeNs, String typeLocalPart)
{
QName typeQName = new QName(typeNs, typeLocalPart);
- switch(cls2TypeMap.size())
- {
- case 0:
- cls2TypeMap = Collections.singletonMap(cls, typeQName);
- break;
- case 1:
- cls2TypeMap = new HashMap(cls2TypeMap);
- default:
- cls2TypeMap.put(cls, typeQName);
- }
+ if(cls2TypeMap.isEmpty())
+ cls2TypeMap = new HashMap<Class<?>, QName>(cls2TypeMap);
+ cls2TypeMap.put(cls, typeQName);
if(log.isTraceEnabled())
- {
log.trace("mapped " + cls + " to xsi:type " + typeQName);
- }
}
public void setVersion(String version)
@@ -221,9 +205,9 @@
protected void declareNs(AttributesImpl attrs)
{
- for(Iterator i = nsRegistry.getRegisteredURIs(); i.hasNext();)
+ for(Iterator<String> i = nsRegistry.getRegisteredURIs(); i.hasNext();)
{
- String uri = (String)i.next();
+ String uri = i.next();
String prefix = nsRegistry.getPrefix(uri);
declareNs(attrs, prefix, uri);
}
@@ -291,16 +275,16 @@
}
}
- protected ClassMapping getClassMapping(Class cls)
+ protected ClassMapping getClassMapping(Class<?> cls)
{
return (ClassMapping)classMappings.get(cls);
}
private void addClassMapping(ClassMapping mapping)
{
- if(classMappings == Collections.EMPTY_MAP)
+ if(classMappings.isEmpty())
{
- classMappings = new HashMap();
+ classMappings = new HashMap<Class<?>, ClassMapping>();
}
classMappings.put(mapping.cls, mapping);
}
@@ -309,13 +293,13 @@
protected class ClassMapping
{
- public final Class cls;
+ public final Class<?> cls;
public final QName elementName;
public final QName typeName;
public final String schemaUrl;
public final GenericObjectModelProvider provider;
- public ClassMapping(Class cls,
+ public ClassMapping(Class<?> cls,
String elementName,
String typeName,
String nsUri,
@@ -393,11 +377,11 @@
protected class FieldToWildcardMapping
{
- public final Class cls;
+ public final Class<?> cls;
public final ObjectLocalMarshaller marshaller;
public final FieldInfo fieldInfo;
- public FieldToWildcardMapping(Class cls, String field, ObjectLocalMarshaller marshaller)
+ public FieldToWildcardMapping(Class<?> cls, String field, ObjectLocalMarshaller marshaller)
{
if(log.isTraceEnabled())
{
@@ -464,7 +448,7 @@
public static class StackImpl
implements Stack
{
- private List list = new ArrayList();
+ private List<Object> list = new ArrayList<Object>();
public void clear()
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/AttributesImpl.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/AttributesImpl.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/AttributesImpl.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -35,7 +35,7 @@
public class AttributesImpl
implements Attributes
{
- private final List attrList;
+ private final List<AttributeImpl> attrList;
public AttributesImpl(Attributes attrs)
{
@@ -58,7 +58,7 @@
public AttributesImpl(int size)
{
- this.attrList = new ArrayList(size);
+ this.attrList = new ArrayList<AttributeImpl>(size);
}
public void add(String namespaceUri, String localName, String qName, String type, String value)
@@ -255,7 +255,7 @@
private AttributeImpl getAttribute(int index)
{
- return (AttributeImpl)attrList.get(index);
+ return attrList.get(index);
}
// Inner
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/Content.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/Content.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/Content.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -44,7 +44,7 @@
{
private static Logger log = Logger.getLogger(Content.class);
- private List content = new ArrayList();
+ private List<Node> content = new ArrayList<Node>();
private final boolean trace = log.isTraceEnabled();
// Public
@@ -104,7 +104,7 @@
{
handler.startDocument();
- for(Iterator i = content.iterator(); i.hasNext();)
+ for(Iterator<Node> i = content.iterator(); i.hasNext();)
{
Object item = i.next();
if(item instanceof StartElement)
@@ -232,7 +232,7 @@
public void append(Content content)
{
- for(Iterator i = content.content.iterator(); i.hasNext();)
+ for(Iterator<Node> i = content.content.iterator(); i.hasNext();)
{
this.content.add(i.next());
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelFactory.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelFactory.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelFactory.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -40,7 +40,7 @@
implements GenericObjectModelFactory
{
private final ObjectModelFactory typedFactory;
- private final Map addMethodsByParent = new HashMap();
+ private final Map<Class<?>, AddMethods> addMethodsByParent = new HashMap<Class<?>, AddMethods>();
private boolean replaceProps;
public DelegatingObjectModelFactory(ObjectModelFactory typedFactory)
@@ -54,8 +54,8 @@
Method method = methods[i];
if("addChild".equals(method.getName()))
{
- Class parent = method.getParameterTypes()[0];
- AddMethods addMethods = (AddMethods)addMethodsByParent.get(parent);
+ Class<?> parent = method.getParameterTypes()[0];
+ AddMethods addMethods = addMethodsByParent.get(parent);
if(addMethods == null)
{
addMethods = new AddMethods(parent);
@@ -93,7 +93,7 @@
public Object newChild(Object parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
{
// Get the newChild method
- Class objClass = parent.getClass();
+ Class<?> objClass = parent.getClass();
Class[] classes = new Class[] { objClass, UnmarshallingContext.class, String.class, String.class, Attributes.class };
Method method = ObjectModelBuilder.getMethodForElement(typedFactory, "newChild", classes);
@@ -132,7 +132,7 @@
String.class
});
*/
- AddMethods addMethods = (AddMethods)addMethodsByParent.get(parent.getClass());
+ AddMethods addMethods = addMethodsByParent.get(parent.getClass());
if(addMethods != null)
{
Method method = addMethods.getMethodForChild(child.getClass());
@@ -155,7 +155,7 @@
public void setValue(Object o, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
{
// Get the setValue method
- Class objClass = o.getClass();
+ Class<?> objClass = o.getClass();
Class[] classes = new Class[] { objClass, UnmarshallingContext.class, String.class, String.class, String.class };
Method method = ObjectModelBuilder.getMethodForElement(typedFactory, "setValue", classes);
@@ -216,11 +216,11 @@
{
private static final int DEFAULT_METHODS_SIZE = 10;
- public final Class parent;
+ public final Class<?> parent;
private Method[] methods = new Method[DEFAULT_METHODS_SIZE];
private int totalMethods;
- public AddMethods(Class parent)
+ public AddMethods(Class<?> parent)
{
this.parent = parent;
}
@@ -236,14 +236,14 @@
methods[totalMethods++] = m;
}
- public Method getMethodForChild(Class child)
+ public Method getMethodForChild(Class<?> child)
{
- Class closestParam = null;
+ Class<?> closestParam = null;
Method closestMethod = null;
for(int i = 0; i < totalMethods; ++i)
{
Method method = methods[i];
- Class param = method.getParameterTypes()[1];
+ Class<?> param = method.getParameterTypes()[1];
if(param == child)
{
return method;
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelProvider.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelProvider.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/DelegatingObjectModelProvider.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -70,8 +70,8 @@
String namespaceUri,
String name)
{
- Class providerClass = provider.getClass();
- Class parentClass = parent.getClass();
+ Class<? extends ObjectModelProvider> providerClass = provider.getClass();
+ Class<?> parentClass = parent.getClass();
String methodName = "getChildren";
Object container = null;
@@ -103,8 +103,8 @@
String namespaceUri,
String name)
{
- Class providerClass = provider.getClass();
- Class parentClass = parent.getClass();
+ Class<? extends ObjectModelProvider> providerClass = provider.getClass();
+ Class<?> parentClass = parent.getClass();
String methodName = "getElementValue";
Object value = null;
@@ -135,8 +135,8 @@
String namespaceUri,
String name)
{
- Class providerClass = provider.getClass();
- Class objectClass = object.getClass();
+ Class<? extends ObjectModelProvider> providerClass = provider.getClass();
+ Class<?> objectClass = object.getClass();
String methodName = "getAttributeValue";
Object value = null;
@@ -162,7 +162,7 @@
return value;
}
- private static Method getProviderMethod(Class providerClass, String methodName, Class[] args)
+ private static Method getProviderMethod(Class<? extends ObjectModelProvider> providerClass, String methodName, Class[] args)
{
Method method = null;
try
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/DtdMarshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/DtdMarshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/DtdMarshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -74,9 +74,9 @@
private GenericObjectModelProvider provider;
private Content content = new Content();
- private final List elementStack = new ArrayList();
+ private final List<Element> elementStack = new ArrayList<Element>();
- private final Map simpleTypeBindings = new HashMap();
+ private final Map<String, TypeBinding> simpleTypeBindings = new HashMap<String, TypeBinding>();
public void addBinding(String elementName, TypeBinding binding)
{
@@ -244,7 +244,7 @@
boolean startElement = false;
if(!elementStack.isEmpty())
{
- Element e = (Element) elementStack.get(elementStack.size() - 1);
+ Element e = elementStack.get(elementStack.size() - 1);
startElement = element != e.element;
}
@@ -263,7 +263,7 @@
writeSkippedElements();
String marshalled;
- TypeBinding binding = (TypeBinding)simpleTypeBindings.get(elementName);
+ TypeBinding binding = simpleTypeBindings.get(elementName);
if(binding != null)
{
marshalled = binding.marshal(value);
@@ -297,14 +297,14 @@
if(children != null)
{
- Iterator iter;
+ Iterator<Object> iter;
if(children instanceof Iterator)
{
- iter = (Iterator)children;
+ iter = (Iterator<Object>)children;
}
else if(children instanceof Collection)
{
- iter = ((Collection)children).iterator();
+ iter = ((Collection<Object>)children).iterator();
}
else
{
@@ -366,7 +366,7 @@
if(removeLast)
{
- Element el = (Element)elementStack.remove(elementStack.size() - 1);
+ Element el = elementStack.remove(elementStack.size() - 1);
if(el.started)
{
DTDElement started = el.element;
@@ -397,13 +397,13 @@
private void writeSkippedElements()
{
- Element el = (Element)elementStack.get(elementStack.size() - 1);
+ Element el = elementStack.get(elementStack.size() - 1);
if(!el.started)
{
int firstNotStarted = elementStack.size() - 1;
do
{
- el = (Element)elementStack.get(--firstNotStarted);
+ el = elementStack.get(--firstNotStarted);
}
while(!el.started);
@@ -411,7 +411,7 @@
while(firstNotStarted < elementStack.size())
{
- el = (Element)elementStack.get(firstNotStarted++);
+ el = elementStack.get(firstNotStarted++);
DTDElement notStarted = el.element;
if(log.isTraceEnabled())
@@ -427,10 +427,10 @@
private AttributesImpl provideAttributes(DTDElement element, Object container)
{
- final Hashtable attributes = element.attributes;
+ final Hashtable<?, ?> attributes = element.attributes;
AttributesImpl attrs = new AttributesImpl(attributes.size());
- for(Iterator attrIter = attributes.values().iterator(); attrIter.hasNext();)
+ for(Iterator<?> attrIter = attributes.values().iterator(); attrIter.hasNext();)
{
DTDAttribute attr = (DTDAttribute)attrIter.next();
final Object attrValue = provider.getAttributeValue(container, null, systemId, attr.getName());
@@ -455,8 +455,8 @@
*/
protected static DTDElement[] getRootList(DTD dtd)
{
- Hashtable roots = new Hashtable();
- Enumeration e = dtd.elements.elements();
+ Hashtable<String, DTDElement> roots = new Hashtable<String, DTDElement>();
+ Enumeration<?> e = dtd.elements.elements();
while(e.hasMoreElements())
{
DTDElement element = (DTDElement)e.nextElement();
@@ -472,18 +472,18 @@
continue;
}
- Enumeration items = ((DTDContainer)element.content).getItemsVec().elements();
+ Enumeration<?> items = ((DTDContainer)element.content).getItemsVec().elements();
while(items.hasMoreElements())
{
removeElements(roots, dtd, (DTDItem)items.nextElement());
}
}
- final Collection rootCol = roots.values();
- return (DTDElement[])rootCol.toArray(new DTDElement[rootCol.size()]);
+ final Collection<DTDElement> rootCol = roots.values();
+ return rootCol.toArray(new DTDElement[rootCol.size()]);
}
- protected static void removeElements(Hashtable h, DTD dtd, DTDItem item)
+ protected static void removeElements(Hashtable<String, DTDElement> h, DTD dtd, DTDItem item)
{
if(item instanceof DTDName)
{
@@ -491,7 +491,7 @@
}
else if(item instanceof DTDContainer)
{
- Enumeration e = ((DTDContainer)item).getItemsVec().elements();
+ Enumeration<?> e = ((DTDContainer)item).getItemsVec().elements();
while(e.hasMoreElements())
{
removeElements(h, dtd, (DTDItem)e.nextElement());
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/GenericValueContainer.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/GenericValueContainer.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/GenericValueContainer.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -36,21 +36,21 @@
{
class FACTORY
{
- public static GenericValueContainer array(final Class itemClass)
+ public static GenericValueContainer array(final Class<?> itemClass)
{
return array(null, null, itemClass);
}
- public static GenericValueContainer array(final Class wrapperClass,
+ public static GenericValueContainer array(final Class<?> wrapperClass,
final String itemProperty,
- final Class itemClass)
+ final Class<?> itemClass)
{
return new GenericValueContainer()
{
- private final Class wrapperType = wrapperClass;
+ private final Class<?> wrapperType = wrapperClass;
private final String itemProp = itemProperty;
- private final Class itemType = itemClass;
- private final List items = new ArrayList();
+ private final Class<?> itemType = itemClass;
+ private final List<Object> items = new ArrayList<Object>();
public void addChild(QName name, Object value)
{
@@ -114,7 +114,7 @@
// wrap
if(wrapperType != null)
{
- Constructor ctor = null;
+ Constructor<?> ctor = null;
try
{
try
@@ -163,7 +163,7 @@
return result;
}
- public Class getTargetClass()
+ public Class<?> getTargetClass()
{
// this method should only be called for multidimansional arrays
// todo: what's the best way to get a class for array having the item class?
@@ -182,5 +182,5 @@
Object instantiate();
- Class getTargetClass();
+ Class<?> getTargetClass();
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/Immutable.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/Immutable.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/Immutable.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -34,13 +34,13 @@
{
private static final Logger log = Logger.getLogger(Immutable.class);
- public final Class cls;
+ public final Class<?> cls;
- final List names = new java.util.ArrayList();
+ final List<String> names = new java.util.ArrayList<String>();
- final List values = new java.util.ArrayList();
+ final List<Object> values = new java.util.ArrayList<Object>();
- public Immutable(Class cls)
+ public Immutable(Class<?> cls)
{
this.cls = cls;
if(log.isTraceEnabled())
@@ -79,7 +79,7 @@
public Object newInstance()
{
- Constructor ctor = null;
+ Constructor<?> ctor = null;
Constructor[] ctors = cls.getConstructors();
if(ctors == null || ctors.length == 0)
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelFactory.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelFactory.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelFactory.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -48,12 +48,12 @@
/**
* The class mappings
*/
- private final Map elementToClassMapping = new HashMap();
+ private final Map<String, ElementToClassMapping> elementToClassMapping = new HashMap<String, ElementToClassMapping>();
/**
* The field mappings
*/
- private final Map elementToFieldMapping = new HashMap();
+ private final Map<ElementToFieldMappingKey, ElementToFieldMapping> elementToFieldMapping = new HashMap<ElementToFieldMappingKey, ElementToFieldMapping>();
// Public
@@ -63,7 +63,7 @@
* @param element the element name
* @param cls the class
*/
- public void mapElementToClass(String element, Class cls)
+ public void mapElementToClass(String element, Class<?> cls)
{
ElementToClassMapping mapping = new ElementToClassMapping(element, cls);
addElementToClassMapping(mapping);
@@ -81,7 +81,7 @@
* @param field the field name
* @param converter the type convertor
*/
- public void mapElementToField(String element, Class cls, String field, TypeBinding converter)
+ public void mapElementToField(String element, Class<?> cls, String field, TypeBinding converter)
{
ElementToFieldMapping mapping = new ElementToFieldMapping(element, cls, field, converter);
addElementToFieldMapping(mapping);
@@ -114,7 +114,7 @@
if(root == null)
{
- ElementToClassMapping mapping = (ElementToClassMapping)elementToClassMapping.get(localName);
+ ElementToClassMapping mapping = elementToClassMapping.get(localName);
if(mapping != null)
{
if(log.isTraceEnabled())
@@ -190,7 +190,7 @@
Object child = null;
- ElementToClassMapping mapping = (ElementToClassMapping)elementToClassMapping.get(localName);
+ ElementToClassMapping mapping = elementToClassMapping.get(localName);
XSTypeDefinition type = ctx.getType();
if(mapping != null)
{
@@ -203,7 +203,7 @@
{
if(!(o instanceof Collection))
{
- ElementToFieldMapping fieldMapping = (ElementToFieldMapping)elementToFieldMapping.get(
+ ElementToFieldMapping fieldMapping = elementToFieldMapping.get(
new ElementToFieldMappingKey(localName, o.getClass())
);
@@ -263,7 +263,7 @@
}
else
{
- Class oCls;
+ Class<?> oCls;
if(o instanceof Immutable)
{
oCls = ((Immutable)o).cls;
@@ -299,14 +299,14 @@
{
if(child == null)
{
- child = new ArrayList();
+ child = new ArrayList<Object>();
}
}
}
else if(!Util.isAttributeType(fieldInfo.getType()))
{
// id there is no field mapping
- ElementToFieldMapping fieldMapping = (ElementToFieldMapping)elementToFieldMapping.get(
+ ElementToFieldMapping fieldMapping = elementToFieldMapping.get(
new ElementToFieldMappingKey(localName, o.getClass())
);
TypeBinding converter = fieldMapping == null ? null : fieldMapping.converter;
@@ -413,11 +413,11 @@
{
log.trace("Add " + value + " to collection " + parent);
}
- ((Collection)parent).add(value);
+ ((Collection<Object>)parent).add(value);
}
else
{
- final ElementToFieldMapping fieldMapping = (ElementToFieldMapping)elementToFieldMapping.get(
+ final ElementToFieldMapping fieldMapping = elementToFieldMapping.get(
new ElementToFieldMappingKey(localName, parent.getClass())
);
if(fieldMapping != null)
@@ -430,7 +430,7 @@
}
else
{
- Class parentCls = parent instanceof Immutable ?
+ Class<?> parentCls = parent instanceof Immutable ?
((Immutable)parent).cls :
parent.getClass();
@@ -446,7 +446,7 @@
if(!(child instanceof Collection) && Collection.class.isAssignableFrom(fieldInfo.getType()))
{
Object o = get(parent, localName, fieldInfo);
- Collection col = (Collection)o;
+ Collection<Object> col = (Collection<Object>)o;
if(trace)
{
log.trace("Add " + value + " to collection " + col + " retrieved from " + fieldName);
@@ -470,7 +470,7 @@
if(type == null)
{
log.warn("Type is not available for collection item " + localName + "=" + value + " -> adding as string.");
- ((Collection)o).add(value);
+ ((Collection<String>)o).add(value);
}
else
{
@@ -480,13 +480,13 @@
}
Object trgValue = SimpleTypeBindings.unmarshal(type.getName(), value, ctx.getNamespaceContext());
- ((Collection)o).add(trgValue);
+ ((Collection<Object>)o).add(trgValue);
}
}
else
{
Object fieldValue = null;
- final ElementToFieldMapping fieldMapping = (ElementToFieldMapping)elementToFieldMapping.get(
+ final ElementToFieldMapping fieldMapping = elementToFieldMapping.get(
new ElementToFieldMappingKey(localName, o.getClass())
);
@@ -497,7 +497,7 @@
}
else
{
- Class oCls;
+ Class<?> oCls;
if(o instanceof Immutable)
{
oCls = ((Immutable)o).cls;
@@ -532,7 +532,7 @@
Util.xmlNameToClassName(namespaceURI, type.getName(), true) :
Util.xmlNameToClassName(namespaceURI, localName, true);
- Class cls = null;
+ Class<?> cls = null;
try
{
cls = Thread.currentThread().getContextClassLoader().loadClass(clsName);
@@ -598,7 +598,7 @@
}
}
- private static Object newInstance(Class cls)
+ private static Object newInstance(Class<?> cls)
{
if(log.isTraceEnabled())
{
@@ -608,7 +608,7 @@
Object instance;
try
{
- Constructor ctor = cls.getConstructor(null);
+ Constructor<?> ctor = cls.getConstructor(null);
instance = ctor.newInstance(null);
}
catch(NoSuchMethodException e)
@@ -633,9 +633,9 @@
{
public final String element;
- public final Class cls;
+ public final Class<?> cls;
- public ElementToClassMapping(String element, Class cls)
+ public ElementToClassMapping(String element, Class<?> cls)
{
this.element = element;
this.cls = cls;
@@ -685,9 +685,9 @@
{
public final String element;
- public final Class cls;
+ public final Class<?> cls;
- public ElementToFieldMappingKey(String element, Class cls)
+ public ElementToFieldMappingKey(String element, Class<?> cls)
{
this.element = element;
this.cls = cls;
@@ -732,12 +732,12 @@
private class ElementToFieldMapping
{
public final String element;
- public final Class cls;
+ public final Class<?> cls;
public final TypeBinding converter;
public final ElementToFieldMappingKey key;
public final FieldInfo fieldInfo;
- public ElementToFieldMapping(String element, Class cls, String fieldName, TypeBinding converter)
+ public ElementToFieldMapping(String element, Class<?> cls, String fieldName, TypeBinding converter)
{
this.element = element;
this.cls = cls;
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelProvider.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelProvider.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/MappingObjectModelProvider.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -37,8 +37,8 @@
{
private static final Logger log = Logger.getLogger(MappingObjectModelProvider.class);
- private final Map classMappings = new HashMap();
- private final Map fieldMappings = new HashMap();
+ private final Map<Class<?>, ClassToElementMapping> classMappings = new HashMap<Class<?>, ClassToElementMapping>();
+ private final Map<String, FieldToElementMapping> fieldMappings = new HashMap<String, FieldToElementMapping>();
private boolean ignoreLowLine = true;
private boolean ignoreNotFoundField = true;
@@ -52,7 +52,7 @@
this.ignoreNotFoundField = ignoreNotFoundField;
}
- public void mapClassToElement(Class cls, String namespaceURI, String localName, ObjectModelProvider provider)
+ public void mapClassToElement(Class<?> cls, String namespaceURI, String localName, ObjectModelProvider provider)
{
ClassToElementMapping mapping = new ClassToElementMapping(cls, namespaceURI, localName,
provider instanceof GenericObjectModelProvider ?
@@ -61,7 +61,7 @@
classMappings.put(mapping.cls, mapping);
}
- public void mapFieldToElement(Class cls,
+ public void mapFieldToElement(Class<?> cls,
String field,
String namespaceURI,
String localName,
@@ -147,7 +147,7 @@
private Object getJavaValue(String namespaceURI, String localName, String fieldName, Object o, boolean forComplexType, boolean optional)
{
String mappingKey = o.getClass().getName() + ":" + localName;
- FieldToElementMapping mapping = (FieldToElementMapping)fieldMappings.get(mappingKey);
+ FieldToElementMapping mapping = fieldMappings.get(mappingKey);
if(mapping == null)
{
if(fieldName == null)
@@ -197,7 +197,7 @@
return value;
}
- private boolean writeAsValue(final Class type)
+ private boolean writeAsValue(final Class<?> type)
{
return Classes.isPrimitive(type) ||
type == String.class ||
@@ -210,12 +210,12 @@
private class ClassToElementMapping
{
- public final Class cls;
+ public final Class<?> cls;
public final String namespaceURI;
public final String localName;
public final GenericObjectModelProvider provider;
- public ClassToElementMapping(Class cls,
+ public ClassToElementMapping(Class<?> cls,
String namespaceURI,
String localName,
GenericObjectModelProvider provider)
@@ -281,13 +281,13 @@
private class FieldToElementMapping
{
- public final Class cls;
+ public final Class<?> cls;
public final String namespaceURI;
public final String localName;
public final TypeBinding converter;
public final FieldInfo fieldInfo;
- public FieldToElementMapping(Class cls,
+ public FieldToElementMapping(Class<?> cls,
String field,
String namespaceURI,
String localName,
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/Marshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/Marshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/Marshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -64,7 +64,7 @@
throw new IllegalStateException("Required system property is not set: " + PROP_MARSHALLER);
}
- Class implCls;
+ Class<?> implCls;
try
{
implCls = Thread.currentThread().getContextClassLoader().loadClass(impl);
@@ -93,9 +93,9 @@
void mapPublicIdToSystemId(String publicId, String systemId);
- void mapClassToGlobalElement(Class cls, String localName, String nsUri, String schemaUrl, ObjectModelProvider provider);
+ void mapClassToGlobalElement(Class<?> cls, String localName, String nsUri, String schemaUrl, ObjectModelProvider provider);
- void mapClassToGlobalType(Class cls, String localName, String nsUri, String schemaUrl, ObjectModelProvider provider);
+ void mapClassToGlobalType(Class<?> cls, String localName, String nsUri, String schemaUrl, ObjectModelProvider provider);
void addRootElement(String namespaceUri, String prefix, String name);
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/NamespaceRegistry.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/NamespaceRegistry.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/NamespaceRegistry.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -52,8 +52,8 @@
// The index of the last assigned prefix
private int namespaceIndex;
- private final Map prefixByUri = new HashMap();
- private final Map uriByPrefix = new HashMap();
+ private final Map<String, Object> prefixByUri = new HashMap<String, Object>();
+ private final Map<String, Object> uriByPrefix = new HashMap<String, Object>();
public NamespaceRegistry()
{
@@ -119,14 +119,14 @@
}
else if (obj instanceof String)
{
- List list = new ArrayList();
- list.add(obj);
+ List<String> list = new ArrayList<String>();
+ list.add((String) obj);
list.add(nsURI);
uriByPrefix.put(prefix, list);
}
else if (obj instanceof List)
{
- ((List)obj).add(nsURI);
+ ((List<String>)obj).add(nsURI);
}
else
{
@@ -140,14 +140,14 @@
}
else if (obj instanceof String)
{
- List list = new ArrayList();
- list.add(obj);
+ List<String> list = new ArrayList<String>();
+ list.add((String) obj);
list.add(prefix);
prefixByUri.put(nsURI, list);
}
else if (obj instanceof List)
{
- ((List)obj).add(prefix);
+ ((List<String>)obj).add(prefix);
}
else
{
@@ -174,7 +174,7 @@
}
else if (obj instanceof List)
{
- List list = (List)obj;
+ List<String> list = (List<String>)obj;
uri = (String)list.remove(list.size() - 1);
if (list.isEmpty())
{
@@ -199,7 +199,7 @@
}
else if (obj instanceof List)
{
- List list = (ArrayList)obj;
+ List<String> list = (ArrayList<String>)obj;
list.remove(prefix);
if (list.isEmpty())
{
@@ -234,7 +234,7 @@
}
else if (obj instanceof List)
{
- List list = (List)obj;
+ List<?> list = (List<?>)obj;
for (int i = 0; i < list.size(); ++i)
{
removePrefixMappingOnly((String)list.get(i), nsURI);
@@ -257,14 +257,14 @@
/** Return an iterator over all registered nsURIs.
*/
- public Iterator getRegisteredURIs()
+ public Iterator<String> getRegisteredURIs()
{
return prefixByUri.keySet().iterator();
}
/** Return an iterator over all registered nsURIs.
*/
- public Iterator getRegisteredPrefixes()
+ public Iterator<String> getRegisteredPrefixes()
{
return uriByPrefix.keySet().iterator();
}
@@ -295,7 +295,7 @@
}
else if (obj instanceof List)
{
- List list = (List)obj;
+ List<String> list = (List<String>)obj;
prefix = (String)list.get(list.size() - 1);
}
else
@@ -313,22 +313,22 @@
* @param namespaceURI the URI to return prefixes for
* @return prefixes mapped to the URI
*/
- public Iterator getPrefixes(String namespaceURI)
+ public Iterator<String> getPrefixes(String namespaceURI)
{
Object obj = prefixByUri.get(namespaceURI);
- Iterator result = null;
+ Iterator<String> result = null;
if (obj == null)
{
result = Collections.EMPTY_LIST.iterator();
}
else if (obj instanceof String)
{
- result = Collections.singletonList(obj).iterator();
+ result = Collections.singletonList((String)obj).iterator();
}
else if (obj instanceof List)
{
- result = ((List)obj).iterator();
+ result = ((List<String>)obj).iterator();
}
else
{
@@ -353,7 +353,7 @@
}
else if (obj instanceof List)
{
- List list = (List)obj;
+ List<String> list = (List<String>)obj;
uri = (String)list.get(list.size() - 1);
}
else
@@ -380,7 +380,7 @@
}
else if (obj instanceof List)
{
- List list = (List)obj;
+ List<String> list = (List<String>) obj;
list.remove(prefix);
if (list.isEmpty())
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/ObjectModelBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/ObjectModelBuilder.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/ObjectModelBuilder.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -89,7 +89,7 @@
/**
* factories mapped to namespace URIs
*/
- private Map factoriesToNs = Collections.EMPTY_MAP;
+ private Map<String, GenericObjectModelFactory> factoriesToNs = Collections.emptyMap();
/**
* NamespaceContext implementation
@@ -105,9 +105,9 @@
public void mapFactoryToNamespace(ObjectModelFactory factory, String namespaceUri)
{
- if(factoriesToNs == Collections.EMPTY_MAP)
+ if(factoriesToNs.isEmpty())
{
- factoriesToNs = new HashMap();
+ factoriesToNs = new HashMap<String, GenericObjectModelFactory>();
}
factoriesToNs.put(namespaceUri, getGenericObjectModelFactory(factory));
}
@@ -155,7 +155,7 @@
// UnmarshallingContext implementation
- public Iterator getNamespaceURIs()
+ public Iterator<String> getNamespaceURIs()
{
return nsRegistry.getRegisteredURIs();
}
@@ -241,7 +241,7 @@
}
String factoryProp = data.substring(i + 9, end);
- Class factoryCls;
+ Class<?> factoryCls;
try
{
factoryCls = Thread.currentThread().getContextClassLoader().loadClass(factoryProp);
@@ -575,7 +575,7 @@
private static class StackImpl
implements Stack
{
- private List list = new ArrayList();
+ private List<Object> list = new ArrayList<Object>();
public void clear()
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessMarshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessMarshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessMarshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -49,7 +49,7 @@
private final Properties props = new Properties();
- private final Map gettersPerClass = new HashMap();
+ private final Map<Class<?>, List> gettersPerClass = new HashMap<Class<?>, List>();
private final Content content = new Content();
@@ -88,13 +88,13 @@
private void marshalObject(Object root, String localName, StringWriter writer)
{
- List getters = getGetterList(root.getClass());
+ List<Method> getters = getGetterList(root.getClass());
AttributesImpl attrs = null; //new AttributesImpl(5);
content.startElement(null, localName, localName, attrs);
for(int i = 0; i < getters.size(); ++i)
{
- Method getter = (Method)getters.get(i);
+ Method getter = getters.get(i);
Object child;
try
{
@@ -137,8 +137,8 @@
else if(Collection.class.isAssignableFrom(child.getClass()))
{
content.startElement(null, childName, childName, null);
- Collection col = (Collection)child;
- for(Iterator iter = col.iterator(); iter.hasNext();)
+ Collection<?> col = (Collection<?>)child;
+ for(Iterator<?> iter = col.iterator(); iter.hasNext();)
{
Object o = iter.next();
marshalCollectionItem(o, o.getClass().getName(), o.getClass().getName(), writer);
@@ -178,12 +178,12 @@
content.endElement(null, qName, qName);
}
- private List getGetterList(Class aClass)
+ private List<Method> getGetterList(Class<?> aClass)
{
- List getters = (List)gettersPerClass.get(aClass);
+ List<Method> getters = gettersPerClass.get(aClass);
if(getters == null)
{
- getters = new ArrayList();
+ getters = new ArrayList<Method>();
Method[] methods = aClass.getMethods();
for(int i = 0; i < methods.length; ++i)
{
@@ -202,7 +202,7 @@
return getters;
}
- static boolean isAttributeType(Class cls)
+ static boolean isAttributeType(Class<?> cls)
{
if(cls.isPrimitive() ||
cls == Byte.class ||
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessObjectModelFactory.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessObjectModelFactory.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/SchemalessObjectModelFactory.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -59,7 +59,7 @@
{
if(!localName.equals(java.lang.String.class.getName()))
{
- Class itemClass = Thread.currentThread().getContextClassLoader().loadClass(localName);
+ Class<?> itemClass = Thread.currentThread().getContextClassLoader().loadClass(localName);
child = itemClass.newInstance();
((Collection)parent).add(child);
}
@@ -71,15 +71,15 @@
{
if(List.class.isAssignableFrom(getter.getReturnType()))
{
- child = new ArrayList();
+ child = new ArrayList<Object>();
}
else if(Set.class.isAssignableFrom(getter.getReturnType()))
{
- child = new HashSet();
+ child = new HashSet<Object>();
}
else if(Collection.class.isAssignableFrom(getter.getReturnType()))
{
- child = new ArrayList();
+ child = new ArrayList<Object>();
}
else
{
@@ -129,7 +129,7 @@
{
if(localName.equals(java.lang.String.class.getName()))
{
- ((Collection)o).add(value);
+ ((Collection<String>)o).add(value);
}
}
else
@@ -167,7 +167,7 @@
String localName,
Attributes attrs)
{
- Class rootClass;
+ Class<?> rootClass;
try
{
rootClass = Thread.currentThread().getContextClassLoader().loadClass(localName);
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -442,9 +442,9 @@
}
}
- public static Class classForType(String xsdType, boolean nillable)
+ public static Class<?> classForType(String xsdType, boolean nillable)
{
- Class result;
+ Class<?> result;
int typeCode = xsdType.hashCode();
if(typeCode == XS_INT)
{
@@ -946,11 +946,11 @@
return result;
}
- public static List unmarshalList(String itemType, String value, NamespaceContext nsCtx)
+ public static List<Object> unmarshalList(String itemType, String value, NamespaceContext nsCtx)
{
StringTokenizer tokenizer = new StringTokenizer(value);
int total = tokenizer.countTokens();
- List list = new ArrayList(total);
+ List<Object> list = new ArrayList<Object>(total);
for(int i = 0; i < total; ++i)
{
Object o = unmarshal(itemType, tokenizer.nextToken(), nsCtx);
@@ -959,7 +959,7 @@
return list;
}
- public static String marshalList(String itemType, List value, NamespaceContext nsCtx)
+ public static String marshalList(String itemType, List<?> value, NamespaceContext nsCtx)
{
StringBuffer buf = new StringBuffer();
for(int i = 0; i < value.size(); ++i)
@@ -974,7 +974,7 @@
return buf.toString();
}
- public static Object unmarshal(String value, Class javaType)
+ public static Object unmarshal(String value, Class<?> javaType)
{
Object result;
if(String.class == javaType)
@@ -1403,7 +1403,7 @@
return result;
}
- public static QName typeQName(Class cls)
+ public static QName typeQName(Class<?> cls)
{
if(cls == null)
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallerFactory.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallerFactory.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallerFactory.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -32,7 +32,7 @@
*/
public abstract class UnmarshallerFactory
{
- protected Map features;
+ protected Map<String, Object> features;
protected Boolean validation = Boolean.TRUE;
protected Boolean namespaces = Boolean.TRUE;
@@ -77,7 +77,7 @@
{
if(features == null)
{
- features = new HashMap();
+ features = new HashMap<String, Object>();
}
features.put(name, value);
}
@@ -113,9 +113,9 @@
if(features != null)
{
- for(Iterator i = features.entrySet().iterator(); i.hasNext();)
+ for(Iterator<?> i = features.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry)i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>)i.next();
if(entry.getValue() != null)
{
Boolean value = (Boolean)entry.getValue();
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallingContext.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallingContext.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/UnmarshallingContext.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -44,7 +44,7 @@
/**
* @return all the known namespace URIs
*/
- Iterator getNamespaceURIs();
+ Iterator<String> getNamespaceURIs();
/**
* @return NamespaceContext instance
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/Util.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/Util.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/Util.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -312,7 +312,7 @@
xmlNamespaceToJavaPackage(namespaceUri) + '.' + xmlNameToClassName(localName, ignoreLowLine);
}
- public static boolean isAttributeType(final Class type)
+ public static boolean isAttributeType(final Class<?> type)
{
return Classes.isPrimitive(type) ||
type == String.class ||
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/XercesXsMarshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/XercesXsMarshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/XercesXsMarshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -243,7 +243,7 @@
") for the root element is specified then the name for the root element is required!"
);
}
- QName rootQName = (QName)rootQNames.get(0);
+ QName rootQName = rootQNames.get(0);
XSTypeDefinition type = model.getTypeDefinition(rootTypeQName.getLocalPart(),
rootTypeQName.getNamespaceURI()
@@ -304,7 +304,7 @@
{
for(int i = 0; i < rootQNames.size(); ++i)
{
- QName qName = (QName)rootQNames.get(i);
+ QName qName = rootQNames.get(i);
XSElementDeclaration element = model.getElementDeclaration(qName.getLocalPart(), qName.getNamespaceURI());
if(element == null)
{
@@ -562,14 +562,14 @@
XSSimpleTypeDefinition itemType = attrType.getItemType();
if(Constants.NS_XML_SCHEMA.equals(itemType.getNamespace()))
{
- List list;
+ List<QName> list;
if(attrValue instanceof List)
{
- list = (List)attrValue;
+ list = (List<QName>)attrValue;
}
else if(attrValue.getClass().isArray())
{
- list = Arrays.asList((Object[])attrValue);
+ list = Arrays.asList((QName[])attrValue);
}
else
{
@@ -734,7 +734,7 @@
boolean marshalled;
XSTerm term = particle.getTerm();
Object o;
- Iterator i;
+ Iterator<?> i;
switch(term.getType())
{
case XSConstants.MODEL_GROUP:
@@ -993,7 +993,7 @@
if(typeDef == null)
{
- List typeNames = new ArrayList();
+ List<QName> typeNames = new ArrayList<QName>();
XSNamedMap types = model.getComponents(XSConstants.TYPE_DEFINITION);
for(int i = 0; i < types.getLength(); ++i)
{
@@ -1112,10 +1112,10 @@
XSSimpleTypeDefinition itemType = type.getItemType();
if(Constants.NS_XML_SCHEMA.equals(itemType.getNamespace()))
{
- List list;
+ List<?> list;
if(value instanceof List)
{
- list = (List)value;
+ list = (List<?>)value;
}
else if(value.getClass().isArray())
{
@@ -1208,7 +1208,7 @@
}
catch(NoSuchMethodException e1)
{
- List values = new ArrayList(lexicalEnumeration.getLength());
+ List<String> values = new ArrayList<String>(lexicalEnumeration.getLength());
for(int i = 0; i < lexicalEnumeration.getLength(); ++i)
{
values.add(lexicalEnumeration.item(i));
@@ -1383,12 +1383,12 @@
return is;
}
- private Iterator getIterator(Object value)
+ private Iterator<?> getIterator(Object value)
{
- Iterator i = null;
+ Iterator<?> i = null;
if(value instanceof Collection)
{
- i = ((Collection)value).iterator();
+ i = ((Collection<?>)value).iterator();
}
else if(value.getClass().isArray())
{
@@ -1416,7 +1416,7 @@
}
else if(value instanceof Iterator)
{
- i = (Iterator)value;
+ i = (Iterator<?>)value;
}
else
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueList.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -43,7 +43,7 @@
{
private final ValueListInitializer initializer;
private final ValueListHandler handler;
- private final Class targetClass;
+ private final Class<?> targetClass;
//private final int requiredTotal;
//private final Object[] requiredValues;
@@ -52,7 +52,7 @@
//private List nonRequiredBindings;
private List nonRequiredValues = Collections.EMPTY_LIST;
- ValueList(ValueListInitializer initializer, ValueListHandler handler, Class targetClass)
+ ValueList(ValueListInitializer initializer, ValueListHandler handler, Class<?> targetClass)
{
this.initializer = initializer;
this.handler = handler;
@@ -120,7 +120,7 @@
PropertyMetaData propMetaData = binding.getTerm().getPropertyMetaData();
if(propMetaData != null && propMetaData.getCollectionType() != null)
{
- Class colCls = RtUtil.loadClass(propMetaData.getCollectionType(), true);
+ Class<?> colCls = RtUtil.loadClass(propMetaData.getCollectionType(), true);
try
{
col = (Collection) colCls.newInstance();
@@ -154,7 +154,7 @@
nonRequiredValues = Collections.singletonList(val);
break;
case 1:
- nonRequiredValues = new ArrayList(nonRequiredValues);
+ nonRequiredValues = new ArrayList<Object>(nonRequiredValues);
default:
nonRequiredValues.add(val);
}
@@ -171,19 +171,19 @@
return initializer;
}
- public List getRequiredValues()
+ public List<?> getRequiredValues()
{
// return Arrays.asList(requiredValues);
throw new UnsupportedOperationException();
}
- public Map getNonRequiredValues()
+ public Map<?, ?> getNonRequiredValues()
{
// return nonRequiredValues;
throw new UnsupportedOperationException();
}
- public List getNonRequiredBindings()
+ public List<?> getNonRequiredBindings()
{
// return nonRequiredBindings;
throw new UnsupportedOperationException();
@@ -194,7 +194,7 @@
return handler;
}
- public Class getTargetClass()
+ public Class<?> getTargetClass()
{
return targetClass;
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -49,16 +49,16 @@
{
public Object newInstance(ParticleBinding particle, ValueList valueList)
{
- Class cls = valueList.getTargetClass();
- Map map = valueList.getNonRequiredValues();
+ Class<?> cls = valueList.getTargetClass();
+ Map<?, ?> map = valueList.getNonRequiredValues();
- Collection values = map.values();
+ Collection<?> values = map.values();
if(values.isEmpty())
{
throw new JBossXBRuntimeException("Value list does not contain non-required values.");
}
- Constructor ctor = null;
+ Constructor<?> ctor = null;
Constructor[] ctors = cls.getConstructors();
if(ctors == null || ctors.length == 0)
@@ -80,10 +80,10 @@
ctor = ctors[i];
int typeInd = 0;
- Iterator iter = values.iterator();
+ Iterator<?> iter = values.iterator();
while(iter.hasNext())
{
- Class type = types[typeInd++];
+ Class<?> type = types[typeInd++];
if(type.isPrimitive())
{
type = Classes.getPrimitiveWrapper(type);
@@ -110,7 +110,7 @@
.append(cls)
.append(" that would take the following arguments:\n");
int cnt = 0;
- for(Iterator i = values.iterator(); i.hasNext();)
+ for(Iterator<?> i = values.iterator(); i.hasNext();)
{
Object o = i.next();
buf.append(' ').append(++cnt).append(") ").append(o.getClass()).append(": ").append(o).append('\n');
@@ -137,7 +137,7 @@
{
public Object newInstance(ParticleBinding particle, ValueList valueList)
{
- Class cls = valueList.getTargetClass();
+ Class<?> cls = valueList.getTargetClass();
int size = valueList.size();
if(size == 0)
@@ -154,7 +154,7 @@
}
}
- Constructor ctor = matchBestCtor(cls, valueList);
+ Constructor<?> ctor = matchBestCtor(cls, valueList);
if(ctor == null)
{
@@ -207,8 +207,8 @@
}
else
{
- Collection col = (Collection)valueEntry.value;
- for(Iterator iter = col.iterator(); iter.hasNext();)
+ Collection<?> col = (Collection<?>)valueEntry.value;
+ for(Iterator<?> iter = col.iterator(); iter.hasNext();)
{
pHandler.setParent(o, iter.next(), valueEntry.qName, childParticle, particle);
}
@@ -255,16 +255,16 @@
return o;
}
- private Constructor matchBestCtor(Class cls, ValueList valueList)
+ private Constructor<?> matchBestCtor(Class<?> cls, ValueList valueList)
{
- Constructor bestMatch = null;
+ Constructor<?> bestMatch = null;
int bestMatchArgsTotal = 0;
Constructor[] ctors = cls.getConstructors();
int size = valueList.size();
for(int i = 0; i < ctors.length; ++i)
{
- Constructor ctor = ctors[i];
+ Constructor<?> ctor = ctors[i];
Class[] types = ctor.getParameterTypes();
if((types == null || types.length == 0) && bestMatch == null)
@@ -278,7 +278,7 @@
int typeInd = 0;
for(int valueInd = 0; typeInd < types.length && valueInd < size; ++typeInd, ++valueInd)
{
- Class type = types[typeInd];
+ Class<?> type = types[typeInd];
if(type.isPrimitive())
{
type = Classes.getPrimitiveWrapper(type);
@@ -316,7 +316,7 @@
return bestMatch;
}
- private Object newInstance(Constructor bestMatch, Object[] args)
+ private Object newInstance(Constructor<?> bestMatch, Object[] args)
{
try
{
@@ -332,7 +332,7 @@
}
}
- private Object[] getArgs(Constructor ctor, ValueList valueList)
+ private Object[] getArgs(Constructor<?> ctor, ValueList valueList)
{
Class[] types = ctor.getParameterTypes();
Object[] args = new Object[types.length];
@@ -346,10 +346,10 @@
// todo this part should be smarter about collections
if(types[i].isArray() && Collection.class.isAssignableFrom(arg.getClass()))
{
- Collection col = (Collection)arg;
+ Collection<?> col = (Collection<?>)arg;
arg = Array.newInstance(types[i].getComponentType(), col.size());
int arrInd = 0;
- for(Iterator iter = col.iterator(); iter.hasNext();)
+ for(Iterator<?> iter = col.iterator(); iter.hasNext();)
{
Array.set(arg, arrInd++, iter.next());
}
@@ -396,7 +396,7 @@
}
else
{
- Collection col = (Collection) valueEntry.value;
+ Collection<?> col = (Collection<?>) valueEntry.value;
//System.out.println("newInstance: " + childParticle.getTerm() + "=" + col);
pHandler.setParent(parent, col, valueEntry.qName, childParticle, valueEntry.parentParticle);
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListInitializer.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListInitializer.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/group/ValueListInitializer.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.Collections;
import java.util.List;
-import java.util.ArrayList;
import javax.xml.namespace.QName;
import org.jboss.xb.binding.JBossXBRuntimeException;
import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
@@ -38,10 +37,10 @@
*/
public class ValueListInitializer
{
- private int initializedState;
+ //private int initializedState;
private Map attrIndex = Collections.EMPTY_MAP;
private Map elemIndex = Collections.EMPTY_MAP;
- private List requiredBindings = Collections.EMPTY_LIST;
+ //private List<?> requiredBindings = Collections.EMPTY_LIST;
public void addRequiredAttribute(QName qName, AttributeBinding binding)
{
@@ -83,7 +82,7 @@
throw new UnsupportedOperationException();
}
- public ValueList newValueList(ValueListHandler handler, Class targetClass)
+ public ValueList newValueList(ValueListHandler handler, Class<?> targetClass)
{
return new ValueList(this, handler, targetClass);
}
@@ -180,7 +179,7 @@
throw new UnsupportedOperationException();
}
- public List getRequiredBindings()
+ public List<?> getRequiredBindings()
{
// return requiredBindings;
throw new UnsupportedOperationException();
@@ -188,12 +187,12 @@
// Private
- private void addBinding(Object binding)
+/* private void addBinding(Object binding)
{
if(requiredBindings == Collections.EMPTY_LIST)
{
- requiredBindings = new ArrayList();
+ requiredBindings = new ArrayList<Object>();
}
requiredBindings.add(binding);
}
-}
+*/}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfo.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfo.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfo.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -37,16 +37,16 @@
public class ClassInfo
{
private static final Object FIELD_INFO_NA = new Object();
- private final Class type;
- private Map fields = new ConcurrentHashMap();
+ private final Class<?> type;
+ private Map<String, Object> fields = new ConcurrentHashMap<String, Object>();
private boolean introspected;
- public ClassInfo(Class cls)
+ public ClassInfo(Class<?> cls)
{
this.type = cls;
}
- public Class getType()
+ public Class<?> getType()
{
return type;
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfos.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfos.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/ClassInfos.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -35,7 +35,8 @@
*/
public class ClassInfos
{
- private static Map classloaderCache = new WeakHashMap();
+ private static final Map<ClassLoader, Map<String, WeakReference<ClassInfo>>> NO_CACHE = new NoopMap<ClassLoader, Map<String, WeakReference<ClassInfo>>>();
+ private static Map<ClassLoader, Map<String, WeakReference<ClassInfo>>> classloaderCache = new WeakHashMap<ClassLoader, Map<String, WeakReference<ClassInfo>>>();
/**
* Disables caching of ClassInfo's. Already cached ClassInfo's will be lost after
@@ -45,7 +46,7 @@
{
synchronized(classloaderCache)
{
- classloaderCache = NoopMap.INSTANCE;
+ classloaderCache = NO_CACHE;
}
}
@@ -58,7 +59,7 @@
{
if(!isCacheEnabled())
{
- classloaderCache = new WeakHashMap();
+ classloaderCache = new WeakHashMap<ClassLoader, Map<String, WeakReference<ClassInfo>>>();
}
}
}
@@ -70,7 +71,7 @@
{
synchronized(classloaderCache)
{
- return classloaderCache != NoopMap.INSTANCE;
+ return classloaderCache != NO_CACHE;
}
}
@@ -92,7 +93,7 @@
public static void flushCache(String cls)
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Map classLoaderCache = getClassLoaderCache(cl);
+ Map<String, WeakReference<ClassInfo>> classLoaderCache = getClassLoaderCache(cl);
classLoaderCache.remove(cls);
}
@@ -100,17 +101,17 @@
* Evicts ClassInfo for a specific class.
* @param cls the class to remove the ClassInfo for
*/
- public static void flushCache(Class cls)
+ public static void flushCache(Class<?> cls)
{
- Map classLoaderCache = getClassLoaderCache(cls.getClassLoader());
+ Map<String, WeakReference<ClassInfo>> classLoaderCache = getClassLoaderCache(cls.getClassLoader());
classLoaderCache.remove(cls.getName());
}
- public static ClassInfo getClassInfo(Class cls)
+ public static ClassInfo getClassInfo(Class<?> cls)
{
- Map classLoaderCache = getClassLoaderCache(cls.getClassLoader());
+ Map<String, WeakReference<ClassInfo>> classLoaderCache = getClassLoaderCache(cls.getClassLoader());
- WeakReference weak = (WeakReference)classLoaderCache.get(cls.getName());
+ WeakReference<ClassInfo> weak = classLoaderCache.get(cls.getName());
if(weak != null)
{
Object result = weak.get();
@@ -121,7 +122,7 @@
}
ClassInfo clsInfo = new ClassInfo(cls);
- weak = new WeakReference(clsInfo);
+ weak = new WeakReference<ClassInfo>(clsInfo);
classLoaderCache.put(cls.getName(), weak);
return clsInfo;
}
@@ -129,9 +130,9 @@
public static ClassInfo getClassInfo(String name, boolean required)
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Map classLoaderCache = getClassLoaderCache(cl);
+ Map<String, WeakReference<ClassInfo>> classLoaderCache = getClassLoaderCache(cl);
- WeakReference weak = (WeakReference)classLoaderCache.get(name);
+ WeakReference<ClassInfo> weak = classLoaderCache.get(name);
if(weak != null)
{
Object result = weak.get();
@@ -144,7 +145,7 @@
try
{
ClassInfo clsInfo = new ClassInfo(cl.loadClass(name));
- weak = new WeakReference(clsInfo);
+ weak = new WeakReference<ClassInfo>(clsInfo);
classLoaderCache.put(name, weak);
return clsInfo;
}
@@ -159,14 +160,14 @@
return null;
}
- private static Map getClassLoaderCache(ClassLoader cl)
+ private static Map<String, WeakReference<ClassInfo>> getClassLoaderCache(ClassLoader cl)
{
synchronized(classloaderCache)
{
- Map result = (Map) classloaderCache.get(cl);
+ Map<String, WeakReference<ClassInfo>> result = classloaderCache.get(cl);
if (result == null)
{
- result = new ConcurrentHashMap();
+ result = new ConcurrentHashMap<String, WeakReference<ClassInfo>>();
classloaderCache.put(cl, result);
}
return result;
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/FieldInfo.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/FieldInfo.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/introspection/FieldInfo.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -100,14 +100,14 @@
{
if (owner == null)
throw new IllegalArgumentException("Null target for " + m.getName());
- ArrayList expected = new ArrayList();
+ ArrayList<String> expected = new ArrayList<String>();
Class[] parameters = m.getParameterTypes();
if (parameters != null)
{
for (int i = 0; i < parameters.length; ++i)
expected.add(parameters[i].getName());
}
- ArrayList actual = new ArrayList();
+ ArrayList<String> actual = new ArrayList<String>();
if (arguments != null)
{
for (int i = 0; i < arguments.length; ++i)
@@ -150,19 +150,19 @@
return fieldInfo;
}
- public static FieldInfo getFieldInfo(Class cls, String fieldName, boolean required)
+ public static FieldInfo getFieldInfo(Class<?> cls, String fieldName, boolean required)
{
return ClassInfos.getClassInfo(cls).getFieldInfo(fieldName, required);
}
- private final Class owner;
+ private final Class<?> owner;
private final String name;
- private final Class type;
+ private final Class<?> type;
private final GetValueAccess getter;
private SetValueAccess setter;
private boolean setterInitialized;
- public FieldInfo(Class owner, String name, Method getter)
+ public FieldInfo(Class<?> owner, String name, Method getter)
{
this.owner = owner;
this.name = name;
@@ -170,7 +170,7 @@
this.getter = GetValueAccessFactory.methodAccess(getter);
}
- public FieldInfo(Class owner, String name, Method getter, Method setter)
+ public FieldInfo(Class<?> owner, String name, Method getter, Method setter)
{
this.owner = owner;
this.name = name;
@@ -180,7 +180,7 @@
setterInitialized = true;
}
- public FieldInfo(Class owner, Field field)
+ public FieldInfo(Class<?> owner, Field field)
{
this.owner = owner;
this.name = field.getName();
@@ -190,7 +190,7 @@
setterInitialized = true;
}
- public Class getOwner()
+ public Class<?> getOwner()
{
return owner;
}
@@ -200,7 +200,7 @@
return name;
}
- public Class getType()
+ public Class<?> getType()
{
return type;
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/SchemaMetaData.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/SchemaMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/SchemaMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -34,7 +34,7 @@
public class SchemaMetaData
{
private PackageMetaData packageMetaData;
- private Map values = Collections.EMPTY_MAP;
+ private Map<String, ValueMetaData> values = Collections.emptyMap();
private boolean ignoreUnresolvedFieldOrClass = true;
private boolean replacePropertyRefs = true;
@@ -84,7 +84,7 @@
values = Collections.singletonMap(value.getId(), value);
break;
case 1:
- values = new HashMap(values);
+ values = new HashMap<String, ValueMetaData>(values);
default:
values.put(value.getId(), value);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/XsdElement.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/XsdElement.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/metadata/XsdElement.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -35,8 +35,8 @@
public static final QName QNAME_NAME = new QName("name");
private final QName qName;
- private Map attributes = Collections.EMPTY_MAP;
- private Map children = Collections.EMPTY_MAP;
+ private Map<QName, String> attributes = Collections.emptyMap();
+ private Map<QName, XsdElement> children = Collections.emptyMap();
private String data;
public XsdElement(QName qName)
@@ -57,7 +57,7 @@
attributes = Collections.singletonMap(qName, value);
break;
case 1:
- attributes = new HashMap(attributes);
+ attributes = new HashMap<QName, String>(attributes);
default:
attributes.put(qName, value);
}
@@ -76,7 +76,7 @@
children = Collections.singletonMap(child.qName, child);
break;
case 1:
- children = new HashMap(children);
+ children = new HashMap<QName, XsdElement>(children);
default:
children.put(child.qName, child);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/parser/sax/SaxJBossXBParser.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/parser/sax/SaxJBossXBParser.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/parser/sax/SaxJBossXBParser.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -74,7 +74,7 @@
{
try
{
- Class clazz = saxFactory.getClass();
+ Class<? extends SAXParserFactory> clazz = saxFactory.getClass();
Method method = clazz.getMethod("setXIncludeAware", new Class[] { Boolean.TYPE });
method.invoke(saxFactory, new Object[] { Boolean.TRUE });
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/DefaultAttributeMarshaller.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/DefaultAttributeMarshaller.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/DefaultAttributeMarshaller.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -33,7 +33,6 @@
import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
@@ -101,14 +100,14 @@
TypeBinding itemType = attrType.getItemType();
if(Constants.NS_XML_SCHEMA.equals(itemType.getQName().getNamespaceURI()))
{
- List list;
+ List<QName> list;
if(value instanceof List)
{
- list = (List)value;
+ list = (List<QName>)value;
}
else if(value.getClass().isArray())
{
- list = Arrays.asList((Object[])value);
+ list = Arrays.asList((QName[])value);
}
else
{
@@ -161,7 +160,7 @@
attrType.getBaseType() != null &&
Constants.QNAME_BOOLEAN.equals(attrType.getBaseType().getQName()))
{
- String item = (String)attrType.getLexicalPattern().get(0);
+ String item = attrType.getLexicalPattern().get(0);
if(item.indexOf('0') != -1 && item.indexOf('1') != -1)
{
marshalled = ((Boolean)value).booleanValue() ? "1" : "0";
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/MarshallerImpl.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/MarshallerImpl.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/marshalling/MarshallerImpl.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -179,7 +179,7 @@
") for the root element is specified then the name for the root element is required!"
);
}
- QName rootQName = (QName)rootQNames.get(0);
+ QName rootQName = rootQNames.get(0);
TypeBinding type = schema.getType(rootTypeQName);
if(type == null)
@@ -202,7 +202,7 @@
}
else if(rootQNames.isEmpty())
{
- Iterator elements = schema.getElementParticles();
+ Iterator<ParticleBinding> elements = schema.getElementParticles();
if(!elements.hasNext())
{
throw new JBossXBRuntimeException("The schema doesn't contain global element declarations.");
@@ -210,7 +210,7 @@
while(elements.hasNext())
{
- ParticleBinding element = (ParticleBinding)elements.next();
+ ParticleBinding element = elements.next();
ctx.particle = element;
marshalElementOccurence((ElementBinding) element.getTerm(), root, true, true);
}
@@ -219,11 +219,11 @@
{
for(int i = 0; i < rootQNames.size(); ++i)
{
- QName qName = (QName)rootQNames.get(i);
+ QName qName = rootQNames.get(i);
ParticleBinding element = schema.getElementParticle(qName);
if(element == null)
{
- Iterator components = schema.getElements();
+ Iterator<ElementBinding> components = schema.getElements();
String roots = "";
for(int j = 0; components.hasNext(); ++j)
{
@@ -492,7 +492,7 @@
boolean declareNs,
boolean declareXsiType)
{
- Collection attrBindings = type.getAttributes();
+ Collection<AttributeBinding> attrBindings = type.getAttributes();
int attrsTotal = declareNs || declareXsiType ? nsRegistry.size() + attrBindings.size() + 1: attrBindings.size();
ctx.attrs = attrsTotal > 0 ? new AttributesImpl(attrsTotal) : null;
@@ -532,9 +532,9 @@
if(!attrBindings.isEmpty())
{
- for(Iterator i = attrBindings.iterator(); i.hasNext();)
+ for(Iterator<AttributeBinding> i = attrBindings.iterator(); i.hasNext();)
{
- AttributeBinding attrBinding = (AttributeBinding)i.next();
+ AttributeBinding attrBinding = i.next();
QName attrQName = attrBinding.getQName();
if(Constants.QNAME_XMIME_CONTENTTYPE.equals(attrQName))
@@ -643,7 +643,7 @@
boolean marshalled;
TermBinding term = particle.getTerm();
Object o;
- Iterator i;
+ Iterator<?> i;
ParticleBinding ctxParticle = ctx.particle;
ctx.particle = particle;
@@ -912,24 +912,24 @@
return marshalled;
}
- private boolean marshalModelGroupAll(Collection particles, boolean declareNs)
+ private boolean marshalModelGroupAll(Collection<ParticleBinding> particles, boolean declareNs)
{
boolean marshalled = false;
- for(Iterator i = particles.iterator(); i.hasNext();)
+ for(Iterator<ParticleBinding> i = particles.iterator(); i.hasNext();)
{
- ParticleBinding particle = (ParticleBinding)i.next();
+ ParticleBinding particle = i.next();
marshalled |= marshalParticle(particle, declareNs);
}
return marshalled;
}
- private boolean marshalModelGroupChoice(Collection particles, boolean declareNs)
+ private boolean marshalModelGroupChoice(Collection<ParticleBinding> particles, boolean declareNs)
{
boolean marshalled = false;
Content mainContent = this.content;
- for(Iterator i = particles.iterator(); i.hasNext() && !marshalled;)
+ for(Iterator<ParticleBinding> i = particles.iterator(); i.hasNext() && !marshalled;)
{
- ParticleBinding particle = (ParticleBinding)i.next();
+ ParticleBinding particle = i.next();
this.content = new Content();
marshalled = marshalParticle(particle, declareNs);
}
@@ -947,7 +947,7 @@
{
// if sequence is bound to a collection,
// we assume the iterator over the collection is in sync with the particle iterator
- Iterator valueIterator = null;
+ Iterator<?> valueIterator = null;
if(!sequence.isSkip() && !stack.isEmpty())
{
Object o = stack.peek();
@@ -958,7 +958,7 @@
}
boolean marshalled = true;
- for(Iterator i = sequence.getParticles().iterator(); i.hasNext();)
+ for(Iterator<ParticleBinding> i = sequence.getParticles().iterator(); i.hasNext();)
{
if(valueIterator != null)
{
@@ -966,7 +966,7 @@
stack.push(o);
}
- ParticleBinding particle = (ParticleBinding)i.next();
+ ParticleBinding particle = i.next();
marshalled &= marshalParticle(particle, declareNs);
if(valueIterator != null)
@@ -989,10 +989,10 @@
TypeBinding itemType = simpleType.getItemType();
if(Constants.NS_XML_SCHEMA.equals(itemType.getQName().getNamespaceURI()))
{
- List list;
+ List<?> list;
if(value instanceof List)
{
- list = (List)value;
+ list = (List<?>)value;
}
else if(value.getClass().isArray())
{
@@ -1055,7 +1055,7 @@
simpleType.getBaseType() != null &&
Constants.QNAME_BOOLEAN.equals(simpleType.getBaseType().getQName()))
{
- String item = (String)simpleType.getLexicalPattern().get(0);
+ String item = simpleType.getLexicalPattern().get(0);
if(item.indexOf('0') != -1 && item.indexOf('1') != -1)
{
marshalled = ((Boolean)value).booleanValue() ? "1" : "0";
@@ -1207,12 +1207,12 @@
return is;
}
- private Iterator getIterator(Object value)
+ private Iterator<?> getIterator(Object value)
{
- Iterator i = null;
+ Iterator<?> i = null;
if(value instanceof Collection)
{
- i = ((Collection)value).iterator();
+ i = ((Collection<?>)value).iterator();
}
else if(value.getClass().isArray())
{
@@ -1240,7 +1240,7 @@
}
else if(value instanceof Iterator)
{
- i = (Iterator)value;
+ i = (Iterator<?>)value;
}
else
{
@@ -1288,7 +1288,7 @@
return value;
}
- private static boolean writeAsValue(final Class type)
+ private static boolean writeAsValue(final Class<?> type)
{
return Classes.isPrimitive(type) ||
type == String.class ||
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AllBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AllBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AllBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -29,7 +29,6 @@
import java.util.Collection;
import javax.xml.namespace.QName;
import org.jboss.xb.binding.JBossXBRuntimeException;
-import org.jboss.logging.Logger;
import org.xml.sax.Attributes;
@@ -40,9 +39,9 @@
public class AllBinding
extends ModelGroupBinding
{
- private static final Logger log = Logger.getLogger(AllBinding.class);
+ //private static final Logger log = Logger.getLogger(AllBinding.class);
- private Map elements = Collections.EMPTY_MAP;
+ private Map<QName, ParticleBinding> elements = Collections.emptyMap();
public AllBinding(SchemaBinding schema)
{
@@ -68,14 +67,14 @@
elements = Collections.singletonMap(element.getQName(), particle);
break;
case 1:
- elements = new HashMap(elements);
+ elements = new HashMap<QName, ParticleBinding>(elements);
default:
elements.put(element.getQName(), particle);
}
super.addParticle(particle);
}
- public Collection getParticles()
+ public Collection<ParticleBinding> getParticles()
{
return Collections.unmodifiableCollection(elements.values());
}
@@ -126,7 +125,7 @@
return false;
}
- protected List startElement(QName qName, Attributes atts, Set passedGroups, List groupStack, boolean required)
+ protected List<ModelGroupBinding.Cursor> startElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, List<ModelGroupBinding.Cursor> groupStack, boolean required)
{
ParticleBinding particle = (ParticleBinding)elements.get(qName);
if(particle != null)
@@ -145,7 +144,7 @@
return groupStack;
}
- protected ElementBinding getElement(QName qName, Attributes atts, Set passedGroups, boolean ignoreWildcards)
+ protected ElementBinding getElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, boolean ignoreWildcards)
{
ParticleBinding particle = (ParticleBinding)elements.get(qName);
return particle == null ? null : (ElementBinding)particle.getTerm();
@@ -153,7 +152,7 @@
};
}
- protected boolean mayStartWith(QName qName, Set set)
+ protected boolean mayStartWith(QName qName, Set<ModelGroupBinding> set)
{
return elements.containsKey(qName);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/CharactersHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/CharactersHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/CharactersHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -27,7 +27,6 @@
import javax.xml.namespace.NamespaceContext;
import org.jboss.xb.binding.Constants;
-import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.JBossXBRuntimeException;
import org.jboss.xb.binding.metadata.ValueMetaData;
@@ -83,17 +82,17 @@
QName itemTypeQName = itemType.getQName();
if(itemTypeQName != null && Constants.NS_XML_SCHEMA.equals(itemTypeQName.getNamespaceURI()))
{
- List list = SimpleTypeBindings.unmarshalList(itemTypeQName.getLocalPart(), value, nsCtx);
+ List<?> list = SimpleTypeBindings.unmarshalList(itemTypeQName.getLocalPart(), value, nsCtx);
if(typeBinding.getSchemaBinding().isUnmarshalListsToArrays())
{
if(list.isEmpty())
{
- Class compType = SimpleTypeBindings.classForType(itemTypeQName.getLocalPart(), true);
+ Class<?> compType = SimpleTypeBindings.classForType(itemTypeQName.getLocalPart(), true);
o = Array.newInstance(compType, 0);
}
else
{
- Class compType = list.get(0).getClass();
+ Class<?> compType = list.get(0).getClass();
o = list.toArray((Object[])Array.newInstance(compType, list.size()));
}
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ChoiceBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ChoiceBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ChoiceBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -39,7 +39,7 @@
public class ChoiceBinding
extends ModelGroupBinding
{
- private List choices = Collections.EMPTY_LIST;
+ private List<ParticleBinding> choices = Collections.emptyList();
public ChoiceBinding(SchemaBinding schema)
{
@@ -59,7 +59,7 @@
choices = Collections.singletonList(particle);
break;
case 1:
- choices = new ArrayList(choices);
+ choices = new ArrayList<ParticleBinding>(choices);
default:
choices.add(particle);
}
@@ -67,7 +67,7 @@
super.addParticle(particle);
}
- public Collection getParticles()
+ public Collection<ParticleBinding> getParticles()
{
return Collections.unmodifiableCollection(choices);
}
@@ -133,7 +133,7 @@
return wildcardContent;
}
- protected List startElement(QName qName, Attributes atts, Set passedGroups, List groupStack, boolean required)
+ protected List<ModelGroupBinding.Cursor> startElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, List<ModelGroupBinding.Cursor> groupStack, boolean required)
{
if(trace)
{
@@ -218,10 +218,10 @@
switch(passedGroups.size())
{
case 0:
- passedGroups = Collections.singleton(this);
+ passedGroups = Collections.singleton((ModelGroupBinding.Cursor)this);
break;
case 1:
- passedGroups = new HashSet(passedGroups);
+ passedGroups = new HashSet<ModelGroupBinding.Cursor>(passedGroups);
default:
passedGroups.add(this);
}
@@ -287,14 +287,14 @@
return groupStack;
}
- protected ElementBinding getElement(QName qName, Attributes atts, Set passedGroups, boolean ignoreWildcards)
+ protected ElementBinding getElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, boolean ignoreWildcards)
{
return getElement(choices, qName, atts, passedGroups, ignoreWildcards);
}
};
}
- protected boolean mayStartWith(QName qName, Set set)
+ protected boolean mayStartWith(QName qName, Set<ModelGroupBinding> set)
{
boolean result = false;
for(int i = 0; i < choices.size(); ++i)
@@ -318,10 +318,10 @@
switch(set.size())
{
case 0:
- set = Collections.singleton(this);
+ set = Collections.singleton((ModelGroupBinding)this);
break;
case 1:
- set = new HashSet(set);
+ set = new HashSet<ModelGroupBinding>(set);
default:
set.add(this);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/DefaultSchemaResolver.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/DefaultSchemaResolver.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/DefaultSchemaResolver.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -172,7 +172,7 @@
{
if (sbiClassName == null)
throw new IllegalArgumentException("Null class name");
- Class clazz = Thread.currentThread().getContextClassLoader().loadClass(sbiClassName);
+ Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(sbiClassName);
Object object = clazz.newInstance();
if (object instanceof SchemaBindingInitializer == false)
throw new IllegalArgumentException(clazz.getName() + " is not an instance of " + SchemaBindingInitializer.class.getName());
@@ -234,24 +234,24 @@
throw new IllegalArgumentException("Null reference class");
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Class clazz = cl.loadClass(reference);
+ Class<?> clazz = cl.loadClass(reference);
addClassBinding(nsUri, clazz);
}
- public void addClassBinding(String nsUri, Class clazz)
+ public void addClassBinding(String nsUri, Class<?> clazz)
{
uriToClass.put(nsUri, clazz);
}
- public Class removeClassBinding(String nsUri)
+ public Class<?> removeClassBinding(String nsUri)
{
return uriToClass.remove(nsUri);
}
- public void addClassBindingForLocation(String schemaLocation, Class clazz)
+ public void addClassBindingForLocation(String schemaLocation, Class<?> clazz)
{
schemaLocationToClass.put(schemaLocation, clazz);
}
- public Class removeClassBindingForLocation(String schemaLocation)
+ public Class<?> removeClassBindingForLocation(String schemaLocation)
{
return schemaLocationToClass.remove(schemaLocation);
}
@@ -288,7 +288,7 @@
}
// Look for a class binding by schemaLocation
- Class bindingClass = resolveClassFromSchemaLocation(schemaLocation, trace);
+ Class<?> bindingClass = resolveClassFromSchemaLocation(schemaLocation, trace);
if (bindingClass == null)
{
// Next look by namespace
@@ -353,7 +353,7 @@
if(schema != null && nsURI.length() > 0 && cacheResolvedSchemas && foundByNS)
{
- if(schemasByUri == Collections.EMPTY_MAP)
+ if(schemasByUri.isEmpty())
{
schemasByUri = new HashMap<String, SchemaBinding>();
}
@@ -379,10 +379,10 @@
* @param trace - logging trace flag
* @return the binding class if found.
*/
- protected Class resolveClassFromSchemaLocation(String schemaLocation,
+ protected Class<?> resolveClassFromSchemaLocation(String schemaLocation,
boolean trace)
{
- Class bindingClass = schemaLocationToClass.get(schemaLocation);
+ Class<?> bindingClass = schemaLocationToClass.get(schemaLocation);
if (bindingClass == null && schemaLocation != null && schemaLocation.length() > 0)
{
// Parse the schemaLocation as a uri to get the final path component
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -42,7 +42,7 @@
public class ElementBinding
extends TermBinding
{
- protected List interceptors = Collections.EMPTY_LIST;
+ protected List<ElementInterceptor> interceptors = Collections.emptyList();
protected QName qName;
protected TypeBinding typeBinding;
@@ -72,7 +72,7 @@
return qName;
}
- public List getInterceptors()
+ public List<ElementInterceptor> getInterceptors()
{
return interceptors;
}
@@ -90,7 +90,7 @@
interceptors = Collections.singletonList(interceptor);
break;
case 1:
- interceptors = new ArrayList(interceptors);
+ interceptors = new ArrayList<ElementInterceptor>(interceptors);
default:
{
if( interceptors.contains(interceptor) == false )
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ModelGroupBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ModelGroupBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ModelGroupBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -103,7 +103,7 @@
}
}
- public abstract Collection getParticles();
+ public abstract Collection<ParticleBinding> getParticles();
public boolean hasRequiredParticle()
{
@@ -130,7 +130,7 @@
// Protected
- protected abstract boolean mayStartWith(QName qName, Set set);
+ protected abstract boolean mayStartWith(QName qName, Set<ModelGroupBinding> set);
public boolean isSkip()
{
@@ -180,7 +180,7 @@
public abstract boolean isPositioned();
- public List startElement(QName qName, Attributes attrs)
+ public List<ModelGroupBinding.Cursor> startElement(QName qName, Attributes attrs)
{
return startElement(qName, attrs, Collections.EMPTY_SET, Collections.EMPTY_LIST, true);
}
@@ -198,15 +198,15 @@
// Protected
- protected abstract List startElement(QName qName,
+ protected abstract List<ModelGroupBinding.Cursor> startElement(QName qName,
Attributes atts,
- Set passedGroups,
- List groupStack,
+ Set<ModelGroupBinding.Cursor> passedGroups,
+ List<ModelGroupBinding.Cursor> groupStack,
boolean required);
- protected abstract ElementBinding getElement(QName qName, Attributes atts, Set passedGroups, boolean ignoreWildcards);
+ protected abstract ElementBinding getElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, boolean ignoreWildcards);
- protected ElementBinding getElement(List group, QName qName, Attributes atts, Set passedGroups, boolean ignoreWildcards)
+ protected ElementBinding getElement(List<ParticleBinding> group, QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, boolean ignoreWildcards)
{
ElementBinding element = null;
for(int i = 0; i < group.size(); ++i)
@@ -233,7 +233,7 @@
passedGroups = Collections.singleton(this);
break;
case 1:
- passedGroups = new HashSet(passedGroups);
+ passedGroups = new HashSet<ModelGroupBinding.Cursor>(passedGroups);
default:
passedGroups.add(this);
}
@@ -272,7 +272,7 @@
return element;
}
- protected List addItem(List list, Object o)
+ protected List<ModelGroupBinding.Cursor> addItem(List<ModelGroupBinding.Cursor> list, ModelGroupBinding.Cursor o)
{
switch(list.size())
{
@@ -280,7 +280,7 @@
list = Collections.singletonList(o);
break;
case 1:
- list = new ArrayList(list);
+ list = new ArrayList<ModelGroupBinding.Cursor>(list);
default:
list.add(o);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -49,7 +49,7 @@
{
private static final ValueAdapter DATE_ADAPTER = new ValueAdapter()
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
if (o != null && java.util.Date.class.isAssignableFrom(c))
{
@@ -60,7 +60,7 @@
};
/** The namespaces Set<String> */
- private Set namespaces = Collections.EMPTY_SET;
+ private Set<String> namespaces = Collections.emptySet();
/** namespace to prefix map, used in xb builder during binding */
private Map<String, String> nsByPrefix = Collections.emptyMap();
/** Map<QName, TypeBinding> for simple/complex types */
@@ -152,7 +152,7 @@
public void addPrefixMapping(String prefix, String ns)
{
- if(nsByPrefix == Collections.EMPTY_MAP)
+ if(nsByPrefix.isEmpty())
{
nsByPrefix = Collections.singletonMap(prefix, ns);
}
@@ -176,7 +176,7 @@
*
* @return the namespaces.
*/
- public Set getNamespaces()
+ public Set<String> getNamespaces()
{
return namespaces;
}
@@ -187,7 +187,7 @@
* @param namespaces the namespaces.
* @throws IllegalArgumentException for null spaces
*/
- public void setNamespaces(Set namespaces)
+ public void setNamespaces(Set<String> namespaces)
{
if (namespaces == null)
throw new IllegalArgumentException("Null namespaces");
@@ -234,9 +234,9 @@
return element;
}
- public Iterator getElements()
+ public Iterator<ElementBinding> getElements()
{
- return new Iterator()
+ return new Iterator<ElementBinding>()
{
private Iterator<ParticleBinding> particleIterator = elements.values().iterator();
@@ -245,10 +245,10 @@
return particleIterator.hasNext();
}
- public Object next()
+ public ElementBinding next()
{
ParticleBinding particle = particleIterator.next();
- return particle.getTerm();
+ return (ElementBinding) particle.getTerm();
}
public void remove()
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaResolverConfig.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaResolverConfig.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SchemaResolverConfig.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -77,9 +77,9 @@
this.schemaInitializers = schemaInitializers;
if (schemaInitializers != null && schemaInitializers.size() != 0)
{
- for (Iterator i = schemaInitializers.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = schemaInitializers.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
String namespace = (String) entry.getKey();
String initializer = (String) entry.getValue();
try
@@ -104,9 +104,9 @@
this.schemaLocations = schemaLocations;
if (schemaLocations != null && schemaLocations.size() != 0)
{
- for (Iterator i = schemaLocations.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = schemaLocations.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
String namespace = (String) entry.getKey();
String location = (String) entry.getValue();
resolver.addSchemaLocation(namespace, location);
@@ -124,9 +124,9 @@
this.parseAnnotations = parseAnnotations;
if (parseAnnotations != null && parseAnnotations.size() != 0)
{
- for (Iterator i = parseAnnotations.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = parseAnnotations.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
String namespace = (String) entry.getKey();
String value = (String) entry.getValue();
Boolean booleanValue = Boolean.valueOf(value);
@@ -146,14 +146,14 @@
if (bindingClassesByLocation != null && bindingClassesByLocation.size() != 0)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- for (Iterator i = bindingClassesByLocation.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = bindingClassesByLocation.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
String schemaLocation = (String) entry.getKey();
String value = (String) entry.getValue();
try
{
- Class clazz = loader.loadClass(value);
+ Class<?> clazz = loader.loadClass(value);
resolver.addClassBindingForLocation(schemaLocation, clazz);
}
catch(ClassNotFoundException e)
@@ -175,14 +175,14 @@
if (bindingClasses != null && bindingClasses.size() != 0)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- for (Iterator i = bindingClasses.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = bindingClasses.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
String namespace = (String) entry.getKey();
String value = (String) entry.getValue();
try
{
- Class clazz = loader.loadClass(value);
+ Class<?> clazz = loader.loadClass(value);
resolver.addClassBinding(namespace, clazz);
}
catch(ClassNotFoundException e)
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SequenceBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SequenceBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SequenceBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -39,7 +39,7 @@
public class SequenceBinding
extends ModelGroupBinding
{
- private List sequence = Collections.EMPTY_LIST;
+ private List<ParticleBinding> sequence = Collections.emptyList();
private ElementBinding arrayItem;
public SequenceBinding(SchemaBinding schema)
@@ -68,7 +68,7 @@
}
break;
case 1:
- sequence = new ArrayList(sequence);
+ sequence = new ArrayList<ParticleBinding>(sequence);
arrayItem = null;
default:
sequence.add(particle);
@@ -76,7 +76,7 @@
super.addParticle(particle);
}
- public Collection getParticles()
+ public Collection<ParticleBinding> getParticles()
{
return Collections.unmodifiableCollection(sequence);
}
@@ -142,7 +142,7 @@
return wildcardContent;
}
- protected List startElement(QName qName, Attributes atts, Set passedGroups, List groupStack, boolean required)
+ protected List<ModelGroupBinding.Cursor> startElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, List<ModelGroupBinding.Cursor> groupStack, boolean required)
{
if(trace)
{
@@ -242,10 +242,10 @@
switch(passedGroups.size())
{
case 0:
- passedGroups = Collections.singleton(this);
+ passedGroups = Collections.singleton((ModelGroupBinding.Cursor)this);
break;
case 1:
- passedGroups = new HashSet(passedGroups);
+ passedGroups = new HashSet<ModelGroupBinding.Cursor>(passedGroups);
default:
passedGroups.add(this);
}
@@ -345,14 +345,14 @@
return groupStack;
}
- protected ElementBinding getElement(QName qName, Attributes atts, Set passedGroups, boolean ignoreWildcards)
+ protected ElementBinding getElement(QName qName, Attributes atts, Set<ModelGroupBinding.Cursor> passedGroups, boolean ignoreWildcards)
{
return getElement(sequence, qName, atts, passedGroups, ignoreWildcards);
}
};
}
- protected boolean mayStartWith(QName qName, Set set)
+ protected boolean mayStartWith(QName qName, Set<ModelGroupBinding> set)
{
boolean result = false;
for(int i = 0; i < sequence.size(); ++i)
@@ -381,10 +381,10 @@
switch(set.size())
{
case 0:
- set = Collections.singleton(this);
+ set = Collections.singleton((ModelGroupBinding)this);
break;
case 1:
- set = new HashSet(set);
+ set = new HashSet<ModelGroupBinding>(set);
default:
set.add(this);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/SundayContentHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -394,7 +394,7 @@
}
cursor = modelGroup.newCursor(typeParticle);
- List newCursors = cursor.startElement(startName, atts);
+ List<ModelGroupBinding.Cursor> newCursors = cursor.startElement(startName, atts);
if(newCursors.isEmpty())
{
throw new JBossXBRuntimeException(startName +
@@ -410,7 +410,7 @@
// push all except the last one
for(int i = newCursors.size() - 1; i >= 0; --i)
{
- cursor = (ModelGroupBinding.Cursor)newCursors.get(i);
+ cursor = newCursors.get(i);
ParticleBinding modelGroupParticle = cursor.getParticle();
if(modelGroupParticle.isRepeatable())
@@ -448,7 +448,7 @@
//int prevOccurence = cursor.getOccurence();
ParticleBinding prevParticle = cursor.isPositioned() ? cursor.getCurrentParticle() : null;
- List newCursors = cursor.startElement(startName, atts);
+ List<ModelGroupBinding.Cursor> newCursors = cursor.startElement(startName, atts);
if(newCursors.isEmpty())
{
if(!item.ended) // this is for choices
@@ -494,14 +494,14 @@
Object o = item.o;
for(int i = newCursors.size() - 2; i >= 0; --i)
{
- cursor = (ModelGroupBinding.Cursor)newCursors.get(i);
+ cursor = newCursors.get(i);
ParticleBinding modelGroupParticle = cursor.getParticle();
handler = getHandler(modelGroupParticle);
o = handler.startParticle(o, startName, modelGroupParticle, atts, nsRegistry);
push(cursor, o, handler, parentType);
}
- cursor = (ModelGroupBinding.Cursor)newCursors.get(0);
+ cursor = newCursors.get(0);
particle = cursor.getCurrentParticle();
break;
}
@@ -598,8 +598,8 @@
handler = defParticleHandler;
}
- List localInterceptors = parentType == null ? Collections.EMPTY_LIST : parentType.getInterceptors(startName);
- List interceptors = element.getInterceptors();
+ List<ElementInterceptor> localInterceptors = parentType == null ? Collections.EMPTY_LIST : parentType.getInterceptors(startName);
+ List<ElementInterceptor> interceptors = element.getInterceptors();
if(interceptors.size() + localInterceptors.size() > 0)
{
if (repeated)
@@ -797,7 +797,7 @@
term.getPutMethodMetaData() == null)
{
ValueListHandler handler = ValueListHandler.FACTORY.lazy(item.o);
- Class cls = item.o.getClass();
+ Class<?> cls = item.o.getClass();
item.repeatableParticleValue = new ValueListInitializer().newValueList(handler, cls);
}
}
@@ -830,7 +830,7 @@
// that's not good. some elements can be handled as "unresolved" and some as "resolved"
QName qName = valueList.getValue(0).qName;
- Collection col = new ArrayList();
+ Collection<Object> col = new ArrayList<Object>();
for(int i = 0; i < valueList.size(); ++i)
{
NonRequiredValue value = valueList.getValue(i);
@@ -983,10 +983,10 @@
private ParticleBinding getParentParticle()
{
- ListIterator iter = stack.prevIterator();
+ ListIterator<StackItem> iter = stack.prevIterator();
while(iter.hasPrevious())
{
- StackItem prev = (StackItem)iter.previous();
+ StackItem prev = iter.previous();
ParticleBinding peeked = prev.particle;
TermBinding term = peeked.getTerm();
@@ -1007,10 +1007,10 @@
ElementBinding element = (ElementBinding)particle.getTerm();
QName endName = element.getQName();
TypeBinding type = element.getType();
- List interceptors = element.getInterceptors();
+ List<ElementInterceptor> interceptors = element.getInterceptors();
int interceptorsTotal = interceptors.size();
- List localInterceptors = item.parentType == null ? Collections.EMPTY_LIST : item.parentType.getInterceptors(endName);
+ List<ElementInterceptor> localInterceptors = item.parentType == null ? Collections.EMPTY_LIST : item.parentType.getInterceptors(endName);
int localInterceptorsTotal = localInterceptors.size();
if(o != NIL)
@@ -1238,10 +1238,10 @@
else if(parentParticle != null && hasWildcard && stack.size() > 1)
{
// the parent has anyType, so it gets the value of its child
- ListIterator iter = stack.prevIterator();
+ ListIterator<StackItem> iter = stack.prevIterator();
while(iter.hasPrevious())
{
- StackItem peeked = (StackItem)iter.previous();
+ StackItem peeked = iter.previous();
peeked.o = o;
if(peeked.cursor == null)
{
@@ -1440,7 +1440,7 @@
static class StackImpl
{
- private List list = new ArrayList();
+ private List<StackItem> list = new ArrayList<StackItem>();
public void clear()
{
@@ -1454,22 +1454,22 @@
public StackItem pop()
{
- return (StackItem)list.remove(list.size() - 1);
+ return list.remove(list.size() - 1);
}
- public ListIterator prevIterator()
+ public ListIterator<StackItem> prevIterator()
{
return list.listIterator(list.size() - 1);
}
public StackItem peek()
{
- return (StackItem)list.get(list.size() - 1);
+ return list.get(list.size() - 1);
}
public StackItem peek(int i)
{
- return (StackItem)list.get(list.size() - 1 - i);
+ return list.get(list.size() - 1 - i);
}
public boolean isEmpty()
@@ -1524,7 +1524,7 @@
return prop;
}
- public Class resolvePropertyType()
+ public Class<?> resolvePropertyType()
{
if(parent == null)
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/TypeBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/TypeBinding.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/TypeBinding.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -52,7 +52,7 @@
{
protected QName qName;
/** Map<QName, AttributeBinding> */
- private Map attrs = Collections.EMPTY_MAP;
+ private Map<QName, AttributeBinding> attrs = Collections.emptyMap();
private ParticleHandler handler;//todo default handler is now in SundayContentHandler.
private CharactersHandler charactersHandler;
private ClassMetaData classMetaData;
@@ -75,8 +75,8 @@
private WildcardBinding wildcard;
private ParticleBinding particle;
- private List patternValues;
- private List enumValues;
+ private List<String> patternValues;
+ private List<String> enumValues;
private TypeBinding itemType; // the type is a list type with this item type
private TypeBinding simpleType;
@@ -86,7 +86,7 @@
/** Map<QName, List<ElementInterceptor>>
* these are local element interceptors that are "added" to the interceptor stack
* defined in the element binding */
- private Map interceptors = Collections.EMPTY_MAP;
+ private Map<QName, List<ElementInterceptor>> interceptors = Collections.emptyMap();
public TypeBinding()
{
@@ -120,7 +120,7 @@
this.particle = baseType.particle;
}
- this.attrs = new HashMap(baseType.attrs);
+ this.attrs = new HashMap<QName, AttributeBinding>(baseType.attrs);
this.classMetaData = baseType.classMetaData;
this.valueMetaData = baseType.valueMetaData;
this.propertyMetaData = baseType.propertyMetaData;
@@ -200,20 +200,20 @@
return el;
}
- public void addGroup(Map group)
+ public void addGroup(Map<QName, TypeBinding> group)
{
- for(Iterator i = group.entrySet().iterator(); i.hasNext();)
+ for(Iterator<Map.Entry<QName, TypeBinding>> i = group.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry)i.next();
- QName name = (QName)entry.getKey();
- TypeBinding type = (TypeBinding)entry.getValue();
+ Map.Entry<QName, TypeBinding> entry = i.next();
+ QName name = entry.getKey();
+ TypeBinding type = entry.getValue();
addElement(name, type);
}
}
public AttributeBinding getAttribute(QName qName)
{
- return (AttributeBinding)attrs.get(qName);
+ return attrs.get(qName);
}
/**
@@ -232,7 +232,7 @@
}
// Map<QName, AttributeBinding>
- HashMap attrsNotSeen = new HashMap(this.attrs);
+ HashMap<QName, AttributeBinding> attrsNotSeen = new HashMap<QName, AttributeBinding>(this.attrs);
for(int n = 0; n < attrs.getLength(); n ++)
{
QName name = new QName(attrs.getURI(n), attrs.getLocalName(n));
@@ -243,12 +243,12 @@
if( attrsNotSeen.size() > 0 )
{
AttributesImpl tmp = new AttributesImpl(attrs);
- Iterator iter = attrsNotSeen.entrySet().iterator();
+ Iterator<Map.Entry<QName, AttributeBinding>> iter = attrsNotSeen.entrySet().iterator();
while( iter.hasNext() )
{
- Map.Entry entry = (Map.Entry) iter.next();
- QName name = (QName) entry.getKey();
- AttributeBinding binding = (AttributeBinding) entry.getValue();
+ Map.Entry<QName, AttributeBinding> entry = (Map.Entry<QName, AttributeBinding>) iter.next();
+ QName name = entry.getKey();
+ AttributeBinding binding = entry.getValue();
String constraint = binding.getDefaultConstraint();
if( constraint != null )
{
@@ -256,8 +256,7 @@
// "The attribute type is one of the strings
// "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
// or "NOTATION" (always in upper case)."
- tmp.addAttribute(name.getNamespaceURI(), name.getLocalPart(),
- name.toString(), "CDATA", constraint);
+ tmp.addAttribute(name.getNamespaceURI(), name.getLocalPart(), name.toString(), "CDATA", constraint);
}
}
expandedAttrs = tmp;
@@ -281,13 +280,13 @@
attrs = Collections.singletonMap(attr.getQName(), attr);
break;
case 1:
- attrs = new HashMap(attrs);
+ attrs = new HashMap<QName, AttributeBinding>(attrs);
default:
attrs.put(attr.getQName(), attr);
}
}
- public Collection getAttributes()
+ public Collection<AttributeBinding> getAttributes()
{
return attrs.values();
}
@@ -354,7 +353,7 @@
}
//el.pushInterceptor(interceptor);
- List intList = (List) interceptors.get(qName);
+ List<ElementInterceptor> intList = (List<ElementInterceptor>) interceptors.get(qName);
if(intList == null)
{
intList = Collections.singletonList(interceptor);
@@ -364,7 +363,7 @@
interceptors = Collections.singletonMap(qName, intList);
break;
case 1:
- interceptors = new HashMap(interceptors);
+ interceptors = new HashMap<QName, List<ElementInterceptor>>(interceptors);
default:
interceptors.put(qName, intList);
}
@@ -373,7 +372,7 @@
{
if(intList.size() == 1)
{
- intList = new ArrayList(intList);
+ intList = new ArrayList<ElementInterceptor>(intList);
interceptors.put(qName, intList);
}
intList.add(interceptor);
@@ -388,9 +387,9 @@
* @param qName
* @return
*/
- public List getInterceptors(QName qName)
+ public List<ElementInterceptor> getInterceptors(QName qName)
{
- List list = (List) interceptors.get(qName);
+ List<ElementInterceptor> list = interceptors.get(qName);
return list == null ? Collections.EMPTY_LIST : list;
}
@@ -568,7 +567,7 @@
this.particle = particle;
}
- public List getLexicalPattern()
+ public List<String> getLexicalPattern()
{
return patternValues;
}
@@ -583,13 +582,13 @@
{
if(patternValues.size() == 1)
{
- patternValues = new ArrayList(patternValues);
+ patternValues = new ArrayList<String>(patternValues);
}
patternValues.add(patternValue);
}
}
- public List getLexicalEnumeration()
+ public List<String> getLexicalEnumeration()
{
return enumValues;
}
@@ -604,7 +603,7 @@
{
if(enumValues.size() == 1)
{
- enumValues = new ArrayList(enumValues);
+ enumValues = new ArrayList<String>(enumValues);
}
enumValues.add(value);
}
@@ -650,10 +649,10 @@
}
else
{
- Iterator iter = attrs.keySet().iterator();
+ Iterator<QName> iter = attrs.keySet().iterator();
while(iter.hasNext())
{
- QName qName = (QName)iter.next();
+ QName qName = iter.next();
if(!Constants.NS_XML_MIME.equals(qName.getNamespaceURI()))
{
return false;
@@ -708,9 +707,9 @@
if(term.isModelGroup())
{
ModelGroupBinding group = (ModelGroupBinding) term;
- for(Iterator i = group.getParticles().iterator(); i.hasNext();)
+ for(Iterator<ParticleBinding> i = group.getParticles().iterator(); i.hasNext();)
{
- term = ((ParticleBinding)i.next()).getTerm();
+ term = i.next().getTerm();
if(term.isWildcard())
{
return (WildcardBinding)term;
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/UnmarshallingContext.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/UnmarshallingContext.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/UnmarshallingContext.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -35,5 +35,5 @@
String resolvePropertyName();
- Class resolvePropertyType();
+ Class<?> resolvePropertyType();
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ValueAdapter.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ValueAdapter.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ValueAdapter.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -29,7 +29,7 @@
{
ValueAdapter NOOP = new ValueAdapter()
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
return o;
}
@@ -43,5 +43,5 @@
* @param c
* @return
*/
- Object cast(Object o, Class c);
+ Object cast(Object o, Class<?> c);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/XsdBinder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/XsdBinder.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/XsdBinder.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -305,7 +305,7 @@
private boolean trace = log.isTraceEnabled();
private final SchemaBinding schema;
private SharedElements sharedElements = new SharedElements();
- private final List typeGroupStack = new ArrayList();
+ private final List<Object> typeGroupStack = new ArrayList<Object>();
// Ctors
@@ -439,7 +439,7 @@
}
StringList namespaceList = model.getNamespaces();
- Set namespaces = new LinkedHashSet(namespaceList.getLength());
+ Set<String> namespaces = new LinkedHashSet<String>(namespaceList.getLength());
for (int i = 0; i < namespaceList.getLength(); ++i)
namespaces.add(namespaceList.item(i));
schema.setNamespaces(namespaces);
@@ -1483,7 +1483,7 @@
private TypeBinding peekType()
{
TypeBinding binding = null;
- for(ListIterator i = typeGroupStack.listIterator(typeGroupStack.size()); i.hasPrevious();)
+ for(ListIterator<Object> i = typeGroupStack.listIterator(typeGroupStack.size()); i.hasPrevious();)
{
Object o = i.previous();
if(o instanceof TypeBinding)
@@ -1499,9 +1499,8 @@
private static final class SharedElements
{
- private Map elements = Collections.EMPTY_MAP;
-
- private Map globalGroups = Collections.EMPTY_MAP;
+ private Map<XSElementDeclaration, TypeBinding> elements = Collections.emptyMap();
+ private Map<XSModelGroup, ModelGroupBinding> globalGroups = Collections.emptyMap();
public void add(XSElementDeclaration element)
{
@@ -1511,7 +1510,7 @@
elements = Collections.singletonMap(element, null);
break;
case 1:
- elements = new HashMap(elements);
+ elements = new HashMap<XSElementDeclaration, TypeBinding>(elements);
default:
elements.put(element, null);
}
@@ -1535,7 +1534,7 @@
elements = Collections.singletonMap(element, type);
break;
case 1:
- elements = new HashMap(elements);
+ elements = new HashMap<XSElementDeclaration, TypeBinding>(elements);
default:
elements.put(element, type);
}
@@ -1549,7 +1548,7 @@
globalGroups = Collections.singletonMap(group, groupBinding);
break;
case 1:
- globalGroups = new HashMap(globalGroups);
+ globalGroups = new HashMap<XSModelGroup, ModelGroupBinding>(globalGroups);
default:
globalGroups.put(group, groupBinding);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtCharactersHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtCharactersHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtCharactersHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -85,7 +85,7 @@
}
}
- Class cls = clsName == null ? null : RtUtil.loadClass(clsName, failIfNotFound);
+ Class<?> cls = clsName == null ? null : RtUtil.loadClass(clsName, failIfNotFound);
if(cls != null && !cls.isPrimitive())
{
// I assume if it doesn't have ctors, there should be static fromValue
@@ -93,7 +93,7 @@
// for java5 cls.isEnum() should be used instead
if(cls.getConstructors().length == 0)
{
- Class valueType = unmarshalled.getClass();
+ Class<?> valueType = unmarshalled.getClass();
// todo: this should be used in combination element.isNillable...
if(Classes.isPrimitiveWrapper(valueType))
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtElementHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtElementHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtElementHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -147,7 +147,7 @@
setKeyMethodName = "setKey";
}
- Class parentCls = parent.getClass();
+ Class<?> parentCls = parent.getClass();
Method setKeyMethod = getSetMethod(parentCls, getKeyMethodName, setKeyMethodName);
invokeSetter(setKeyMethod, parent, o, setKeyMethodName);
}
@@ -219,7 +219,7 @@
);
}
- Class valueCls;
+ Class<?> valueCls;
try
{
valueCls = Thread.currentThread().getContextClassLoader().loadClass(valueType);
@@ -280,7 +280,7 @@
{
log.trace("setParent " + qName + " collection.add()");
}
- ((Collection) owner).add(o);
+ ((Collection<Object>) owner).add(o);
}
else
{
@@ -427,7 +427,7 @@
if(arrayItem != null)
{
- Class wrapperType = null;
+ Class<?> wrapperType = null;
if(classMetaData != null)
{
wrapperType = loadClassForTerm(classMetaData.getImpl(),
@@ -445,7 +445,7 @@
if(wrapperType == null && parent == null)
{
- Class itemType = classForElement(arrayItem, null);
+ Class<?> itemType = classForElement(arrayItem, null);
if(itemType != null)
{
if(trace)
@@ -478,7 +478,7 @@
log.trace("startElement " + elementName + " property=" + propName + " wrapper=" + wrapperType);
}
- Class parentClass = wrapperType;
+ Class<?> parentClass = wrapperType;
if(wrapperType == null)
{
if(parent instanceof GenericValueContainer)
@@ -495,7 +495,7 @@
}
}
- Class fieldType = null;
+ Class<?> fieldType = null;
if(parentClass.isArray())
{
fieldType = parentClass.getComponentType();
@@ -556,7 +556,7 @@
{
if (mapEntryMetaData.getImpl() != null)
{
- Class cls = loadClassForTerm(mapEntryMetaData.getImpl(), term.getSchema().isIgnoreUnresolvedFieldOrClass(), elementName);
+ Class<?> cls = loadClassForTerm(mapEntryMetaData.getImpl(), term.getSchema().isIgnoreUnresolvedFieldOrClass(), elementName);
if (trace)
{
@@ -576,7 +576,7 @@
if (mapEntryMetaData.isNonNullValue() && mapEntryMetaData.getValueType() != null)
{
- Class mapValueType;
+ Class<?> mapValueType;
try
{
mapValueType = Thread.currentThread().getContextClassLoader().loadClass(mapEntryMetaData.getValueType());
@@ -660,7 +660,7 @@
{
// todo: for now we require metadata for model groups to be bound
// todo 2: parent.getClass() is not going to work for containers
- Class parentClass = null;
+ Class<?> parentClass = null;
if (parent != null)
{
if (parent instanceof GenericValueContainer)
@@ -677,7 +677,7 @@
}
}
- Class cls;
+ Class<?> cls;
if (term.isModelGroup())
{
if (classMetaData == null)
@@ -697,7 +697,7 @@
TypeBinding simpleType = element.getType().getSimpleType();
if (simpleType != null)
{
- Class simpleCls = classForSimpleType(simpleType, element.isNillable());
+ Class<?> simpleCls = classForSimpleType(simpleType, element.isNillable());
if (cls.equals(simpleCls) || cls.isPrimitive() && Classes.getPrimitiveWrapper(cls) == simpleCls
|| simpleCls.isPrimitive() && Classes.getPrimitiveWrapper(simpleCls) == cls)
{
@@ -815,9 +815,9 @@
return false;
}
- private Class classForElement(ElementBinding element, Class parentClass)
+ private Class<?> classForElement(ElementBinding element, Class<?> parentClass)
{
- Class cls;
+ Class<?> cls;
TypeBinding type = element.getType();
QName typeQName = type.getQName();
if(typeQName != null && Constants.NS_XML_SCHEMA.equals(typeQName.getNamespaceURI()))
@@ -862,7 +862,7 @@
setValueMethodName = "setValue";
}
- Class parentCls = parent.getClass();
+ Class<?> parentCls = parent.getClass();
Method setValueMethod = getSetMethod(parentCls, getValueMethodName, setValueMethodName);
invokeSetter(setValueMethod, parent, o, setValueMethodName);
}
@@ -887,7 +887,7 @@
}
}
- private static Method getSetMethod(Class cls, String getMethodName, String setMethodName)
+ private static Method getSetMethod(Class<?> cls, String getMethodName, String setMethodName)
{
Method getKeyMethod;
try
@@ -946,7 +946,7 @@
return mapEntryMetaData;
}
- private static Object newInstance(Class cls, QName elementName, boolean useNoArgCtorIfFound)
+ private static Object newInstance(Class<?> cls, QName elementName, boolean useNoArgCtorIfFound)
{
Object o;
if(cls.isArray())
@@ -967,7 +967,7 @@
{
try
{
- Constructor ctor = cls.getConstructor(null);
+ Constructor<?> ctor = cls.getConstructor(null);
o = ctor.newInstance(null);
}
catch(NoSuchMethodException e)
@@ -1006,7 +1006,7 @@
return o;
}
- private static Class loadClassForTerm(String className,
+ private static Class<?> loadClassForTerm(String className,
boolean ignoreCNFE,
QName elementName)
{
@@ -1015,7 +1015,7 @@
throw new JBossXBRuntimeException("No class for " + elementName);
}
- Class cls = null;
+ Class<?> cls = null;
try
{
cls = Thread.currentThread().getContextClassLoader().loadClass(className);
@@ -1047,7 +1047,7 @@
private void invokeAdd(QName qName, AddMethodMetaData addMethodMetaData, Object owner, Object o)
{
- Class valueType = Object.class;
+ Class<?> valueType = Object.class;
if(addMethodMetaData.getValueType() != null)
{
try
@@ -1080,7 +1080,7 @@
valueType = o.getClass();
}
- Class ownerClass = owner.getClass();
+ Class<?> ownerClass = owner.getClass();
Method addMethod;
try
{
@@ -1139,7 +1139,7 @@
);
}
- Class oClass = o.getClass();
+ Class<?> oClass = o.getClass();
String getKeyMethodName = mapEntryMetaData.getGetKeyMethod();
if(getKeyMethodName == null)
{
@@ -1180,10 +1180,10 @@
);
}
- Class keyType = Object.class;
- Class valueType = Object.class;
+ Class<?> keyType = Object.class;
+ Class<?> valueType = Object.class;
String putMethodName = "put";
- Class ownerClass = owner.getClass();
+ Class<?> ownerClass = owner.getClass();
if(putMethodMetaData != null)
{
@@ -1302,7 +1302,7 @@
}
}
- private Class classForNonArrayItem(ElementBinding element, Class parentClass)
+ private Class<?> classForNonArrayItem(ElementBinding element, Class<?> parentClass)
{
String clsName;
@@ -1346,7 +1346,7 @@
if(propName != null)
{
FieldInfo fieldInfo = FieldInfo.getFieldInfo(parentClass, propName, false);
- Class fieldType = fieldInfo == null ? null : fieldInfo.getType();
+ Class<?> fieldType = fieldInfo == null ? null : fieldInfo.getType();
if(fieldType == null ||
Modifier.isAbstract(fieldType.getModifiers()) ||
@@ -1397,7 +1397,7 @@
return clsName;
}
- private static Class classForSimpleType(TypeBinding type, boolean nillable)
+ private static Class<?> classForSimpleType(TypeBinding type, boolean nillable)
{
ValueMetaData valueMetaData = type.getValueMetaData();
if(valueMetaData != null && valueMetaData.getUnmarshalMethod() != null)
@@ -1415,7 +1415,7 @@
if(type.getSchemaBinding().isUnmarshalListsToArrays())
{
// todo: nillable not always should be propagated to the item
- Class itemClass = classForSimpleType(itemType, nillable);
+ Class<?> itemClass = classForSimpleType(itemType, nillable);
return Array.newInstance(itemClass, 0).getClass();
}
else
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtUtil.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtUtil.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/impl/runtime/RtUtil.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -58,7 +58,7 @@
return;
}
- Class fieldType = fieldInfo.getType();
+ Class<?> fieldType = fieldInfo.getType();
boolean arrType;
if(fieldType.isArray())
{
@@ -83,16 +83,16 @@
if(!arrType || colType != null)
{
- Collection col = (Collection)fieldInfo.getValue(o);
+ Collection<Object> col = (Collection<Object>)fieldInfo.getValue(o);
if(col == null)
{
if(colType == null)
{
- col = new ArrayList();
+ col = new ArrayList<Object>();
}
else
{
- Class colCls;
+ Class<?> colCls;
try
{
colCls = Thread.currentThread().getContextClassLoader().loadClass(colType);
@@ -104,7 +104,7 @@
try
{
- col = (Collection)colCls.newInstance();
+ col = (Collection<Object>)colCls.newInstance();
}
catch(Exception e)
{
@@ -151,7 +151,7 @@
return;
}
- Class fieldType = fieldInfo.getType();
+ Class<?> fieldType = fieldInfo.getType();
if(valueAdapter != null)
{
@@ -161,16 +161,16 @@
if(Collection.class.isAssignableFrom(fieldType) &&
!Collection.class.isAssignableFrom(value.getClass()))
{
- Collection col = (Collection)fieldInfo.getValue(o);
+ Collection<Object> col = (Collection<Object>)fieldInfo.getValue(o);
if(col == null)
{
if(colType == null)
{
- col = new ArrayList();
+ col = new ArrayList<Object>();
}
else
{
- Class colCls;
+ Class<?> colCls;
try
{
colCls = Thread.currentThread().getContextClassLoader().loadClass(colType);
@@ -182,7 +182,7 @@
try
{
- col = (Collection)colCls.newInstance();
+ col = (Collection<Object>)colCls.newInstance();
}
catch(Exception e)
{
@@ -225,16 +225,16 @@
else
{
// todo: unmarshalling should produce the right type instead
- Class valueClass = value == null ? null : value.getClass();
+ Class<? extends Object> valueClass = value == null ? null : value.getClass();
if (valueClass != null && fieldType.isArray() && Collection.class.isAssignableFrom(valueClass))
{
- Collection col = (Collection) value;
- Class compType = fieldType.getComponentType();
+ Collection<?> col = (Collection<?>) value;
+ Class<?> compType = fieldType.getComponentType();
value = Array.newInstance(compType, col.size());
if (compType.isPrimitive())
{
int i = 0;
- for (Iterator iter = col.iterator(); iter.hasNext();)
+ for (Iterator<?> iter = col.iterator(); iter.hasNext();)
{
Array.set(value, i++, iter.next());
}
@@ -253,7 +253,7 @@
{
if(o instanceof Collection)
{
- ((Collection)o).add(value);
+ ((Collection<Object>)o).add(value);
}
else
{
@@ -263,9 +263,9 @@
}
}
- public static Class loadClass(String clsName, boolean failIfNotFound)
+ public static Class<?> loadClass(String clsName, boolean failIfNotFound)
{
- Class cls = null;
+ Class<?> cls = null;
try
{
cls = Classes.loadClass(clsName);
@@ -294,7 +294,7 @@
String clsName = unmarshalMethod.substring(0, lastDot);
String methodName = unmarshalMethod.substring(lastDot + 1);
- Class cls = RtUtil.loadClass(clsName, true);
+ Class<?> cls = RtUtil.loadClass(clsName, true);
try
{
@@ -324,10 +324,10 @@
}
}
- public static Object invokeUnmarshalMethod(Class cls,
+ public static Object invokeUnmarshalMethod(Class<?> cls,
String methodName,
Object value,
- Class valueType,
+ Class<?> valueType,
NamespaceContext nsCtx,
QName qName)
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -1994,7 +1994,7 @@
private static class XBValueAdapter implements ValueAdapter
{
- private final XmlAdapter xmlAdapter;
+ private final XmlAdapter<Object, ?> xmlAdapter;
private final TypeInfo adaptedTypeInfo;
private final Type adaptedType;
@@ -2028,7 +2028,7 @@
return adaptedType;
}
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
try
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionInterceptor.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionInterceptor.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionInterceptor.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -44,7 +44,7 @@
public void add(Object parent, Object child, QName qName)
{
BeanAdapter beanAdapter = (BeanAdapter) parent;
- Collection collection = (Collection) beanAdapter.getValue();
+ Collection<Object> collection = (Collection<Object>) beanAdapter.getValue();
collection.add(child);
}
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionWildcardHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionWildcardHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/ChildCollectionWildcardHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -84,7 +84,7 @@
public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
{
BeanAdapter beanAdapter = (BeanAdapter) parent;
- Collection collection = (Collection) beanAdapter.getValue();
+ Collection<Object> collection = (Collection<Object>) beanAdapter.getValue();
if (beanInfo != null)
{
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/CollectionPropertyHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -111,7 +111,7 @@
{
BeanAdapter beanAdapter = (BeanAdapter) parent;
- Collection<Object> c = null;
+ Collection c = null;
try
{
if (propertyInfo.getGetter() != null)
@@ -165,7 +165,7 @@
@SuppressWarnings("unchecked")
public Collection<Object> createCollection()
{
- return new ArrayList();
+ return new ArrayList<Object>();
}
}
@@ -174,7 +174,7 @@
@SuppressWarnings("unchecked")
public Collection<Object> createCollection()
{
- return new HashSet();
+ return new HashSet<Object>();
}
}
@@ -188,7 +188,7 @@
}
@SuppressWarnings("unchecked")
- public Collection<Object> createCollection() throws Throwable
+ public Collection createCollection() throws Throwable
{
return (Collection) ctor.newInstance(null);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/EnumValueAdapter.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -120,7 +120,7 @@
}
@SuppressWarnings("unchecked")
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
if (o == null)
return null;
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -267,7 +267,7 @@
}
@SuppressWarnings("unchecked")
- public Map<Object, Object> createMap() throws Throwable
+ public Map createMap() throws Throwable
{
return (Map) ctor.newInstance(null);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/util/Dom2Sax.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/util/Dom2Sax.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/util/Dom2Sax.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -59,7 +59,7 @@
{
AttributesImpl attrs = new AttributesImpl();
- List startedPrefixes = Collections.EMPTY_LIST;
+ List<String> startedPrefixes = Collections.emptyList();
NamedNodeMap domAttrs = e.getAttributes();
if(domAttrs != null && domAttrs.getLength() > 0)
@@ -216,7 +216,7 @@
list = Collections.singletonList(o);
break;
case 1:
- list = new ArrayList(list);
+ list = new ArrayList<Object>(list);
default:
list.add(o);
}
Modified: jbossxb/trunk/src/main/java/org/jboss/xb/util/NoopMap.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/util/NoopMap.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/util/NoopMap.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -26,17 +26,16 @@
import java.util.Collections;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
/**
* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
* @version <tt>$Revision: $</tt>
*/
-public class NoopMap
- extends AbstractMap
+public class NoopMap<K,V>
+ extends AbstractMap<K,V>
{
- public static final Map INSTANCE = new NoopMap();
-
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
return null;
}
@@ -61,24 +60,24 @@
return false;
}
- public Object get(Object key)
+ public V get(Object key)
{
return null;
}
- public Set keySet()
+ public Set<K> keySet()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public Collection values()
+ public Collection<V> values()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public Set entrySet()
+ public Set<Entry<K,V>> entrySet()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
public boolean equals(Object o)
Modified: jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/jboss/cmp/JBossCMPEntityCommandMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -47,7 +47,7 @@
{
private String name;
private String className;
- private Map<String, Attribute> attributes = Collections.EMPTY_MAP;
+ private Map<String, Attribute> attributes = Collections.emptyMap();
/**
Modified: jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/spec/MethodsMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/spec/MethodsMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/ejb/metadata/spec/MethodsMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -154,7 +154,7 @@
for (int i = 0; i < out.length; i++)
{
String brackets = "";
- Class cls = classes[i];
+ Class<?> cls = classes[i];
while (cls.isArray())
{
brackets += "[]";
Modified: jbossxb/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -259,7 +259,7 @@
return true;
if (obj == null || obj instanceof Collection == false)
return false;
- Collection<?> other = (Collection) obj;
+ Collection<?> other = (Collection<?>) obj;
if (size() != other.size())
return false;
Modified: jbossxb/trunk/src/test/java/org/jboss/test/ejb/AbstractEJBEverythingTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/ejb/AbstractEJBEverythingTest.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/ejb/AbstractEJBEverythingTest.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -1261,7 +1261,7 @@
assertEquals(0, bean.getTransactionTimeout("getSomething"));
}
*/
- private void assertEmptyIterator(Iterator i)
+ private void assertEmptyIterator(Iterator<?> i)
{
if (i != null && i.hasNext())
throw new AssertionFailedError("The iterator should be empty: " + i);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -92,7 +92,7 @@
* @return the delegate
* @throws Exception for any error
*/
- public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
{
return new JavaEEMetaDataTestDelegate(clazz);
}
@@ -212,7 +212,7 @@
return url.toString();
}
- protected static SchemaBindingResolver schemaResolverForClass(final Class root)
+ protected static SchemaBindingResolver schemaResolverForClass(final Class<?> root)
{
return new SchemaBindingResolver()
{
Modified: jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -47,7 +47,7 @@
protected void initResolver() throws Exception
{
- Class test = clazz;
+ Class<?> test = clazz;
while (test != null)
{
try
Modified: jbossxb/trunk/src/test/java/org/jboss/test/resolver/DefaultSchemaResolverUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/resolver/DefaultSchemaResolverUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/resolver/DefaultSchemaResolverUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -70,7 +70,7 @@
for(int n = 0; n < locations.length; n ++)
{
- Class c = resolver.removeClassBindingForLocation(locations[n]);
+ Class<?> c = resolver.removeClassBindingForLocation(locations[n]);
assertNotNull(c);
}
for(int n = 0; n < locations.length; n ++)
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/attribute/test/AbstractAttributeTest.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -58,7 +58,7 @@
@SuppressWarnings("unchecked")
public void testUnmarshal() throws Exception
{
- SimpleAttribute result = (SimpleAttribute) unmarshalObject(root);
+ SimpleAttribute<?> result = (SimpleAttribute<?>) unmarshalObject(root);
T actual = (T) result.getAttribute();
assertEquals(expected, actual);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/javatypeadapter/support/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/javatypeadapter/support/Root.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/javatypeadapter/support/Root.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -36,7 +36,7 @@
@XmlRootElement
public class Root
{
- private Map map;
+ private Map<?, ?> map;
@XmlJavaTypeAdapter(MyHashMapAdapter.class)
public Map getMap()
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/wrapper/support/Foo.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/wrapper/support/Foo.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/element/wrapper/support/Foo.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -12,7 +12,7 @@
{
private List<Number> items;
- public List getItems()
+ public List<Number> getItems()
{
return items;
}
@@ -23,7 +23,7 @@
@XmlElement(name="float", required=false, type=Float.class),
@XmlElement(name="x", required=false, type=MyNumber.class)
})
- public void setItems(List items)
+ public void setItems(List<Number> items)
{
this.items = items;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/support/Root.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -39,9 +39,9 @@
public class Root
{
private List<String> defaultList;
- private List unparameterizedList;
+ private List<?> unparameterizedList;
private List<String> jbossXmlList;
- private List unparameterizedJbossXmlList;
+ private List<?> unparameterizedJbossXmlList;
public List<String> getDefaultList()
{
@@ -54,12 +54,12 @@
}
@XmlElement(type=Integer.class)
- public List getUnparameterizedList()
+ public List<?> getUnparameterizedList()
{
return unparameterizedList;
}
- public void setUnparameterizedList(List unparameterizedList)
+ public void setUnparameterizedList(List<?> unparameterizedList)
{
this.unparameterizedList = unparameterizedList;
}
@@ -77,12 +77,12 @@
@JBossXmlCollection(type=java.util.LinkedList.class)
@XmlElement(type=Integer.class)
- public List getUnparameterizedJbossXmlList()
+ public List<?> getUnparameterizedJbossXmlList()
{
return unparameterizedJbossXmlList;
}
- public void setUnparameterizedJbossXmlList(List unparameterizedList)
+ public void setUnparameterizedJbossXmlList(List<?> unparameterizedList)
{
this.unparameterizedJbossXmlList = unparameterizedList;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/test/JBossXmlCollectionUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/test/JBossXmlCollectionUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/jbossxmlcollection/test/JBossXmlCollectionUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -48,7 +48,7 @@
assertNotNull(root);
assertNull(root.getUnparameterizedList());
assertNull(root.getJbossXmlList());
- List list = root.getDefaultList();
+ List<?> list = root.getDefaultList();
assertNotNull(list);
assertEquals(3, list.size());
assertEquals("default1", list.get(0));
@@ -62,7 +62,7 @@
assertNotNull(root);
assertNull(root.getDefaultList());
assertNull(root.getJbossXmlList());
- List list = root.getUnparameterizedList();
+ List<?> list = root.getUnparameterizedList();
assertNotNull(list);
assertEquals(3, list.size());
assertEquals(1, list.get(0));
@@ -76,7 +76,7 @@
assertNotNull(root);
assertNull(root.getDefaultList());
assertNull(root.getUnparameterizedList());
- List list = root.getJbossXmlList();
+ List<?> list = root.getJbossXmlList();
assertNotNull(list);
assertEquals(LinkedList.class, list.getClass());
assertEquals(3, list.size());
@@ -92,7 +92,7 @@
assertNull(root.getDefaultList());
assertNull(root.getUnparameterizedList());
assertNull(root.getJbossXmlList());
- List list = root.getUnparameterizedJbossXmlList();
+ List<?> list = root.getUnparameterizedJbossXmlList();
assertNotNull(list);
assertEquals(LinkedList.class, list.getClass());
assertEquals(3, list.size());
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCollectionMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCollectionMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractCollectionMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -122,7 +122,7 @@
return collection.contains(o);
}
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
return collection.containsAll(c);
}
@@ -142,12 +142,12 @@
return collection.remove(o);
}
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
return collection.removeAll(c);
}
- public boolean retainAll(Collection c)
+ public boolean retainAll(Collection<?> c)
{
return collection.retainAll(c);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractKernelDeployment.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractKernelDeployment.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractKernelDeployment.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -86,7 +86,7 @@
* @param beans a List<BeanMetaData>.
*/
@SuppressWarnings("unchecked")
- public void setBeans(List beans)
+ public void setBeans(List<BeanMetaDataFactory> beans)
{
this.beanFactories = beans;
flushJBossObjectCache();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/AbstractMapMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -114,16 +114,16 @@
@SuppressWarnings("unchecked")
public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
{
- Map result = getExpectedClass().newInstance();//getTypeInstance(info, cl, getExpectedClass());
+ Map<Object, Object> result = getExpectedClass().newInstance();//getTypeInstance(info, cl, getExpectedClass());
TypeInfo keyTypeInfo = ((ClassInfo) info).getKeyType();// getKeyClassInfo(cl);
TypeInfo valueTypeInfo = ((ClassInfo) info).getValueType();//getValueClassInfo(cl);
if (map.size() > 0)
{
- for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ for (Iterator<?> i = map.entrySet().iterator(); i.hasNext();)
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
ValueMetaData key = (ValueMetaData) entry.getKey();
ValueMetaData value = (ValueMetaData) entry.getValue();
Object keyValue = key.getValue(keyTypeInfo, cl);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/CardinalityValueAdapter.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/CardinalityValueAdapter.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/CardinalityValueAdapter.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -31,7 +31,7 @@
*/
public class CardinalityValueAdapter implements ValueAdapter
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
return Cardinality.toCardinality((String) o);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerModeValueAdapter.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerModeValueAdapter.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerModeValueAdapter.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -31,7 +31,7 @@
*/
public class ControllerModeValueAdapter implements ValueAdapter
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
return new ControllerMode((String) o);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerStateValueAdapter.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerStateValueAdapter.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/support/model/ControllerStateValueAdapter.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -31,7 +31,7 @@
*/
public class ControllerStateValueAdapter implements ValueAdapter
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
return new ControllerState((String) o);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AbstractMCTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AbstractMCTest.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AbstractMCTest.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -85,9 +85,9 @@
assertNotNull(annotations);
assertEquals(expected.size(), annotations.size());
HashSet<String> clonedExpected = new HashSet<String>(expected);
- for (Iterator i = annotations.iterator(); i.hasNext();)
+ for (Iterator<AnnotationMetaData> i = annotations.iterator(); i.hasNext();)
{
- AnnotationMetaData annotation = (AnnotationMetaData) i.next();
+ AnnotationMetaData annotation = i.next();
if (clonedExpected.remove(annotation.getAnnotation()) == false)
fail("Did not expect " + annotation + " expected " + expected);
}
@@ -100,7 +100,7 @@
assertNotNull(properties);
assertEquals(expected.size(), properties.size());
HashSet<String> clonedExpected = new HashSet<String>(expected);
- for (Iterator i = properties.iterator(); i.hasNext();)
+ for (Iterator<?> i = properties.iterator(); i.hasNext();)
{
PropertyMetaData property = (PropertyMetaData) i.next();
if (clonedExpected.remove(property.getName()) == false)
@@ -143,7 +143,7 @@
assertNotNull(supplies);
assertEquals(expected.size(), supplies.size());
HashSet<String> clonedExpected = new HashSet<String>(expected);
- for (Iterator i = supplies.iterator(); i.hasNext();)
+ for (Iterator<?> i = supplies.iterator(); i.hasNext();)
{
SupplyMetaData supply = (SupplyMetaData) i.next();
if (clonedExpected.remove(supply.getSupply()) == false)
@@ -153,7 +153,7 @@
fail("Expected " + expected + " got " + supplies);
}
- protected void assertInstalls(List expected, List installs)
+ protected void assertInstalls(List<?> expected, List<?> installs)
{
assertNotNull(installs);
assertEquals(expected.size(), installs.size());
@@ -165,7 +165,7 @@
}
}
- protected void assertCallbacks(List expected, List callbacks)
+ protected void assertCallbacks(List<?> expected, List<?> callbacks)
{
assertNotNull(callbacks);
assertEquals(expected.size(), callbacks.size());
@@ -177,7 +177,7 @@
}
}
- protected void assertParameters(List expected, List parameters)
+ protected void assertParameters(List<?> expected, List<?> parameters)
{
assertNotNull(parameters);
assertEquals(expected.size(), parameters.size());
@@ -266,7 +266,7 @@
assertTrue(value instanceof ThisValueMetaData);
}
- protected void checkJBossXBException(Class expected, Throwable throwable)
+ protected void checkJBossXBException(Class<? extends Throwable> expected, Throwable throwable)
{
checkThrowable(JBossXBException.class, throwable);
JBossXBException e = (JBossXBException) throwable;
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AliasTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AliasTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AliasTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -48,7 +48,7 @@
protected Object getAlias() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set aliases = bean.getAliases();
+ Set<?> aliases = bean.getAliases();
assertNotNull(aliases);
assertEquals(1, aliases.size());
Object alias = aliases.iterator().next();
@@ -106,7 +106,7 @@
public void testMultipleAlias() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set aliases = bean.getAliases();
+ Set<?> aliases = bean.getAliases();
assertNotNull(aliases);
int size = aliases.size();
assertTrue(size > 1);
@@ -117,7 +117,7 @@
public void testAliasWithBeanFactory() throws Exception
{
GenericBeanFactoryMetaData bean = unmarshalBeanFactory();
- Set aliases = bean.getAliases();
+ Set<?> aliases = bean.getAliases();
assertNotNull(aliases);
assertFalse(aliases.isEmpty());
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AnnotationTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AnnotationTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/AnnotationTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -43,7 +43,7 @@
AbstractBeanMetaData bean = unmarshalBean();
ConstructorMetaData constructor = bean.getConstructor();
assertNotNull(constructor);
- Set annotations = constructor.getAnnotations();
+ Set<?> annotations = constructor.getAnnotations();
assertEquals(1, annotations.size());
AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) annotations.iterator().next();
assertNotNull(annotation);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ArrayTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ArrayTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ArrayTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
protected AbstractArrayMetaData getCollection() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/CollectionTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/CollectionTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/CollectionTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -42,7 +42,7 @@
protected AbstractCollectionMetaData getCollection() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
@@ -171,10 +171,10 @@
protected void assertValues(AbstractCollectionMetaData collection, String... values)
{
assertEquals(values.length, collection.size());
- Iterator<ValueMetaData> iterator = (Iterator) collection.iterator();
+ Iterator iterator = collection.iterator();
for (int i = 0; i < values.length; ++i)
{
- assertValue(values[i], iterator.next());
+ assertValue(values[i], (ValueMetaData) iterator.next());
}
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DemandTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DemandTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DemandTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -40,7 +40,7 @@
protected AbstractDemandMetaData getDemand() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set demands = bean.getDemands();
+ Set<?> demands = bean.getDemands();
assertNotNull(demands);
assertEquals(1, demands.size());
AbstractDemandMetaData demand = (AbstractDemandMetaData) demands.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DeploymentTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DeploymentTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/DeploymentTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -69,7 +69,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(1, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -83,7 +83,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(3, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -105,7 +105,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(1, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -119,7 +119,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(3, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -141,7 +141,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beanFactories = deployment.getBeanFactories();
+ List<?> beanFactories = deployment.getBeanFactories();
assertNotNull(beanFactories);
assertEquals(3, beanFactories.size());
BeanMetaDataFactory factory = (BeanMetaDataFactory) beanFactories.get(0);
@@ -150,7 +150,7 @@
assertEquals(TestBeanMetaDataFactory1.class.getName(), factory.getClass().getName());
factory = (BeanMetaDataFactory) beanFactories.get(2);
assertEquals(TestBeanMetaDataFactory2.class.getName(), factory.getClass().getName());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(6, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -178,12 +178,12 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beanFactories = deployment.getBeanFactories();
+ List<?> beanFactories = deployment.getBeanFactories();
assertNotNull(beanFactories);
assertEquals(1, beanFactories.size());
BeanMetaDataFactory factory = (BeanMetaDataFactory) beanFactories.get(0);
assertEquals(TestBeanMetaDataFactory.class.getName(), factory.getClass().getName());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(2, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
@@ -199,7 +199,7 @@
AbstractKernelDeployment deployment = unmarshalDeployment();
assertEquals("SimpleDeployment", deployment.getName());
assertNull(deployment.getClassLoader());
- List beans = deployment.getBeans();
+ List<?> beans = deployment.getBeans();
assertNotNull(beans);
assertEquals(8, beans.size());
BeanMetaData bean = (BeanMetaData) beans.get(0);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InjectionTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InjectionTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InjectionTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -42,7 +42,7 @@
protected AbstractDependencyValueMetaData getInjection() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InstallTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InstallTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/InstallTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -45,7 +45,7 @@
protected InstallMetaData getInstall() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- List installs = bean.getInstalls();
+ List<?> installs = bean.getInstalls();
assertNotNull(installs);
assertEquals(1, installs.size());
InstallMetaData install = (InstallMetaData) installs.get(0);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ListTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ListTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ListTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
protected AbstractListMetaData getCollection() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/MapTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/MapTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/MapTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
protected AbstractMapMetaData getMap() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ParameterTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ParameterTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ParameterTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -47,7 +47,7 @@
AbstractBeanMetaData bean = unmarshalBean();
ConstructorMetaData constructor = bean.getConstructor();
assertNotNull(constructor);
- List parameters = constructor.getParameters();
+ List<?> parameters = constructor.getParameters();
assertNotNull(parameters);
assertEquals(1, parameters.size());
ParameterMetaData parameter = (ParameterMetaData) parameters.get(0);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/PropertyTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/PropertyTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/PropertyTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -46,7 +46,7 @@
protected PropertyMetaData getProperty() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SetTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SetTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SetTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
protected AbstractSetMetaData getCollection() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SupplyTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SupplyTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/SupplyTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -39,7 +39,7 @@
protected AbstractSupplyMetaData getSupply() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set supplies = bean.getSupplies();
+ Set<?> supplies = bean.getSupplies();
assertNotNull(supplies);
assertEquals(1, supplies.size());
AbstractSupplyMetaData supply = (AbstractSupplyMetaData) supplies.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ValueTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ValueTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/ValueTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
protected StringValueMetaData getValue() throws Exception
{
AbstractBeanMetaData bean = unmarshalBean();
- Set properties = bean.getProperties();
+ Set<?> properties = bean.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData property = (PropertyMetaData) properties.iterator().next();
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/XMLTestDelegate.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/XMLTestDelegate.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/mc/test/XMLTestDelegate.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -46,7 +46,7 @@
*
* @param clazz the test class
*/
- public XMLTestDelegate(Class clazz)
+ public XMLTestDelegate(Class<?> clazz)
{
super(clazz);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AllUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -89,7 +89,7 @@
assertTrue(term instanceof ElementBinding);
elements.add(((ElementBinding) term).getQName());
}
- HashSet<QName> expected = new HashSet();
+ HashSet<QName> expected = new HashSet<QName>();
expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/AlphaUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -89,7 +89,7 @@
assertTrue(term instanceof ElementBinding);
elements.add(((ElementBinding) term).getQName());
}
- ArrayList<QName> expected = new ArrayList();
+ ArrayList<QName> expected = new ArrayList<QName>();
expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/type/accessor/test/SequenceUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -89,7 +89,7 @@
assertTrue(term instanceof ElementBinding);
elements.add(((ElementBinding) term).getQName());
}
- ArrayList<QName> expected = new ArrayList();
+ ArrayList<QName> expected = new ArrayList<QName>();
expected.add(new QName(XMLConstants.NULL_NS_URI, "three"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "two"));
expected.add(new QName(XMLConstants.NULL_NS_URI, "one"));
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/AbstractJBossXBTest.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/AbstractJBossXBTest.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/AbstractJBossXBTest.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -120,7 +120,7 @@
* @return the unmarshalled object
* @throws Exception for any error
*/
- protected Object unmarshal(String name, Class expected) throws Exception
+ protected Object unmarshal(String name, Class<?> expected) throws Exception
{
Object object = unmarshal(name);
if (object == null)
@@ -138,7 +138,7 @@
* @return the unmarshalled object
* @throws Exception for any error
*/
- protected Object unmarshal(String name, Class expected, SchemaBindingResolver resolver) throws Exception
+ protected Object unmarshal(String name, Class<?> expected, SchemaBindingResolver resolver) throws Exception
{
Object object = unmarshal(name, resolver);
if (object == null)
@@ -204,7 +204,7 @@
* @return the object
* @throws Exception for any problem
*/
- protected Object unmarshal(Class expected) throws Exception
+ protected Object unmarshal(Class<?> expected) throws Exception
{
Object object = unmarshal();
if (object == null)
@@ -236,7 +236,7 @@
* @return the unmarshalled object
* @throws Exception for any error
*/
- protected Object unmarshal(String name, SchemaBinding schema, Class expected) throws Exception
+ protected Object unmarshal(String name, SchemaBinding schema, Class<?> expected) throws Exception
{
Object object = unmarshal(name, schema);
if (object == null)
@@ -292,7 +292,7 @@
* @param schema the schema name
* @return the location in the "classpath"
*/
- protected static String getSchemaLocation(Class clazz, String schema)
+ protected static String getSchemaLocation(Class<?> clazz, String schema)
{
String packageName = Classes.getPackageName(clazz);
packageName = packageName.replace('.', '/');
@@ -307,7 +307,7 @@
* @return the delegate
* @throws Exception for any error
*/
- public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
{
return new JBossXBTestDelegate(clazz);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/AttributesUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/AttributesUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/AttributesUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -171,7 +171,7 @@
{
ElementBinding eBinding = SCHEMA.getElement(new QName(NS_1, "e"));
TypeBinding eType = eBinding.getType();
- Collection attributes = eType.getAttributes();
+ Collection<?> attributes = eType.getAttributes();
assertNotNull(attributes);
assertEquals(3, attributes.size());
assertNotNull(eType.getAttribute(UNQUALIFIED_QNAME));
@@ -230,7 +230,7 @@
complexType.setValueAdapter(
new ValueAdapter()
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
// TODO Auto-generated method stub
return null;
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/BeforeMarshalAfterUnmarshalHandlerTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/BeforeMarshalAfterUnmarshalHandlerTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/BeforeMarshalAfterUnmarshalHandlerTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -256,9 +256,9 @@
// have to override string type's handlers
ElementBinding global = SCHEMA.getElement(new QName("http://jboss.org/ns/test", "global"));
SequenceBinding sequence = (SequenceBinding) global.getType().getParticle().getTerm();
- Iterator iter = sequence.getParticles().iterator();
+ Iterator<ParticleBinding> iter = sequence.getParticles().iterator();
iter.next(); // stringType element
- ElementBinding stringElement = (ElementBinding) ((ParticleBinding)iter.next()).getTerm();
+ ElementBinding stringElement = (ElementBinding) iter.next().getTerm();
stringElement.setBeforeMarshallingCallback(new TermBeforeMarshallingCallback()
{
public Object beforeMarshalling(Object o, MarshallingContext ctx)
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionOverridePropertyUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionOverridePropertyUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionOverridePropertyUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -73,7 +73,7 @@
getLog().debug("Add " + parent + " " + child);
Parent p = (Parent) parent;
if (p.list == null)
- p.list = new LinkedList();
+ p.list = new LinkedList<Object>();
p.list.add(child);
}
});
@@ -85,7 +85,7 @@
type.setClassMetaData(classMetaData);
Parent parent = (Parent) unmarshal("CollectionOverrideProperty.xml", schema, Parent.class);
- List list = parent.list;
+ List<Object> list = parent.list;
assertNotNull(list);
assertEquals("one", ((Child) list.get(0)).getValue());
assertEquals("two", ((Child) list.get(1)).getValue());
@@ -113,7 +113,7 @@
type.setClassMetaData(classMetaData);
Parent parent = (Parent) unmarshal("CollectionOverrideProperty.xml", schema, Parent.class);
- List list = parent.list;
+ List<Object> list = parent.list;
assertNotNull(list);
assertEquals("one", ((Child) list.get(0)).getValue());
assertEquals("two", ((Child) list.get(1)).getValue());
@@ -121,14 +121,14 @@
public static class Parent
{
- private List list;
+ private List<Object> list;
- public List getList()
+ public List<Object> getList()
{
return list;
}
- public void setList(List list)
+ public void setList(List<Object> list)
{
this.list = list;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionsUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionsUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/CollectionsUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -430,8 +430,8 @@
public static final class ListWrapper
{
- public List field1;
- public List field2;
+ public List<String> field1;
+ public List<Boolean> field2;
public QName[] field3;
}
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/EnumUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/EnumUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/EnumUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -201,7 +201,7 @@
{
public Color color;
public Nmbr number;
- public List all;
+ public List<Object> all;
public boolean equals(Object o)
{
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/GlobalGroupUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/GlobalGroupUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/GlobalGroupUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -74,10 +74,10 @@
assertNotNull(term);
assertTrue(term instanceof SequenceBinding);
SequenceBinding sequence = (SequenceBinding) term;
- Collection particles = sequence.getParticles();
+ Collection<ParticleBinding> particles = sequence.getParticles();
assertNotNull(particles);
assertEquals(1, particles.size());
- particle = (ParticleBinding) particles.iterator().next();
+ particle = particles.iterator().next();
term = particle.getTerm();
assertTrue(group == term);
}
@@ -93,10 +93,10 @@
assertNotNull(group4);
// Forwards
- Collection particles = group2.getParticles();
+ Collection<ParticleBinding> particles = group2.getParticles();
assertNotNull(particles);
assertEquals(1, particles.size());
- ParticleBinding particle = (ParticleBinding) particles.iterator().next();
+ ParticleBinding particle = particles.iterator().next();
TermBinding term = particle.getTerm();
assertTrue(term == group3);
@@ -104,7 +104,7 @@
particles = group4.getParticles();
assertNotNull(particles);
assertEquals(1, particles.size());
- particle = (ParticleBinding) particles.iterator().next();
+ particle = particles.iterator().next();
term = particle.getTerm();
assertTrue(term == group3);
}
@@ -136,7 +136,7 @@
assertNotNull(parent.global1);
assertEquals(2, parent.global1.child.size());
- ArrayList expected = new ArrayList();
+ ArrayList<String> expected = new ArrayList<String>();
expected.add("Hello");
expected.add("Goodbye");
assertEquals(expected, parent.global1.child);
@@ -149,6 +149,6 @@
public static class Global1
{
- public Collection child = new ArrayList();
+ public Collection<?> child = new ArrayList<Object>();
}
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/IgnorableWhitespaceUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/IgnorableWhitespaceUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/IgnorableWhitespaceUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -174,7 +174,7 @@
{
if(top.string == null)
{
- top.string = new ArrayList();
+ top.string = new ArrayList<Object>();
}
top.string.add(value);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/JBossXBTestDelegate.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/JBossXBTestDelegate.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/JBossXBTestDelegate.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -73,7 +73,7 @@
*
* @param clazz the test class
*/
- public JBossXBTestDelegate(Class clazz)
+ public JBossXBTestDelegate(Class<?> clazz)
{
super(clazz);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/MappingTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/MappingTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/MappingTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -92,7 +92,7 @@
assertEquals(person.getPhones(), Arrays.asList(new Object[]{"01", "02"}));
- ArrayList list = new ArrayList();
+ ArrayList<Address> list = new ArrayList<Address>();
Address addr1 = new Address();
addr1.setStreet("prosp. Rad. Ukr. 11A, 70");
list.add(addr1);
@@ -193,9 +193,9 @@
private Parent newImmutableParent()
{
Child1 child1 = new Child1("child1");
- List child2 = Arrays.asList(new Object[]{new Child2("child2_1"), new Child2("child2_2")});
- List others = Arrays.asList(new Object[]{new Child3("child3_1"), new Child3("child3_2"), new Child3("child3_3")});
- List choice = Arrays.asList(
+ List<Object> child2 = Arrays.asList(new Object[]{new Child2("child2_1"), new Child2("child2_2")});
+ List<Object> others = Arrays.asList(new Object[]{new Child3("child3_1"), new Child3("child3_2"), new Child3("child3_3")});
+ List<Object> choice = Arrays.asList(
new Object[]{new ImmutableChoice("choice1"), new ImmutableChoice(new Child1("child1"))}
);
Parent parent = new Parent(child1, child2, others, choice);
@@ -234,8 +234,8 @@
String b = "b";
String c = "c";
- List choice1 = Arrays.asList(new Choice1[]{new Choice1(a, null), new Choice1(null, b)});
- List choice2 = Arrays.asList(new Choice2[]{new Choice2(a, b, null), new Choice2(a, null, c)});
+ List<Choice1> choice1 = Arrays.asList(new Choice1[]{new Choice1(a, null), new Choice1(null, b)});
+ List<Choice2> choice2 = Arrays.asList(new Choice2[]{new Choice2(a, b, null), new Choice2(a, null, c)});
Root root = new Root();
root.setChoice1(choice1);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/MapsUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/MapsUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/MapsUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -61,11 +61,11 @@
private static final QName QNAME_VALUE1 = new QName(NS, "value1");
private static final QName QNAME_VALUE2 = new QName(NS, "value2");
- private static final Map EXPECTED;
+ private static final Map<?, ?> EXPECTED;
static
{
- Map expected = new HashMap();
+ Map<String, Object> expected = new HashMap<String, Object>();
expected.put("key1", "value1");
expected.put("key2", "value2");
expected.put("key3", "value3");
@@ -147,7 +147,7 @@
{
public void add(Object parent, Object child, QName name)
{
- Map map = (Map)parent;
+ Map<Object, Object> map = (Map<Object, Object>)parent;
Object[] arr = (Object[])child;
map.put(arr[0], arr[1]);
}
@@ -313,7 +313,7 @@
public void add(Object parent, Object child, QName qName)
{
Object[] arr = (Object[])parent;
- Map submap = (Map)child;
+ Map<?, ?> submap = (Map<?, ?>)child;
arr[1] = submap;
}
}
@@ -342,7 +342,7 @@
ParticleBinding particle,
ParticleBinding parentParticle)
{
- Map map = (Map)parent;
+ Map<Object, Object> map = (Map<Object, Object>)parent;
Object[] arr = (Object[])o;
map.put(arr[0], arr[1]);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/MiscUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/MiscUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/MiscUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -322,9 +322,9 @@
final URL xsdUrl = getUrl("xml/immutable.xsd");
Child1 child1 = new Child1("child1");
- List child2 = Arrays.asList(new Object[]{new Child2("child2_1"), new Child2("child2_2")});
- List others = Arrays.asList(new Object[]{new Child3("child3_1"), new Child3("child3_2"), new Child3("child3_3")});
- List choice = Arrays.asList(
+ List<Object> child2 = Arrays.asList(new Object[]{new Child2("child2_1"), new Child2("child2_2")});
+ List<Object> others = Arrays.asList(new Object[]{new Child3("child3_1"), new Child3("child3_2"), new Child3("child3_3")});
+ List<Object> choice = Arrays.asList(
new Object[]{new ImmutableChoice("choice1"), new ImmutableChoice(new Child1("child1"))}
);
Parent parent = new Parent(child1, child2, others, choice);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/ModelGroupBindingUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/ModelGroupBindingUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/ModelGroupBindingUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -123,7 +123,7 @@
"<item_2>item32</item_2>" +
"</global>";
- private static final List LIST_OF_LISTS = Arrays.asList(new Object[]{
+ private static final List<Object> LIST_OF_LISTS = Arrays.asList(new Object[]{
Arrays.asList(new String[]{"item11", "item12"}),
Arrays.asList(new String[]{"item21", "item22"}),
Arrays.asList(new String[]{"item31", "item32"})
@@ -217,9 +217,9 @@
INSTANCE = global;
}
- public Collection sequences;
- public Collection choices;
- public Collection listOfLists;
+ public Collection<Object> sequences;
+ public Collection<Object> choices;
+ public Collection<Object> listOfLists;
public String toString()
{
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/MultispacedUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/MultispacedUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/MultispacedUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -165,15 +165,15 @@
assertEquals("The JBoss XMBean version of the monitor server", xmbean.getDescription());
assertEquals("monitor.MonitorPOJO", xmbean.getMbeanClass());
- final List constructors = xmbean.getConstructors();
+ final List<XMBeanConstructorMetaData> constructors = xmbean.getConstructors();
assertEquals(1, constructors.size());
- XMBeanConstructorMetaData constructor = (XMBeanConstructorMetaData)constructors.get(0);
+ XMBeanConstructorMetaData constructor = constructors.get(0);
assertEquals("The no-arg constructor", constructor.getDescription());
assertEquals("monitor.MonitorPOJO", constructor.getName());
- final List attributes = xmbean.getAttributes();
+ final List<XMBeanAttributeMetaData> attributes = xmbean.getAttributes();
assertEquals(1, attributes.size());
- XMBeanAttributeMetaData attribute = (XMBeanAttributeMetaData)attributes.get(0);
+ XMBeanAttributeMetaData attribute = attributes.get(0);
assertEquals("read-write", attribute.getAccess());
assertEquals("getInterval", attribute.getGetMethod());
assertEquals("setInterval", attribute.getSetMethod());
@@ -181,16 +181,16 @@
assertEquals("Interval", attribute.getName());
assertEquals("int", attribute.getType());
- final List operations = xmbean.getOperations();
+ final List<XMBeanOperationMetaData> operations = xmbean.getOperations();
assertEquals(1, operations.size());
- XMBeanOperationMetaData operation = (XMBeanOperationMetaData)operations.get(0);
+ XMBeanOperationMetaData operation = operations.get(0);
assertEquals("Access the last HistoryLength monitor reports", operation.getDescription());
assertEquals("history", operation.getName());
assertEquals("java.lang.String", operation.getReturnType());
- final List notifications = xmbean.getNotifications();
+ final List<XMBeanNotificationMetaData> notifications = xmbean.getNotifications();
assertEquals(1, notifications.size());
- XMBeanNotificationMetaData notification = (XMBeanNotificationMetaData)notifications.get(0);
+ XMBeanNotificationMetaData notification = notifications.get(0);
assertEquals("A notification sent when the monitor interval expires", notification.getDescription());
assertEquals("javax.management.Notification", notification.getName());
assertEquals("monitor.IntervalElapsed", notification.getNotificationType());
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerTestBase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerTestBase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerTestBase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -304,26 +304,26 @@
assertNotNull(deployment.getBeans());
assertEquals(2, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getProperties());
assertEquals(1, bean.getProperties().size());
- AbstractPropertyMetaData prop = (AbstractPropertyMetaData)bean.getProperties().iterator().next();
+ AbstractPropertyMetaData prop = bean.getProperties().iterator().next();
assertNotNull(prop);
assertEquals("other", prop.getName());
assertTrue(prop.getValue() instanceof AbstractDependencyValueMetaData);
AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)prop.getValue();
assertEquals("SimpleBean2", dependency.getValue());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
+ bean = deployment.getBeans().get(1);
assertEquals("SimpleBean2", bean.getName());
assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getConstructor());
ConstructorMetaData ctor = bean.getConstructor();
assertNotNull(ctor.getParameters());
assertEquals(1, ctor.getParameters().size());
- AbstractParameterMetaData param = (AbstractParameterMetaData)ctor.getParameters().get(0);
+ AbstractParameterMetaData param = ctor.getParameters().get(0);
assertEquals("java.lang.String", param.getType());
assertEquals("Bean2", param.getValue().getUnderlyingValue());
}
@@ -335,26 +335,26 @@
assertNotNull(deployment.getBeans());
assertEquals(2, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getProperties());
assertEquals(1, bean.getProperties().size());
- AbstractPropertyMetaData prop = (AbstractPropertyMetaData)bean.getProperties().iterator().next();
+ AbstractPropertyMetaData prop = bean.getProperties().iterator().next();
assertNotNull(prop);
assertEquals("other", prop.getName());
assertTrue(prop.getValue() instanceof AbstractDependencyValueMetaData);
AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)prop.getValue();
assertEquals("SimpleBean2", dependency.getValue());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
+ bean = deployment.getBeans().get(1);
assertEquals("SimpleBean2", bean.getName());
assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getConstructor());
ConstructorMetaData ctor = bean.getConstructor();
assertNotNull(ctor.getParameters());
assertEquals(1, ctor.getParameters().size());
- AbstractParameterMetaData param = (AbstractParameterMetaData)ctor.getParameters().get(0);
+ AbstractParameterMetaData param = ctor.getParameters().get(0);
assertEquals("java.lang.String", param.getType());
assertEquals("Bean2", param.getValue().getUnderlyingValue());
}
@@ -366,15 +366,15 @@
assertNotNull(deployment.getBeans());
assertEquals(1, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getProperties());
assertEquals(18, bean.getProperties().size());
- for(Iterator i = bean.getProperties().iterator(); i.hasNext();)
+ for(Iterator<AbstractPropertyMetaData> i = bean.getProperties().iterator(); i.hasNext();)
{
- AbstractPropertyMetaData prop = (AbstractPropertyMetaData)i.next();
+ AbstractPropertyMetaData prop = i.next();
String name = prop.getName();
Object value = prop.getValue().getUnderlyingValue();
assertConfigureProperty(name, value);
@@ -388,15 +388,15 @@
assertNotNull(deployment.getBeans());
assertEquals(1, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getProperties());
assertEquals(19, bean.getProperties().size());
- for(Iterator i = bean.getProperties().iterator(); i.hasNext();)
+ for(Iterator<AbstractPropertyMetaData> i = bean.getProperties().iterator(); i.hasNext();)
{
- AbstractPropertyMetaData prop = (AbstractPropertyMetaData)i.next();
+ AbstractPropertyMetaData prop = i.next();
String name = prop.getName();
if("other".equals(name))
{
@@ -435,7 +435,7 @@
assertNotNull(deployment.getBeans());
assertEquals(2, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getConstructor());
@@ -451,7 +451,7 @@
AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
assertEquals("SimpleBean2", dependency.getValue());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
+ bean = deployment.getBeans().get(1);
assertEquals("SimpleBean2", bean.getName());
assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
}
@@ -534,7 +534,7 @@
assertNotNull(deployment.getBeans());
assertEquals(3, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getConstructor());
@@ -544,17 +544,17 @@
assertEquals("SimpleBeanFactory", ctor.getFactory().getUnderlyingValue());
assertNotNull(ctor.getParameters());
assertEquals(1, ctor.getParameters().size());
- AbstractParameterMetaData param = (AbstractParameterMetaData)ctor.getParameters().get(0);
+ AbstractParameterMetaData param = ctor.getParameters().get(0);
assertEquals("org.jboss.test.xml.pojoserver.SimpleBean", param.getType());
assertTrue(param.getValue() instanceof AbstractDependencyValueMetaData);
AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
assertEquals("SimpleBean2", dependency.getValue());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
+ bean = deployment.getBeans().get(1);
assertEquals("SimpleBean2", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(2);
+ bean = deployment.getBeans().get(2);
assertEquals("SimpleBeanFactory", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanFactory", bean.getBean());
}
@@ -690,7 +690,7 @@
assertNotNull(deployment.getBeans());
assertEquals(2, deployment.getBeans().size());
- AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
+ AbstractBeanMetaData bean = deployment.getBeans().get(0);
assertEquals("SimpleBean1", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
assertNotNull(bean.getConstructor());
@@ -699,7 +699,7 @@
assertEquals("staticCreateSimpleBean", ctor.getFactoryMethod());
assertNotNull(ctor.getParameters());
assertEquals(1, ctor.getParameters().size());
- AbstractParameterMetaData param = (AbstractParameterMetaData)ctor.getParameters().get(0);
+ AbstractParameterMetaData param = ctor.getParameters().get(0);
assertNotNull(param);
assertEquals("org.jboss.test.kernel.xml.support.SimpleBean", param.getType());
assertNotNull(param.getValue());
@@ -707,7 +707,7 @@
AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
assertEquals("SimpleBean2", dependency.getValue());
- bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
+ bean = deployment.getBeans().get(1);
assertEquals("SimpleBean2", bean.getName());
assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/PojoServerUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -115,10 +115,10 @@
{
AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
- List beans = deployment.getBeans();
+ List<AbstractBeanMetaData> beans = deployment.getBeans();
if (beans == null)
{
- beans = new ArrayList();
+ beans = new ArrayList<AbstractBeanMetaData>();
deployment.setBeans(beans);
}
beans.add(bean);
@@ -132,10 +132,10 @@
{
AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
- List beans = deployment.getBeans();
+ List<AbstractBeanMetaData> beans = deployment.getBeans();
if (beans == null)
{
- beans = new ArrayList();
+ beans = new ArrayList<AbstractBeanMetaData>();
deployment.setBeans(beans);
}
beans.add(bean);
@@ -175,14 +175,14 @@
{
AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData();
beanMetaData.setBean(GenericBeanFactory.class.getName());
- beanMetaData.setProperties(new HashSet());
+ beanMetaData.setProperties(new HashSet<AbstractPropertyMetaData>());
return beanMetaData;
}
public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) o;
- Set properties = bean.getProperties();
+ Set<AbstractPropertyMetaData> properties = bean.getProperties();
for (int i = 0; i < attrs.getLength(); ++i)
{
String localName = attrs.getLocalName(i);
@@ -212,7 +212,7 @@
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) child;
- Set properties = bean.getProperties();
+ Set<AbstractPropertyMetaData> properties = bean.getProperties();
properties.add(new AbstractPropertyMetaData("constructor", new AbstractValueMetaData(constructor)));
}
});
@@ -258,10 +258,10 @@
{
AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) parent;
AbstractParameterMetaData parameter = (AbstractParameterMetaData) child;
- List parameters = constructor.getParameters();
+ List<AbstractParameterMetaData> parameters = constructor.getParameters();
if (parameters == null)
{
- parameters = new ArrayList();
+ parameters = new ArrayList<AbstractParameterMetaData>();
constructor.setParameters(parameters);
}
parameters.add(parameter);
@@ -269,7 +269,7 @@
});
ModelGroupBinding valueGroup = schemaBinding.getGroup(valueGroupQName);
- for(Iterator i = valueGroup.getParticles().iterator(); i.hasNext();)
+ for(Iterator<?> i = valueGroup.getParticles().iterator(); i.hasNext();)
{
TermBinding term = ((ParticleBinding)i.next()).getTerm();
if(!term.isWildcard())
@@ -394,10 +394,10 @@
{
AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) parent;
AbstractParameterMetaData parameter = (AbstractParameterMetaData) child;
- List parameters = lifecycle.getParameters();
+ List<AbstractParameterMetaData> parameters = lifecycle.getParameters();
if (parameters == null)
{
- parameters = new ArrayList();
+ parameters = new ArrayList<AbstractParameterMetaData>();
lifecycle.setParameters(parameters);
}
parameters.add(parameter);
@@ -411,10 +411,10 @@
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
AbstractPropertyMetaData property = (AbstractPropertyMetaData) child;
- Set properties = bean.getProperties();
+ Set<AbstractPropertyMetaData> properties = bean.getProperties();
if (properties == null)
{
- properties = new HashSet();
+ properties = new HashSet<AbstractPropertyMetaData>();
bean.setProperties(properties);
}
properties.add(property);
@@ -427,11 +427,11 @@
public void add(Object parent, Object child, QName name)
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
- Set properties = bean.getProperties();
+ Set<AbstractPropertyMetaData> properties = bean.getProperties();
AbstractPropertyMetaData props = null;
- for (Iterator i = properties.iterator(); i.hasNext();)
+ for (Iterator<AbstractPropertyMetaData> i = properties.iterator(); i.hasNext();)
{
- AbstractPropertyMetaData prop = (AbstractPropertyMetaData) i.next();
+ AbstractPropertyMetaData prop = i.next();
if ("properties".equals(prop.getName()))
{
props = prop;
@@ -464,10 +464,10 @@
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
AbstractDependencyMetaData dependency = (AbstractDependencyMetaData) child;
- Set demands = bean.getDemands();
+ Set<Object> demands = bean.getDemands();
if (demands == null)
{
- demands = new HashSet();
+ demands = new HashSet<Object>();
bean.setDemands(demands);
}
demands.add(dependency);
@@ -481,10 +481,10 @@
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
AbstractDemandMetaData demand = (AbstractDemandMetaData) child;
- Set demands = bean.getDemands();
+ Set<Object> demands = bean.getDemands();
if (demands == null)
{
- demands = new HashSet();
+ demands = new HashSet<Object>();
bean.setDemands(demands);
}
demands.add(demand);
@@ -498,10 +498,10 @@
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) parent;
AbstractSupplyMetaData supply = (AbstractSupplyMetaData) child;
- Set supplies = bean.getSupplies();
+ Set<AbstractSupplyMetaData> supplies = bean.getSupplies();
if (supplies == null)
{
- supplies = new HashSet();
+ supplies = new HashSet<AbstractSupplyMetaData>();
bean.setSupplies(supplies);
}
supplies.add(supply);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaBindingInitializerUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaBindingInitializerUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaBindingInitializerUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -41,7 +41,7 @@
{
public static SchemaBindingResolver initResolver() throws Exception
{
- Class clazz = SchemaBindingInitializerUnitTestCase.class;
+ Class<?> clazz = SchemaBindingInitializerUnitTestCase.class;
DefaultSchemaResolver resolver = new DefaultSchemaResolver();
resolver.addSchemaInitializer(SimpleInitializer.NS, SimpleInitializer.class.getName());
String location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseSimple.xsd");
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaImportUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaImportUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SchemaImportUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -120,7 +120,7 @@
Object o = unmarshaller.unmarshal(new StringReader(XML), schema);
assertNotNull(o);
assertTrue(o instanceof List);
- List list = (List)o;
+ List<?> list = (List<?>)o;
assertEquals(1, list.size());
o = list.get(0);
assertTrue(o instanceof Book);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SharedElementUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SharedElementUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SharedElementUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -74,14 +74,14 @@
assertNotNull(term);
assertTrue(term instanceof SequenceBinding);
SequenceBinding sequence = (SequenceBinding) term;
- Collection particles = sequence.getParticles();
+ Collection<ParticleBinding> particles = sequence.getParticles();
assertNotNull(particles);
assertEquals(2, particles.size());
- Iterator iterator = particles.iterator();
- particle = (ParticleBinding) iterator.next();
+ Iterator<ParticleBinding> iterator = particles.iterator();
+ particle = iterator.next();
term = particle.getTerm();
assertTrue(element1 == term);
- particle = (ParticleBinding) iterator.next();
+ particle = iterator.next();
term = particle.getTerm();
assertTrue(element3 == term);
}
@@ -96,14 +96,14 @@
ElementBinding element3 = schema.getElement(new QName(NS, "element3"));
assertNotNull(element3);
- Collection particles = group.getParticles();
+ Collection<ParticleBinding> particles = group.getParticles();
assertNotNull(particles);
assertEquals(2, particles.size());
- Iterator iterator = particles.iterator();
- ParticleBinding particle = (ParticleBinding) iterator.next();
+ Iterator<ParticleBinding> iterator = particles.iterator();
+ ParticleBinding particle = iterator.next();
TermBinding term = particle.getTerm();
assertTrue(element1 == term);
- particle = (ParticleBinding) iterator.next();
+ particle = iterator.next();
term = particle.getTerm();
assertTrue(element3 == term);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleContentUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleContentUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleContentUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -76,7 +76,7 @@
getLog().debug("Add " + parent + " " + child);
Top p = (Top) parent;
if (p.string == null)
- p.string = new LinkedList();
+ p.string = new LinkedList<Object>();
p.string.add(child);
}
});
@@ -88,14 +88,14 @@
public static class Top
{
- public List string;
+ public List<Object> string;
- public List getString()
+ public List<Object> getString()
{
return string;
}
- public void setString(List string)
+ public void setString(List<Object> string)
{
this.string = string;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -342,9 +342,9 @@
assertEquals("0836217462", book.getIsbn());
assertEquals(book.getCharactersTotal(), 2);
- for(Iterator iter = book.getCharacters().iterator(); iter.hasNext();)
+ for(Iterator<BookCharacter> iter = book.getCharacters().iterator(); iter.hasNext();)
{
- BookCharacter character = (BookCharacter)iter.next();
+ BookCharacter character = iter.next();
final String name = character.getName();
if(name.equals("Snoopy"))
{
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -447,7 +447,7 @@
return prefix;
}
- public Iterator getPrefixes(String namespaceURI)
+ public Iterator<?> getPrefixes(String namespaceURI)
{
if(!ns.equals(namespaceURI))
{
@@ -485,7 +485,7 @@
return null;
}
- public Iterator getPrefixes(String namespaceURI)
+ public Iterator<?> getPrefixes(String namespaceURI)
{
return Collections.emptyList().iterator();
}
@@ -503,7 +503,7 @@
public void testBooleanListUnmarshalling() throws Exception
{
- List booleans = SimpleTypeBindings.unmarshalList(
+ List<Object> booleans = SimpleTypeBindings.unmarshalList(
SimpleTypeBindings.XS_BOOLEAN_NAME, " 1 1 0 true true false ", null
);
assertNotNull(booleans);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/SundayUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/SundayUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/SundayUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -34,6 +34,10 @@
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
import org.jboss.test.xml.config.Config;
+import org.jboss.test.xml.config.Config.Bean;
+import org.jboss.test.xml.config.Config.ConfigAttr;
+import org.jboss.test.xml.config.Config.Depends;
+import org.jboss.test.xml.config.Config.ListValue;
import org.xml.sax.Attributes;
import javax.xml.namespace.QName;
@@ -127,10 +131,10 @@
{
Config config = (Config)parent;
Config.ConfigAttr attr = (Config.ConfigAttr)child;
- Collection attrs = config.getAttrs();
+ Collection<ConfigAttr> attrs = config.getAttrs();
if(attrs == null)
{
- attrs = new ArrayList();
+ attrs = new ArrayList<ConfigAttr>();
config.setAttrs(attrs);
}
attrs.add(attr);
@@ -143,7 +147,7 @@
public void add(Object parent, Object child, QName name)
{
Config config = (Config)parent;
- config.beans = (Collection)child;
+ config.beans = (Collection<Bean>)child;
}
}
);
@@ -153,7 +157,7 @@
public void add(Object parent, Object child, QName name)
{
Config config = (Config)parent;
- config.list = (Collection)child;
+ config.list = (Collection<Object>)child;
}
}
);
@@ -163,7 +167,7 @@
public void add(Object parent, Object child, QName name)
{
Config config = (Config)parent;
- config.map = (Map)child;
+ config.map = (Map<?, ?>)child;
}
}
);
@@ -261,7 +265,7 @@
{
public void add(Object parent, Object child, QName name)
{
- Collection beans = (Collection)parent;
+ Collection<Bean> beans = (Collection<Bean>)parent;
Config.Bean bean = (Config.Bean)child;
beans.add(bean);
}
@@ -306,7 +310,7 @@
{
public void add(Object parent, Object child, QName name)
{
- Collection list = (Collection)parent;
+ Collection<ListValue> list = (Collection<ListValue>)parent;
Config.ListValue value = (Config.ListValue)child;
list.add(value);
}
@@ -316,7 +320,7 @@
{
public void add(Object parent, Object child, QName name)
{
- Collection list = (Collection)parent;
+ Collection<Depends> list = (Collection<Depends>)parent;
Config.Depends depends = (Config.Depends)child;
list.add(depends);
}
@@ -326,8 +330,8 @@
{
public void add(Object parent, Object child, QName name)
{
- Collection list = (Collection)parent;
- Collection sublist = (Collection)child;
+ Collection<Collection<?>> list = (Collection<Collection<?>>)parent;
+ Collection<?> sublist = (Collection<?>)child;
list.add(sublist);
}
}
@@ -419,7 +423,7 @@
{
public void add(Object parent, Object child, QName name)
{
- Map map = (Map)parent;
+ Map<Object, Object> map = (Map<Object, Object>)parent;
Object[] arr = (Object[])child;
map.put(arr[0], arr[1]);
}
@@ -583,7 +587,7 @@
public void add(Object parent, Object child, QName qName)
{
Object[] arr = (Object[])parent;
- Map submap = (Map)child;
+ Map<?, ?> submap = (Map<?, ?>)child;
arr[1] = submap;
}
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/TopLevelValueAdapterUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/TopLevelValueAdapterUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/TopLevelValueAdapterUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -59,7 +59,7 @@
TypeBinding type = element.getType();
type.setValueAdapter(new ValueAdapter()
{
- public Object cast(Object o, Class c)
+ public Object cast(Object o, Class<?> c)
{
String string = (String) o;
return string + "...";
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardUnresolvedElementsUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardUnresolvedElementsUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardUnresolvedElementsUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -211,8 +211,8 @@
if(ge.getAttributesTotal() > 0)
{
attrs = new AttributesImpl(ge.getAttributesTotal() + 1);
- Set attrNames = ge.getAttributeNames();
- for(Iterator i = attrNames.iterator(); i.hasNext();)
+ Set<?> attrNames = ge.getAttributeNames();
+ for(Iterator<?> i = attrNames.iterator(); i.hasNext();)
{
String attrName = (String)i.next();
String attrValue = ge.getAttribute(attrName);
@@ -236,7 +236,7 @@
if(ge.getChildElementsTotal() > 0)
{
- for(Iterator i = ge.getChildElements(); i.hasNext();)
+ for(Iterator<?> i = ge.getChildElements(); i.hasNext();)
{
GenericElement child = (GenericElement)i.next();
this.marshal(ctx, child);
@@ -329,7 +329,7 @@
assertNoTextContent(ge);
assertChildElementsTotal(ge, 3);
- for(Iterator i = ge.getChildElements(); i.hasNext();)
+ for(Iterator<?> i = ge.getChildElements(); i.hasNext();)
{
ge = (GenericElement)i.next();
String localName = ge.getLocalName();
@@ -743,8 +743,8 @@
{
private String localName;
private String nsUri;
- private Map attributes = Collections.EMPTY_MAP;
- private Map childElements = Collections.EMPTY_MAP;
+ private Map<String, String> attributes = Collections.emptyMap();
+ private Map<String, GenericElement> childElements = Collections.emptyMap();
private String textContent;
public GenericElement(String localName)
@@ -786,7 +786,7 @@
attributes = Collections.singletonMap(name, value);
break;
case 1:
- attributes = new HashMap(attributes);
+ attributes = new HashMap<String, String>(attributes);
default:
attributes.put(name, value);
}
@@ -805,7 +805,7 @@
childElements = Collections.singletonMap(child.getLocalName(), child);
break;
case 1:
- childElements = new LinkedHashMap(childElements);
+ childElements = new LinkedHashMap<String, GenericElement>(childElements);
default:
childElements.put(child.getLocalName(), child);
}
@@ -816,7 +816,7 @@
return (GenericElement)childElements.get(name);
}
- public Iterator getChildElements()
+ public Iterator<?> getChildElements()
{
return childElements.values().iterator();
}
@@ -826,7 +826,7 @@
return childElements.size();
}
- public Set getAttributeNames()
+ public Set<?> getAttributeNames()
{
return attributes.keySet();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardWrapperUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardWrapperUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/WildcardWrapperUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -43,7 +43,7 @@
{
public static SchemaBindingResolver initResolver() throws Exception
{
- Class clazz = WildcardWrapperUnitTestCase.class;
+ Class<?> clazz = WildcardWrapperUnitTestCase.class;
DefaultSchemaResolver resolver = new DefaultSchemaResolver();
resolver.addSchemaInitializer(PropertyInitializer.NS, PropertyInitializer.class.getName());
String location = getSchemaLocation(clazz, "WildcardWrapperUnitTestCase.xsd");
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/XOPUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/XOPUnitTestCase.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/XOPUnitTestCase.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -264,7 +264,7 @@
public Object beforeSetParent(Object o, UnmarshallingContext ctx)
{
ElementBinding e = (ElementBinding) ctx.getParticle().getTerm();
- Class propType = ctx.resolvePropertyType();
+ Class<?> propType = ctx.resolvePropertyType();
String localPart = e.getQName().getLocalPart();
if("image".equals(localPart) ||
@@ -297,7 +297,7 @@
ElementBinding e = SCHEMA.getElement(new javax.xml.namespace.QName("http://www.jboss.org/xml/test/xop", "e"));
SequenceBinding seq = (SequenceBinding) e.getType().getParticle().getTerm();
- for(Iterator i = seq.getParticles().iterator(); i.hasNext();)
+ for(Iterator<?> i = seq.getParticles().iterator(); i.hasNext();)
{
ParticleBinding particle = (ParticleBinding) i.next();
ElementBinding child = (ElementBinding) particle.getTerm();
@@ -310,7 +310,7 @@
public Object beforeSetParent(Object o, UnmarshallingContext ctx)
{
ElementBinding e = (ElementBinding) ctx.getParticle().getTerm();
- Class propType = ctx.resolvePropertyType();
+ Class<?> propType = ctx.resolvePropertyType();
assertNotNull("Failed to resolve property type for "+e.getQName(), propType);
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/XmlDiff.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/XmlDiff.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/XmlDiff.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -587,7 +587,7 @@
private static final class MutableNodeList
implements NodeList
{
- private List list = Collections.EMPTY_LIST;
+ private List<Node> list = Collections.emptyList();
public void add(Node node)
{
@@ -597,7 +597,7 @@
list = Collections.singletonList(node);
break;
case 1:
- list = new ArrayList(list);
+ list = new ArrayList<Node>(list);
default:
list.add(node);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/book/Book.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/book/Book.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/book/Book.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -58,7 +58,7 @@
private String isbn;
private String title;
private String author;
- private List characters = new ArrayList();
+ private List<BookCharacter> characters = new ArrayList<BookCharacter>();
public String getIsbn()
{
@@ -90,12 +90,12 @@
this.title = title;
}
- public List getCharacters()
+ public List<BookCharacter> getCharacters()
{
return characters;
}
- public void setCharacters(List characters)
+ public void setCharacters(List<BookCharacter> characters)
{
this.characters = characters;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/choice/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/choice/Root.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/choice/Root.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -29,25 +29,25 @@
*/
public class Root
{
- private Collection choice1;
- private Collection choice2;
+ private Collection<Choice1> choice1;
+ private Collection<Choice2> choice2;
- public Collection getChoice1()
+ public Collection<Choice1> getChoice1()
{
return choice1;
}
- public void setChoice1(Collection choice1)
+ public void setChoice1(Collection<Choice1> choice1)
{
this.choice1 = choice1;
}
- public Collection getChoice2()
+ public Collection<Choice2> getChoice2()
{
return choice2;
}
- public void setChoice2(Collection choice2)
+ public void setChoice2(Collection<Choice2> choice2)
{
this.choice2 = choice2;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/collections/Collections.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/collections/Collections.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/collections/Collections.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -45,9 +45,9 @@
}
private String[] stringArray;
- private Collection intCol;
+ private Collection<Integer> intCol;
private String[] itemArray;
- private Collection itemCol;
+ private Collection<String> itemCol;
private int[] intArray;
public String[] getStringArray()
@@ -60,12 +60,12 @@
this.stringArray = stringArray;
}
- public Collection getIntCol()
+ public Collection<Integer> getIntCol()
{
return intCol;
}
- public void setIntCol(Collection intCol)
+ public void setIntCol(Collection<Integer> intCol)
{
this.intCol = intCol;
}
@@ -80,12 +80,12 @@
this.itemArray = itemArray;
}
- public Collection getItemCol()
+ public Collection<String> getItemCol()
{
return itemCol;
}
- public void setItemCol(Collection itemCol)
+ public void setItemCol(Collection<String> itemCol)
{
this.itemCol = itemCol;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/config/Config.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/config/Config.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/config/Config.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -50,15 +50,15 @@
value2.setValue2("value2");
config.getAttrs().add(new Config.ConfigAttr(value2));
- config.beans = new ArrayList();
+ config.beans = new ArrayList<Bean>();
config.beans.add(new Config.Bean("A"));
config.beans.add(new Config.Bean("B"));
- config.list = new LinkedList();
+ config.list = new LinkedList<Object>();
config.list.add(new Config.ListValue("some.type", "foo"));
config.list.add(new Config.Depends("SomeBean"));
- List sublist = new LinkedList();
+ List<Object> sublist = new LinkedList<Object>();
sublist.add(new Config.ListValue("another.type", "bar"));
sublist.add(new Config.Depends("AnotherBean"));
config.list.add(sublist);
@@ -76,17 +76,17 @@
return config;
}
- private Collection attrs = new ArrayList();
- public Collection beans;
- public Collection list;
+ private Collection<ConfigAttr> attrs = new ArrayList<ConfigAttr>();
+ public Collection<Bean> beans;
+ public Collection<Object> list;
public Map map;
- public Collection getAttrs()
+ public Collection<ConfigAttr> getAttrs()
{
return attrs;
}
- public void setAttrs(Collection attrs)
+ public void setAttrs(Collection<ConfigAttr> attrs)
{
this.attrs = attrs;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/immutable/Parent.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/immutable/Parent.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/immutable/Parent.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -30,11 +30,11 @@
public class Parent
{
private final Child1 child1;
- private final Collection child2;
- private final Collection otherChildren;
- private final Collection immutableChoice;
+ private final Collection<Object> child2;
+ private final Collection<Object> otherChildren;
+ private final Collection<Object> immutableChoice;
- public Parent(Child1 child1, Collection child2, Collection otherChildren, Collection immutableChoice)
+ public Parent(Child1 child1, Collection<Object> child2, Collection<Object> otherChildren, Collection<Object> immutableChoice)
{
this.child1 = child1;
this.child2 = child2;
@@ -47,17 +47,17 @@
return child1;
}
- public Collection getChild2()
+ public Collection<Object> getChild2()
{
return child2;
}
- public Collection getOtherChildren()
+ public Collection<Object> getOtherChildren()
{
return otherChildren;
}
- public Collection getImmutableChoice()
+ public Collection<Object> getImmutableChoice()
{
return immutableChoice;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/multispaced/XMBeanMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/multispaced/XMBeanMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/multispaced/XMBeanMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -32,10 +32,10 @@
{
private String description;
private String mbeanClass;
- private List constructors = new ArrayList();
- private List attributes = new ArrayList();
- private List operations = new ArrayList();
- private List notifications = new ArrayList();
+ private List<XMBeanConstructorMetaData> constructors = new ArrayList<XMBeanConstructorMetaData>();
+ private List<XMBeanAttributeMetaData> attributes = new ArrayList<XMBeanAttributeMetaData>();
+ private List<XMBeanOperationMetaData> operations = new ArrayList<XMBeanOperationMetaData>();
+ private List<XMBeanNotificationMetaData> notifications = new ArrayList<XMBeanNotificationMetaData>();
private Object persistenceManager;
@@ -59,7 +59,7 @@
this.mbeanClass = mbeanClass;
}
- public List getConstructors()
+ public List<XMBeanConstructorMetaData> getConstructors()
{
return constructors;
}
@@ -69,7 +69,7 @@
constructors.add(constructor);
}
- public List getAttributes()
+ public List<XMBeanAttributeMetaData> getAttributes()
{
return attributes;
}
@@ -79,7 +79,7 @@
attributes.add(attribute);
}
- public List getOperations()
+ public List<XMBeanOperationMetaData> getOperations()
{
return operations;
}
@@ -89,7 +89,7 @@
operations.add(operation);
}
- public List getNotifications()
+ public List<XMBeanNotificationMetaData> getNotifications()
{
return notifications;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/person/Person.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/person/Person.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/person/Person.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -42,7 +42,7 @@
person.setDateOfBirth((java.util.Date)SimpleTypeBindings.JAVA_UTIL_DATE.unmarshal("1980-01-01"));
person.setPhones(Arrays.asList(new Object[]{"01", "02"}));
- ArrayList list = new ArrayList();
+ ArrayList<Address> list = new ArrayList<Address>();
Address addr1 = new Address();
addr1.setStreet("prosp. Rad. Ukr. 11A, 70");
list.add(addr1);
@@ -57,8 +57,8 @@
private String firstName;
private String lastName;
private java.util.Date dateOfBirth;
- private Collection phones = new ArrayList();
- private Collection addresses = new ArrayList();
+ private Collection<Object> phones = new ArrayList<Object>();
+ private Collection<Address> addresses = new ArrayList<Address>();
public String getFirstName()
{
@@ -90,22 +90,22 @@
this.dateOfBirth = dateOfBirth;
}
- public Collection getPhones()
+ public Collection<Object> getPhones()
{
return phones;
}
- public void setPhones(Collection phones)
+ public void setPhones(Collection<Object> phones)
{
this.phones = phones;
}
- public Collection getAddresses()
+ public Collection<Address> getAddresses()
{
return addresses;
}
- public void setAddresses(Collection addresses)
+ public void setAddresses(Collection<Address> addresses)
{
this.addresses = addresses;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/po/PurchaseOrder.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/po/PurchaseOrder.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/po/PurchaseOrder.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -54,7 +54,7 @@
po.billTo.setState("PA");
po.billTo.setZip(new BigDecimal((double)95819));
po.comment = "Hurry, my lawn is going wild!";
- po.items = new ArrayList();
+ po.items = new ArrayList<Item>();
Item item = new Item();
item.setPartNum("872-AA");
@@ -78,7 +78,7 @@
public USAddress shipTo;
private USAddress billTo;
private String comment;
- private Collection items;
+ private Collection<Item> items;
private Calendar orderDate;
public USAddress getBillTo()
@@ -101,12 +101,12 @@
this.comment = comment;
}
- public Collection getItems()
+ public Collection<Item> getItems()
{
return items;
}
- public void setItems(Collection items)
+ public void setItems(Collection<Item> items)
{
this.items = items;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/SimpleBeanImpl.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/SimpleBeanImpl.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/SimpleBeanImpl.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -112,12 +112,12 @@
private SimpleBean other;
/** A collection */
- private Collection collection;
+ private Collection<?> collection;
/** A list */
- private List aList;
+ private List<?> aList;
/** A set */
- private Set aSet;
+ private Set<?> aSet;
/** A properties */
private Properties props;
@@ -363,32 +363,32 @@
this.other = other;
}
- public Collection getCollection()
+ public Collection<?> getCollection()
{
return collection;
}
- public void setCollection(Collection collection)
+ public void setCollection(Collection<?> collection)
{
this.collection = collection;
}
- public List getAList()
+ public List<?> getAList()
{
return aList;
}
- public void setAList(List aList)
+ public void setAList(List<?> aList)
{
this.aList = aList;
}
- public Set getASet()
+ public Set<?> getASet()
{
return aSet;
}
- public void setASet(Set aSet)
+ public void setASet(Set<?> aSet)
{
this.aSet = aSet;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/deployment/AbstractKernelDeployment.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/deployment/AbstractKernelDeployment.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/deployment/AbstractKernelDeployment.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -23,6 +23,8 @@
import java.util.List;
+import org.jboss.test.xml.pojoserver.metadata.AbstractBeanMetaData;
+
/**
* An abstract kernel deployment.
*
@@ -35,7 +37,7 @@
protected String name;
/** The beans List<BeanMetaData> */
- protected List beans;
+ protected List<AbstractBeanMetaData> beans;
/**
* Create a new kernel deployment
@@ -49,7 +51,7 @@
*
* @param beans a List<BeanMetaData>.
*/
- public void setBeans(List beans)
+ public void setBeans(List<AbstractBeanMetaData> beans)
{
this.beans = beans;
}
@@ -64,7 +66,7 @@
this.name = name;
}
- public List getBeans()
+ public List<AbstractBeanMetaData> getBeans()
{
return beans;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractAnnotationMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractAnnotationMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractAnnotationMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -39,7 +39,7 @@
protected String name;
/** The attributes Set<AnnotationAttributeMetaData> */
- protected Set attributes;
+ protected Set<?> attributes;
// Static --------------------------------------------------------
@@ -70,7 +70,7 @@
*
* @param attributes Set<AnnotationAttributeMetaData>
*/
- public void setAttributes(Set attributes)
+ public void setAttributes(Set<?> attributes)
{
this.attributes = attributes;
}
@@ -82,7 +82,7 @@
return name;
}
- public Set getAttributes()
+ public Set<?> getAttributes()
{
return attributes;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractBeanMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractBeanMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractBeanMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -44,7 +44,7 @@
protected ControllerMode mode = null;
/** The properties configuration Set<PropertyMetaData> */
- protected Set properties;
+ protected Set<AbstractPropertyMetaData> properties;
/** The constructor */
protected ConstructorMetaData constructor;
@@ -62,12 +62,12 @@
protected LifecycleMetaData destroy;
/** What the bean demands Set<DemandMetaData> */
- protected Set demands;
+ protected Set<Object> demands;
/** What the bean supplies Set<SupplyMetaData> */
- protected Set supplies;
+ protected Set<AbstractSupplyMetaData> supplies;
- protected Map metaData;
+ protected Map<?, ?> metaData;
/**
* Create a new bean meta data
*/
@@ -112,7 +112,7 @@
*
* @param properties Set<PropertiesMetaData>
*/
- public void setProperties(Set properties)
+ public void setProperties(Set<AbstractPropertyMetaData> properties)
{
this.properties = properties;
}
@@ -132,7 +132,7 @@
*
* @param demands Set<DemandMetaData>
*/
- public void setDemands(Set demands)
+ public void setDemands(Set<Object> demands)
{
this.demands = demands;
}
@@ -142,7 +142,7 @@
*
* @param supplies Set<SupplyMetaData>
*/
- public void setSupplies(Set supplies)
+ public void setSupplies(Set<AbstractSupplyMetaData> supplies)
{
this.supplies = supplies;
}
@@ -177,7 +177,7 @@
this.mode = mode;
}
- public Set getProperties()
+ public Set<AbstractPropertyMetaData> getProperties()
{
return properties;
}
@@ -251,19 +251,19 @@
this.destroy = lifecycle;
}
- public Set getDemands()
+ public Set<Object> getDemands()
{
return demands;
}
- public Set getSupplies()
+ public Set<AbstractSupplyMetaData> getSupplies()
{
return supplies;
}
- public Iterator getChildren()
+ public Iterator<Object> getChildren()
{
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
if (constructor != null)
list.add(constructor);
if (properties != null)
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractCollectionMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractCollectionMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractCollectionMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -96,7 +96,7 @@
return collection.isEmpty();
}
- public Iterator iterator()
+ public Iterator<?> iterator()
{
return collection.iterator();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractConstructorMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractConstructorMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractConstructorMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -37,7 +37,7 @@
// Attributes ----------------------------------------------------
/** The paramaters List<ParameterMetaData> */
- protected List parameters;
+ protected List<AbstractParameterMetaData> parameters;
/** The factory */
protected ValueMetaData factory;
@@ -66,7 +66,7 @@
*
* @param parameters List<ParameterMetaData>
*/
- public void setParameters(List parameters)
+ public void setParameters(List<AbstractParameterMetaData> parameters)
{
this.parameters = parameters;
}
@@ -103,7 +103,7 @@
// ConstructorMetaData implementation ----------------------------
- public List getParameters()
+ public List<AbstractParameterMetaData> getParameters()
{
return parameters;
}
@@ -125,7 +125,7 @@
// MetaDataVisitorNode overrides ----------------------------------
- public Iterator getChildren()
+ public Iterator<?> getChildren()
{
ArrayList list = new ArrayList();
if (parameters != null)
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractFeatureMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractFeatureMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractFeatureMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -37,7 +37,7 @@
protected String description;
/** The generic metadata */
- protected Map values;
+ protected Map<String, Object> values;
// Static --------------------------------------------------------
@@ -71,7 +71,7 @@
public void setValue(String key, Object value)
{
if (values == null)
- values = new ConcurrentHashMap();
+ values = new ConcurrentHashMap<String, Object>();
values.put(key, value);
}
@@ -96,7 +96,7 @@
visitor.visit(this);
}
- public Iterator getChildren()
+ public Iterator<?> getChildren()
{
return null;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractLifecycleMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractLifecycleMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractLifecycleMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -38,7 +38,7 @@
protected String methodName;
/** The paramaters List<ParameterMetaData> */
- protected List parameters;
+ protected List<AbstractParameterMetaData> parameters;
/**
* Create a new lifecycle meta data
@@ -72,7 +72,7 @@
this.methodName = name;
}
- public List getParameters()
+ public List<AbstractParameterMetaData> getParameters()
{
return parameters;
}
@@ -82,7 +82,7 @@
*
* @param parameters List<ParameterMetaData>
*/
- public void setParameters(List parameters)
+ public void setParameters(List<AbstractParameterMetaData> parameters)
{
this.parameters = parameters;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractListMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractListMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractListMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -65,12 +65,12 @@
return lastIndexOf(o);
}
- public ListIterator listIterator()
+ public ListIterator<Object> listIterator()
{
return collection.listIterator();
}
- public ListIterator listIterator(int index)
+ public ListIterator<Object> listIterator(int index)
{
return collection.listIterator(index);
}
@@ -85,7 +85,7 @@
return set(index, element);
}
- public List subList(int fromIndex, int toIndex)
+ public List<?> subList(int fromIndex, int toIndex)
{
return subList(fromIndex, toIndex);
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractMapMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractMapMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractMapMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -105,7 +105,7 @@
return map.containsValue(value);
}
- public Set entrySet()
+ public Set<?> entrySet()
{
return map.entrySet();
}
@@ -120,7 +120,7 @@
return map.isEmpty();
}
- public Set keySet()
+ public Set<?> keySet()
{
return map.keySet();
}
@@ -145,7 +145,7 @@
return map.size();
}
- public Collection values()
+ public Collection<?> values()
{
return map.values();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractSetMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractSetMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AbstractSetMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -52,7 +52,7 @@
boolean changed = false;
if (c != null && c.size() > 0)
{
- for (Iterator i = c.iterator(); i.hasNext(); )
+ for (Iterator<?> i = c.iterator(); i.hasNext(); )
{
Object o = i.next();
if (collection.contains(o) == false)
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AnnotationMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AnnotationMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/AnnotationMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -47,7 +47,7 @@
*
* @return Set<AnnotationAttributeMetaData>.
*/
- Set getAttributes();
+ Set<?> getAttributes();
// Inner classes -------------------------------------------------
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/BeanMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/BeanMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/BeanMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -59,7 +59,7 @@
*
* @return List<PropertyMetaData>.
*/
- Set getProperties();
+ Set<AbstractPropertyMetaData> getProperties();
/**
* Get the constructor
@@ -73,12 +73,12 @@
*
* @return Set<DemandMetaData>
*/
- Set getDemands();
+ Set<Object> getDemands();
/**
* Get what this bean supplies.
*
* @return Set<SupplyMetaData>
*/
- Set getSupplies();
+ Set<AbstractSupplyMetaData> getSupplies();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/ConstructorMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/ConstructorMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/ConstructorMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -38,7 +38,7 @@
*
* @return List<ParameterMetaData>.
*/
- List getParameters();
+ List<AbstractParameterMetaData> getParameters();
/**
* Get the factory.
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/GenericBeanFactory.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/GenericBeanFactory.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/GenericBeanFactory.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -38,7 +38,7 @@
protected ConstructorMetaData constructor;
/** The properties Map<propertyName, ValueMetaData> */
- protected Map properties;
+ protected Map<?, ?> properties;
/**
* Create a new generic bean factory
@@ -94,7 +94,7 @@
*
* @return the properties Map<propertyName, ValueMetaData>
*/
- public Map getProperties()
+ public Map<?, ?> getProperties()
{
return properties;
}
@@ -104,7 +104,7 @@
*
* @param properties the properties Map<propertyName, ValueMetaData>
*/
- public void setProperties(Map properties)
+ public void setProperties(Map<?, ?> properties)
{
this.properties = properties;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/LifecycleMetaData.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/LifecycleMetaData.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/LifecycleMetaData.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -57,5 +57,5 @@
*
* @return List<ParameterMetaData>.
*/
- List getParameters();
+ List<AbstractParameterMetaData> getParameters();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/MetaDataVisitorNode.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/MetaDataVisitorNode.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/pojoserver/metadata/MetaDataVisitorNode.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -45,6 +45,6 @@
*
* @return Iterator<MetaDataVistorNode> or null if there aren't any
*/
- public Iterator getChildren();
+ public Iterator<?> getChildren();
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Choice3.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Choice3.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Choice3.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -29,35 +29,35 @@
*/
public class Choice3
{
- private Collection listOfIntegers;
- private Collection listOfStrings;
+ private Collection<Integer> listOfIntegers;
+ private Collection<String> listOfStrings;
public Choice3()
{
}
- public Choice3(Collection listOfIntegers, Collection listOfStrings)
+ public Choice3(Collection<Integer> listOfIntegers, Collection<String> listOfStrings)
{
this.listOfIntegers = listOfIntegers;
this.listOfStrings = listOfStrings;
}
- public Collection getListOfIntegers()
+ public Collection<Integer> getListOfIntegers()
{
return listOfIntegers;
}
- public void setListOfIntegers(Collection listOfIntegers)
+ public void setListOfIntegers(Collection<Integer> listOfIntegers)
{
this.listOfIntegers = listOfIntegers;
}
- public Collection getListOfStrings()
+ public Collection<String> getListOfStrings()
{
return listOfStrings;
}
- public void setListOfStrings(Collection listOfStrings)
+ public void setListOfStrings(Collection<String> listOfStrings)
{
this.listOfStrings = listOfStrings;
}
Modified: jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Root.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Root.java 2008-09-08 12:59:14 UTC (rev 2912)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/sandbox/Root.java 2008-09-09 13:19:00 UTC (rev 2913)
@@ -29,36 +29,36 @@
*/
public class Root
{
- private Collection choiceCollection1;
- private Collection choice2;
- private Collection choice3;
+ private Collection<Object> choiceCollection1;
+ private Collection<Object> choice2;
+ private Collection<Object> choice3;
- public Collection getChoice3()
+ public Collection<Object> getChoice3()
{
return choice3;
}
- public void setChoice3(Collection choice3)
+ public void setChoice3(Collection<Object> choice3)
{
this.choice3 = choice3;
}
- public Collection getChoiceCollection1()
+ public Collection<Object> getChoiceCollection1()
{
return choiceCollection1;
}
- public void setChoiceCollection1(Collection choiceCollection1)
+ public void setChoiceCollection1(Collection<Object> choiceCollection1)
{
this.choiceCollection1 = choiceCollection1;
}
- public Collection getChoice2()
+ public Collection<Object> getChoice2()
{
return choice2;
}
- public void setChoice2(Collection choice2)
+ public void setChoice2(Collection<Object> choice2)
{
this.choice2 = choice2;
}
More information about the jboss-svn-commits
mailing list