compiler warnings (round2)
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
index 963192b..2ef5235 100644
--- a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
+++ b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
@@ -86,7 +86,7 @@
/**
* Map from annotation classes to their writers.
*/
- private final Map<Class, JDefinedClass> queue = new HashMap<Class, JDefinedClass>();
+ private final Map<Class<?>, JDefinedClass> queue = new HashMap<>();
public ACTask() {
classpath = new Path(null);
@@ -230,14 +230,14 @@
}
}
- for (Map.Entry<Class, JDefinedClass> e : queue.entrySet()) {
- Class ann = e.getKey();
+ for (Map.Entry<Class<?>, JDefinedClass> e : queue.entrySet()) {
+ Class<?> ann = e.getKey();
JDefinedClass w = e.getValue();
w._implements(codeModel.ref(JAnnotationWriter.class).narrow(ann));
for (Method m : ann.getDeclaredMethods()) {
- Class rt = m.getReturnType();
+ Class<?> rt = m.getReturnType();
if (rt.isArray()) // array writers aren't distinguishable from scalar writers
{
@@ -354,7 +354,7 @@
*/
private void queue(String className, long timestamp) {
log("Processing " + className, Project.MSG_VERBOSE);
- Class ann;
+ Class<?> ann;
try {
ann = userLoader.loadClass(className);
} catch (ClassNotFoundException e) {
diff --git a/jaxb-ri/codemodel/codemodel/src/main/java/com/sun/codemodel/JClass.java b/jaxb-ri/codemodel/codemodel/src/main/java/com/sun/codemodel/JClass.java
index 9fc4691..210cab9 100644
--- a/jaxb-ri/codemodel/codemodel/src/main/java/com/sun/codemodel/JClass.java
+++ b/jaxb-ri/codemodel/codemodel/src/main/java/com/sun/codemodel/JClass.java
@@ -130,7 +130,7 @@
@Override
public JType unboxify() {
JPrimitiveType pt = getPrimitiveType();
- return pt==null ? (JType)this : pt;
+ return pt==null ? this : pt;
}
@Override
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/ClassFactory.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/ClassFactory.java
index 3bf88d6..4e4514c 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/ClassFactory.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/ClassFactory.java
@@ -106,7 +106,7 @@
private static <T> Constructor<T> tryGetDeclaredConstructor(Class<T> clazz) {
try {
- return clazz.getDeclaredConstructor((Class<T>[])emptyClass);
+ return clazz.getDeclaredConstructor(emptyClass);
} catch (NoSuchMethodException e) {
logger.log(Level.INFO,"No default constructor found on "+clazz,e);
NoSuchMethodError exp;
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
index 6b61db6..25e140e 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
@@ -139,7 +139,7 @@
File baseDir = new File(xmlpath, config.getBaseDir().getPath());
SchemaOutputResolverImpl outResolver = new SchemaOutputResolverImpl (baseDir);
- for( Schema schema : (List<Schema>)config.getSchema() ) {
+ for( Schema schema : config.getSchema() ) {
String namespace = schema.getNamespace();
File location = schema.getLocation();
outResolver.addSchemaInfo(namespace,location);
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenerator.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenerator.java
index 05c6db7..e79438a 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenerator.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenerator.java
@@ -112,7 +112,7 @@
return -1;
}
- Class schemagenRunner = classLoader.loadClass(Runner.class.getName());
+ Class<?> schemagenRunner = classLoader.loadClass(Runner.class.getName());
Method compileMethod = schemagenRunner.getDeclaredMethod("compile",String[].class,File.class);
List<String> aptargs = new ArrayList<String>();
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGeneratorFacade.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGeneratorFacade.java
index 1b38a3e..2a8698a 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGeneratorFacade.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGeneratorFacade.java
@@ -24,8 +24,8 @@
ClassLoader cl = SecureLoader.getClassClassLoader(SchemaGeneratorFacade.class);
if(cl==null) cl = SecureLoader.getSystemClassLoader();
- Class driver = cl.loadClass("com.sun.tools.jxc.SchemaGenerator");
- Method mainMethod = driver.getDeclaredMethod("main", new Class[]{String[].class});
+ Class<?> driver = cl.loadClass("com.sun.tools.jxc.SchemaGenerator");
+ Method mainMethod = driver.getDeclaredMethod("main", new Class<?>[]{String[].class});
try {
mainMethod.invoke(null,new Object[]{args});
} catch (IllegalAccessException e) {
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
index 83553e6..0ef26d9 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
@@ -17,6 +17,7 @@
import java.util.List;
import java.util.ArrayList;
+import java.util.regex.Pattern;
/**
* <p><b>
@@ -315,10 +316,10 @@
}
- private List includes = new ArrayList();
- public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
- private List excludes = new ArrayList();
- public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
+ private List<String> includes = new ArrayList<>();
+ public List<Pattern> getIncludes() { return $runtime.getIncludePatterns(this.includes);}
+ private List<String> excludes = new ArrayList<>();
+ public List<Pattern> getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
index 24a2eb3..43c56e2 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
@@ -313,10 +313,10 @@
private File baseDir;
private Classes classes;
- private List schema = new ArrayList();
+ private List<Schema> schema = new ArrayList<>();
public Classes getClasses() { return this.classes;}
public File getBaseDir() { return baseDir;}
- public List getSchema() { return this.schema;}
+ public List<Schema> getSchema() { return this.schema;}
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
index 64a9e24..fbb10c6 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
@@ -12,6 +12,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.List;
import java.util.Stack;
import java.util.StringTokenizer;
@@ -108,7 +109,7 @@
/** stack of {@link Attributes}. */
- private final Stack attStack = new Stack();
+ private final Stack<AttributesImpl> attStack = new Stack();
/** current attributes set. always equal to attStack.peek() */
private AttributesImpl currentAtts;
@@ -199,8 +200,8 @@
* follow an end tag, then they must be either whitespaces or
* must match to <text/>.
*
- * @param possiblyWhitespace
- * True if the buffered character can be ignorabale. False if
+ * @param ignorable
+ * True if the buffered character can be ignorable. False if
* it needs to be consumed.
*/
private void processPendingText(boolean ignorable) throws SAXException {
@@ -260,8 +261,8 @@
if(attStack.isEmpty())
currentAtts = null;
else
- currentAtts = (AttributesImpl)attStack.peek();
- nsEffectivePtr = ((Integer)nsEffectiveStack.pop()).intValue();
+ currentAtts = attStack.peek();
+ nsEffectivePtr = nsEffectiveStack.pop();
}
public void endElement(String uri, String localname, String qname)
@@ -276,7 +277,7 @@
// finished redirection.
for( int i=0; i<namespaces.size(); i+=2 )
- redirect.endPrefixMapping((String)namespaces.get(i));
+ redirect.endPrefixMapping(namespaces.get(i));
redirect.endDocument();
redirect = null;
@@ -447,8 +448,8 @@
// modified to report active bindings only.
for( int i=0; i<namespaces.size(); i+=2 )
redirect.startPrefixMapping(
- (String)namespaces.get(i),
- (String)namespaces.get(i+1)
+ namespaces.get(i),
+ namespaces.get(i+1)
);
redirect.startElement(uri,local,qname,currentAtts);
@@ -463,7 +464,7 @@
/** in-scope namespace mapping.
* namespaces[2n ] := prefix
* namespaces[2n+1] := namespace URI */
- private final ArrayList namespaces = new ArrayList();
+ private final List<String> namespaces = new ArrayList<>();
/**
* Index on the namespaces array, which points to
* the top of the effective bindings. Because of the
@@ -488,12 +489,12 @@
/**
* Stack to preserve old nsEffectivePtr values.
*/
- private final Stack nsEffectiveStack = new Stack();
+ private final Stack<Integer> nsEffectiveStack = new Stack<>();
public String resolveNamespacePrefix( String prefix ) {
for( int i = nsEffectivePtr-2; i>=0; i-=2 )
if( namespaces.get(i).equals(prefix) )
- return (String)namespaces.get(i+1);
+ return namespaces.get(i+1);
// no binding was found.
if(prefix.equals("")) return ""; // return the default no-namespace
diff --git a/jaxb-ri/jxc/src/main/java/module-info.java b/jaxb-ri/jxc/src/main/java/module-info.java
index 41e54ae..edc29fe 100644
--- a/jaxb-ri/jxc/src/main/java/module-info.java
+++ b/jaxb-ri/jxc/src/main/java/module-info.java
@@ -24,6 +24,7 @@
exports com.sun.tools.jxc;
exports com.sun.tools.jxc.ap;
- exports com.sun.tools.jxc.model.nav;
exports com.sun.tools.jxc.api;
+ exports com.sun.tools.jxc.gen.config;
+ exports com.sun.tools.jxc.model.nav;
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ClassInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ClassInfoImpl.java
index be51b0e..bf43b3f 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ClassInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ClassInfoImpl.java
@@ -342,7 +342,7 @@
}
DummyPropertyInfo prop = (DummyPropertyInfo) top.getProperty("content");
PropertySeed seed = createFieldSeed(f);
- ((DummyPropertyInfo)prop).addType(createReferenceProperty(seed));
+ prop.addType(createReferenceProperty(seed));
} else {
addProperty(createFieldSeed(f), annotations, false);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
index 0a8e08a..c05c170 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
@@ -217,7 +217,7 @@
public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException {
ChildLoader child = childUnmarshallers.get(arg.uri,arg.local);
if(child == null) {
- Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace;
+ Boolean backupWithParentNamespace = state.getContext().getJAXBContext().backupWithParentNamespace;
backupWithParentNamespace = backupWithParentNamespace != null
? backupWithParentNamespace
: Boolean.parseBoolean(Utils.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE));
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
index 1dc7c98..0aa928d 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
@@ -59,7 +59,7 @@
continue;
JMethod m = clazz.method(JMod.PUBLIC,
- nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
+ nset.opts.chainMethod? clazz : nset.codeModel.VOID,
methodName);
m.param(t,"value");
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
index 0fbc77d..2db5100 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
@@ -178,7 +178,7 @@
if(!props.add(new LeafElementProp(name,t)))
continue;
generateMethod(clazz,
- nset, nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID
+ nset, nset.opts.chainMethod? clazz : nset.codeModel.VOID
).param(t,"value");
}
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
index 0e51a77..e9d6fa9 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
@@ -102,7 +102,7 @@
return;
JMethod m = clazz.method(JMod.PUBLIC,
- nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
+ nset.opts.chainMethod? clazz : nset.codeModel.VOID,
"_text");
m.annotate(XmlValue.class);
m.param(valueType,"value");
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
index 7823d1e..c846f68 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
@@ -153,6 +153,7 @@
/**
* Writes a new element.
*/
+ @SuppressWarnings("unchecked")
private Object addElement(XmlElement e, Method method, Object[] args) {
Class<?> rt = method.getReturnType();
@@ -200,7 +201,7 @@
}
if(TypedXmlWriter.class.isAssignableFrom(rt)) {
// sub writer
- return _element(nsUri,localName,(Class)rt);
+ return _element(nsUri,localName,(Class<? extends TypedXmlWriter>)rt);
}
throw new IllegalSignatureException("Illegal return type: "+rt);
@@ -335,7 +336,7 @@
}
public <T extends TypedXmlWriter> T _cast(Class<T> facadeType) {
- return facadeType.cast(Proxy.newProxyInstance(facadeType.getClassLoader(),new Class[]{facadeType},this));
+ return facadeType.cast(Proxy.newProxyInstance(facadeType.getClassLoader(),new Class<?>[]{facadeType},this));
}
public <T extends TypedXmlWriter> T _element(String nsUri, String localName, Class<T> contentModel) {
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
index 28b9940..780690d 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
@@ -41,9 +41,10 @@
*/
void print(DT dt, NamespaceResolver resolver, StringBuilder buf);
- static final List<DatatypeWriter<?>> BUILTIN = Collections.unmodifiableList(new AbstractList() {
-
- private DatatypeWriter<?>[] BUILTIN_ARRAY = new DatatypeWriter<?>[] {
+ static final List<DatatypeWriter<Object>> BUILTIN = Collections.unmodifiableList(new AbstractList<DatatypeWriter<Object>>() {
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private DatatypeWriter<Object>[] BUILTIN_ARRAY = new DatatypeWriter[] {
new DatatypeWriter<String>() {
public Class<String> getType() {
return String.class;
@@ -89,7 +90,7 @@
}
};
- public DatatypeWriter<?> get(int n) {
+ public DatatypeWriter<Object> get(int n) {
return BUILTIN_ARRAY[n];
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
index 6856f28..6186e89 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
@@ -40,7 +40,7 @@
*/
private Content current = null;
- private final Map<Class,DatatypeWriter> datatypeWriters = new HashMap<Class,DatatypeWriter>();
+ private final Map<Class<?>,DatatypeWriter<Object>> datatypeWriters = new HashMap<>();
/**
* Used to generate unique namespace prefix.
@@ -61,7 +61,7 @@
Document(XmlSerializer out) {
this.out = out;
- for( DatatypeWriter dw : DatatypeWriter.BUILTIN )
+ for( DatatypeWriter<Object> dw : DatatypeWriter.BUILTIN )
datatypeWriters.put(dw.getType(),dw);
}
@@ -86,7 +86,7 @@
* @param dw
* The {@link DatatypeWriter} to be added. Must not be null.
*/
- public void addDatatypeWriter( DatatypeWriter<?> dw ) {
+ public void addDatatypeWriter( DatatypeWriter<Object> dw ) {
datatypeWriters.put(dw.getType(),dw);
}
@@ -128,9 +128,9 @@
if(buf.length()>0)
buf.append(' ');
- Class c = obj.getClass();
+ Class<?> c = obj.getClass();
while(c!=null) {
- DatatypeWriter dw = datatypeWriters.get(c);
+ DatatypeWriter<Object> dw = datatypeWriters.get(c);
if(dw!=null) {
dw.print(obj,nsResolver,buf);
return;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceDecl.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceDecl.java
index 70c7e5a..81817e9 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceDecl.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceDecl.java
@@ -33,7 +33,7 @@
String prefix;
/**
- * Used temporarily inside {@link Document#finalizeStartTag()}.
+ * Used temporarily inside {@link Document}.
* true if this prefix is declared on the new element.
*/
boolean declared;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceSupport.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceSupport.java
index 21dc457..ca429f9 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceSupport.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/NamespaceSupport.java
@@ -113,8 +113,8 @@
/**
* An empty enumeration.
*/
- private final static Enumeration EMPTY_ENUMERATION =
- new Vector().elements();
+ private final static Enumeration<String> EMPTY_ENUMERATION =
+ new Vector<String>().elements();
////////////////////////////////////////////////////////////////////
@@ -382,7 +382,7 @@
* @see #getDeclaredPrefixes
* @see #getURI
*/
- public Enumeration getPrefixes ()
+ public Enumeration<String> getPrefixes ()
{
return currentContext.getPrefixes();
}
@@ -436,12 +436,12 @@
* @see #getDeclaredPrefixes
* @see #getURI
*/
- public Enumeration getPrefixes (String uri)
+ public Enumeration<String> getPrefixes (String uri)
{
- Vector prefixes = new Vector();
- Enumeration allPrefixes = getPrefixes();
+ Vector<String> prefixes = new Vector<>();
+ Enumeration<String> allPrefixes = getPrefixes();
while (allPrefixes.hasMoreElements()) {
- String prefix = (String)allPrefixes.nextElement();
+ String prefix = allPrefixes.nextElement();
if (uri.equals(getURI(prefix))) {
prefixes.addElement(prefix);
}
@@ -462,7 +462,7 @@
* @see #getPrefixes
* @see #getURI
*/
- public Enumeration getDeclaredPrefixes ()
+ public Enumeration<String> getDeclaredPrefixes ()
{
return currentContext.getDeclaredPrefixes();
}
@@ -546,7 +546,7 @@
* The context must either have been freshly constructed,
* or must have been cleared.
*
- * @param context The parent Namespace context object.
+ * @param parent The parent Namespace context object.
*/
void setParent (Context parent)
{
@@ -594,7 +594,7 @@
copyTables();
}
if (declarations == null) {
- declarations = new Vector();
+ declarations = new Vector<>();
}
prefix = prefix.intern();
@@ -623,7 +623,7 @@
String [] processName (String qName, boolean isAttribute)
{
String name[];
- Hashtable table;
+ Hashtable<String, String[]> table;
// Select the appropriate table.
if (isAttribute) {
@@ -635,7 +635,7 @@
// Start by looking in the cache, and
// return immediately if the name
// is already known in this content
- name = (String[])table.get(qName);
+ name = table.get(qName);
if (name != null) {
return name;
}
@@ -670,7 +670,7 @@
if ("".equals(prefix)) {
uri = defaultNS;
} else {
- uri = (String)prefixTable.get(prefix);
+ uri = prefixTable.get(prefix);
}
if (uri == null
|| (!isAttribute && "xmlns".equals (prefix))) {
@@ -702,7 +702,7 @@
} else if (prefixTable == null) {
return null;
} else {
- return (String)prefixTable.get(prefix);
+ return prefixTable.get(prefix);
}
}
@@ -719,9 +719,9 @@
*/
String getPrefix (String uri) {
if (uriTable != null) {
- String uriPrefix = (String)uriTable.get(uri);
+ String uriPrefix = uriTable.get(uri);
if (uriPrefix == null) return null;
- String verifyNamespace = (String) prefixTable.get(uriPrefix);
+ String verifyNamespace = prefixTable.get(uriPrefix);
if (uri.equals(verifyNamespace)) {
return uriPrefix;
}
@@ -736,7 +736,7 @@
* @return An enumeration of prefixes (possibly empty).
* @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
*/
- Enumeration getDeclaredPrefixes ()
+ Enumeration<String> getDeclaredPrefixes ()
{
if (declarations == null) {
return EMPTY_ENUMERATION;
@@ -755,7 +755,7 @@
* @return An enumeration of prefixes (never empty).
* @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
*/
- Enumeration getPrefixes ()
+ Enumeration<String> getPrefixes ()
{
if (prefixTable == null) {
return EMPTY_ENUMERATION;
@@ -777,20 +777,21 @@
* <p>This class is optimized for the normal case where most
* elements do not contain Namespace declarations.</p>
*/
+ @SuppressWarnings("unchecked")
private void copyTables ()
{
if (prefixTable != null) {
- prefixTable = (Hashtable)prefixTable.clone();
+ prefixTable = (Hashtable<String, String>)prefixTable.clone();
} else {
- prefixTable = new Hashtable();
+ prefixTable = new Hashtable<>();
}
if (uriTable != null) {
- uriTable = (Hashtable)uriTable.clone();
+ uriTable = (Hashtable<String, String>)uriTable.clone();
} else {
- uriTable = new Hashtable();
+ uriTable = new Hashtable<>();
}
- elementNameTable = new Hashtable();
- attributeNameTable = new Hashtable();
+ elementNameTable = new Hashtable<>();
+ attributeNameTable = new Hashtable<>();
declSeen = true;
}
@@ -800,10 +801,10 @@
// Protected state.
////////////////////////////////////////////////////////////////
- Hashtable prefixTable;
- Hashtable uriTable;
- Hashtable elementNameTable;
- Hashtable attributeNameTable;
+ Hashtable<String, String> prefixTable;
+ Hashtable<String, String> uriTable;
+ Hashtable<String, String[]> elementNameTable;
+ Hashtable<String, String[]> attributeNameTable;
String defaultNS = "";
@@ -812,7 +813,7 @@
// Internal state.
////////////////////////////////////////////////////////////////
- private Vector declarations = null;
+ private Vector<String> declarations = null;
private boolean declSeen = false;
private Context parent = null;
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
index 262d8d5..a6c36ee 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
@@ -182,7 +182,7 @@
{
depth = 0;
state = SEEN_NOTHING;
- stateStack = new Stack();
+ stateStack = new Stack<>();
super.reset();
}
@@ -351,7 +351,7 @@
////////////////////////////////////////////////////////////////////
private Object state = SEEN_NOTHING;
- private Stack stateStack = new Stack();
+ private Stack<Object> stateStack = new Stack<>();
private String indentStep = "";
private int depth = 0;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
index 9bffb4c..cca6bff 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
@@ -25,6 +25,7 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.dom.DOMResult;
import java.util.ArrayList;
+import java.util.List;
import java.util.Stack;
import com.sun.xml.txw2.TxwException;
@@ -120,7 +121,7 @@
class Dom2SaxAdapter implements ContentHandler, LexicalHandler {
private final Node _node;
- private final Stack _nodeStk = new Stack();
+ private final Stack<Node> _nodeStk = new Stack<>();
private boolean inCDATA;
public final Element getCurrentElement() {
@@ -184,8 +185,8 @@
// process namespace bindings
for( int i=0; i<unprocessedNamespaces.size(); i+=2 ) {
- String prefix = (String)unprocessedNamespaces.get(i+0);
- String uri = (String)unprocessedNamespaces.get(i+1);
+ String prefix = unprocessedNamespaces.get(i+0);
+ String uri = unprocessedNamespaces.get(i+1);
String qname;
if( "".equals(prefix) || prefix==null )
@@ -227,7 +228,7 @@
}
private final Node getParent() {
- return (Node) _nodeStk.peek();
+ return _nodeStk.peek();
}
public void endElement(String namespace, String localName, String qName){
@@ -264,7 +265,7 @@
public void skippedEntity(String name) {
}
- private ArrayList unprocessedNamespaces = new ArrayList();
+ private List<String> unprocessedNamespaces = new ArrayList<>();
public void startPrefixMapping(String prefix, String uri) {
unprocessedNamespaces.add(prefix);
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
index a7dbbba..1767b45 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
@@ -292,7 +292,7 @@
////////////////////////////////////////////////////////////////////
private Object state = SEEN_NOTHING;
- private Stack<Object> stateStack = new Stack<Object>();
+ private Stack<Object> stateStack = new Stack<>();
private String indentStep = "";
private int depth = 0;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
index 3e02824..041f4cb 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
@@ -23,7 +23,7 @@
private final static Object SEEN_DATA = new Object();
private Object state = SEEN_NOTHING;
- private Stack<Object> stateStack = new Stack<Object>();
+ private Stack<Object> stateStack = new Stack<>();
private String indentStep = " ";
private int depth = 0;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
index eaf887f..6b36806 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
@@ -72,7 +72,7 @@
// namespace prefix bindings
// add in #writeXmlns and fired in #endStartTag
- private final Stack<String> prefixBindings = new Stack<String>();
+ private final Stack<String> prefixBindings = new Stack<>();
public void writeXmlns(String prefix, String uri) {
// defend against parsers that pass null in for "xmlns" prefix
@@ -89,7 +89,7 @@
}
// element stack
- private final Stack<String> elementBindings = new Stack<String>();
+ private final Stack<String> elementBindings = new Stack<>();
public void beginStartTag(String uri, String localName, String prefix) {
// save element bindings for #endTag
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
index d3753de..d25eba9 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
@@ -387,7 +387,7 @@
}
- private final HashMap locallyDeclaredPrefix = new HashMap();
+ private final Map<String, String> locallyDeclaredPrefix = new HashMap<>();
public void startPrefixMapping( String prefix, String uri ) throws SAXException {
locallyDeclaredPrefix.put(prefix,uri);
}
@@ -498,11 +498,11 @@
// declare namespaces specified by the startPrefixMapping methods
if(!locallyDeclaredPrefix.isEmpty()) {
- Iterator itr = locallyDeclaredPrefix.entrySet().iterator();
+ Iterator<Map.Entry<String, String>> itr = locallyDeclaredPrefix.entrySet().iterator();
while(itr.hasNext()) {
- Map.Entry e = (Map.Entry)itr.next();
- String p = (String)e.getKey();
- String u = (String)e.getValue();
+ Map.Entry<String, String> e = itr.next();
+ String p = e.getKey();
+ String u = e.getValue();
if (u == null) {
u = "";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/AbortException.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/AbortException.java
index 9235df6..ff1f210 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/AbortException.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/AbortException.java
@@ -13,7 +13,6 @@
*/
package com.sun.tools.xjc;
-
/**
* Signals the abortion of the compilation.
* <p>
@@ -23,6 +22,8 @@
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public class AbortException extends RuntimeException {
+ private static final long serialVersionUID = -335027176514421642L;
+
public AbortException() {
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/BadCommandLineException.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/BadCommandLineException.java
index 7bb3ae3..40d3830 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/BadCommandLineException.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/BadCommandLineException.java
@@ -16,6 +16,8 @@
* Signals a bad command line argument.
*/
public class BadCommandLineException extends Exception {
+ private static final long serialVersionUID = 8088500733830641442L;
+
private Options options;
public BadCommandLineException(String msg) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ConsoleErrorReporter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ConsoleErrorReporter.java
index 421ba4a..03bee13 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ConsoleErrorReporter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ConsoleErrorReporter.java
@@ -38,20 +38,24 @@
}
public ConsoleErrorReporter() { this(System.out); }
+ @Override
public void warning(SAXParseException e) {
print(Messages.WARNING_MSG,e);
}
+ @Override
public void error(SAXParseException e) {
hadError = true;
print(Messages.ERROR_MSG,e);
}
+ @Override
public void fatalError(SAXParseException e) {
hadError = true;
print(Messages.ERROR_MSG,e);
}
+ @Override
public void info(SAXParseException e) {
print(Messages.INFO_MSG,e);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Driver.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Driver.java
index 3dc99e8..fec4d73 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Driver.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Driver.java
@@ -172,18 +172,22 @@
status.println(msg);
}
+ @Override
public void error(SAXParseException exception) {
cer.error(exception);
}
+ @Override
public void fatalError(SAXParseException exception) {
cer.fatalError(exception);
}
+ @Override
public void warning(SAXParseException exception) {
cer.warning(exception);
}
+ @Override
public void info(SAXParseException exception) {
cer.info(exception);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ErrorReceiver.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ErrorReceiver.java
index 4e3c877..99f0f67 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ErrorReceiver.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ErrorReceiver.java
@@ -81,8 +81,11 @@
// ErrorHandler implementation, but can't throw SAXException
//
//
+ @Override
public abstract void error(SAXParseException exception) throws AbortException;
+ @Override
public abstract void fatalError(SAXParseException exception) throws AbortException;
+ @Override
public abstract void warning(SAXParseException exception) throws AbortException;
/**
@@ -99,7 +102,8 @@
* messages. The implementation usually discards them
* unless some specific debug option is turned on.
*/
- public abstract void info(SAXParseException exception) /*REVISIT:throws AbortException*/;
+ @Override
+ public abstract void info(SAXParseException exception);
/**
* Reports a debug message to users.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
index 8c22e6d..1fe9851 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
@@ -83,7 +83,6 @@
this.errorReceiver = new ErrorReceiverFilter(er);
}
- @SuppressWarnings("CallToThreadDumpStack")
private Model load() {
Model grammar;
@@ -385,6 +384,7 @@
public XSOMParser createXSOMParser(final DOMForest forest) {
XSOMParser p = createXSOMParser(forest.createParser());
p.setEntityResolver(new EntityResolver() {
+ @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
// DOMForest only parses documents that are reachable through systemIds,
// and it won't pick up references like <xs:import namespace="..." /> without
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Plugin.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Plugin.java
index 86f2cf0..2cbfe44 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Plugin.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/Plugin.java
@@ -38,6 +38,12 @@
public abstract class Plugin {
/**
+ * Default constructor.
+ */
+ protected Plugin() {
+ }
+
+ /**
* Gets the option name to turn on this add-on.
*
* <p>
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SchemaCache.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SchemaCache.java
index eafaaa9..4f3a568 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SchemaCache.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SchemaCache.java
@@ -93,7 +93,7 @@
class ResourceResolver implements LSResourceResolver {
- private List<InputStream> streamsToClose = Collections.synchronizedList(new ArrayList<InputStream>());
+ private List<InputStream> streamsToClose = Collections.synchronizedList(new ArrayList<>());
private Class<?> clazz;
ResourceResolver(Class<?> clazz) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SecureLoader.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SecureLoader.java
index 64d4dca..a1d481b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SecureLoader.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -31,12 +32,13 @@
}
}
- static ClassLoader getClassClassLoader(final Class c) {
+ static ClassLoader getClassClassLoader(final Class<?> c) {
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
@@ -63,6 +66,7 @@
} else {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
Thread.currentThread().setContextClassLoader(cl);
return null;
@@ -77,6 +81,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return cl.getParent();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
index 5ede004..d0be84f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
@@ -338,6 +338,7 @@
*
* @deprecated not much need for JAXB2, as we now use much less stack.
*/
+ @Deprecated
public void setStackSize(String ss) {
try {
stackSize = Long.parseLong(ss);
@@ -691,6 +692,7 @@
Thread t;
Runnable job = new Runnable() {
+ @Override
public void run() {
try {
doXJC();
@@ -899,7 +901,7 @@
String[] includedFiles = ds.getIncludedFiles();
File baseDir = ds.getBasedir();
- ArrayList<InputSource> lst = new ArrayList<InputSource>();
+ ArrayList<InputSource> lst = new ArrayList<>();
for (String value : includedFiles) {
lst.add(getInputSource(new File(baseDir, value)));
@@ -954,18 +956,22 @@
*/
private class ErrorReceiverImpl extends ErrorReceiver {
+ @Override
public void warning(SAXParseException e) {
print(Project.MSG_WARN, Messages.WARNING_MSG, e);
}
+ @Override
public void error(SAXParseException e) {
print(Project.MSG_ERR, Messages.ERROR_MSG, e);
}
+ @Override
public void fatalError(SAXParseException e) {
print(Project.MSG_ERR, Messages.ERROR_MSG, e);
}
+ @Override
public void info(SAXParseException e) {
print(Project.MSG_VERBOSE, Messages.INFO_MSG, e);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCListener.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCListener.java
index d925f65..2e8f056 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCListener.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCListener.java
@@ -38,6 +38,7 @@
* Override {@link #generatedFile(String, int, int)}.
* Deprecated in 2.0.1.
*/
+ @Deprecated
public void generatedFile(String fileName) {}
/**
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCTask.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCTask.java
index 2ff6b92..4acd898 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCTask.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCTask.java
@@ -36,10 +36,12 @@
}
+ @Override
protected ClassLoader createClassLoader() throws ClassNotFoundException, IOException {
return SecureLoader.getClassClassLoader(XJCTask.class);
}
+ @Override
protected String getCoreClassName() {
return "com.sun.tools.xjc.XJC2Task";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
index 8029ab4..5003bd4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
@@ -66,14 +66,17 @@
private File episodeFile;
+ @Override
public String getOptionName() {
return "episode";
}
+ @Override
public String getUsage() {
return " -episode <FILE> : generate the episode file for separate compilation";
}
+ @Override
public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException {
if(args[i].equals("-episode")) {
episodeFile = new File(opt.requireArgument("-episode",args,++i));
@@ -86,16 +89,17 @@
* Capture all the generated classes from global schema components
* and generate them in an episode file.
*/
+ @Override
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) throws SAXException {
OutputStream episodeFileOutputStream = null;
try {
// reorganize qualifying components by their namespaces to
// generate the list nicely
- Map<XSSchema, PerSchemaOutlineAdaptors> perSchema = new LinkedHashMap<XSSchema, PerSchemaOutlineAdaptors>();
+ Map<XSSchema, PerSchemaOutlineAdaptors> perSchema = new LinkedHashMap<>();
boolean hasComponentInNoNamespace = false;
// Combine classes and enums into a single list
- List<OutlineAdaptor> outlines = new ArrayList<OutlineAdaptor>();
+ List<OutlineAdaptor> outlines = new ArrayList<>();
for (ClassOutline co : model.getClasses()) {
XSComponent sc = co.target.getSchemaComponent();
@@ -194,18 +198,18 @@
*/
private static final XSFunction<String> SCD = new XSFunction<String>() {
private String name(XSDeclaration decl) {
- if(decl.getTargetNamespace().equals(""))
+ if (decl.getTargetNamespace().equals(""))
return decl.getName();
else
- return "tns:"+decl.getName();
+ return "tns:" + decl.getName();
}
public String complexType(XSComplexType type) {
- return "~"+name(type);
+ return "~" + name(type);
}
public String simpleType(XSSimpleType simpleType) {
- return "~"+name(simpleType);
+ return "~" + name(simpleType);
}
public String elementDecl(XSElementDecl decl) {
@@ -275,11 +279,13 @@
private enum OutlineType {
CLASS(new BindingsBuilder() {
+ @Override
public void build(OutlineAdaptor adaptor, Bindings bindings) {
bindings.klass().ref(adaptor.implName);
}
}),
ENUM(new BindingsBuilder() {
+ @Override
public void build(OutlineAdaptor adaptor, Bindings bindings) {
bindings.typesafeEnumClass().ref(adaptor.implName);
}
@@ -318,9 +324,9 @@
private final static class PerSchemaOutlineAdaptors {
- private final List<OutlineAdaptor> outlineAdaptors = new ArrayList<OutlineAdaptor>();
+ private final List<OutlineAdaptor> outlineAdaptors = new ArrayList<>();
- private final Set<String> packageNames = new HashSet<String>();
+ private final Set<String> packageNames = new HashSet<>();
private void add(OutlineAdaptor outlineAdaptor) {
this.outlineAdaptors.add(outlineAdaptor);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/locator/SourceLocationAddOn.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/locator/SourceLocationAddOn.java
index 494b67b..c6b3ebd 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/locator/SourceLocationAddOn.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/locator/SourceLocationAddOn.java
@@ -37,20 +37,24 @@
*/
public class SourceLocationAddOn extends Plugin {
+ @Override
public String getOptionName() {
return "Xlocator";
}
+ @Override
public String getUsage() {
return " -Xlocator : enable source location support for generated code";
}
+ @Override
public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException {
return 0; // no option recognized
}
private static final String fieldName = "locator";
+ @Override
public boolean run(
Outline outline,
Options opt,
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/sync/SynchronizedMethodAddOn.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/sync/SynchronizedMethodAddOn.java
index ce5d94b..d6a2e55 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/sync/SynchronizedMethodAddOn.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/sync/SynchronizedMethodAddOn.java
@@ -29,18 +29,22 @@
*/
public class SynchronizedMethodAddOn extends Plugin {
+ @Override
public String getOptionName() {
return "Xsync-methods";
}
+ @Override
public String getUsage() {
return " -Xsync-methods : generate accessor methods with the 'synchronized' keyword";
}
+ @Override
public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException {
return 0; // no option recognized
}
+ @Override
public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
for( ClassOutline co : model.getClasses() )
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/ErrorListener.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/ErrorListener.java
index f477811..ae1d068 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/ErrorListener.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/ErrorListener.java
@@ -29,12 +29,16 @@
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public interface ErrorListener extends org.glassfish.jaxb.core.api.ErrorListener {
+ @Override
void error(SAXParseException exception);
+ @Override
void fatalError(SAXParseException exception);
+ @Override
void warning(SAXParseException exception);
/**
* Used to report possibly verbose information that
* can be safely ignored.
*/
+ @Override
void info(SAXParseException exception);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/JAXBModel.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/JAXBModel.java
index 4cea728..bfaf8fe 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/JAXBModel.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/JAXBModel.java
@@ -39,6 +39,7 @@
* @deprecated
* this method is provided for now to allow gradual migration for JAX-RPC.
*/
+ @Deprecated
List<String> getClassList();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/Reference.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/Reference.java
index 30996af..89584e9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/Reference.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/Reference.java
@@ -76,6 +76,7 @@
this.annotations = annotations;
}
+ @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Reference)) return false;
@@ -85,6 +86,7 @@
return annotations.equals(that.annotations) && type.equals(that.type);
}
+ @Override
public int hashCode() {
return 29 * type.hashCode() + annotations.hashCode();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/SchemaCompiler.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/SchemaCompiler.java
index f152f64..e6d0245 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/SchemaCompiler.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/SchemaCompiler.java
@@ -235,5 +235,6 @@
* {@link Options} class in the compatible fashion. So please don't
* use this method unless you know what you're doing.
*/
+ @Deprecated
@NotNull Options getOptions();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/TypeAndAnnotation.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/TypeAndAnnotation.java
index 4422be6..7cbd277 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/TypeAndAnnotation.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/TypeAndAnnotation.java
@@ -41,5 +41,6 @@
* Two {@link TypeAndAnnotation} are equal if they
* has the same type and annotations.
*/
+ @Override
boolean equals(Object o);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/AbstractMappingImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/AbstractMappingImpl.java
index 36b608a..d531143 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/AbstractMappingImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/AbstractMappingImpl.java
@@ -57,6 +57,7 @@
this.clazz = clazz;
}
+ @Override
public final QName getElement() {
return clazz.getElementName();
}
@@ -65,6 +66,7 @@
return clazz.getType().fullName();
}
+ @Override
public final List<? extends Property> getWrapperStyleDrilldown() {
if (!drilldownComputed) {
drilldownComputed = true;
@@ -95,7 +97,7 @@
return null; // aborted
}
} else {
- result = new ArrayList<Property>();
+ result = new ArrayList<>();
}
for (CPropertyInfo p : typeBean.getProperties()) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/BeanMappingImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/BeanMappingImpl.java
index c26b098..d38df88 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/BeanMappingImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/BeanMappingImpl.java
@@ -32,6 +32,7 @@
assert classInfo.isElement();
}
+ @Override
public TypeAndAnnotation getType() {
return taa;
}
@@ -40,6 +41,7 @@
return getClazz();
}
+ @Override
public List<Property> calcDrilldown() {
if(!clazz.isOrdered())
return null; // all is not eligible for the wrapper style
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/DowngradingErrorHandler.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/DowngradingErrorHandler.java
index e4daee0..c93220f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/DowngradingErrorHandler.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/DowngradingErrorHandler.java
@@ -26,14 +26,17 @@
this.core = core;
}
+ @Override
public void warning(SAXParseException exception) throws SAXException {
core.warning(exception);
}
+ @Override
public void error(SAXParseException exception) throws SAXException {
core.warning(exception);
}
+ @Override
public void fatalError(SAXParseException exception) throws SAXException {
core.warning(exception);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementAdapter.java
index 74e1a30..25ea450 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementAdapter.java
@@ -56,10 +56,12 @@
this.ei = ei;
}
+ @Override
public ClassOutline parent() {
return core.parent();
}
+ @Override
public CPropertyInfo getPropertyInfo() {
return core.getPropertyInfo();
}
@@ -79,18 +81,22 @@
acc = core.create(target);
}
+ @Override
public void unsetValues(JBlock body) {
acc.unsetValues(body);
}
+ @Override
public JExpression hasSetValue() {
return acc.hasSetValue();
}
+ @Override
public FieldOutline owner() {
return ElementAdapter.this;
}
+ @Override
public CPropertyInfo getPropertyInfo() {
return core.getPropertyInfo();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementCollectionAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementCollectionAdapter.java
index cf22f21..12e3d2d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementCollectionAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementCollectionAdapter.java
@@ -40,6 +40,7 @@
super(core, ei);
}
+ @Override
public JType getRawType() {
return codeModel().ref(List.class).narrow(itemType().boxify());
}
@@ -48,6 +49,7 @@
return ei.getContentInMemoryType().toType(outline(), EXPOSED);
}
+ @Override
public FieldAccessor create(JExpression targetObject) {
return new FieldAccessorImpl(targetObject);
}
@@ -57,6 +59,7 @@
super(target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
JCodeModel cm = outline().getCodeModel();
JClass elementType = ei.toType(outline(),EXPOSED).boxify();
@@ -80,6 +83,7 @@
cond._else().invoke($var,"add").arg(loop.var().invoke("getValue"));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
JCodeModel cm = outline().getCodeModel();
JClass elementType = ei.toType(outline(),EXPOSED).boxify();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementMappingImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementMappingImpl.java
index c20100c..9c5090b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementMappingImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementMappingImpl.java
@@ -41,10 +41,12 @@
taa = new TypeAndAnnotationImpl(parent.outline,t);
}
+ @Override
public TypeAndAnnotation getType() {
return taa;
}
+ @Override
public final List<Property> calcDrilldown() {
CElementPropertyInfo p = clazz.getProperty();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementSingleAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementSingleAdapter.java
index 13b5363..0ad57cf 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementSingleAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/ElementSingleAdapter.java
@@ -33,10 +33,12 @@
super(core, ei);
}
+ @Override
public JType getRawType() {
return ei.getContentInMemoryType().toType(outline(), Aspect.EXPOSED);
}
+ @Override
public FieldAccessor create(JExpression targetObject) {
return new FieldAccessorImpl(targetObject);
}
@@ -46,6 +48,7 @@
super(target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// [RESULT]
// if([core.hasSetValue])
@@ -60,6 +63,7 @@
cond._else().assign($var, JExpr._null());
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
// [RESULT]
// [core.fromRawValue](new JAXBElement(tagName, TYPE, $var));
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/JAXBModelImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/JAXBModelImpl.java
index 7830197..75b2e96 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/JAXBModelImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/JAXBModelImpl.java
@@ -47,7 +47,7 @@
*/
private final Model model;
- private final Map<QName,Mapping> byXmlName = new HashMap<QName,Mapping>();
+ private final Map<QName,Mapping> byXmlName = new HashMap<>();
JAXBModelImpl(Outline outline) {
this.model = outline.getModel();
@@ -63,27 +63,32 @@
}
}
+ @Override
public JCodeModel generateCode(Plugin[] extensions,ErrorListener errorListener) {
// we no longer do any code generation
return outline.getCodeModel();
}
+ @Override
public List<JClass> getAllObjectFactories() {
- List<JClass> r = new ArrayList<JClass>();
+ List<JClass> r = new ArrayList<>();
for (PackageOutline pkg : outline.getAllPackageContexts()) {
r.add(pkg.objectFactory());
}
return r;
}
+ @Override
public final Mapping get(QName elementName) {
return byXmlName.get(elementName);
}
+ @Override
public final Collection<? extends Mapping> getMappings() {
return byXmlName.values();
}
+ @Override
public TypeAndAnnotation getJavaType(QName xmlTypeName) {
// TODO: primitive type handling?
TypeUse use = model.typeUses().get(xmlTypeName);
@@ -92,8 +97,9 @@
return new TypeAndAnnotationImpl(outline,use);
}
+ @Override
public final List<String> getClassList() {
- List<String> classList = new ArrayList<String>();
+ List<String> classList = new ArrayList<>();
// list up root classes
for( PackageOutline p : outline.getAllPackageContexts() )
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/PropertyImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/PropertyImpl.java
index 4ec177f..dea0fa6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/PropertyImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/PropertyImpl.java
@@ -35,11 +35,13 @@
this.codeModel = fr.getRawType().owner();
}
+ @Override
public final String name() {
return fr.getPropertyInfo().getName(false);
}
/** Returns raw schema name for simpleType property. May return null for other types. */
+ @Override
public final QName rawName() {
if (fr instanceof ElementAdapter) {
CElementInfo eInfo = ((ElementAdapter)fr).ei;
@@ -50,10 +52,12 @@
return null;
}
+ @Override
public final QName elementName() {
return elementName;
}
+ @Override
public final JType type() {
return fr.getRawType();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
index c90c1ee..8a959e9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
@@ -92,14 +92,17 @@
}
@NotNull
+ @Override
public Options getOptions() {
return opts;
}
+ @Override
public ContentHandler getParserHandler( String systemId ) {
return forest.getParserHandler(systemId,true);
}
+ @Override
public void parseSchema( String systemId, Element element ) {
checkAbsoluteness(systemId);
try {
@@ -124,6 +127,7 @@
}
}
+ @Override
public void parseSchema(InputSource source) {
checkAbsoluteness(source.getSystemId());
try {
@@ -135,12 +139,14 @@
}
}
+ @Override
public void setTargetVersion(SpecVersion version) {
if(version==null)
version = SpecVersion.LATEST;
opts.target = version;
}
+ @Override
public void parseSchema(String systemId, XMLStreamReader reader) throws XMLStreamException {
checkAbsoluteness(systemId);
forest.parse(systemId,reader,true);
@@ -166,29 +172,35 @@
}
}
+ @Override
public void setEntityResolver(EntityResolver entityResolver) {
forest.setEntityResolver(entityResolver);
opts.entityResolver = entityResolver;
}
+ @Override
public void setDefaultPackageName(String packageName) {
opts.defaultPackage2 = packageName;
}
+ @Override
public void forcePackageName(String packageName) {
opts.defaultPackage = packageName;
}
+ @Override
public void setClassNameAllocator(ClassNameAllocator allocator) {
opts.classNameAllocator = allocator;
}
+ @Override
public void resetSchema() {
forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
forest.setErrorHandler(this);
forest.setEntityResolver(opts.entityResolver);
}
+ @Override
public JAXBModelImpl bind() {
// this has been problematic. turn it off.
// if(!forest.checkSchemaCorrectness(this))
@@ -210,6 +222,7 @@
// taken from SchemaConstraintChecker, TODO XXX FIXME UGLY
if (opts.entityResolver != null) {
sf.setResourceResolver(new LSResourceResolver() {
+ @Override
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
try {
// XSOM passes the namespace URI to the publicID parameter.
@@ -270,23 +283,28 @@
}
}
+ @Override
public void setErrorListener(ErrorListener errorListener) {
this.errorListener = errorListener;
}
+ @Override
public void info(SAXParseException exception) {
if(errorListener!=null)
errorListener.info(exception);
}
+ @Override
public void warning(SAXParseException exception) {
if(errorListener!=null)
errorListener.warning(exception);
}
+ @Override
public void error(SAXParseException exception) {
hadError = true;
if(errorListener!=null)
errorListener.error(exception);
}
+ @Override
public void fatalError(SAXParseException exception) {
hadError = true;
if(errorListener!=null)
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/TypeAndAnnotationImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
index 77650bb..281959e 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
@@ -39,6 +39,7 @@
this.outline = outline;
}
+ @Override
public JType getTypeClass() {
CAdapter a = typeUse.getAdapterUse();
NType nt;
@@ -59,6 +60,7 @@
return jt;
}
+ @Override
public void annotate(JAnnotatable programElement) {
if(typeUse.getAdapterUse()==null && !typeUse.isCollection())
return; // nothing
@@ -79,6 +81,7 @@
programElement.annotate(XmlList.class);
}
+ @Override
public String toString() {
StringBuilder builder = new StringBuilder();
// TODO: support annotations
@@ -86,12 +89,14 @@
return builder.toString();
}
+ @Override
public boolean equals(Object o) {
if (!(o instanceof TypeAndAnnotationImpl)) return false;
TypeAndAnnotationImpl that = (TypeAndAnnotationImpl) o;
return this.typeUse==that.typeUse;
}
+ @Override
public int hashCode() {
return typeUse.hashCode();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlElementWriter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlElementWriter.java
index 1a42a07..fc39bd1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlElementWriter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlElementWriter.java
@@ -26,7 +26,7 @@
XmlElementWriter name(String value);
- XmlElementWriter type(Class value);
+ XmlElementWriter type(Class<?> value);
XmlElementWriter type(JType value);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlTypeWriter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlTypeWriter.java
index 2cae54b..a4b70db 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlTypeWriter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/annotation/spec/XmlTypeWriter.java
@@ -30,7 +30,7 @@
XmlTypeWriter propOrder(String value);
- XmlTypeWriter factoryClass(Class value);
+ XmlTypeWriter factoryClass(Class<?> value);
XmlTypeWriter factoryClass(JType value);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/BeanGenerator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/BeanGenerator.java
index fba0969..a39681c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/BeanGenerator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/BeanGenerator.java
@@ -100,26 +100,26 @@
private final CodeModelClassFactory codeModelClassFactory;
private final ErrorReceiver errorReceiver;
/** all {@link PackageOutline}s keyed by their {@link PackageOutline#_package}. */
- private final Map<JPackage, PackageOutlineImpl> packageContexts = new LinkedHashMap<JPackage, PackageOutlineImpl>();
+ private final Map<JPackage, PackageOutlineImpl> packageContexts = new LinkedHashMap<>();
/** all {@link ClassOutline}s keyed by their {@link ClassOutline#target}. */
- private final Map<CClassInfo, ClassOutlineImpl> classes = new LinkedHashMap<CClassInfo, ClassOutlineImpl>();
+ private final Map<CClassInfo, ClassOutlineImpl> classes = new LinkedHashMap<>();
/** all {@link EnumOutline}s keyed by their {@link EnumOutline#target}. */
- private final Map<CEnumLeafInfo, EnumOutline> enums = new LinkedHashMap<CEnumLeafInfo, EnumOutline>();
+ private final Map<CEnumLeafInfo, EnumOutline> enums = new LinkedHashMap<>();
/**
* Generated runtime classes.
*/
- private final Map<Class, JClass> generatedRuntime = new LinkedHashMap<Class, JClass>();
+ private final Map<Class<?>, JClass> generatedRuntime = new LinkedHashMap<>();
/** the model object which we are processing. */
private final Model model;
private final JCodeModel codeModel;
/**
* for each property, the information about the generated field.
*/
- private final Map<CPropertyInfo, FieldOutline> fields = new LinkedHashMap<CPropertyInfo, FieldOutline>();
+ private final Map<CPropertyInfo, FieldOutline> fields = new LinkedHashMap<>();
/**
* elements that generate classes to the generated classes.
*/
- /*package*/ final Map<CElementInfo, ElementOutlineImpl> elements = new LinkedHashMap<CElementInfo, ElementOutlineImpl>();
+ /*package*/ final Map<CElementInfo, ElementOutlineImpl> elements = new LinkedHashMap<>();
/**
* Generates beans into code model according to the BGM,
@@ -258,7 +258,6 @@
* This is used in the debug mode so that a new properly configured
* {@link JAXBContext} object can be used.
*/
- @SuppressWarnings("CallToThreadDumpStack")
private void generateClassList() {
try {
JDefinedClass jc = codeModel.rootPackage()._class("JAXBDebug");
@@ -298,14 +297,17 @@
}
}
+ @Override
public Model getModel() {
return model;
}
+ @Override
public JCodeModel getCodeModel() {
return codeModel;
}
+ @Override
public JClassContainer getContainer(CClassInfoParent parent, Aspect aspect) {
CClassInfoParent.Visitor<JClassContainer> v;
switch (aspect) {
@@ -322,21 +324,25 @@
return parent.accept(v);
}
+ @Override
public final JType resolve(CTypeRef ref, Aspect a) {
return ref.getTarget().getType().toType(this, a);
}
private final CClassInfoParent.Visitor<JClassContainer> exposedContainerBuilder =
new CClassInfoParent.Visitor<JClassContainer>() {
+ @Override
public JClassContainer onBean(CClassInfo bean) {
return getClazz(bean).ref;
}
+ @Override
public JClassContainer onElement(CElementInfo element) {
// hmm...
return getElement(element).implClass;
}
+ @Override
public JClassContainer onPackage(JPackage pkg) {
return model.strategy.getPackage(pkg, EXPOSED);
}
@@ -344,14 +350,17 @@
private final CClassInfoParent.Visitor<JClassContainer> implContainerBuilder =
new CClassInfoParent.Visitor<JClassContainer>() {
+ @Override
public JClassContainer onBean(CClassInfo bean) {
return getClazz(bean).implClass;
}
+ @Override
public JClassContainer onElement(CElementInfo element) {
return getElement(element).implClass;
}
+ @Override
public JClassContainer onPackage(JPackage pkg) {
return model.strategy.getPackage(pkg, Aspect.IMPLEMENTATION);
}
@@ -371,7 +380,7 @@
* is always the same regardless of the environment.
*/
public final JPackage[] getUsedPackages(Aspect aspect) {
- Set<JPackage> s = new TreeSet<JPackage>();
+ Set<JPackage> s = new TreeSet<>();
for (CClassInfo bean : model.beans().values()) {
JClassContainer cont = getContainer(bean.parent(), aspect);
@@ -391,14 +400,17 @@
return s.toArray(new JPackage[s.size()]);
}
+ @Override
public ErrorReceiver getErrorReceiver() {
return errorReceiver;
}
+ @Override
public CodeModelClassFactory getClassFactory() {
return codeModelClassFactory;
}
+ @Override
public PackageOutlineImpl getPackageContext(JPackage p) {
PackageOutlineImpl r = packageContexts.get(p);
if (r == null) {
@@ -436,12 +448,14 @@
return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef);
}
+ @Override
public Collection<ClassOutlineImpl> getClasses() {
// make sure that classes are fully populated
assert model.beans().size() == classes.size();
return classes.values();
}
+ @Override
public ClassOutlineImpl getClazz(CClassInfo bean) {
ClassOutlineImpl r = classes.get(bean);
if (r == null) {
@@ -450,6 +464,7 @@
return r;
}
+ @Override
public ElementOutlineImpl getElement(CElementInfo ei) {
ElementOutlineImpl def = elements.get(ei);
if (def == null && ei.hasClass()) {
@@ -459,18 +474,22 @@
return def;
}
+ @Override
public EnumOutline getEnum(CEnumLeafInfo eli) {
return enums.get(eli);
}
+ @Override
public Collection<EnumOutline> getEnums() {
return enums.values();
}
+ @Override
public Iterable<? extends PackageOutline> getAllPackageContexts() {
return packageContexts.values();
}
+ @Override
public FieldOutline getField(CPropertyInfo prop) {
return fields.get(prop);
}
@@ -634,7 +653,7 @@
// [RESULT]
// <EnumName>(<deserializer of m>(<value>));
- Set<String> enumFieldNames = new HashSet<String>(); // record generated field names to detect collision
+ Set<String> enumFieldNames = new HashSet<>(); // record generated field names to detect collision
for (CEnumConstant mem : e.members) {
String constName = mem.getName();
@@ -786,7 +805,8 @@
}
}
- public final JClass addRuntime(Class clazz) {
+ @Override
+ public final JClass addRuntime(Class<?> clazz) {
JClass g = generatedRuntime.get(clazz);
if (g == null) {
// put code into a separate package to avoid name conflicts.
@@ -797,13 +817,13 @@
return g;
}
- public JClass generateStaticClass(Class src, JPackage out) {
+ public JClass generateStaticClass(Class<?> src, JPackage out) {
JStaticJavaFile sjf = new JStaticJavaFile(out, getShortName(src), src, null);
out.addResourceFile(sjf);
return sjf.getJClass();
}
- private String getShortName(Class src) {
+ private String getShortName(Class<?> src) {
String name = src.getName();
return name.substring(name.lastIndexOf('.') + 1);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ClassOutlineImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ClassOutlineImpl.java
index d818139..3b0603f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ClassOutlineImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ClassOutlineImpl.java
@@ -34,6 +34,7 @@
* Gets {@link #_package} as {@link PackageOutlineImpl},
* since it's guaranteed to be of that type.
*/
+ @Override
public PackageOutlineImpl _package() {
return (PackageOutlineImpl)super._package();
}
@@ -45,6 +46,7 @@
_package().classes.add(this);
}
+ @Override
public BeanGenerator parent() {
return _parent;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/DualObjectFactoryGenerator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/DualObjectFactoryGenerator.java
index c352b50..8364274 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/DualObjectFactoryGenerator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/DualObjectFactoryGenerator.java
@@ -40,11 +40,13 @@
Void.class, "_useJAXBProperties", JExpr._null());
}
+ @Override
void populate(CElementInfo ei) {
publicOFG.populate(ei);
privateOFG.populate(ei);
}
+ @Override
void populate(ClassOutlineImpl cc) {
publicOFG.populate(cc);
privateOFG.populate(cc);
@@ -53,6 +55,7 @@
/**
* Returns the private version (which is what gets used at runtime.)
*/
+ @Override
public JDefinedClass getObjectFactory() {
return privateOFG.getObjectFactory();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ElementOutlineImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ElementOutlineImpl.java
index 506a530..65fa009 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ElementOutlineImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ElementOutlineImpl.java
@@ -35,6 +35,7 @@
final class ElementOutlineImpl extends ElementOutline {
private final BeanGenerator parent;
+ @Override
public BeanGenerator parent() {
return parent;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ImplStructureStrategy.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ImplStructureStrategy.java
index 6b98ab2..893c8fc 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ImplStructureStrategy.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ImplStructureStrategy.java
@@ -46,6 +46,7 @@
*/
@XmlEnumValue("true")
BEAN_ONLY() {
+ @Override
protected Result createClasses(Outline outline, CClassInfo bean) {
JClassContainer parent = outline.getContainer( bean.parent(), Aspect.EXPOSED );
@@ -58,10 +59,12 @@
return new Result(impl,impl);
}
+ @Override
protected JPackage getPackage(JPackage pkg, Aspect a) {
return pkg;
}
+ @Override
protected MethodWriter createMethodWriter(final ClassOutlineImpl target) {
assert target.ref==target.implClass;
@@ -70,21 +73,25 @@
private JMethod implMethod;
+ @Override
public JVar addParameter(JType type, String name) {
return implMethod.param(type,name);
}
+ @Override
public JMethod declareMethod(JType returnType, String methodName) {
implMethod = impl.method( JMod.PUBLIC, returnType, methodName );
return implMethod;
}
+ @Override
public JDocComment javadoc() {
return implMethod.javadoc();
}
};
}
+ @Override
protected void _extends(ClassOutlineImpl derived, ClassOutlineImpl base) {
derived.implClass._extends(base.implRef);
}
@@ -98,6 +105,7 @@
*/
@XmlEnumValue("false")
INTF_AND_IMPL() {
+ @Override
protected Result createClasses( Outline outline, CClassInfo bean ) {
JClassContainer parent = outline.getContainer( bean.parent(), Aspect.EXPOSED );
@@ -116,6 +124,7 @@
return new Result(intf,impl);
}
+ @Override
protected JPackage getPackage(JPackage pkg, Aspect a) {
switch(a) {
case EXPOSED:
@@ -128,6 +137,7 @@
}
}
+ @Override
protected MethodWriter createMethodWriter(final ClassOutlineImpl target) {
return new MethodWriter(target) {
private final JDefinedClass intf = target.ref;
@@ -136,6 +146,7 @@
private JMethod intfMethod;
private JMethod implMethod;
+ @Override
public JVar addParameter(JType type, String name) {
// TODO: do we still need to deal with the case where intf is null?
if(intf!=null)
@@ -143,6 +154,7 @@
return implMethod.param(type,name);
}
+ @Override
public JMethod declareMethod(JType returnType, String methodName) {
if(intf!=null)
intfMethod = intf.method( 0, returnType, methodName );
@@ -150,6 +162,7 @@
return implMethod;
}
+ @Override
public JDocComment javadoc() {
if(intf!=null)
return intfMethod.javadoc();
@@ -159,6 +172,7 @@
};
}
+ @Override
protected void _extends(ClassOutlineImpl derived, ClassOutlineImpl base) {
derived.implClass._extends(base.implRef);
derived.ref._implements(base.ref);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/MethodWriter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/MethodWriter.java
index 6730d9d..02183c4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/MethodWriter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/MethodWriter.java
@@ -46,7 +46,7 @@
*/
public abstract JMethod declareMethod( JType returnType, String methodName );
- public final JMethod declareMethod( Class returnType, String methodName ) {
+ public final JMethod declareMethod( Class<?> returnType, String methodName ) {
return declareMethod( codeModel.ref(returnType), methodName );
}
@@ -67,7 +67,7 @@
*/
public abstract JVar addParameter( JType type, String name );
- public final JVar addParameter( Class type, String name ) {
+ public final JVar addParameter( Class<?> type, String name ) {
return addParameter( codeModel.ref(type), name );
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ObjectFactoryGeneratorImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
index c745e15..8893f19 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
@@ -68,7 +68,7 @@
private final JDefinedClass objectFactory;
/** map of qname to the QName constant field. */
- private final HashMap<QName,JFieldVar> qnameMap = new HashMap<QName,JFieldVar>();
+ private final HashMap<QName,JFieldVar> qnameMap = new HashMap<>();
/**
* Names of the element factory methods that are created.
@@ -76,7 +76,7 @@
*
* The value is used for reporting error locations.
*/
- private final Map<String,CElementInfo> elementFactoryNames = new HashMap<String,CElementInfo>();
+ private final Map<String,CElementInfo> elementFactoryNames = new HashMap<>();
/**
* Names of the value factory methods that are created.
@@ -84,11 +84,12 @@
*
* The value is used for reporting error locations.
*/
- private final Map<String,ClassOutlineImpl> valueFactoryNames = new HashMap<String,ClassOutlineImpl>();
+ private final Map<String,ClassOutlineImpl> valueFactoryNames = new HashMap<>();
/**
* Returns a reference to the generated (public) ObjectFactory
*/
+ @Override
public JDefinedClass getObjectFactory() {
return objectFactory;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PackageOutlineImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PackageOutlineImpl.java
index ae04172..381a224 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PackageOutlineImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PackageOutlineImpl.java
@@ -48,7 +48,7 @@
private final JPackage _package;
private final ObjectFactoryGenerator objectFactoryGenerator;
- /*package*/ final Set<ClassOutlineImpl> classes = new HashSet<ClassOutlineImpl>();
+ /*package*/ final Set<ClassOutlineImpl> classes = new HashSet<>();
private final Set<ClassOutlineImpl> classesView = Collections.unmodifiableSet(classes);
private String mostUsedNamespaceURI;
@@ -64,6 +64,7 @@
*
* @see #calcDefaultValues()
*/
+ @Override
public String getMostUsedNamespaceURI() {
return mostUsedNamespaceURI;
}
@@ -73,6 +74,7 @@
* <p>
* The value is computed by examining what would yield the smallest generated code.
*/
+ @Override
public XmlNsForm getAttributeFormDefault() {
assert attributeFormDefault!=null;
return attributeFormDefault;
@@ -83,23 +85,28 @@
* <p>
* The value is computed by examining what would yield the smallest generated code.
*/
+ @Override
public XmlNsForm getElementFormDefault() {
assert elementFormDefault!=null;
return elementFormDefault;
}
+ @Override
public JPackage _package() {
return _package;
}
+ @Override
public ObjectFactoryGenerator objectFactoryGenerator() {
return objectFactoryGenerator;
}
+ @Override
public Set<ClassOutlineImpl> getClasses() {
return classesView;
}
+ @Override
public JDefinedClass objectFactory() {
return objectFactoryGenerator.getObjectFactory();
}
@@ -137,6 +144,7 @@
// used to visit properties
CPropertyVisitor<Void> propVisitor = new CPropertyVisitor<Void>() {
+ @Override
public Void onElement(CElementPropertyInfo p) {
for (CTypeRef tr : p.getTypes()) {
countURI(propUriCountMap, tr.getTagName());
@@ -144,6 +152,7 @@
return null;
}
+ @Override
public Void onReference(CReferencePropertyInfo p) {
for (CElement e : p.getElements()) {
countURI(propUriCountMap, e.getElementName());
@@ -151,10 +160,12 @@
return null;
}
+ @Override
public Void onAttribute(CAttributePropertyInfo p) {
return null;
}
+ @Override
public Void onValue(CValuePropertyInfo p) {
return null;
}
@@ -195,11 +206,11 @@
// Map to keep track of how often each type or element uri is used in this package
// mostly used to calculate mostUsedNamespaceURI
- private HashMap<String, Integer> uriCountMap = new HashMap<String, Integer>();
+ private HashMap<String, Integer> uriCountMap = new HashMap<>();
// Map to keep track of how often each property uri is used in this package
// used to calculate elementFormDefault
- private HashMap<String, Integer> propUriCountMap = new HashMap<String, Integer>();
+ private HashMap<String, Integer> propUriCountMap = new HashMap<>();
/**
* pull the uri out of the specified QName and keep track of it in the
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PrivateObjectFactoryGenerator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PrivateObjectFactoryGenerator.java
index 024dfb1..b8e7990 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PrivateObjectFactoryGenerator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PrivateObjectFactoryGenerator.java
@@ -46,10 +46,12 @@
factory.fullName());
}
+ @Override
void populate(CElementInfo ei) {
populate(ei,Aspect.IMPLEMENTATION,Aspect.IMPLEMENTATION);
}
+ @Override
void populate(ClassOutlineImpl cc) {
populate(cc,cc.implRef);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PublicObjectFactoryGenerator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PublicObjectFactoryGenerator.java
index 0040837..3088408 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PublicObjectFactoryGenerator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/PublicObjectFactoryGenerator.java
@@ -25,10 +25,12 @@
super(outline, model, targetPackage);
}
+ @Override
void populate(CElementInfo ei) {
populate(ei,Aspect.IMPLEMENTATION,Aspect.EXPOSED);
}
+ @Override
void populate(ClassOutlineImpl cc) {
populate(cc,cc.ref);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractField.java
index b1cfa93..294f491 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractField.java
@@ -12,9 +12,7 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Comparator;
import java.util.List;
-import java.util.stream.Collectors;
import jakarta.xml.bind.annotation.W3CDomHandler;
import jakarta.xml.bind.annotation.XmlList;
@@ -100,10 +98,12 @@
this.exposedType = getType(Aspect.EXPOSED);
}
+ @Override
public final ClassOutline parent() {
return outline;
}
+ @Override
public final CPropertyInfo getPropertyInfo() {
return prop;
}
@@ -373,10 +373,12 @@
this.$target = $target;
}
+ @Override
public final FieldOutline owner() {
return AbstractField.this;
}
+ @Override
public final CPropertyInfo getPropertyInfo() {
return prop;
}
@@ -415,7 +417,9 @@
return prop.getAdapter().customType.toType(outline.parent(),aspect);
final class TypeList extends ArrayList<JType> {
- void add( CTypeInfo t ) {
+ private static final long serialVersionUID = -2528889889198580251L;
+
+ void add(CTypeInfo t ) {
add( t.getType().toType(outline.parent(),aspect) );
if(t instanceof CElementInfo) {
// UGLY. element substitution is implemented in a way that
@@ -454,7 +458,7 @@
* Returns contents to be added to javadoc.
*/
protected final List<Object> listPossibleTypes( CPropertyInfo prop ) {
- List<Object> r = new ArrayList<Object>();
+ List<Object> r = new ArrayList<>();
List<JType> refs = prop.ref().stream()
.map(tt -> tt.toType(outline.parent(), Aspect.EXPOSED))
.sorted(comparing(JType::fullName))
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractFieldWithVar.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractFieldWithVar.java
index 60f6484..31f6a3f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractFieldWithVar.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractFieldWithVar.java
@@ -73,6 +73,7 @@
protected JFieldVar ref() { return field; }
+ @Override
public final JType getRawType() {
return exposedType;
}
@@ -89,6 +90,7 @@
*/
protected final JFieldRef $ref;
+ @Override
public final void toRawValue(JBlock block, JVar $var) {
if (getOptions().enableIntrospection) {
block.assign($var,$target.invoke(getGetterMethod()));
@@ -97,6 +99,7 @@
}
}
+ @Override
public final void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
block.invoke($target,("set"+prop.getName(true))).arg($var);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractListField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractListField.java
index 6d3d69f..ade117f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractListField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/AbstractListField.java
@@ -122,6 +122,7 @@
.assign(field,newCoreList());
}
+ @Override
public JType getRawType() {
return codeModel.ref(List.class).narrow(exposedType.boxify());
}
@@ -199,9 +200,11 @@
return JOp.cond( field.eq(JExpr._null()), JExpr.lit(0), field.invoke("size") );
}
+ @Override
public void unsetValues( JBlock body ) {
body.assign(field,JExpr._null());
}
+ @Override
public JExpression hasSetValue() {
return field.ne(JExpr._null()).cand(field.invoke("isEmpty").not());
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ArrayField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ArrayField.java
index 182ff6c..0e8dd87 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ArrayField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ArrayField.java
@@ -53,10 +53,12 @@
super($target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
block.assign($var,$target.invoke($getAll));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
block.invoke($target,$setAll).arg($var);
}
@@ -85,6 +87,7 @@
generateAccessors();
}
+ @Override
public void generateAccessors() {
MethodWriter writer = outline.createMethodWriter();
@@ -201,10 +204,12 @@
return exposedType.array();
}
+ @Override
protected JClass getCoreListType() {
return exposedType.array();
}
+ @Override
public Accessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstField.java
index ceaeb05..14aa410 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstField.java
@@ -60,12 +60,14 @@
annotate($ref);
}
+ @Override
public JType getRawType() {
// if( isCollection ) return getInfo().array();
return exposedType;
}
+ @Override
public FieldAccessor create(JExpression target) {
return new Accessor(target);
}
@@ -76,18 +78,22 @@
super($target);
}
+ @Override
public void unsetValues( JBlock body ) {
; // can't unset values
}
+ @Override
public JExpression hasSetValue() {
return null; // can't generate the isSet/unset methods
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// TODO: rethink abstraction. Those constant fields
// don't have "access" to them.
throw new UnsupportedOperationException();
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstFieldRenderer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstFieldRenderer.java
index 97c3a0f..3e032da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstFieldRenderer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ConstFieldRenderer.java
@@ -32,6 +32,7 @@
this.fallback = fallback;
}
+ @Override
public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) {
if(prop.defaultValue.compute(outline.parent())==null)
return fallback.generate(outline, prop);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ContentListField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ContentListField.java
index cfa0ecd..7b54f1b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ContentListField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/ContentListField.java
@@ -84,6 +84,7 @@
generate();
}
+ @Override
protected final JClass getCoreListType() {
return coreList;
}
@@ -126,6 +127,7 @@
.append(listPossibleTypes(prop));
}
+ @Override
public Accessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -135,6 +137,7 @@
super($target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// [RESULT]
// $<var>.addAll(bean.getLIST());
@@ -144,6 +147,7 @@
));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
// [RESULT]
// bean.getLIST().addAll($<var>);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DefaultFieldRenderer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DefaultFieldRenderer.java
index 416092c..7cf589f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DefaultFieldRenderer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DefaultFieldRenderer.java
@@ -48,6 +48,7 @@
private FieldRenderer defaultCollectionFieldRenderer;
+ @Override
public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) {
return decideRenderer(outline,prop).generate(outline,prop);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DummyListField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DummyListField.java
index 7dc3217..7ad65f8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DummyListField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/DummyListField.java
@@ -103,6 +103,7 @@
field.annotate(OverrideAnnotationOf.class);
}
+ @Override
protected final JClass getCoreListType() {
return coreList;
}
@@ -110,6 +111,7 @@
@Override
public void generateAccessors() { }
+ @Override
public Accessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -119,6 +121,7 @@
super($target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// [RESULT]
// $<var>.addAll(bean.getLIST());
@@ -128,6 +131,7 @@
));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
// [RESULT]
// bean.getLIST().addAll($<var>);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/GenericFieldRenderer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/GenericFieldRenderer.java
index 41ea5c6..0767b0a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/GenericFieldRenderer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/GenericFieldRenderer.java
@@ -24,16 +24,17 @@
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public final class GenericFieldRenderer implements FieldRenderer {
- private Constructor constructor;
+ private Constructor<?> constructor;
- public GenericFieldRenderer( Class fieldClass ) {
+ public GenericFieldRenderer( Class<?> fieldClass ) {
try {
- constructor = fieldClass.getDeclaredConstructor(new Class[]{ClassOutlineImpl.class,CPropertyInfo.class});
+ constructor = fieldClass.getDeclaredConstructor(new Class<?>[]{ClassOutlineImpl.class,CPropertyInfo.class});
} catch (NoSuchMethodException e) {
throw new NoSuchMethodError(e.getMessage());
}
}
+ @Override
public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
try {
return (FieldOutline)constructor.newInstance(new Object[]{context,prop});
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetField.java
index 757c81c..5d0da1b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetField.java
@@ -73,10 +73,12 @@
}
}
+ @Override
public JType getRawType() {
return core.getRawType();
}
+ @Override
public FieldAccessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -91,16 +93,20 @@
}
+ @Override
public void unsetValues( JBlock body ) {
core.unsetValues(body);
}
+ @Override
public JExpression hasSetValue() {
return core.hasSetValue();
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
core.toRawValue(block,$var);
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
core.fromRawValue(block,uniqueName,$var);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetFieldRenderer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetFieldRenderer.java
index de0dcd0..16518d7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetFieldRenderer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/IsSetFieldRenderer.java
@@ -40,6 +40,7 @@
this.generateIsSetMethod = generateIsSetMethod;
}
+ @Override
public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
return new IsSetField(context,prop,
core.generate(context, prop),
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/NoExtendedContentField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/NoExtendedContentField.java
index 8c20c5a..1182dc5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/NoExtendedContentField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/NoExtendedContentField.java
@@ -87,6 +87,7 @@
generate();
}
+ @Override
protected final JClass getCoreListType() {
return coreList;
}
@@ -129,6 +130,7 @@
.append(listPossibleTypes(prop));
}
+ @Override
public Accessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -138,6 +140,7 @@
super($target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// [RESULT]
// $<var>.addAll(bean.getLIST());
@@ -147,6 +150,7 @@
));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
// [RESULT]
// bean.getLIST().addAll($<var>);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/SingleField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/SingleField.java
index efca997..1eb7858 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/SingleField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/SingleField.java
@@ -135,10 +135,12 @@
.append(possibleTypes);
}
+ @Override
public final JType getFieldType() {
return implType;
}
+ @Override
public FieldAccessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -148,9 +150,11 @@
super($target);
}
+ @Override
public void unsetValues( JBlock body ) {
body.assign( $ref, JExpr._null() );
}
+ @Override
public JExpression hasSetValue() {
return $ref.ne( JExpr._null() );
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UnboxedField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UnboxedField.java
index 10b15af..1133d74 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UnboxedField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UnboxedField.java
@@ -83,21 +83,26 @@
}
+ @Override
protected JType getType(Aspect aspect) {
return super.getType(aspect).boxify().getPrimitiveType();
}
+ @Override
protected JType getFieldType() {
return ptype;
}
+ @Override
public FieldAccessor create(JExpression targetObject) {
return new Accessor(targetObject) {
+ @Override
public void unsetValues( JBlock body ) {
// you can't unset a value
}
+ @Override
public JExpression hasSetValue() {
return JExpr.TRUE;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListField.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListField.java
index 5b3f29b..b955dac 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListField.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListField.java
@@ -82,6 +82,7 @@
generate();
}
+ @Override
protected final JClass getCoreListType() {
return coreList;
}
@@ -124,6 +125,7 @@
.append(listPossibleTypes(prop));
}
+ @Override
public Accessor create(JExpression targetObject) {
return new Accessor(targetObject);
}
@@ -133,6 +135,7 @@
super($target);
}
+ @Override
public void toRawValue(JBlock block, JVar $var) {
// [RESULT]
// $<var>.addAll(bean.getLIST());
@@ -142,6 +145,7 @@
));
}
+ @Override
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
// [RESULT]
// bean.getLIST().addAll($<var>);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListFieldRenderer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListFieldRenderer.java
index 00f5c0d..1fc13fc 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListFieldRenderer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/bean/field/UntypedListFieldRenderer.java
@@ -37,6 +37,7 @@
this.content = content;
}
+ @Override
public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
if (dummy) {
return new DummyListField(context, prop, coreList);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/ExistingBlockReference.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/ExistingBlockReference.java
index acefd03..0afbaf7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/ExistingBlockReference.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/ExistingBlockReference.java
@@ -24,6 +24,7 @@
this.block = _block;
}
+ @Override
public JBlock get(boolean create) {
return block;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/LazyBlockReference.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/LazyBlockReference.java
index 2881c36..dde32c8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/LazyBlockReference.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/LazyBlockReference.java
@@ -28,6 +28,7 @@
*/
protected abstract JBlock create();
+ @Override
public JBlock get(boolean create) {
if(!create) return block;
if(block==null)
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/WhitespaceNormalizer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/WhitespaceNormalizer.java
index f309cd2..4c0ea03 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/WhitespaceNormalizer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/generator/util/WhitespaceNormalizer.java
@@ -55,12 +55,14 @@
}
public static final WhitespaceNormalizer PRESERVE = new WhitespaceNormalizer() {
+ @Override
public JExpression generate( JCodeModel codeModel, JExpression literal ) {
return literal;
}
};
public static final WhitespaceNormalizer REPLACE = new WhitespaceNormalizer() {
+ @Override
public JExpression generate( JCodeModel codeModel, JExpression literal ) {
// WhitespaceProcessor.replace(<literal>);
if( literal instanceof JStringLiteral )
@@ -73,6 +75,7 @@
};
public static final WhitespaceNormalizer COLLAPSE = new WhitespaceNormalizer() {
+ @Override
public JExpression generate( JCodeModel codeModel, JExpression literal ) {
// WhitespaceProcessor.replace(<literal>);
if( literal instanceof JStringLiteral )
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCElement.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCElement.java
index 88f4d77..04b63cf 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCElement.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCElement.java
@@ -36,14 +36,17 @@
this.locator = locator;
}
+ @Override
public Locator getLocator() {
return locator;
}
+ @Override
public boolean isAbstract() {
return isAbstract;
}
+ @Override
public void setAbstract() {
isAbstract = true;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCTypeInfoImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCTypeInfoImpl.java
index 671280e..946a5a5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCTypeInfoImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AbstractCTypeInfoImpl.java
@@ -57,6 +57,7 @@
return ID.NONE;
}
+ @Override
public final XSComponent getSchemaComponent() {
return source;
}
@@ -65,6 +66,8 @@
* @deprecated
* why are you calling an unimplemented method?
*/
+ @Deprecated
+ @Override
public final boolean canBeReferencedByIDREF() {
// we aren't doing any error check in XJC, so no point in implementing this method.
throw new UnsupportedOperationException();
@@ -77,6 +80,7 @@
return null;
}
+ @Override
public CCustomizations getCustomizations() {
return customizations;
}
@@ -86,10 +90,12 @@
return null;
}
+ @Override
public final Locatable getUpstream() {
throw new UnsupportedOperationException();
}
+ @Override
public final Location getLocation() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AutoClassNameAllocator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AutoClassNameAllocator.java
index 746b425..7534471 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AutoClassNameAllocator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/AutoClassNameAllocator.java
@@ -25,12 +25,13 @@
public class AutoClassNameAllocator implements ClassNameAllocator {
private final ClassNameAllocator core;
- private final Map<String,Set<String>> names = new HashMap<String,Set<String>>();
+ private final Map<String,Set<String>> names = new HashMap<>();
public AutoClassNameAllocator(ClassNameAllocator core) {
this.core = core;
}
+ @Override
public String assignClassName(String packageName, String className) {
className = determineName(packageName, className);
if(core!=null)
@@ -41,7 +42,7 @@
private String determineName(String packageName, String className) {
Set<String> s = names.get(packageName);
if(s==null) {
- s = new HashSet<String>();
+ s = new HashSet<>();
names.put(packageName,s);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAdapter.java
index 9a17ce7..5214cbf 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAdapter.java
@@ -63,6 +63,7 @@
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
+ @Override
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CArrayInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CArrayInfo.java
index 65e3303..8501b79 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CArrayInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CArrayInfo.java
@@ -45,39 +45,48 @@
this.typeName = ArrayInfoUtil.calcArrayTypeName(itemType.getTypeName());
}
+ @Override
public CNonElement getItemType() {
return itemType;
}
+ @Override
public QName getTypeName() {
return typeName;
}
+ @Override
public boolean isSimpleType() {
return false;
}
@Deprecated // guaranteed to return this
+ @Override
public CNonElement getInfo() {
return this;
}
+ @Override
public JType toType(Outline o, Aspect aspect) {
return itemType.toType(o,aspect).array();
}
+ @Override
public NType getType() {
return this;
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public String fullName() {
return itemType.getType().fullName()+"[]";
}
+ @Override
public Locator getLocator() {
return Model.EMPTY_LOCATOR;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAttributePropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAttributePropertyInfo.java
index 909b10a..beeac02 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAttributePropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CAttributePropertyInfo.java
@@ -45,10 +45,12 @@
this.attName = attName;
}
+ @Override
public boolean isRequired() {
return isRequired;
}
+ @Override
public QName getXmlName() {
return attName;
}
@@ -57,6 +59,7 @@
* An optional attribute can never be unboxable,
* for we need null to represent the absence.
*/
+ @Override
public boolean isUnboxable() {
if(!isRequired) return false;
return super.isUnboxable();
@@ -67,6 +70,7 @@
return !isRequired && super.isUnboxable();
}
+ @Override
public <V> V accept(CPropertyVisitor<V> visitor) {
return visitor.onAttribute(this);
}
@@ -75,6 +79,7 @@
return visitor.visit(this, p);
}
+ @Override
public final PropertyKind kind() {
return PropertyKind.ATTRIBUTE;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
index 3673752..5b91bd1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
@@ -103,6 +103,7 @@
/**
* Gets the code model representation of this type.
*/
+ @Override
public JType toType(Outline o, Aspect aspect) {
return getType().toType(o,aspect);
}
@@ -112,6 +113,7 @@
* it is never a collection.
*/
@Deprecated
+ @Override
public final boolean isCollection() {
return false;
}
@@ -120,10 +122,12 @@
* Guaranteed to return this.
*/
@Deprecated
+ @Override
public CNonElement getInfo() {
return this;
}
+ @Override
public ID idUse() {
return id;
}
@@ -131,19 +135,23 @@
/**
* {@link CBuiltinLeafInfo} never has a default associated MIME type.
*/
+ @Override
public MimeType getExpectedMimeType() {
return null;
}
@Deprecated
+ @Override
public final CAdapter getAdapterUse() {
return null;
}
+ @Override
public Locator getLocator() {
return Model.EMPTY_LOCATOR;
}
+ @Override
public final XSComponent getSchemaComponent() {
throw new UnsupportedOperationException("TODO. If you hit this, let us know.");
}
@@ -172,6 +180,8 @@
/**
* @deprecated always return false at this level.
*/
+ @Deprecated
+ @Override
public final boolean isElement() {
return false;
}
@@ -179,6 +189,8 @@
/**
* @deprecated always return null at this level.
*/
+ @Deprecated
+ @Override
public final QName getElementName() {
return null;
}
@@ -186,6 +198,8 @@
/**
* @deprecated always return null at this level.
*/
+ @Deprecated
+ @Override
public final Element<NType,NClass> asElement() {
return null;
}
@@ -193,6 +207,7 @@
/**
* A reference to the representation of the type.
*/
+ @Override
public NType getType() {
return type;
}
@@ -213,18 +228,23 @@
* @deprecated
* why are you calling a method whose return value is always known?
*/
+ @Deprecated
+ @Override
public final boolean canBeReferencedByIDREF() {
return false;
}
+ @Override
public QName getTypeName() {
return typeName;
}
+ @Override
public Locatable getUpstream() {
return null;
}
+ @Override
public Location getLocation() {
// this isn't very accurate, but it's not too bad
// doing it correctly need leaves to hold navigator.
@@ -232,6 +252,7 @@
return this;
}
+ @Override
public boolean isSimpleType() {
return true;
}
@@ -241,10 +262,10 @@
* the spec defined built-in binding semantics.
*/
private static abstract class Builtin extends CBuiltinLeafInfo {
- protected Builtin(Class c, String typeName) {
+ protected Builtin(Class<?> c, String typeName) {
this(c,typeName,org.glassfish.jaxb.core.v2.model.core.ID.NONE);
}
- protected Builtin(Class c, String typeName, ID id) {
+ protected Builtin(Class<?> c, String typeName, ID id) {
super(NavigatorImpl.theInstance.ref(c), id, new QName(WellKnownNamespace.XML_SCHEMA,typeName));
LEAVES.put(getType(),this);
}
@@ -252,6 +273,7 @@
/**
* No vendor customization in the built-in classes.
*/
+ @Override
public CCustomizations getCustomizations() {
return CCustomizations.EMPTY;
}
@@ -261,6 +283,7 @@
public NoConstantBuiltin(Class c, String typeName) {
super(c, typeName);
}
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return null;
}
@@ -269,31 +292,36 @@
/**
* All built-in leaves.
*/
- public static final Map<NType,CBuiltinLeafInfo> LEAVES = new HashMap<NType,CBuiltinLeafInfo>();
+ public static final Map<NType,CBuiltinLeafInfo> LEAVES = new HashMap<>();
public static final CBuiltinLeafInfo ANYTYPE = new NoConstantBuiltin(Object.class,"anyType");
public static final CBuiltinLeafInfo STRING = new Builtin(String.class,"string") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(lexical.value);
}
};
public static final CBuiltinLeafInfo BOOLEAN = new Builtin(Boolean.class,"boolean") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(DatatypeConverter.parseBoolean(lexical.value));
}
};
public static final CBuiltinLeafInfo INT = new Builtin(Integer.class,"int") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(DatatypeConverter.parseInt(lexical.value));
}
};
public static final CBuiltinLeafInfo LONG = new Builtin(Long.class,"long") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(DatatypeConverter.parseLong(lexical.value));
}
};
public static final CBuiltinLeafInfo BYTE = new Builtin(Byte.class,"byte") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.cast(
outline.getCodeModel().BYTE,
@@ -301,6 +329,7 @@
}
};
public static final CBuiltinLeafInfo SHORT = new Builtin(Short.class,"short") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.cast(
outline.getCodeModel().SHORT,
@@ -308,16 +337,19 @@
}
};
public static final CBuiltinLeafInfo FLOAT = new Builtin(Float.class,"float") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(DatatypeConverter.parseFloat(lexical.value));
}
};
public static final CBuiltinLeafInfo DOUBLE = new Builtin(Double.class,"double") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.lit(DatatypeConverter.parseDouble(lexical.value));
}
};
public static final CBuiltinLeafInfo QNAME = new Builtin(QName.class,"QName") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
QName qn = DatatypeConverter.parseQName(lexical.value,new NamespaceContextAdapter(lexical));
return JExpr._new(outline.getCodeModel().ref(QName.class))
@@ -333,18 +365,21 @@
public static final CBuiltinLeafInfo DURATION = new NoConstantBuiltin(Duration.class,"duration");
public static final CBuiltinLeafInfo BIG_INTEGER = new Builtin(BigInteger.class,"integer") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr._new(outline.getCodeModel().ref(BigInteger.class)).arg(lexical.value.trim());
}
};
public static final CBuiltinLeafInfo BIG_DECIMAL = new Builtin(BigDecimal.class,"decimal") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr._new(outline.getCodeModel().ref(BigDecimal.class)).arg(lexical.value.trim());
}
};
public static final CBuiltinLeafInfo BASE64_BYTE_ARRAY = new Builtin(byte[].class,"base64Binary") {
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
return outline.getCodeModel().ref(DatatypeConverter.class).staticInvoke("parseBase64Binary").arg(lexical.value);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfo.java
index 1bd08d9..a659635 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfo.java
@@ -86,7 +86,7 @@
private boolean isOrdered = true;
- private final List<CPropertyInfo> properties = new ArrayList<CPropertyInfo>();
+ private final List<CPropertyInfo> properties = new ArrayList<>();
/**
* TODO: revisit this design.
@@ -162,6 +162,7 @@
model.add(this);
}
+ @Override
public boolean hasAttributeWildcard() {
return hasAttributeWildcard;
}
@@ -170,6 +171,7 @@
this.hasAttributeWildcard = hasAttributeWildcard;
}
+ @Override
public boolean hasSubClasses() {
return firstSubclass!=null;
}
@@ -178,6 +180,7 @@
* Returns true if a new attribute wildcard property needs to be
* declared on this class.
*/
+ @Override
public boolean declaresAttributeWildcard() {
return hasAttributeWildcard && !inheritsAttributeWildcard();
}
@@ -186,6 +189,7 @@
* Returns true if this class inherits a wildcard attribute property
* from its ancestor classes.
*/
+ @Override
public boolean inheritsAttributeWildcard() {
if (getRefBaseClass() != null) {
CClassRef cref = (CClassRef)baseClass;
@@ -205,15 +209,18 @@
}
+ @Override
public NClass getClazz() {
return this;
}
+ @Override
public CClassInfo getScope() {
return null;
}
@XmlID
+ @Override
public String getName() {
return fullName();
}
@@ -236,14 +243,17 @@
}
private static final CClassInfoParent.Visitor<String> calcSqueezedName = new Visitor<String>() {
+ @Override
public String onBean(CClassInfo bean) {
- return bean.parent.accept(this)+bean.shortName;
+ return bean.parent.accept(this) + bean.shortName;
}
+ @Override
public String onElement(CElementInfo element) {
- return element.parent.accept(this)+element.shortName();
+ return element.parent.accept(this) + element.shortName();
}
+ @Override
public String onPackage(JPackage pkg) {
return "";
}
@@ -252,10 +262,12 @@
/**
* Returns a mutable list.
*/
+ @Override
public List<CPropertyInfo> getProperties() {
return properties;
}
+ @Override
public boolean hasValueProperty() {
throw new UnsupportedOperationException();
}
@@ -263,6 +275,7 @@
/**
* Gets a propery by name.
*/
+ @Override
public CPropertyInfo getProperty(String name) {
// TODO: does this method need to be fast?
for( CPropertyInfo p : properties )
@@ -271,10 +284,12 @@
return null;
}
+ @Override
public boolean hasProperties() {
return !getProperties().isEmpty();
}
+ @Override
public boolean isElement() {
return elementName!=null;
}
@@ -283,10 +298,12 @@
* Guaranteed to return this.
*/
@Deprecated
+ @Override
public CNonElement getInfo() {
return this;
}
+ @Override
public Element<NType,NClass> asElement() {
if(isElement())
return this;
@@ -294,6 +311,7 @@
return null;
}
+ @Override
public boolean isOrdered() {
return isOrdered;
}
@@ -302,6 +320,8 @@
* @deprecated
* if you are calling this method directly, you must be doing something wrong.
*/
+ @Deprecated
+ @Override
public boolean isFinal() {
return false;
}
@@ -310,14 +330,17 @@
isOrdered = value;
}
+ @Override
public QName getElementName() {
return elementName;
}
+ @Override
public QName getTypeName() {
return typeName;
}
+ @Override
public boolean isSimpleType() {
throw new UnsupportedOperationException();
}
@@ -325,6 +348,7 @@
/**
* Returns the FQCN of this bean.
*/
+ @Override
public String fullName() {
String r = parent.fullName();
if(r.length()==0) return shortName;
@@ -385,6 +409,7 @@
*
* @see #getRefBaseClass()
*/
+ @Override
public CClassInfo getBaseClass() {
if (baseClass instanceof CClassInfo) {
return (CClassInfo) baseClass;
@@ -407,22 +432,27 @@
public Iterator<CClassInfo> listSubclasses() {
return new Iterator<CClassInfo>() {
CClassInfo cur = firstSubclass;
+
+ @Override
public boolean hasNext() {
- return cur!=null;
+ return cur != null;
}
+ @Override
public CClassInfo next() {
CClassInfo r = cur;
cur = cur.nextSibling;
return r;
}
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
+ @Override
public CClassInfo getSubstitutionHead() {
CClassInfo c=getBaseClass();
while(c!=null && !c.isElement())
@@ -439,13 +469,13 @@
public void _implements(JClass c) {
if(_implements==null)
- _implements = new HashSet<JClass>();
+ _implements = new HashSet<>();
_implements.add(c);
}
/** Constructor declarations. array of {@link Constructor}s. */
- private final List<Constructor> constructors = new ArrayList<Constructor>(1);
+ private final List<Constructor> constructors = new ArrayList<>(1);
/** Creates a new constructor declaration and adds it. */
public void addConstructor( String... fieldNames ) {
@@ -457,18 +487,22 @@
return constructors;
}
+ @Override
public final <T> T accept(Visitor<T> visitor) {
return visitor.onBean(this);
}
+ @Override
public JPackage getOwnerPackage() {
return parent.getOwnerPackage();
}
+ @Override
public final NClass getType() {
return this;
}
+ @Override
public final JClass toType(Outline o, Aspect aspect) {
switch(aspect) {
case IMPLEMENTATION:
@@ -480,10 +514,12 @@
}
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public String toString() {
return fullName();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfoParent.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfoParent.java
index 61953d8..0b1da65 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfoParent.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassInfoParent.java
@@ -53,14 +53,17 @@
this.pkg = pkg;
}
+ @Override
public String fullName() {
return pkg.name();
}
+ @Override
public <T> T accept(Visitor<T> visitor) {
return visitor.onPackage(pkg);
}
+ @Override
public JPackage getOwnerPackage() {
return pkg;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassRef.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassRef.java
index 1b77c02..b8bd4d7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassRef.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CClassRef.java
@@ -57,29 +57,35 @@
assert fullyQualifiedClassName!=null;
}
+ @Override
public void setAbstract() {
// assume that the referenced class is marked as abstract to begin with.
}
+ @Override
public boolean isAbstract() {
// no way to find out for sure
return false;
}
+ @Override
public NType getType() {
return this;
}
+ @Override
public JClass toType(Outline o, Aspect aspect) {
if(clazz==null)
clazz = o.getCodeModel().ref(fullyQualifiedClassName);
return clazz;
}
+ @Override
public String fullName() {
return fullyQualifiedClassName;
}
+ @Override
public QName getTypeName() {
return null;
}
@@ -88,6 +94,7 @@
* Guaranteed to return this.
*/
@Deprecated
+ @Override
public CNonElement getInfo() {
return this;
}
@@ -95,22 +102,27 @@
// are these going to bite us?
// we can compute some of them, but not all.
+ @Override
public CElement getSubstitutionHead() {
return null;
}
+ @Override
public CClassInfo getScope() {
return null;
}
+ @Override
public QName getElementName() {
return null;
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public boolean isSimpleType() {
return false;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CCustomizations.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CCustomizations.java
index a782681..3369164 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CCustomizations.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CCustomizations.java
@@ -28,6 +28,7 @@
*/
public final class CCustomizations extends ArrayList<CPluginCustomization> {
+ private static final long serialVersionUID = 7551826676482019240L;
/**
* All {@link CCustomizations} used by a {@link Model} form a single linked list
* so that we can look for unacknowledged customizations later.
@@ -119,10 +120,12 @@
return r;
}
+ @Override
public boolean equals(Object o) {
return this==o;
}
+ @Override
public int hashCode() {
return System.identityHashCode(this);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CDefaultValue.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CDefaultValue.java
index ccc42b9..a7bd6a7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CDefaultValue.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CDefaultValue.java
@@ -32,6 +32,7 @@
*/
public static CDefaultValue create(final TypeUse typeUse, final XmlString defaultValue) {
return new CDefaultValue() {
+ @Override
public JExpression compute(Outline outline) {
return typeUse.createConstant(outline,defaultValue);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementInfo.java
index 980e76b..10038fe 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementInfo.java
@@ -160,10 +160,12 @@
return parent.getOwnerPackage();
}
+ @Override
public CNonElement getContentType() {
return getProperty().ref().get(0);
}
+ @Override
public NType getContentInMemoryType() {
if(getProperty().getAdapter()==null) {
NType itemType = getContentType().getType();
@@ -176,10 +178,12 @@
}
}
+ @Override
public CElementPropertyInfo getProperty() {
return property;
}
+ @Override
public CClassInfo getScope() {
if(parent instanceof CClassInfo)
return (CClassInfo)parent;
@@ -189,14 +193,18 @@
/**
* @deprecated why are you calling a method that returns this?
*/
+ @Deprecated
+ @Override
public NType getType() {
return this;
}
+ @Override
public QName getElementName() {
return tagName;
}
+ @Override
public JType toType(Outline o, Aspect aspect) {
if(className==null)
return type.toType(o,aspect);
@@ -224,10 +232,12 @@
return b.toString();
}
+ @Override
public CElementInfo getSubstitutionHead() {
return substitutionHead;
}
+ @Override
public Collection<CElementInfo> getSubstitutionMembers() {
if(substitutionMembers==null)
return Collections.emptyList();
@@ -246,10 +256,12 @@
substitutionHead.substitutionMembers.add(this);
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public String fullName() {
if(className==null)
return type.fullName();
@@ -260,10 +272,12 @@
}
}
+ @Override
public <T> T accept(Visitor<T> visitor) {
return visitor.onElement(this);
}
+ @Override
public JPackage getOwnerPackage() {
return parent.getOwnerPackage();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementPropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementPropertyInfo.java
index fd313bd..91ceef7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementPropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CElementPropertyInfo.java
@@ -56,12 +56,15 @@
/**
* List of referenced types.
*/
- private final List<CTypeRef> types = new ArrayList<CTypeRef>();
+ private final List<CTypeRef> types = new ArrayList<>();
private final List<CNonElement> ref = new AbstractList<CNonElement>() {
+ @Override
public CNonElement get(int index) {
return getTypes().get(index).getTarget();
}
+
+ @Override
public int size() {
return getTypes().size();
}
@@ -77,18 +80,22 @@
this.isValueList = collection.val;
}
+ @Override
public ID id() {
return id;
}
+ @Override
public List<CTypeRef> getTypes() {
return types;
}
+ @Override
public List<CNonElement> ref() {
return ref;
}
+ @Override
public QName getSchemaType() {
if(types.size()!=1)
// if more than one kind is here, can't produce @XmlSchemaType.
@@ -106,28 +113,34 @@
* XJC never uses the wrapper element. Always return null.
*/
@Deprecated
+ @Override
public QName getXmlName() {
return null;
}
+ @Override
public boolean isCollectionRequired() {
// in XJC, we never recognize a nillable collection pattern, so this is always false.
return false;
}
+ @Override
public boolean isCollectionNillable() {
// in XJC, we never recognize a nillable collection pattern, so this is always false.
return false;
}
+ @Override
public boolean isRequired() {
return required;
}
+ @Override
public boolean isValueList() {
return isValueList;
}
+ @Override
public boolean isUnboxable() {
if(!isCollection() && !required)
// if the property can be legally absent, it's not unboxable
@@ -150,6 +163,7 @@
return !isCollection() && !required && super.isUnboxable();
}
+ @Override
public <V> V accept(CPropertyVisitor<V> visitor) {
return visitor.onElement(this);
}
@@ -159,6 +173,7 @@
return visitor.visit(this, p);
}
+ @Override
public CAdapter getAdapter() {
return adapter;
}
@@ -168,10 +183,12 @@
adapter = a;
}
+ @Override
public final PropertyKind kind() {
return PropertyKind.ELEMENT;
}
+ @Override
public MimeType getExpectedMimeType() {
return expectedMimeType;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumConstant.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumConstant.java
index 8438f8f..bde1a34 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumConstant.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumConstant.java
@@ -51,6 +51,7 @@
this.locator = loc;
}
+ @Override
public CEnumLeafInfo getEnclosingClass() {
return parent;
}
@@ -59,22 +60,27 @@
this.parent = parent;
}
+ @Override
public String getLexicalValue() {
return lexical;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public XSComponent getSchemaComponent() {
return source;
}
+ @Override
public CCustomizations getCustomizations() {
return customizations;
}
+ @Override
public Locator getLocator() {
return locator;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumLeafInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumLeafInfo.java
index a89e719..41e97a5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumLeafInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CEnumLeafInfo.java
@@ -125,14 +125,17 @@
* where this type-safe enum is defined.
* Used to report error messages.
*/
+ @Override
public Locator getLocator() {
return sourceLocator;
}
+ @Override
public QName getTypeName() {
return typeName;
}
+ @Override
public NType getType() {
return this;
}
@@ -141,42 +144,53 @@
* @deprecated
* why are you calling the method whose return value is known?
*/
+ @Deprecated
+ @Override
public boolean canBeReferencedByIDREF() {
return false;
}
+ @Override
public boolean isElement() {
return false;
}
+ @Override
public QName getElementName() {
return null;
}
+ @Override
public Element<NType,NClass> asElement() {
return null;
}
+ @Override
public NClass getClazz() {
return this;
}
+ @Override
public XSComponent getSchemaComponent() {
return source;
}
+ @Override
public JClass toType(Outline o, Aspect aspect) {
return o.getEnum(this).clazz;
}
+ @Override
public boolean isAbstract() {
return false;
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public String fullName() {
return parent.fullName()+'.'+shortName;
}
@@ -185,6 +199,7 @@
return false;
}
+ @Override
public boolean isSimpleType() {
return true;
}
@@ -205,6 +220,7 @@
return false;
}
+ @Override
public JExpression createConstant(Outline outline, XmlString literal) {
// correctly identifying which constant it maps to is hard, so
// here I'm cheating
@@ -217,44 +233,54 @@
}
@Deprecated
+ @Override
public boolean isCollection() {
return false;
}
@Deprecated
+ @Override
public CAdapter getAdapterUse() {
return null;
}
@Deprecated
+ @Override
public CNonElement getInfo() {
return this;
}
+ @Override
public ID idUse() {
return ID.NONE;
}
+ @Override
public MimeType getExpectedMimeType() {
return null;
}
+ @Override
public Collection<CEnumConstant> getConstants() {
return members;
}
+ @Override
public NonElement<NType,NClass> getBaseType() {
return base;
}
+ @Override
public CCustomizations getCustomizations() {
return customizations;
}
+ @Override
public Locatable getUpstream() {
throw new UnsupportedOperationException();
}
+ @Override
public Location getLocation() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CNonElement.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CNonElement.java
index 66c5adf..5d40152 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CNonElement.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CNonElement.java
@@ -28,17 +28,20 @@
* Guaranteed to return this.
*/
@Deprecated
+ @Override
CNonElement getInfo();
/**
* Guaranteed to return false.
*/
@Deprecated
+ @Override
boolean isCollection();
/**
* Guaranteed to return null.
*/
@Deprecated
+ @Override
CAdapter getAdapterUse();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CPropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CPropertyInfo.java
index 132d0f2..3f2dda3 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CPropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CPropertyInfo.java
@@ -123,10 +123,12 @@
customizations.setParent(parent.model,this);
}
+ @Override
public CTypeInfo parent() {
return parent;
}
+ @Override
public Locator getLocator() {
return locator;
}
@@ -139,10 +141,12 @@
* null if the model is built from sources other than XML Schema
* (such as DTD.)
*/
+ @Override
public final XSComponent getSchemaComponent() {
return source;
}
+ @Override
public abstract CAdapter getAdapter();
/**
@@ -169,6 +173,8 @@
*
* @see #getName(boolean)
*/
+ @Deprecated
+ @Override
public String getName() {
return getName(false);
}
@@ -206,15 +212,18 @@
privateName = newName;
}
+ @Override
public String displayName() {
return parent.toString()+'#'+getName(false);
}
+ @Override
public boolean isCollection() {
return isCollection;
}
+ @Override
public abstract Collection<? extends CTypeInfo> ref();
/**
@@ -268,10 +277,12 @@
return false;
}
+ @Override
public CCustomizations getCustomizations() {
return customizations;
}
+ @Override
public boolean inlineBinaryData() {
return inlineBinaryData;
}
@@ -322,10 +333,12 @@
return null;
}
+ @Override
public final <A extends Annotation> A readAnnotation(Class<A> annotationType) {
throw new UnsupportedOperationException();
}
+ @Override
public final boolean hasAnnotation(Class<? extends Annotation> annotationType) {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CReferencePropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CReferencePropertyInfo.java
index 0b75364..6fa1be8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CReferencePropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CReferencePropertyInfo.java
@@ -45,7 +45,7 @@
/**
* List of referenced elements.
*/
- private final Set<CElement> elements = new LinkedHashSet<CElement>();
+ private final Set<CElement> elements = new LinkedHashSet<>();
private final boolean isMixed;
private WildcardMode wildcard;
@@ -63,6 +63,7 @@
this.isMixedExtendedCust = isMixedExtended;
}
+ @Override
public Set<? extends CTypeInfo> ref() {
// if(wildcard==null && !isMixed())
// return getElements();
@@ -109,10 +110,12 @@
return r;
}
+ @Override
public Set<CElement> getElements() {
return elements;
}
+ @Override
public boolean isMixed() {
return isMixed;
}
@@ -133,6 +136,7 @@
* We'll never use a wrapper element in XJC. Always return null.
*/
@Deprecated
+ @Override
public QName getXmlName() {
return null;
}
@@ -152,6 +156,7 @@
return false;
}
+ @Override
public <V> V accept(CPropertyVisitor<V> visitor) {
return visitor.onReference(this);
}
@@ -161,10 +166,12 @@
return visitor.visit(this, p);
}
+ @Override
public CAdapter getAdapter() {
return null;
}
+ @Override
public final PropertyKind kind() {
return PropertyKind.REFERENCE;
}
@@ -173,10 +180,12 @@
* A reference property can never be ID/IDREF because they always point to
* other element classes.
*/
+ @Override
public ID id() {
return ID.NONE;
}
+ @Override
public WildcardMode getWildcard() {
return wildcard;
}
@@ -185,6 +194,7 @@
this.wildcard = mode;
}
+ @Override
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
@@ -193,25 +203,30 @@
return null;
}
+ @Override
public MimeType getExpectedMimeType() {
return null;
}
+ @Override
public boolean isCollectionNillable() {
// in XJC, we never recognize a nillable collection pattern, so this is always false.
return false;
}
+ @Override
public boolean isCollectionRequired() {
// in XJC, we never recognize a nillable collection pattern, so this is always false.
return false;
}
// reference property cannot have a type.
+ @Override
public QName getSchemaType() {
return null;
}
+ @Override
public boolean isRequired() {
return required;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CSingleTypePropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CSingleTypePropertyInfo.java
index fbf514b..ee93142 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CSingleTypePropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CSingleTypePropertyInfo.java
@@ -48,18 +48,22 @@
schemaType = null;
}
+ @Override
public QName getSchemaType() {
return schemaType;
}
+ @Override
public final ID id() {
return type.idUse();
}
+ @Override
public final MimeType getExpectedMimeType() {
return type.getExpectedMimeType();
}
+ @Override
public final List<? extends CTypeInfo> ref() {
return Collections.singletonList(getTarget());
}
@@ -70,6 +74,7 @@
return r;
}
+ @Override
public final CAdapter getAdapter() {
return type.getAdapterUse();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CTypeRef.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CTypeRef.java
index 7832401..7a793b6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CTypeRef.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CTypeRef.java
@@ -106,14 +106,17 @@
this.defaultValue = defaultValue;
}
+ @Override
public CNonElement getTarget() {
return type;
}
+ @Override
public QName getTagName() {
return elementName;
}
+ @Override
public boolean isNillable() {
return nillable;
}
@@ -124,6 +127,7 @@
*
* @see #defaultValue
*/
+ @Override
public String getDefaultValue() {
if(defaultValue!=null)
return defaultValue.value;
@@ -136,6 +140,7 @@
throw new UnsupportedOperationException();
}
+ @Override
public PropertyInfo<NType, NClass> getSource() {
// TODO: implement this method later
throw new UnsupportedOperationException();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CValuePropertyInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CValuePropertyInfo.java
index 32e4d3f..a7eaf87 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CValuePropertyInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CValuePropertyInfo.java
@@ -30,10 +30,12 @@
super(name, type, typeName, source, customizations, locator);
}
+ @Override
public final PropertyKind kind() {
return PropertyKind.VALUE;
}
+ @Override
public <V> V accept(CPropertyVisitor<V> visitor) {
return visitor.onValue(this);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CWildcardTypeInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CWildcardTypeInfo.java
index 0a61680..56f5415 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CWildcardTypeInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CWildcardTypeInfo.java
@@ -35,14 +35,17 @@
public static final CWildcardTypeInfo INSTANCE = new CWildcardTypeInfo();
+ @Override
public JType toType(Outline o, Aspect aspect) {
return o.getCodeModel().ref(Element.class);
}
+ @Override
public NType getType() {
return NavigatorImpl.create(Element.class);
}
+ @Override
public Locator getLocator() {
return Model.EMPTY_LOCATOR;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/ClassNameAllocatorWrapper.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/ClassNameAllocatorWrapper.java
index 6ff1925..bcf6ca1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/ClassNameAllocatorWrapper.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/ClassNameAllocatorWrapper.java
@@ -24,6 +24,7 @@
ClassNameAllocatorWrapper(ClassNameAllocator core) {
if(core==null)
core = new ClassNameAllocator() {
+ @Override
public String assignClassName(String packageName, String className) {
return className;
}
@@ -31,6 +32,7 @@
this.core = core;
}
+ @Override
public String assignClassName(String packageName, String className) {
return core.assignClassName(packageName,className);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/Model.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/Model.java
index 99cbb32..283bf90 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/Model.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/Model.java
@@ -64,25 +64,26 @@
/**
* Generated beans.
*/
- private final Map<NClass,CClassInfo> beans = new LinkedHashMap<NClass,CClassInfo>();
+ private final Map<NClass,CClassInfo> beans = new LinkedHashMap<>();
/**
* Generated enums.
*/
- private final Map<NClass,CEnumLeafInfo> enums = new LinkedHashMap<NClass,CEnumLeafInfo>();
+ private final Map<NClass,CEnumLeafInfo> enums = new LinkedHashMap<>();
/**
* The element mappings.
*/
private final Map<NClass/*scope*/,Map<QName,CElementInfo>> elementMappings =
- new LinkedHashMap<NClass, Map<QName, CElementInfo>>();
+ new LinkedHashMap<>();
private final Iterable<? extends CElementInfo> allElements =
- new Iterable<CElementInfo>() {
- public Iterator<CElementInfo> iterator() {
- return new FlattenIterator<CElementInfo>(elementMappings.values());
- }
- };
+ new Iterable<CElementInfo>() {
+ @Override
+ public Iterator<CElementInfo> iterator() {
+ return new FlattenIterator<>(elementMappings.values());
+ }
+ };
/**
* {@link TypeUse}s for all named types.
@@ -91,7 +92,7 @@
* but this needs to be exposed for JAX-RPC. A reference to a named XML type will be converted into
* a reference to a Java type with annotations.
*/
- private final Map<QName,TypeUse> typeUses = new LinkedHashMap<QName, TypeUse>();
+ private final Map<QName,TypeUse> typeUses = new LinkedHashMap<>();
/**
* {@link NameConverter} to be used.
@@ -135,7 +136,7 @@
this.defaultSymbolSpace = new SymbolSpace(codeModel);
defaultSymbolSpace.setType(codeModel.ref(Object.class));
- elementMappings.put(null, new LinkedHashMap<QName, CElementInfo>());
+ elementMappings.put(null, new LinkedHashMap<>());
if(opts.automaticNameConflictResolution)
allocator = new AutoClassNameAllocator(allocator);
@@ -228,7 +229,7 @@
public final SymbolSpace defaultSymbolSpace;
/** All the defined {@link SymbolSpace}s keyed by their name. */
- private final Map<String,SymbolSpace> symbolSpaces = new HashMap<String,SymbolSpace>();
+ private final Map<String,SymbolSpace> symbolSpaces = new HashMap<>();
public SymbolSpace getSymbolSpace( String name ) {
SymbolSpace ss = symbolSpaces.get(name);
@@ -268,7 +269,7 @@
// check for unused plug-in customizations.
// these can be only checked after the plug-ins run, so it's here.
// the JAXB bindings are checked by XMLSchema's builder.
- Set<CCustomizations> check = new HashSet<CCustomizations>();
+ Set<CCustomizations> check = new HashSet<>();
for( CCustomizations c=customizations; c!=null; c=c.next ) {
if(!check.add(c)) {
throw new AssertionError(); // detect a loop
@@ -311,7 +312,7 @@
* This needs to be filled by the front-end.
*/
public final Map<QName,CClassInfo> createTopLevelBindings() {
- Map<QName,CClassInfo> r = new HashMap<QName,CClassInfo>();
+ Map<QName,CClassInfo> r = new HashMap<>();
for( CClassInfo b : beans().values() ) {
if(b.isElement())
r.put(b.getElementName(),b);
@@ -319,10 +320,12 @@
return r;
}
+ @Override
public Navigator<NType,NClass,Void,Void> getNavigator() {
return NavigatorImpl.theInstance;
}
+ @Override
public CNonElement getTypeInfo(NType type) {
CBuiltinLeafInfo leaf = CBuiltinLeafInfo.LEAVES.get(type);
if(leaf!=null) return leaf;
@@ -330,20 +333,24 @@
return getClassInfo(getNavigator().asDecl(type));
}
+ @Override
public CBuiltinLeafInfo getAnyTypeInfo() {
return CBuiltinLeafInfo.ANYTYPE;
}
+ @Override
public CNonElement getTypeInfo(Ref<NType,NClass> ref) {
// TODO: handle XmlValueList
assert !ref.valueList;
return getTypeInfo(ref.type);
}
+ @Override
public Map<NClass,CClassInfo> beans() {
return beans;
}
+ @Override
public Map<NClass,CEnumLeafInfo> enums() {
return enums;
}
@@ -355,18 +362,22 @@
/**
* No array mapping generation for XJC.
*/
+ @Override
public Map<NType, ? extends CArrayInfo> arrays() {
return Collections.emptyMap();
}
+ @Override
public Map<NType, ? extends CBuiltinLeafInfo> builtins() {
return CBuiltinLeafInfo.LEAVES;
}
+ @Override
public CClassInfo getClassInfo(NClass t) {
return beans.get(t);
}
+ @Override
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
@@ -376,10 +387,12 @@
return elementMappings.get(null).get(name);
}
+ @Override
public Map<QName,CElementInfo> getElementMappings(NClass scope) {
return elementMappings.get(scope);
}
+ @Override
public Iterable<? extends CElementInfo> getAllElements() {
return allElements;
}
@@ -388,6 +401,8 @@
* @deprecated
* Always return null. Perhaps you are interested in {@link #schemaComponent}?
*/
+ @Deprecated
+ @Override
public XSComponent getSchemaComponent() {
return null;
}
@@ -396,6 +411,8 @@
* @deprecated
* No line number available for the "root" component.
*/
+ @Deprecated
+ @Override
public Locator getLocator() {
LocatorImpl r = new LocatorImpl();
r.setLineNumber(-1);
@@ -406,6 +423,7 @@
/**
* Gets the global customizations.
*/
+ @Override
public CCustomizations getCustomizations() {
return globalCustomizations;
}
@@ -413,22 +431,27 @@
/**
* Not implemented in the compile-time model.
*/
+ @Override
public Map<String, String> getXmlNs(String namespaceUri) {
return Collections.emptyMap();
}
+ @Override
public Map<String, String> getSchemaLocations() {
return Collections.emptyMap();
}
+ @Override
public XmlNsForm getElementFormDefault(String nsUri) {
throw new UnsupportedOperationException();
}
+ @Override
public XmlNsForm getAttributeFormDefault(String nsUri) {
throw new UnsupportedOperationException();
}
+ @Override
public void dump(Result out) {
// TODO
throw new UnsupportedOperationException();
@@ -449,12 +472,12 @@
Map<QName,CElementInfo> m = elementMappings.get(clazz);
if(m==null)
- elementMappings.put(clazz, m = new LinkedHashMap<QName, CElementInfo>());
+ elementMappings.put(clazz, m = new LinkedHashMap<>());
m.put(ei.getElementName(),ei);
}
- private final Map<JPackage,CClassInfoParent.Package> cache = new HashMap<JPackage,CClassInfoParent.Package>();
+ private final Map<JPackage,CClassInfoParent.Package> cache = new HashMap<>();
public CClassInfoParent.Package getPackage(JPackage pkg) {
CClassInfoParent.Package r = cache.get(pkg);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/SymbolSpace.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/SymbolSpace.java
index fb059d3..ef6ba09 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/SymbolSpace.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/SymbolSpace.java
@@ -58,6 +58,7 @@
this.type = _type;
}
+ @Override
public String toString() {
if(type==null) return "undetermined";
else return type.name();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/TypeUseImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/TypeUseImpl.java
index 84fbf07..ffc180e 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/TypeUseImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/TypeUseImpl.java
@@ -43,26 +43,32 @@
this.adapter = adapter;
}
+ @Override
public boolean isCollection() {
return collection;
}
+ @Override
public CNonElement getInfo() {
return coreType;
}
+ @Override
public CAdapter getAdapterUse() {
return adapter;
}
+ @Override
public ID idUse() {
return id;
}
+ @Override
public MimeType getExpectedMimeType() {
return expectedMimeType;
}
+ @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof TypeUseImpl)) return false;
@@ -77,6 +83,7 @@
return true;
}
+ @Override
public int hashCode() {
int result;
result = (coreType != null ? coreType.hashCode() : 0);
@@ -86,6 +93,7 @@
}
+ @Override
public JExpression createConstant(Outline outline, XmlString lexical) {
if(isCollection()) return null;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNClass.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNClass.java
index 3ca0eaa..48b1ae7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNClass.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNClass.java
@@ -22,9 +22,9 @@
* @author Kohsuke Kawaguchi
*/
public class EagerNClass extends EagerNType implements NClass {
- /*package*/ final Class c;
+ /*package*/ final Class<?> c;
- public EagerNClass(Class type) {
+ public EagerNClass(Class<?> type) {
super(type);
this.c = type;
}
@@ -39,11 +39,12 @@
return o.getCodeModel().ref(c);
}
+ @Override
public boolean isAbstract() {
return Modifier.isAbstract(c.getModifiers());
}
- private static final Set<Class> boxedTypes = new HashSet<Class>();
+ private static final Set<Class<?>> boxedTypes = new HashSet<>();
static {
boxedTypes.add(Boolean.class);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNType.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNType.java
index 5aad810..26f5c64 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNType.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/EagerNType.java
@@ -27,6 +27,7 @@
assert t!=null;
}
+ @Override
public JType toType(Outline o, Aspect aspect) {
try {
return o.getCodeModel().parseType(t.toString());
@@ -35,6 +36,7 @@
}
}
+ @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof EagerNType)) return false;
@@ -44,14 +46,17 @@
return t.equals(eagerNType.t);
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public int hashCode() {
return t.hashCode();
}
+ @Override
public String fullName() {
return Utils.REFLECTION_NAVIGATOR.getTypeName(t);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClass.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClass.java
index 65348ad..6836fe8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClass.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClass.java
@@ -18,6 +18,7 @@
* @author Kohsuke Kawaguchi
*/
public interface NClass extends NType {
+ @Override
JClass toType(Outline o, Aspect aspect);
boolean isAbstract();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClassByJClass.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClassByJClass.java
index b6999a0..fb1bfe1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClassByJClass.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NClassByJClass.java
@@ -24,18 +24,22 @@
this.clazz = clazz;
}
+ @Override
public JClass toType(Outline o, Aspect aspect) {
return clazz;
}
+ @Override
public boolean isAbstract() {
return clazz.isAbstract();
}
+ @Override
public boolean isBoxedType() {
return clazz.getPrimitiveType()!=null;
}
+ @Override
public String fullName() {
return clazz.fullName();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NParameterizedType.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NParameterizedType.java
index 1794024..bda46b0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NParameterizedType.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NParameterizedType.java
@@ -30,6 +30,7 @@
assert args.length>0;
}
+ @Override
public JClass toType(Outline o, Aspect aspect) {
JClass r = rawType.toType(o,aspect);
@@ -39,15 +40,18 @@
return r;
}
+ @Override
public boolean isAbstract() {
return rawType.isAbstract();
}
+ @Override
public boolean isBoxedType() {
return false;
}
+ @Override
public String fullName() {
StringBuilder buf = new StringBuilder();
buf.append(rawType.fullName());
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NavigatorImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NavigatorImpl.java
index 48f8461..8cce5d1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NavigatorImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/NavigatorImpl.java
@@ -32,10 +32,12 @@
private NavigatorImpl() {
}
+ @Override
public NClass getSuperClass(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getBaseClass(NType nt, NClass base) {
if(nt instanceof EagerNType) {
EagerNType ent = (EagerNType) nt;
@@ -57,70 +59,87 @@
throw new UnsupportedOperationException();
}
+ @Override
public String getClassName(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public String getTypeName(NType type) {
return type.fullName();
}
+ @Override
public String getClassShortName(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public Collection<? extends Void> getDeclaredFields(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public Void getDeclaredField(NClass clazz, String fieldName) {
throw new UnsupportedOperationException();
}
+ @Override
public Collection<? extends Void> getDeclaredMethods(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public NClass getDeclaringClassForField(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public NClass getDeclaringClassForMethod(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getFieldType(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public String getFieldName(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public String getMethodName(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getReturnType(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public NType[] getMethodParameters(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isStaticMethod(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isFinalMethod(Void aVoid) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isSubClassOf(NType sub, NType sup) {
throw new UnsupportedOperationException();
}
+ @Override
public NClass ref(Class c) {
return create(c);
}
@@ -130,10 +149,12 @@
return new NClassByJClass(c);
}
+ @Override
public NType use(NClass nc) {
return nc;
}
+ @Override
public NClass asDecl(NType nt) {
if(nt instanceof NClass)
return (NClass)nt;
@@ -141,23 +162,28 @@
return null;
}
+ @Override
public NClass asDecl(Class c) {
return ref(c);
}
+ @Override
public boolean isArray(NType nType) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isArrayButNotByteArray(NType t) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getComponentType(NType nType) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getTypeArgument(NType nt, int i) {
if (nt instanceof EagerNType) {
EagerNType ent = (EagerNType) nt;
@@ -171,6 +197,7 @@
throw new UnsupportedOperationException();
}
+ @Override
public boolean isParameterizedType(NType nt) {
if (nt instanceof EagerNType) {
EagerNType ent = (EagerNType) nt;
@@ -184,10 +211,12 @@
throw new UnsupportedOperationException();
}
+ @Override
public boolean isPrimitive(NType type) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getPrimitive(Class primitiveType) {
return create(primitiveType);
}
@@ -218,6 +247,7 @@
return new NParameterizedType(create(rawType),args);
}
+ @Override
public Location getClassLocation(final NClass c) {
// not really needed for XJC but doesn't hurt to have one
return new Location() {
@@ -228,34 +258,42 @@
};
}
+ @Override
public Location getFieldLocation(Void v) {
throw new IllegalStateException();
}
+ @Override
public Location getMethodLocation(Void v) {
throw new IllegalStateException();
}
+ @Override
public boolean hasDefaultConstructor(NClass nClass) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isStaticField(Void aVoid) {
throw new IllegalStateException();
}
+ @Override
public boolean isPublicMethod(Void aVoid) {
throw new IllegalStateException();
}
+ @Override
public boolean isPublicField(Void aVoid) {
throw new IllegalStateException();
}
+ @Override
public boolean isEnum(NClass c) {
return isSubClassOf(c,create(Enum.class));
}
+ @Override
public <T> NType erasure(NType type) {
if(type instanceof NParameterizedType) {
NParameterizedType pt = (NParameterizedType) type;
@@ -264,6 +302,7 @@
return type;
}
+ @Override
public boolean isAbstract(NClass clazz) {
return clazz.isAbstract();
}
@@ -272,18 +311,23 @@
* @deprecated
* no class generated by XJC is final.
*/
+ @Deprecated
+ @Override
public boolean isFinal(NClass clazz) {
return false;
}
+ @Override
public Void[] getEnumConstants(NClass clazz) {
throw new UnsupportedOperationException();
}
+ @Override
public NType getVoidType() {
return ref(void.class);
}
+ @Override
public String getPackageName(NClass clazz) {
// TODO: implement this method later
throw new UnsupportedOperationException();
@@ -294,22 +338,27 @@
throw new UnsupportedOperationException();
}
+ @Override
public boolean isBridgeMethod(Void method) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isOverriding(Void method,NClass clazz) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isInterface(NClass clazz) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isTransient(Void f) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean isInnerClass(NClass clazz) {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/Utils.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/Utils.java
index b31df34..f5e662a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/Utils.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/nav/Utils.java
@@ -35,11 +35,11 @@
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
- static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
+ static final Navigator<Type, Class<?>, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
try {
- final Class refNav = Class.forName("org.glassfish.jaxb.core.v2.model.nav.ReflectionNavigator");
+ final Class<?> refNav = Class.forName("org.glassfish.jaxb.core.v2.model.nav.ReflectionNavigator");
// requires accessClassInPackage privilege
final Method getInstance = AccessController.doPrivileged(
@@ -58,7 +58,7 @@
);
//noinspection unchecked
- REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
+ REFLECTION_NAVIGATOR = (Navigator<Type, Class<?>, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/EnumOutline.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/EnumOutline.java
index ca4e038..69996d3 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/EnumOutline.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/EnumOutline.java
@@ -41,7 +41,7 @@
/**
* Constants.
*/
- public final List<EnumConstantOutline> constants = new ArrayList<EnumConstantOutline>();
+ public final List<EnumConstantOutline> constants = new ArrayList<>();
/**
* {@link PackageOutline} that contains this class.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/Outline.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/Outline.java
index ed78221..b3fe880 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/Outline.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/outline/Outline.java
@@ -113,5 +113,5 @@
* Copies the specified class into the user's package and returns
* a reference to it.
*/
- JClass addRuntime(Class clazz);
+ JClass addRuntime(Class<?> clazz);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
index 4c11c3f..e565fb3 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
@@ -38,9 +38,9 @@
/**
* Set of namespace URIs that designates enabled extensions.
*/
- protected final Set<String> enabledExtensions = new HashSet<String>();
+ protected final Set<String> enabledExtensions = new HashSet<>();
- private final Set<String> recognizableExtensions = new HashSet<String>();
+ private final Set<String> recognizableExtensions = new HashSet<>();
private Locator locator;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/ModelChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/ModelChecker.java
index a820234..eefad7d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/ModelChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/ModelChecker.java
@@ -43,7 +43,7 @@
private void check( CClassInfo ci ) {
List<CPropertyInfo> props = ci.getProperties();
- Map<QName,CPropertyInfo> collisionTable = new HashMap<QName,CPropertyInfo>();
+ Map<QName,CPropertyInfo> collisionTable = new HashMap<>();
OUTER:
for( int i=0; i<props.size(); i++ ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/RawTypeSet.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/RawTypeSet.java
index 8680cba..5b32989 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/RawTypeSet.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/RawTypeSet.java
@@ -114,7 +114,7 @@
* (because of a possible ambiguity).
*/
private Mode canBeTypeRefs() {
- Set<NType> types = new HashSet<NType>();
+ Set<NType> types = new HashSet<>();
collectionMode = mul.isAtMostOnce()?NOT_REPEATED:REPEATED_ELEMENT;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/Ring.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/Ring.java
index 62d7b18..0831b58 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/Ring.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/Ring.java
@@ -48,9 +48,9 @@
*/
public final class Ring {
- private final Map<Class,Object> components = new HashMap<Class,Object>();
+ private final Map<Class,Object> components = new HashMap<>();
- private static final ThreadLocal<Ring> instances = new ThreadLocal<Ring>();
+ private static final ThreadLocal<Ring> instances = new ThreadLocal<>();
private Ring() {}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/TypeUtil.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/TypeUtil.java
index acd3cd7..9d5cb8b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/TypeUtil.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/TypeUtil.java
@@ -58,7 +58,7 @@
*/
public static JType getCommonBaseType(JCodeModel codeModel, JType... t) {
// first, eliminate duplicates.
- Set<JType> uniqueTypes = new TreeSet<JType>(typeComparator);
+ Set<JType> uniqueTypes = new TreeSet<>(typeComparator);
for (JType type : t)
uniqueTypes.add(type);
@@ -126,7 +126,7 @@
return result;
// for each uniqueType we store the list of base type parameterization
- List<List<JClass>> parameters = new ArrayList<List<JClass>>(uniqueTypes.size());
+ List<List<JClass>> parameters = new ArrayList<>(uniqueTypes.size());
int paramLen = -1;
for (JType type : uniqueTypes) {
@@ -148,8 +148,8 @@
paramLen = tp.size();
}
- List<JClass> paramResult = new ArrayList<JClass>();
- List<JClass> argList = new ArrayList<JClass>(parameters.size());
+ List<JClass> paramResult = new ArrayList<>();
+ List<JClass> argList = new ArrayList<>(parameters.size());
// for each type parameter compute the common base type
for( int i=0; i<paramLen; i++ ) {
argList.clear();
@@ -187,7 +187,7 @@
}
private static Set<JClass> getAssignableTypes( JClass t ) {
- Set<JClass> r = new TreeSet<JClass>(typeComparator);
+ Set<JClass> r = new TreeSet<>(typeComparator);
getAssignableTypes(t,r);
return r;
}
@@ -244,6 +244,7 @@
* Compares {@link JType} objects by their names.
*/
private static final Comparator<JType> typeComparator = new Comparator<JType>() {
+ @Override
public int compare(JType t1, JType t2) {
return t1.fullName().compareTo(t2.fullName());
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Block.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Block.java
index 7346348..42367ba 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Block.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Block.java
@@ -26,7 +26,7 @@
* We want to preserve the order they are added, but we don't want
* dupliates.
*/
- final Set<Element> elements = new LinkedHashSet<Element>();
+ final Set<Element> elements = new LinkedHashSet<>();
Block(boolean optional, boolean repeated) {
isOptional = optional;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
index ddc5339..f5ad8c0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
@@ -80,12 +80,12 @@
/**
* List of attribute properties on this element
*/
- final List<CPropertyInfo> attributes = new ArrayList<CPropertyInfo>();
+ final List<CPropertyInfo> attributes = new ArrayList<>();
/**
* Normalized blocks of the content model.
*/
- private final List<Block> normalizedBlocks = new ArrayList<Block>();
+ private final List<Block> normalizedBlocks = new ArrayList<>();
/**
* True if this element needs to be a class.
@@ -230,11 +230,11 @@
}
// normalize
- List<Block> n = new ArrayList<Block>();
+ List<Block> n = new ArrayList<>();
contentModel.normalize(n,false);
{// check collision among Blocks
- Set<String> names = new HashSet<String>();
+ Set<String> names = new HashSet<>();
boolean collision = false;
OUTER:
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/ModelGroup.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/ModelGroup.java
index bd98cd9..9c22cc2 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/ModelGroup.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/ModelGroup.java
@@ -26,8 +26,9 @@
Kind kind;
- private final List<Term> terms = new ArrayList<Term>();
+ private final List<Term> terms = new ArrayList<>();
+ @Override
void normalize(List<Block> r, boolean optional) {
switch(kind) {
case SEQUENCE:
@@ -42,11 +43,13 @@
}
}
+ @Override
void addAllElements(Block b) {
for( Term t : terms )
t.addAllElements(b);
}
+ @Override
boolean isOptional() {
switch(kind) {
case SEQUENCE:
@@ -64,6 +67,7 @@
}
}
+ @Override
boolean isRepeated() {
switch(kind) {
case SEQUENCE:
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Occurence.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Occurence.java
index 1421287..6fe7c65 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Occurence.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Occurence.java
@@ -44,6 +44,7 @@
}
}
+ @Override
void normalize(List<Block> r, boolean optional) {
if(isRepeated) {
Block b = new Block(isOptional||optional,true);
@@ -54,14 +55,17 @@
}
}
+ @Override
void addAllElements(Block b) {
term.addAllElements(b);
}
+ @Override
boolean isOptional() {
return isOptional||term.isOptional();
}
+ @Override
boolean isRepeated() {
return isRepeated||term.isRepeated();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/TDTDReader.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/TDTDReader.java
index 7be7c32..f35f6fa 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/TDTDReader.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/TDTDReader.java
@@ -151,12 +151,14 @@
/**
* Element name to its content model definition.
*/
- private final Map<String,Element> elements = new HashMap<String,Element>();
+ private final Map<String,Element> elements = new HashMap<>();
+ @Override
public void startDTD(InputEntity entity) throws SAXException {
}
+ @Override
public void endDTD() throws SAXException {
// bind them all.
@@ -191,16 +193,17 @@
private void processInterfaceDeclarations() {
- Map<String,InterfaceAcceptor> fromName = new HashMap<String,InterfaceAcceptor>();
+ Map<String,InterfaceAcceptor> fromName = new HashMap<>();
// first, create empty InterfaceItem declaration for all interfaces
- Map<BIInterface,JClass> decls = new HashMap<BIInterface,JClass>();
+ Map<BIInterface,JClass> decls = new HashMap<>();
for( BIInterface decl : bindInfo.interfaces() ) {
final JDefinedClass intf = classFactory.createInterface(
bindInfo.getTargetPackage(), decl.name(), copyLocator() );
decls.put(decl,intf);
fromName.put(decl.name(),new InterfaceAcceptor() {
+ @Override
public void implement(JClass c) {
intf._implements(c);
}
@@ -209,6 +212,7 @@
for( final CClassInfo ci : model.beans().values() ) {
fromName.put(ci.getName(),new InterfaceAcceptor() {
+ @Override
public void implement(JClass c) {
ci._implements(c);
}
@@ -274,6 +278,7 @@
}
}
+ @Override
public void attributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) throws SAXException {
getOrCreateElement(elementName).attributes.add(
createAttribute(elementName, attributeName, attributeType, enumeration, attributeUse, defaultValue)
@@ -329,11 +334,13 @@
}
+ @Override
public void startContentModel(String elementName, short contentModelType) throws SAXException {
assert modelGroups.isEmpty();
modelGroups.push(new ModelGroup());
}
+ @Override
public void endContentModel(String elementName, short contentModelType) throws SAXException {
assert modelGroups.size()==1;
Term term = modelGroups.pop().wrapUp();
@@ -343,17 +350,20 @@
}
- private final Stack<ModelGroup> modelGroups = new Stack<ModelGroup>();
+ private final Stack<ModelGroup> modelGroups = new Stack<>();
+ @Override
public void startModelGroup() throws SAXException {
modelGroups.push(new ModelGroup());
}
+ @Override
public void endModelGroup(short occurence) throws SAXException {
Term t = Occurence.wrap( modelGroups.pop().wrapUp(), occurence );
modelGroups.peek().addTerm(t);
}
+ @Override
public void connector(short connectorType) throws SAXException {
modelGroups.peek().setKind(connectorType);
}
@@ -361,6 +371,7 @@
// TODO: for now, we just ignore all the content model specification
// and treat it as (A,B,C,....)
+ @Override
public void childElement(String elementName, short occurence) throws SAXException {
Element child = getOrCreateElement(elementName);
modelGroups.peek().addTerm( Occurence.wrap( child, occurence ) );
@@ -379,6 +390,7 @@
*/
private Locator locator;
+ @Override
public void setDocumentLocator(Locator loc) {
this.locator = loc;
}
@@ -407,7 +419,7 @@
// note that although xs:token and xs:normalizedString are not
// specified in the spec, they need to be here because they
// have different whitespace normalization semantics.
- Map<String,TypeUse> m = new HashMap<String,TypeUse>();
+ Map<String,TypeUse> m = new HashMap<>();
m.put("CDATA", CBuiltinLeafInfo.NORMALIZED_STRING);
m.put("ENTITY", CBuiltinLeafInfo.TOKEN);
@@ -428,14 +440,17 @@
// error related utility methods
//
//
+ @Override
public void error(SAXParseException e) throws SAXException {
errorReceiver.error(e);
}
+ @Override
public void fatalError(SAXParseException e) throws SAXException {
errorReceiver.fatalError(e);
}
+ @Override
public void warning(SAXParseException e) throws SAXException {
errorReceiver.warning(e);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Term.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Term.java
index 3e32ddd..1d5d27f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Term.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Term.java
@@ -30,16 +30,20 @@
* This special term is only used to represent #PCDATA-only content model.
*/
static final Term EMPTY = new Term() {
+ @Override
void normalize(List<Block> r, boolean optional) {
}
+ @Override
void addAllElements(Block b) {
}
+ @Override
boolean isOptional() {
return false;
}
+ @Override
boolean isRepeated() {
return false;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIConstructor.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIConstructor.java
index c944599..7944dc9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIConstructor.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIConstructor.java
@@ -40,7 +40,7 @@
StringTokenizer tokens = new StringTokenizer(
DOMUtil.getAttribute(_node,"properties"));
- List<String> vec = new ArrayList<String>();
+ List<String> vec = new ArrayList<>();
while(tokens.hasMoreTokens())
vec.add(tokens.nextToken());
properties = vec.toArray(new String[0]);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIElement.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIElement.java
index 8eb13af..4cf2d44 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIElement.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIElement.java
@@ -120,10 +120,10 @@
* <p>
* This vector will be empty if no content-property declaration is made.
*/
- private final List<BIContent> contents = new ArrayList<BIContent>();
+ private final List<BIContent> contents = new ArrayList<>();
/** Conversion declarations. */
- private final Map<String,BIConversion> conversions = new HashMap<String,BIConversion>();
+ private final Map<String,BIConversion> conversions = new HashMap<>();
/**
* The "rest" content-property declaration.
@@ -133,10 +133,10 @@
private BIContent rest;
/** Attribute-property declarations. */
- private final Map<String,BIAttribute> attributes = new HashMap<String,BIAttribute>();
+ private final Map<String,BIAttribute> attributes = new HashMap<>();
/** Constructor declarations. */
- private final List<BIConstructor> constructors = new ArrayList<BIConstructor>();
+ private final List<BIConstructor> constructors = new ArrayList<>();
/**
* the class which is generated by this declaration.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIEnumeration.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIEnumeration.java
index 7923eef..9ab6ecb 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIEnumeration.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIEnumeration.java
@@ -39,9 +39,11 @@
private final TypeUse xducer;
+ @Override
public String name() { return DOMUtil.getAttribute(e,"name"); }
/** Returns a transducer for this enumeration declaration. */
+ @Override
public TypeUse getTransducer() { return xducer; }
@@ -80,7 +82,7 @@
}
private static List<CEnumConstant> buildMemberList( Model model, Element dom ) {
- List<CEnumConstant> r = new ArrayList<CEnumConstant>();
+ List<CEnumConstant> r = new ArrayList<>();
String members = DOMUtil.getAttribute(dom,"members");
if(members==null) members=""; // TODO: error handling
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIUserConversion.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIUserConversion.java
index 9ad1370..d04edb8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIUserConversion.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BIUserConversion.java
@@ -100,9 +100,11 @@
}
/** Gets the conversion name. */
+ @Override
public String name() { return DOMUtil.getAttribute(e,"name"); }
/** Gets a transducer for this conversion. */
+ @Override
public TypeUse getTransducer() {
String ws = DOMUtil.getAttribute(e,"whitespace");
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BindInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BindInfo.java
index b19baec..cdb3a2f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BindInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/BindInfo.java
@@ -118,13 +118,13 @@
private final Element dom;
/** Conversion declarations. */
- private final Map<String,BIConversion> conversions = new HashMap<String,BIConversion>();
+ private final Map<String,BIConversion> conversions = new HashMap<>();
/** Element declarations keyed by names. */
- private final Map<String,BIElement> elements = new HashMap<String,BIElement>();
+ private final Map<String,BIElement> elements = new HashMap<>();
/** interface declarations keyed by names. */
- private final Map<String,BIInterface> interfaces = new HashMap<String,BIInterface>();
+ private final Map<String,BIInterface> interfaces = new HashMap<>();
/** XJC extension namespace. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMLocator.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMLocator.java
index 3ff1bb1..068ba27 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMLocator.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMLocator.java
@@ -39,16 +39,20 @@
return null; // no location information
return new Locator(){
+ @Override
public int getLineNumber() {
return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,line));
}
+ @Override
public int getColumnNumber() {
return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,column));
}
+ @Override
public String getSystemId() {
return DOMUtil.getAttribute(e,locationNamespace,systemId);
}
// we are not interested in PUBLIC ID.
+ @Override
public String getPublicId() { return null; }
};
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMUtil.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMUtil.java
index 7a9bb17..3a2141b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMUtil.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DOMUtil.java
@@ -67,7 +67,7 @@
}
public static List<Element> getChildElements(Element e) {
- List<Element> r = new ArrayList<Element>();
+ List<Element> r = new ArrayList<>();
NodeList l = e.getChildNodes();
for(int i=0;i<l.getLength();i++) {
Node n = l.item(i);
@@ -78,7 +78,7 @@
}
public static List<Element> getChildElements(Element e,String localName) {
- List<Element> r = new ArrayList<Element>();
+ List<Element> r = new ArrayList<>();
NodeList l = e.getChildNodes();
for(int i=0;i<l.getLength();i++) {
Node n = l.item(i);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java
index 9349184..7a6a0d7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java
@@ -54,6 +54,7 @@
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts)
throws SAXException {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Choice.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Choice.java
index d4d0f9e..f0abb5e 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Choice.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Choice.java
@@ -35,19 +35,23 @@
this.isNullable = lhs.isNullable() || rhs.isNullable();
}
+ @Override
boolean isNullable() {
return isNullable;
}
+ @Override
ElementSet lastSet() {
return ElementSets.union(lhs.lastSet(),rhs.lastSet());
}
+ @Override
void buildDAG(ElementSet incoming) {
lhs.buildDAG(incoming);
rhs.buildDAG(incoming);
}
+ @Override
public String toString() {
return '('+lhs.toString()+'|'+rhs.toString()+')';
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ConnectedComponent.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ConnectedComponent.java
index 5874b00..238084b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ConnectedComponent.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ConnectedComponent.java
@@ -24,7 +24,7 @@
/**
* {@link Element}s that belong to this component.
*/
- private final List<Element> elements = new ArrayList<Element>();
+ private final List<Element> elements = new ArrayList<>();
/*package*/ boolean isRequired;
@@ -65,6 +65,7 @@
elements.add(e);
}
+ @Override
public Iterator<Element> iterator() {
return elements.iterator();
}
@@ -72,6 +73,7 @@
/**
* Just produces debug representation
*/
+ @Override
public String toString() {
String s = elements.toString();
if(isRequired())
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Element.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Element.java
index c139061..ac5b2f0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Element.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Element.java
@@ -37,8 +37,8 @@
* we represent an edge e1 -> e2 by {@code e1.foreEdges.contains(e2)}
* and {@code e2.backEdges.contains(e1)}.
*/
- final Set<Element> foreEdges = new LinkedHashSet<Element>();
- final Set<Element> backEdges = new LinkedHashSet<Element>();
+ final Set<Element> foreEdges = new LinkedHashSet<>();
+ final Set<Element> backEdges = new LinkedHashSet<>();
/**
* Previous element in the DFS post-order traveral
@@ -62,10 +62,12 @@
protected Element() {
}
+ @Override
ElementSet lastSet() {
return this;
}
+ @Override
boolean isNullable() {
return false;
}
@@ -84,15 +86,18 @@
return false;
}
+ @Override
void buildDAG(ElementSet incoming) {
incoming.addNext(this);
}
+ @Override
public void addNext(Element element) {
foreEdges.add(element);
element.backEdges.add(this);
}
+ @Override
public boolean contains(ElementSet rhs) {
return this==rhs || rhs==ElementSet.EMPTY_SET;
}
@@ -103,6 +108,8 @@
* @deprecated
* if you statically call this method, there's something wrong.
*/
+ @Deprecated
+ @Override
public Iterator<Element> iterator() {
return Collections.singleton(this).iterator();
}
@@ -133,7 +140,7 @@
public void buildStronglyConnectedComponents(List<ConnectedComponent> ccs) {
// store visited elements - loop detection
- List<Element> visitedElements = new ArrayList<Element>();
+ List<Element> visitedElements = new ArrayList<>();
for(Element cur=this; cur!=cur.prevPostOrder; cur=cur.prevPostOrder) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSet.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSet.java
index 78724e6..51e9523 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSet.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSet.java
@@ -25,14 +25,17 @@
void addNext(Element element);
public static final ElementSet EMPTY_SET = new ElementSet() {
+ @Override
public void addNext(Element element) {
// noop
}
+ @Override
public boolean contains(ElementSet element) {
return this==element;
}
+ @Override
public Iterator<Element> iterator() {
return Collections.<Element>emptySet().iterator();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSets.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSets.java
index b6f09bd..17994b4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSets.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/ElementSets.java
@@ -56,11 +56,13 @@
}
}
+ @Override
public boolean contains(ElementSet rhs) {
// this isn't complete but sound
return super.contains(rhs) || rhs==ElementSet.EMPTY_SET;
}
+ @Override
public void addNext(Element element) {
for (Element e : this)
e.addNext(element);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Expression.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Expression.java
index fdb6e3c..76c2100 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Expression.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Expression.java
@@ -38,18 +38,22 @@
* {@link Expression} that represents epsilon, the length-0 string.
*/
public static final Expression EPSILON = new Expression() {
+ @Override
ElementSet lastSet() {
return ElementSet.EMPTY_SET;
}
+ @Override
boolean isNullable() {
return true;
}
+ @Override
void buildDAG(ElementSet incoming) {
// noop
}
+ @Override
public String toString() {
return "-";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Graph.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Graph.java
index d8dbc60..ef7ffb2 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Graph.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Graph.java
@@ -28,7 +28,7 @@
/**
* Strongly connected components of this graph.
*/
- private final List<ConnectedComponent> ccs = new ArrayList<ConnectedComponent>();
+ private final List<ConnectedComponent> ccs = new ArrayList<>();
/**
* Builds a {@link Graph} from an {@link Expression} tree.
@@ -51,7 +51,7 @@
source.buildStronglyConnectedComponents(ccs);
// cut-set check
- Set<Element> visited = new HashSet<Element>();
+ Set<Element> visited = new HashSet<>();
for (ConnectedComponent cc : ccs) {
visited.clear();
if(source.checkCutSet(cc,visited)) {
@@ -63,10 +63,12 @@
/**
* List up {@link ConnectedComponent}s of this graph in an order.
*/
+ @Override
public Iterator<ConnectedComponent> iterator() {
return ccs.iterator();
}
+ @Override
public String toString() {
return ccs.toString();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/OneOrMore.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/OneOrMore.java
index 3a510cf..db42b14 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/OneOrMore.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/OneOrMore.java
@@ -25,18 +25,22 @@
this.child = child;
}
+ @Override
ElementSet lastSet() {
return child.lastSet();
}
+ @Override
boolean isNullable() {
return child.isNullable();
}
+ @Override
void buildDAG(ElementSet incoming) {
child.buildDAG(ElementSets.union(incoming,child.lastSet()));
}
+ @Override
public String toString() {
return child.toString()+'+';
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Sequence.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Sequence.java
index fc09fa8..fbc0642 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Sequence.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/Sequence.java
@@ -42,6 +42,7 @@
isNullable = lhs.isNullable() && rhs.isNullable();
}
+ @Override
ElementSet lastSet() {
if(lastSet==null) {
if(rhs.isNullable())
@@ -52,10 +53,12 @@
return lastSet;
}
+ @Override
boolean isNullable() {
return isNullable;
}
+ @Override
void buildDAG(ElementSet incoming) {
lhs.buildDAG(incoming);
if(lhs.isNullable())
@@ -64,6 +67,7 @@
rhs.buildDAG(lhs.lastSet());
}
+ @Override
public String toString() {
return '('+lhs.toString()+','+rhs.toString()+')';
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SinkNode.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SinkNode.java
index d05b3a0..f35592f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SinkNode.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SinkNode.java
@@ -15,6 +15,7 @@
* @author Kohsuke Kawaguchi
*/
public final class SinkNode extends Element {
+ @Override
public String toString() {
return "#sink";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SourceNode.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SourceNode.java
index 3a40bec..dfb217c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SourceNode.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/gbind/SourceNode.java
@@ -15,6 +15,7 @@
* @author Kohsuke Kawaguchi
*/
public final class SourceNode extends Element {
+ @Override
public String toString() {
return "#source";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
index 9233273..5e7487d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
@@ -40,7 +40,7 @@
* This set will receive newly found outermost
* jaxb:bindings customizations.
*/
- public DOMBuilder( Document dom, LocatorTable ltable, Set outerMostBindings ) {
+ public DOMBuilder( Document dom, LocatorTable ltable, Set<Element> outerMostBindings ) {
super( dom );
this.locatorTable = ltable;
this.outerMostBindings = outerMostBindings;
@@ -49,7 +49,7 @@
/** Location information will be stored into this object. */
private final LocatorTable locatorTable;
- private final Set outerMostBindings;
+ private final Set<Element> outerMostBindings;
private Locator locator;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForest.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForest.java
index 1aa897c..4dc9342 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForest.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForest.java
@@ -85,13 +85,13 @@
* <p>
* Set of system ids as strings.
*/
- private final Set<String> rootDocuments = new LinkedHashSet<String>();
+ private final Set<String> rootDocuments = new LinkedHashSet<>();
/** Stores location information for all the trees in this forest. */
public final LocatorTable locatorTable = new LocatorTable();
/** Stores all the outer-most {@code <jaxb:bindings>} customizations. */
- public final Set<Element> outerMostBindings = new HashSet<Element>();
+ public final Set<Element> outerMostBindings = new HashSet<>();
/** Used to resolve references to other schema documents. */
private EntityResolver entityResolver = null;
@@ -348,6 +348,7 @@
// but the SAX allows the event source to not to provide that information,
// so be prepared for such case.
HandlerImpl x = new HandlerImpl() {
+ @Override
public Document getDocument() {
return dom;
}
@@ -449,7 +450,7 @@
* To receive errors, use {@link SchemaFactory#setErrorHandler(ErrorHandler)}.
*/
public void weakSchemaCorrectnessCheck(SchemaFactory sf) {
- List<SAXSource> sources = new ArrayList<SAXSource>();
+ List<SAXSource> sources = new ArrayList<>();
for( String systemId : getRootDocuments() ) {
Document dom = get(systemId);
if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
@@ -551,7 +552,6 @@
*
* This is a debug method. As such, error handling is sloppy.
*/
- @SuppressWarnings("CallToThreadDumpStack")
public void dump( OutputStream out ) throws IOException {
try {
// create identity transformer
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestScanner.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestScanner.java
index 3e1be7a..f52d3ad 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestScanner.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestScanner.java
@@ -134,24 +134,28 @@
// Locator methods
//
//
+ @Override
public int getColumnNumber() {
Locator l = findLocator();
if(l!=null) return l.getColumnNumber();
return -1;
}
+ @Override
public int getLineNumber() {
Locator l = findLocator();
if(l!=null) return l.getLineNumber();
return -1;
}
+ @Override
public String getPublicId() {
Locator l = findLocator();
if(l!=null) return l.getPublicId();
return null;
}
+ @Override
public String getSystemId() {
Locator l = findLocator();
if(l!=null) return l.getSystemId();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/Internalizer.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/Internalizer.java
index 86073ac..fd9dfc5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/Internalizer.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/Internalizer.java
@@ -104,7 +104,7 @@
private SCDBasedBindingSet transform() {
// either target nodes are conventional DOM nodes (as per spec),
- Map<Element,List<Node>> targetNodes = new HashMap<Element,List<Node>>();
+ Map<Element,List<Node>> targetNodes = new HashMap<>();
// ... or it will be schema components by means of SCD (RI extension)
SCDBasedBindingSet scd = new SCDBasedBindingSet(forest);
@@ -175,7 +175,7 @@
if(schemaLocation.equals("*")) {
for(String systemId : forest.listSystemIDs()) {
if (result.get(bindings) == null)
- result.put(bindings, new ArrayList<Node>());
+ result.put(bindings, new ArrayList<>());
result.get(bindings).add(forest.get(systemId).getDocumentElement());
Element[] children = DOMUtils.getChildElements(bindings, Const.JAXB_NSURI, "bindings");
@@ -248,7 +248,7 @@
return; // abort
} else {
- if(targetMultiple == null) targetMultiple = new ArrayList<Node>();
+ if(targetMultiple == null) targetMultiple = new ArrayList<>();
for(int i = 0; i < nlst.getLength(); i++) {
targetMultiple.add(nlst.item(i));
}
@@ -315,12 +315,12 @@
inheritedSCD.addBinidng(bindings);
} else if (!multiple || targetMultiple == null) {
if (result.get(bindings) == null)
- result.put(bindings, new ArrayList<Node>());
+ result.put(bindings, new ArrayList<>());
result.get(bindings).add(target);
} else {
for (Node rnode : targetMultiple) {
if (result.get(bindings) == null)
- result.put(bindings, new ArrayList<Node>());
+ result.put(bindings, new ArrayList<>());
result.get(bindings).add(rnode);
}
@@ -416,7 +416,7 @@
// to the decl node itself so that this move won't change
// the in-scope namespace bindings.
Element p = decl;
- Set<String> inscopes = new HashSet<String>();
+ Set<String> inscopes = new HashSet<>();
while(true) {
NamedNodeMap atts = p.getAttributes();
for( int i=0; i<atts.getLength(); i++ ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/LocatorTable.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/LocatorTable.java
index e7535d2..e49d0e2 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/LocatorTable.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/LocatorTable.java
@@ -25,24 +25,24 @@
*/
public final class LocatorTable {
/** Locations of the start element. */
- private final Map startLocations = new HashMap();
+ private final Map<Element, Locator> startLocations = new HashMap<>();
/** Locations of the end element. */
- private final Map endLocations = new HashMap();
+ private final Map<Element, Locator> endLocations = new HashMap<>();
public void storeStartLocation( Element e, Locator loc ) {
startLocations.put(e,new LocatorImpl(loc));
}
public void storeEndLocation( Element e, Locator loc ) {
- endLocations.put(e,new LocatorImpl(loc));
+ endLocations.put(e, new LocatorImpl(loc));
}
public Locator getStartLocation( Element e ) {
- return (Locator)startLocations.get(e);
+ return startLocations.get(e);
}
public Locator getEndLocation( Element e ) {
- return (Locator)endLocations.get(e);
+ return endLocations.get(e);
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/NamespaceContextImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/NamespaceContextImpl.java
index c465516..ecadd7a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/NamespaceContextImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/NamespaceContextImpl.java
@@ -39,6 +39,7 @@
this.e = e;
}
+ @Override
public String getNamespaceURI(String prefix) {
Node parent = e;
String namespace = null;
@@ -84,11 +85,13 @@
return namespace;
}
+ @Override
public String getPrefix(String namespaceURI) {
throw new UnsupportedOperationException();
}
- public Iterator getPrefixes(String namespaceURI) {
+ @Override
+ public Iterator<String> getPrefixes(String namespaceURI) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/SCDBasedBindingSet.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/SCDBasedBindingSet.java
index 461f118..6548b07 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/SCDBasedBindingSet.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/SCDBasedBindingSet.java
@@ -82,7 +82,7 @@
/**
* Bindings that apply to this SCD.
*/
- private final List<Element> bindings = new ArrayList<Element>();
+ private final List<Element> bindings = new ArrayList<>();
private Target(Target parent, Element src, SCD scd) {
if(parent==null) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/VersionChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/VersionChecker.java
index 84a9202..63f654a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/VersionChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/VersionChecker.java
@@ -67,6 +67,7 @@
if(er!=null) setEntityResolver(er);
}
+ @Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
@@ -96,6 +97,7 @@
seenBindings = true;
}
+ @Override
public void endDocument() throws SAXException {
super.endDocument();
@@ -114,11 +116,12 @@
}
}
+ @Override
public void setDocumentLocator(Locator locator) {
super.setDocumentLocator(locator);
this.locator = locator;
}
- private static final Set<String> VERSIONS = new HashSet<String>(Arrays.asList("3.0"));
+ private static final Set<String> VERSIONS = new HashSet<>(Arrays.asList("3.0"));
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/WhitespaceStripper.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/WhitespaceStripper.java
index 3f187cd..38a8a28 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/WhitespaceStripper.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/WhitespaceStripper.java
@@ -50,6 +50,7 @@
if(er!=null) setEntityResolver(er);
}
+ @Override
public void characters(char[] ch, int start, int length) throws SAXException {
switch(state) {
case AFTER_START_ELEMENT:
@@ -79,6 +80,7 @@
}
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
processPendingText();
super.startElement(uri, localName, qName, atts);
@@ -86,6 +88,7 @@
bufLen = 0;
}
+ @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
processPendingText();
super.endElement(uri, localName, qName);
@@ -106,6 +109,7 @@
}
}
+ @Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
// ignore completely.
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
index 6b167e7..fd775b4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
@@ -25,7 +25,7 @@
*/
final class DefineFinder extends DPatternWalker {
- public final Set<DDefine> defs = new HashSet<DDefine>();
+ public final Set<DDefine> defs = new HashSet<>();
public Void onGrammar(DGrammarPattern p) {
for( DDefine def : p ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
index 7e64bc3..eafc137 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
@@ -65,7 +65,7 @@
*/
final JPackage pkg;
- final Map<String,DatatypeLib> datatypes = new HashMap<String, DatatypeLib>();
+ final Map<String,DatatypeLib> datatypes = new HashMap<>();
/**
* Patterns that are mapped to Java concepts.
@@ -77,14 +77,14 @@
* TODO: depending on the type of the key, the type of the values can be further
* restricted. Make this into its own class to represent those constraints better.
*/
- final Map<DPattern,CTypeInfo[]> classes = new HashMap<DPattern,CTypeInfo[]>();
+ final Map<DPattern,CTypeInfo[]> classes = new HashMap<>();
/**
* Classes that need to be bound.
*
* The value is the content model to be bound.
*/
- final Map<CClassInfo,DPattern> bindQueue = new HashMap<CClassInfo,DPattern>();
+ final Map<CClassInfo,DPattern> bindQueue = new HashMap<>();
final TypeUseBinder typeUseBinder = new TypeUseBinder(this);
@@ -139,7 +139,7 @@
// we'll be trying a lot of choices,
// and most of them will not be type-safe enum.
// using the same list improves the memory efficiency.
- List<CEnumConstant> members = new ArrayList<CEnumConstant>();
+ List<CEnumConstant> members = new ArrayList<>();
OUTER:
for( DDefine def : defs ) {
@@ -186,7 +186,7 @@
CEnumLeafInfo xducer = new CEnumLeafInfo(model, null,
new CClassInfoParent.Package(pkg), def.getName(), base,
- new ArrayList<CEnumConstant>(members),
+ new ArrayList<>(members),
null, null/*TODO*/, cp.getLocation());
classes.put(cp,new CTypeInfo[]{xducer});
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGInternalizationLogic.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
index 3148ec1..7a1b765 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
@@ -36,6 +36,7 @@
super(parent);
}
+ @Override
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
if( Const.RELAXNG_URI.equals(nsURI)
&& ("include".equals(localName) || "externalRef".equals(localName) ) )
@@ -45,14 +46,17 @@
}
};
+ @Override
public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
return new ReferenceFinder(parent);
}
+ @Override
public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
return Const.RELAXNG_URI.equals(target.getNamespaceURI());
}
+ @Override
public Element refineTarget(Element target) {
// no refinement necessary
return target;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
index 4288b91..c7f7279 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
@@ -49,7 +49,7 @@
/**
* Accumulates discovered {@link RawTypeSet.Ref}s.
*/
- private final Set<RawTypeSet.Ref> refs = new HashSet<RawTypeSet.Ref>();
+ private final Set<RawTypeSet.Ref> refs = new HashSet<>();
private final RELAXNGCompiler compiler;
@@ -99,22 +99,27 @@
assert ci.isElement();
}
+ @Override
protected ID id() {
return ID.NONE;
}
+ @Override
protected boolean isListOfValues() {
return false;
}
+ @Override
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
+ @Override
protected void toElementRef(CReferencePropertyInfo prop) {
prop.getElements().add(ci);
}
+ @Override
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
return new CTypeRef(ci,ci.getElementName(),ci.getTypeName(),false,null);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
index cf76192..55b54da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
@@ -32,12 +32,12 @@
*/
final class TypePatternBinder extends DPatternWalker {
private boolean canInherit;
- private final Stack<Boolean> stack = new Stack<Boolean>();
+ private final Stack<Boolean> stack = new Stack<>();
/**
* Patterns that are determined not to be bindable to inheritance.
*/
- private final Set<DDefine> cannotBeInherited = new HashSet<DDefine>();
+ private final Set<DDefine> cannotBeInherited = new HashSet<>();
void reset() {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/Abstractifier.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/Abstractifier.java
index b8aced6..d89c490 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/Abstractifier.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/Abstractifier.java
@@ -24,6 +24,7 @@
super(core);
}
+ @Override
public CElement complexType(XSComplexType xs) {
CElement ci = super.complexType(xs);
if(ci!=null && xs.isAbstract())
@@ -31,6 +32,7 @@
return ci;
}
+ @Override
public CElement elementDecl(XSElementDecl xs) {
CElement ci = super.elementDecl(xs);
if(ci!=null && xs.isAbstract())
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BGMBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BGMBuilder.java
index 82751e4..7086c23 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BGMBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BGMBuilder.java
@@ -294,7 +294,7 @@
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
- ArrayList<Locator> locations = new ArrayList<Locator>();
+ ArrayList<Locator> locations = new ArrayList<>();
BindInfo bi = getBindInfo(schema);
for( BIDeclaration bid : bi ) {
@@ -308,7 +308,7 @@
Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
schema.getTargetNamespace() );
for( int i=1; i<locations.size(); i++ )
- getErrorReporter().error( (Locator)locations.get(i),
+ getErrorReporter().error(locations.get(i),
Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
@@ -414,7 +414,7 @@
/**
* A map that stores binding declarations augmented by XJC.
*/
- private final Map<XSComponent,BindInfo> externalBindInfos = new HashMap<XSComponent,BindInfo>();
+ private final Map<XSComponent,BindInfo> externalBindInfos = new HashMap<>();
/**
* Gets the {@link BIDom} object that applies to the given particle.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
index a467159..427d1dc 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
@@ -69,7 +69,7 @@
* Map from XSComponents to {@link Binding}s. Keeps track of all
* content interfaces that are already built or being built.
*/
- private final Map<XSComponent,Binding> bindMap = new HashMap<XSComponent,Binding>();
+ private final Map<XSComponent,Binding> bindMap = new HashMap<>();
/**
* UGLY HACK.
@@ -84,17 +84,17 @@
* OTOH, types need to know whether its parent is bound to a class to decide
* which class name to use.
*/
- /*package*/ final Map<XSComponent,CElementInfo> boundElements = new HashMap<XSComponent,CElementInfo>();
+ /*package*/ final Map<XSComponent,CElementInfo> boundElements = new HashMap<>();
/**
* A list of {@link Binding}s object that needs to be built.
*/
- private final Stack<Binding> bindQueue = new Stack<Binding>();
+ private final Stack<Binding> bindQueue = new Stack<>();
/**
* {@link CClassInfo}s that are already {@link Binding#build() built}.
*/
- private final Set<CClassInfo> built = new HashSet<CClassInfo>();
+ private final Set<CClassInfo> built = new HashSet<>();
/**
* Object that determines components that are mapped
@@ -106,7 +106,7 @@
* {@link CClassInfoParent}s that determines where a new class
* should be created.
*/
- private final Stack<CClassInfoParent> classScopes = new Stack<CClassInfoParent>();
+ private final Stack<CClassInfoParent> classScopes = new Stack<>();
/**
* The component that is being bound to {@link #currentBean}.
@@ -413,7 +413,7 @@
* This set is used to avoid duplicating "incorrect package name"
* errors.
*/
- private static Set<String> checkedPackageNames = new HashSet<String>();
+ private static Set<String> checkedPackageNames = new HashSet<>();
/**
* Gets the Java package to which classes from
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/CollisionInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/CollisionInfo.java
index dbd9190..4033e4d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/CollisionInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/CollisionInfo.java
@@ -32,6 +32,7 @@
/**
* Returns a localized message that describes the collision.
*/
+ @Override
public String toString() {
return Messages.format( Messages.MSG_COLLISION_INFO,
name, printLocator(source1), printLocator(source2) );
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
index 6b4ac47..cb9e311 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
@@ -202,7 +202,7 @@
*
* A map from XSParticle to its label.
*/
- public final Map<XSParticle,String> markedParticles = new HashMap<XSParticle,String>();
+ public final Map<XSParticle,String> markedParticles = new HashMap<>();
/**
@@ -242,12 +242,12 @@
}
/** List of particles reported through the check method. */
- private final List<XSParticle> particles = new ArrayList<XSParticle>();
+ private final List<XSParticle> particles = new ArrayList<>();
/**
* Label names already used in the base type.
*/
- private final Map<String,CPropertyInfo> occupiedLabels = new HashMap<String,CPropertyInfo>();
+ private final Map<String,CPropertyInfo> occupiedLabels = new HashMap<>();
/**
* Checks the conflict of two particles.
@@ -275,7 +275,7 @@
/** Keep the computed label names for particles. */
- private final Map<XSParticle,String> labelCache = new Hashtable<XSParticle,String>();
+ private final Map<XSParticle,String> labelCache = new Hashtable<>();
/**
* Hides the computeLabel method of the outer class
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
index 654465a..2a2d453 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
@@ -47,7 +47,7 @@
*/
private GWildcardElement wildcard = null;
- private final Map<QName,GElementImpl> decls = new HashMap<QName,GElementImpl>();
+ private final Map<QName,GElementImpl> decls = new HashMap<>();
private XSParticle current;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionParticleBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionParticleBinder.java
index e33e924..7f249ea 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionParticleBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionParticleBinder.java
@@ -30,6 +30,7 @@
* @author Kohsuke Kawaguchi
*/
final class ExpressionParticleBinder extends ParticleBinder {
+ @Override
public void build(XSParticle p, Collection<XSParticle> forcedProps) {
// this class isn't about spec conformance, but
// for the ease of use.
@@ -121,6 +122,7 @@
return first;
}
+ @Override
public boolean checkFallback(XSParticle p) {
// this algorithm never falls back to 'getContent'.
return false;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElement.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElement.java
index eb1700b..64bf1d1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElement.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElement.java
@@ -25,7 +25,7 @@
* All the {@link XSParticle}s (whose term is {@link XSElementDecl})
* that are coereced into a single {@link Element}.
*/
- final Set<XSParticle> particles = new HashSet<XSParticle>();
+ final Set<XSParticle> particles = new HashSet<>();
/**
* Gets the seed (raw XML name) to be used to generate a property name.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElementImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElementImpl.java
index df8bd3c..f109cf0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElementImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GElementImpl.java
@@ -42,10 +42,12 @@
this.decl = decl;
}
+ @Override
public String toString() {
return tagName.toString();
}
+ @Override
String getPropertyNameSeed() {
return tagName.getLocalPart();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GWildcardElement.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GWildcardElement.java
index 9a66f89..c8041e6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GWildcardElement.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/GWildcardElement.java
@@ -27,10 +27,12 @@
*/
private boolean strict = true;
+ @Override
public String toString() {
return "#any";
}
+ @Override
String getPropertyNameSeed() {
return "any";
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
index 67cf2d1..944d918 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
@@ -70,9 +70,9 @@
* (A,A), we keep track of element names here while we are building up
* this instance.
*/
- private final Set<QName> elementNames = new LinkedHashSet<QName>();
+ private final Set<QName> elementNames = new LinkedHashSet<>();
- private final Set<RawTypeSet.Ref> refs = new LinkedHashSet<RawTypeSet.Ref>();
+ private final Set<RawTypeSet.Ref> refs = new LinkedHashSet<>();
protected final BGMBuilder builder = Ring.get(BGMBuilder.class);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
index d79807c..b8893c7 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
@@ -44,9 +44,9 @@
* @author Kohsuke Kawaguchi
*/
final class RefererFinder implements XSVisitor {
- private final Set<Object> visited = new HashSet<Object>();
+ private final Set<Object> visited = new HashSet<>();
- private final Map<XSComponent,Set<XSComponent>> referers = new HashMap<XSComponent,Set<XSComponent>>();
+ private final Map<XSComponent,Set<XSComponent>> referers = new HashMap<>();
public Set<XSComponent> getReferer(XSComponent src) {
Set<XSComponent> r = referers.get(src);
@@ -131,7 +131,7 @@
private void refer(XSComponent source, XSType target) {
Set<XSComponent> r = referers.get(target);
if(r==null) {
- r = new HashSet<XSComponent>();
+ r = new HashSet<>();
referers.put(target,r);
}
r.add(source);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
index a842308..8298f33 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
@@ -109,14 +109,14 @@
*
* UGLY: Implemented as a Stack of XSComponent to fix a bug
*/
- public final Stack<XSComponent> refererStack = new Stack<XSComponent>();
+ public final Stack<XSComponent> refererStack = new Stack<>();
/**
* Records what xmime:expectedContentTypes annotations we honored and processed,
* so that we can later check if the user had these annotations in the places
* where we didn't anticipate them.
*/
- private final Set<XSComponent> acknowledgedXmimeContentTypes = new HashSet<XSComponent>();
+ private final Set<XSComponent> acknowledgedXmimeContentTypes = new HashSet<>();
/**
* The type that was originally passed to this {@link SimpleTypeBuilder#build(XSSimpleType)}.
@@ -285,14 +285,14 @@
public TypeUse unionSimpleType(XSUnionSimpleType type) {
boolean isCollection = false;
- for( int i=0; i<type.getMemberSize(); i++ )
- if(type.getMember(i).getVariety()==XSVariety.LIST || type.getMember(i).getVariety()==XSVariety.UNION) {
+ for (int i = 0; i < type.getMemberSize(); i++)
+ if (type.getMember(i).getVariety() == XSVariety.LIST || type.getMember(i).getVariety() == XSVariety.UNION) {
isCollection = true;
break;
}
TypeUse r = CBuiltinLeafInfo.STRING;
- if(isCollection)
+ if (isCollection)
r = TypeUseFactory.makeCollection(r);
return r;
}
@@ -425,7 +425,7 @@
// see issue https://jaxb.dev.java.net/issues/show_bug.cgi?id=711
if(reportedEnumMemberSizeWarnings == null)
- reportedEnumMemberSizeWarnings = new HashSet<XSRestrictionSimpleType>();
+ reportedEnumMemberSizeWarnings = new HashSet<>();
if(!reportedEnumMemberSizeWarnings.contains(type)) {
getErrorReporter().warning(type.getLocator(), Messages.WARN_ENUM_MEMBER_SIZE_CAP,
@@ -456,7 +456,7 @@
private static final Set<String> builtinTypeSafeEnumCapableTypes;
static {
- Set<String> s = new HashSet<String>();
+ Set<String> s = new HashSet<>();
// see a bullet of 6.5.1 of the spec.
String[] typeNames = new String[] {
@@ -631,9 +631,9 @@
* null if unable to generate names for some of the constants.
*/
private List<CEnumConstant> buildCEnumConstants(XSRestrictionSimpleType type, boolean needsToGenerateMemberName, Map<String, BIEnumMember> members, XSFacet[] errorRef) {
- List<CEnumConstant> memberList = new ArrayList<CEnumConstant>();
+ List<CEnumConstant> memberList = new ArrayList<>();
int idx=1;
- Set<String> enums = new HashSet<String>(); // to avoid duplicates. See issue #366
+ Set<String> enums = new HashSet<>(); // to avoid duplicates. See issue #366
for( XSFacet facet : type.getDeclaredFacets(XSFacet.FACET_ENUMERATION)) {
String name=null;
@@ -691,7 +691,7 @@
* otherwise return null.
*/
private CEnumConstant[] checkMemberNameCollision( List<CEnumConstant> memberList ) {
- Map<String,CEnumConstant> names = new HashMap<String,CEnumConstant>();
+ Map<String,CEnumConstant> names = new HashMap<>();
for (CEnumConstant c : memberList) {
CEnumConstant old = names.put(c.getName(),c);
if(old!=null)
@@ -861,7 +861,7 @@
// note that although xs:token and xs:normalizedString are not
// specified in the spec, they need to be here because they
// have different whitespace normalization semantics.
- Map<String,TypeUse> m = new HashMap<String,TypeUse>();
+ Map<String,TypeUse> m = new HashMap<>();
// TODO: this is so dumb
m.put("string", CBuiltinLeafInfo.STRING);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
index cddb2c2..ee323c9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
@@ -61,7 +61,7 @@
private final BGMBuilder builder = Ring.get(BGMBuilder.class);
private final SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
- private final Set<XSComponent> visitedComponents = new HashSet<XSComponent>();
+ private final Set<XSComponent> visitedComponents = new HashSet<>();
/**
* Runs the check.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
index fa5d377..970fd29 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
@@ -39,9 +39,11 @@
@XmlLocation
Locator loc; // set by JAXB
+ @Override
public Locator getLocation() { return loc; }
protected BindInfo parent;
+ @Override
public void setParent(BindInfo p) { this.parent=p; }
protected final XSComponent getOwner() {
@@ -57,15 +59,19 @@
private boolean isAcknowledged = false;
+ @Override
public final boolean isAcknowledged() { return isAcknowledged; }
+ @Override
public void onSetOwner() {
}
+ @Override
public Collection<BIDeclaration> getChildren() {
return Collections.emptyList();
}
+ @Override
public void markAsAcknowledged() {
isAcknowledged = true;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIClass.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIClass.java
index 9113d24..b3b2c0c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIClass.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIClass.java
@@ -101,8 +101,10 @@
*/
public String getJavadoc() { return javadoc; }
+ @Override
public QName getName() { return NAME; }
+ @Override
public void setParent(BindInfo p) {
super.setParent(p);
// if this specifies a reference to external class,
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIDom.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIDom.java
index db4595b..a7b23ac 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIDom.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIDom.java
@@ -29,6 +29,7 @@
@XmlAttribute
String type;
+ @Override
public final QName getName() { return NAME; }
/** Name of the conversion declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnum.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnum.java
index 3118d98..978a82f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnum.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnum.java
@@ -73,10 +73,12 @@
* Always return non-null.
*/
@XmlTransient
- public final Map<String,BIEnumMember> members = new HashMap<String,BIEnumMember>();
+ public final Map<String,BIEnumMember> members = new HashMap<>();
+ @Override
public QName getName() { return NAME; }
+ @Override
public void setParent(BindInfo p) {
super.setParent(p);
for( BIEnumMember mem : members.values() )
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnumMember.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
index d13681f..d2b41d5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
@@ -43,6 +43,7 @@
@XmlElement
public final String javadoc;
+ @Override
public QName getName() { return NAME; }
/** Name of this declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIFactoryMethod.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIFactoryMethod.java
index aaccca6..646595b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIFactoryMethod.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIFactoryMethod.java
@@ -43,6 +43,7 @@
}
+ @Override
public final QName getName() { return NAME; }
/** Name of the declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
index ef169b9..5b78dad 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
@@ -315,7 +315,7 @@
* @see #setGlobalConversions
*/
@XmlTransient
- private final Map<QName,BIConversion> globalConversions = new HashMap<QName, BIConversion>();
+ private final Map<QName,BIConversion> globalConversions = new HashMap<>();
// method for JAXB unmarshaller
@XmlElement(name="javaType")
@@ -364,6 +364,7 @@
String type;
}
+ @Override
public void onSetOwner() {
super.onSetOwner();
// if one is given by options, use that
@@ -378,6 +379,7 @@
public BIGlobalBinding() {
}
+ @Override
public void setParent(BindInfo parent) {
super.setParent(parent);
// fill in the remaining default values
@@ -432,6 +434,7 @@
}
+ @Override
public QName getName() { return NAME; }
public static final QName NAME = new QName(
Const.JAXB_NSURI, "globalBindings" );
@@ -467,6 +470,7 @@
}
static final class ClassNameAdapter extends ReadOnlyAdapter<ClassNameBean,String> {
+ @Override
public String unmarshal(ClassNameBean bean) throws Exception {
return bean.name;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIInlineBinaryData.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIInlineBinaryData.java
index 659d018..7595cf6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIInlineBinaryData.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIInlineBinaryData.java
@@ -41,6 +41,7 @@
}
+ @Override
public final QName getName() { return NAME; }
/** Name of the declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
index 989efe6..de3340d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
@@ -130,6 +130,7 @@
return Collections.<BIDeclaration>singleton(conv);
}
+ @Override
public void setParent( BindInfo parent ) {
super.setParent(parent);
if(baseType!=null && baseType.conv!=null)
@@ -540,6 +541,7 @@
+ @Override
public void markAsAcknowledged() {
if( isAcknowledged() ) return;
@@ -678,22 +680,62 @@
}
// delegates to the context schema object
- public XSComponent attributeDecl(XSAttributeDecl decl) { return decl.getOwnerSchema(); }
- public XSComponent wildcard(XSWildcard wc) { return wc.getOwnerSchema(); }
- public XSComponent modelGroupDecl(XSModelGroupDecl decl) { return decl.getOwnerSchema(); }
- public XSComponent modelGroup(XSModelGroup group) { return group.getOwnerSchema(); }
- public XSComponent elementDecl(XSElementDecl decl) { return decl.getOwnerSchema(); }
- public XSComponent complexType(XSComplexType type) { return type.getOwnerSchema(); }
- public XSComponent simpleType(XSSimpleType st) { return st.getOwnerSchema(); }
+ public XSComponent attributeDecl(XSAttributeDecl decl) {
+ return decl.getOwnerSchema();
+ }
+
+ public XSComponent wildcard(XSWildcard wc) {
+ return wc.getOwnerSchema();
+ }
+
+ public XSComponent modelGroupDecl(XSModelGroupDecl decl) {
+ return decl.getOwnerSchema();
+ }
+
+ public XSComponent modelGroup(XSModelGroup group) {
+ return group.getOwnerSchema();
+ }
+
+ public XSComponent elementDecl(XSElementDecl decl) {
+ return decl.getOwnerSchema();
+ }
+
+ public XSComponent complexType(XSComplexType type) {
+ return type.getOwnerSchema();
+ }
+
+ public XSComponent simpleType(XSSimpleType st) {
+ return st.getOwnerSchema();
+ }
// property customizations are not allowed on these components.
- public XSComponent attGroupDecl(XSAttGroupDecl decl) { throw new IllegalStateException(); }
- public XSComponent empty(XSContentType empty) { throw new IllegalStateException(); }
- public XSComponent annotation(XSAnnotation xsAnnotation) { throw new IllegalStateException(); }
- public XSComponent facet(XSFacet xsFacet) { throw new IllegalStateException(); }
- public XSComponent notation(XSNotation xsNotation) { throw new IllegalStateException(); }
- public XSComponent identityConstraint(XSIdentityConstraint x) { throw new IllegalStateException(); }
- public XSComponent xpath(XSXPath xsxPath) { throw new IllegalStateException(); }
+ public XSComponent attGroupDecl(XSAttGroupDecl decl) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent empty(XSContentType empty) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent annotation(XSAnnotation xsAnnotation) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent facet(XSFacet xsFacet) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent notation(XSNotation xsNotation) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent identityConstraint(XSIdentityConstraint x) {
+ throw new IllegalStateException();
+ }
+
+ public XSComponent xpath(XSXPath xsxPath) {
+ throw new IllegalStateException();
+ }
};
@@ -703,6 +745,7 @@
return s1+"\n\n"+s2;
}
+ @Override
public QName getName() { return NAME; }
/** Name of this declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
index 08f9c9c..cf94a4c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
@@ -137,6 +137,7 @@
public String getJavadoc() { return packageInfo.javadoc; }
+ @Override
public QName getName() { return NAME; }
public static final QName NAME = new QName(
Const.JAXB_NSURI, "schemaBinding" );
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
index 1e38f93..0f98674 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
@@ -38,12 +38,14 @@
element = e;
}
+ @Override
public void onSetOwner() {
super.onSetOwner();
if(!Ring.get(Model.class).options.pluginURIs.contains(element.getNamespaceURI()))
markAsAcknowledged();
}
+ @Override
public final QName getName() {
if(name==null)
name = new QName(element.getNamespaceURI(),element.getLocalName());
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java
index 7627db7..fbf8a3d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java
@@ -26,6 +26,7 @@
*/
@XmlRootElement(name="substitutable",namespace= Const.XJC_EXTENSION_URI)
public final class BIXSubstitutable extends AbstractDeclarationImpl {
+ @Override
public final QName getName() { return NAME; }
/** Name of the conversion declaration. */
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
index d4ea496..91c9f91 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
@@ -86,13 +86,13 @@
private static final class Documentation {
@XmlAnyElement
@XmlMixed
- List<Object> contents = new ArrayList<Object>();
+ List<Object> contents = new ArrayList<>();
void addAll(Documentation rhs) {
if(rhs==null) return;
if(contents==null)
- contents = new ArrayList<Object>();
+ contents = new ArrayList<>();
if(!contents.isEmpty())
contents.add("\n\n");
contents.addAll(rhs.contents);
@@ -100,14 +100,14 @@
}
/** list of individual declarations. */
- private final List<BIDeclaration> decls = new ArrayList<BIDeclaration>();
+ private final List<BIDeclaration> decls = new ArrayList<>();
private static final class AppInfo {
/**
* Receives {@link BIDeclaration}s and other DOMs.
*/
@XmlAnyElement(lax=true,value=DomHandlerEx.class)
- List<Object> contents = new ArrayList<Object>();
+ List<Object> contents = new ArrayList<>();
public void addTo(BindInfo bi) {
if(contents==null) return;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
index cd3058b..5ff32a4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
@@ -44,14 +44,17 @@
}
}
+ @Override
public ResultImpl createUnmarshaller(ValidationEventHandler errorHandler) {
return new ResultImpl();
}
+ @Override
public DomAndLocation getElement(ResultImpl r) {
return new DomAndLocation( ((Document)r.s2d.getDOM()).getDocumentElement(), r.location );
}
+ @Override
public Source marshal(DomAndLocation domAndLocation, ValidationEventHandler errorHandler) {
return new DOMSource(domAndLocation.element);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
index 85f518c..a3a8960 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
@@ -47,7 +47,7 @@
* namespaces[2n ] := prefix
* namespaces[2n+1] := namespace URI
*/
- private final ArrayList<String> namespaces = new ArrayList<String>();
+ private final ArrayList<String> namespaces = new ArrayList<>();
private Locator loc;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
index b0dd2ad..d6b1c79 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
@@ -45,7 +45,7 @@
* represents the names used in its child elements [0] and
* attributes [1].
*/
- protected final Map<XSComplexType, NameClass[]> characteristicNameClasses = new HashMap<XSComplexType, NameClass[]>();
+ protected final Map<XSComplexType, NameClass[]> characteristicNameClasses = new HashMap<>();
/**
* Computes a name class that represents everything in a given content model.
@@ -64,7 +64,7 @@
@Override
public NameClass modelGroup(XSModelGroup group) {
NameClass nc = NameClass.NULL;
- for( int i=0; i<group.getSize(); i++ )
+ for (int i = 0; i < group.getSize(); i++)
nc = new ChoiceNameClass(nc, group.getChild(i).getTerm().apply(this));
return nc;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
index 238d049..fa157c0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
@@ -25,6 +25,7 @@
*/
final class ChoiceContentComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
if( !bgmBuilder.getGlobalBinding().isChoiceContentPropertyEnabled() )
return false;
@@ -61,6 +62,7 @@
return mg;
}
+ @Override
public void build(XSComplexType ct) {
XSParticle p = ct.getContentType().asParticle();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
index 14246e2..63fc082 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
@@ -45,7 +45,7 @@
/** Records ComplexTypeBindingMode for XSComplexType. */
private final Map<XSComplexType,ComplexTypeBindingMode> complexTypeBindingModes =
- new HashMap<XSComplexType,ComplexTypeBindingMode>();
+ new HashMap<>();
/**
* Binds a complex type to a field expression.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
index e7c5d1e..70f9e2d 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
@@ -25,6 +25,7 @@
*/
final class ExtendedComplexTypeBuilder extends AbstractExtendedComplexTypeBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
XSType baseType = ct.getBaseType();
return baseType!=schemas.getAnyType()
@@ -32,6 +33,7 @@
&& ct.getDerivationMethod()==XSType.EXTENSION;
}
+ @Override
public void build(XSComplexType ct) {
XSComplexType baseType = ct.getBaseType().asComplexType();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
index c7f66ba..de67e16 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
@@ -32,11 +32,13 @@
*/
final class FreshComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
return ct.getBaseType()==schemas.getAnyType()
&& !ct.isMixed(); // not mixed
}
+ @Override
public void build(final XSComplexType ct) {
XSContentType contentType = ct.getContentType();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
index 2ad8cdd..0f20156 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
@@ -27,6 +27,7 @@
*/
final class MixedComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
XSType bt = ct.getBaseType();
if(bt ==schemas.getAnyType() && ct.isMixed())
@@ -46,6 +47,7 @@
return false;
}
+ @Override
public void build(XSComplexType ct) {
XSContentType contentType = ct.getContentType();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedExtendedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedExtendedComplexTypeBuilder.java
index 7bce533..7055729 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedExtendedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MixedExtendedComplexTypeBuilder.java
@@ -25,6 +25,7 @@
*/
final class MixedExtendedComplexTypeBuilder extends AbstractExtendedComplexTypeBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
if (!bgmBuilder.isGenerateMixedExtensions()) return false;
@@ -43,6 +44,7 @@
return false;
}
+ @Override
public void build(XSComplexType ct) {
XSComplexType baseType = ct.getBaseType().asComplexType();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MultiWildcardComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MultiWildcardComplexTypeBuilder.java
index 2b0eec3..6e39bb2 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MultiWildcardComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/MultiWildcardComplexTypeBuilder.java
@@ -26,6 +26,7 @@
*/
final class MultiWildcardComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
if (!bgmBuilder.model.options.contentForWildcard) {
return false;
@@ -49,6 +50,7 @@
return false;
}
+ @Override
public void build(XSComplexType ct) {
XSContentType contentType = ct.getContentType();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
index c3e323d..9380abc 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
@@ -29,6 +29,7 @@
*/
final class RestrictedComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
XSType baseType = ct.getBaseType();
return baseType!=schemas.getAnyType()
@@ -36,6 +37,7 @@
&& ct.getDerivationMethod()==XSType.RESTRICTION;
}
+ @Override
public void build(XSComplexType ct) {
if (bgmBuilder.getGlobalBinding().isRestrictionFreshType()) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
index 3111752..fd51282 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
@@ -28,10 +28,12 @@
*/
final class STDerivedComplexTypeBuilder extends CTBuilder {
+ @Override
public boolean isApplicable(XSComplexType ct) {
return ct.getBaseType().isSimpleType();
}
+ @Override
public void build(XSComplexType ct) {
assert ct.getDerivationMethod()==XSType.EXTENSION;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
index 6c50d90..db8c949 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
@@ -100,14 +100,14 @@
public class CustomizationContextChecker extends XMLFilterImpl {
/** Keep names of all the ancestor elements. */
- private final Stack<QName> elementNames = new Stack<QName>();
+ private final Stack<QName> elementNames = new Stack<>();
private final ErrorHandler errorHandler;
private Locator locator;
/** Set of element names that cannot have JAXB customizations. */
- private static final Set<String> prohibitedSchemaElementNames = new HashSet<String>();
+ private static final Set<String> prohibitedSchemaElementNames = new HashSet<>();
/**
* @param _errorHandler
@@ -134,6 +134,7 @@
return elementNames.peek();
}
+ @Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
QName newElement = new QName(namespaceURI,localName);
@@ -163,6 +164,7 @@
super.startElement(namespaceURI, localName, qName, atts );
}
+ @Override
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
@@ -171,6 +173,7 @@
elementNames.pop();
}
+ @Override
public void setDocumentLocator(Locator locator) {
super.setDocumentLocator(locator);
this.locator = locator;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
index 3ce6ebb..2c867a1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
@@ -29,66 +29,82 @@
core = inputSource;
}
+ @Override
public Reader getCharacterStream() {
return core.getCharacterStream();
}
+ @Override
public void setCharacterStream(Reader characterStream) {
core.setCharacterStream(characterStream);
}
+ @Override
public InputStream getByteStream() {
return core.getByteStream();
}
+ @Override
public void setByteStream(InputStream byteStream) {
core.setByteStream(byteStream);
}
+ @Override
public String getStringData() {
return null;
}
+ @Override
public void setStringData(String stringData) {
// no-op
}
+ @Override
public String getSystemId() {
return core.getSystemId();
}
+ @Override
public void setSystemId(String systemId) {
core.setSystemId(systemId);
}
+ @Override
public String getPublicId() {
return core.getPublicId();
}
+ @Override
public void setPublicId(String publicId) {
core.setPublicId(publicId);
}
+ @Override
public String getBaseURI() {
return null;
}
+ @Override
public void setBaseURI(String baseURI) {
// no-op
}
+ @Override
public String getEncoding() {
return core.getEncoding();
}
+ @Override
public void setEncoding(String encoding) {
core.setEncoding(encoding);
}
+ @Override
public boolean getCertifiedText() {
return true;
}
+ @Override
public void setCertifiedText(boolean certifiedText) {
// no-op
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
index fb55620..77b0ae0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
@@ -58,6 +58,7 @@
sf.setErrorHandler(errorFilter);
if( entityResolver != null ) {
sf.setResourceResolver(new LSResourceResolver() {
+ @Override
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
try {
// XSOM passes the namespace URI to the publicID parameter.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
index d7c3f80..1f2d953 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
@@ -38,6 +38,7 @@
super(parent);
}
+ @Override
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
if( WellKnownNamespace.XML_SCHEMA.equals(nsURI)
&& ("import".equals(localName) || "include".equals(localName) ) )
@@ -47,14 +48,17 @@
}
}
+ @Override
public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
return new ReferenceFinder(parent);
}
+ @Override
public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
return WellKnownNamespace.XML_SCHEMA.equals(target.getNamespaceURI());
}
+ @Override
public Element refineTarget(Element target) {
// look for existing xs:annotation
Element annotation = DOMUtils.getFirstChildElement(target, WellKnownNamespace.XML_SCHEMA, "annotation");
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/JAXBContextFactory.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/JAXBContextFactory.java
index d2435b5..73c57a5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/JAXBContextFactory.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/JAXBContextFactory.java
@@ -63,14 +63,14 @@
/**
* The JAXB API will invoke this method via reflection
*/
- public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException {
- Class[] r = new Class[classes.length];
+ public static JAXBContext createContext( Class<?>[] classes, Map<String, ?> properties ) throws JAXBException {
+ Class<?>[] r = new Class<?>[classes.length];
boolean modified = false;
// find any reference to our 'public' ObjectFactory and
// replace that to our 'private' ObjectFactory.
for( int i=0; i<r.length; i++ ) {
- Class c = classes[i];
+ Class<?> c = classes[i];
String name = c.getName();
if(name.endsWith(DOT_OBJECT_FACTORY)
&& !name.endsWith(IMPL_DOT_OBJECT_FACTORY)) {
@@ -117,9 +117,9 @@
* The JAXB API will invoke this method via reflection
*/
public static JAXBContext createContext( String contextPath,
- ClassLoader classLoader, Map properties ) throws JAXBException {
+ ClassLoader classLoader, Map<String, ?> properties ) throws JAXBException {
- List<Class> classes = new ArrayList<Class>();
+ List<Class<?>> classes = new ArrayList<>();
StringTokenizer tokens = new StringTokenizer(contextPath,":");
// each package should be pointing to a JAXB RI generated
@@ -136,16 +136,17 @@
}
// delegate to the JAXB provider in the system
- return JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),properties);
+ return JAXBContext.newInstance(classes.toArray(new Class<?>[classes.size()]),properties);
}
- private static ClassLoader getClassClassLoader(final Class c) {
+ private static ClassLoader getClassClassLoader(final Class<?> c) {
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
+ public ClassLoader run() {
return c.getClassLoader();
}
});
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/ZeroOneBooleanAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/ZeroOneBooleanAdapter.java
index a936148..656ff93 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/ZeroOneBooleanAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/runtime/ZeroOneBooleanAdapter.java
@@ -20,11 +20,13 @@
* @since 2.0
*/
public class ZeroOneBooleanAdapter extends XmlAdapter<String,Boolean> {
+ @Override
public Boolean unmarshal(String v) {
if(v==null) return null;
return DatatypeConverter.parseBoolean(v);
}
+ @Override
public String marshal(Boolean v) {
if(v==null) return null;
if(v) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/DOMUtils.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/DOMUtils.java
index 1f4f805..e41fa08 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/DOMUtils.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/DOMUtils.java
@@ -17,6 +17,7 @@
package com.sun.tools.xjc.util;
import java.util.ArrayList;
+import java.util.List;
import javax.xml.namespace.QName;
@@ -50,7 +51,7 @@
/** Gets the child elements of the given name. */
public static Element[] getChildElements(Element parent, String nsUri, String localPart ) {
- ArrayList a = new ArrayList();
+ List<Element> a = new ArrayList<>();
NodeList children = parent.getChildNodes();
for( int i=0; i<children.getLength(); i++ ) {
Node item = children.item(i);
@@ -58,22 +59,22 @@
if(nsUri.equals(item.getNamespaceURI())
&& localPart.equals(item.getLocalName()) )
- a.add(item);
+ a.add((Element) item);
}
- return (Element[]) a.toArray(new Element[a.size()]);
+ return a.toArray(new Element[a.size()]);
}
/** Gets all the child elements. */
public static Element[] getChildElements( Element parent ) {
- ArrayList a = new ArrayList();
+ List<Element> a = new ArrayList<>();
NodeList children = parent.getChildNodes();
for( int i=0; i<children.getLength(); i++ ) {
Node item = children.item(i);
if(!(item instanceof Element )) continue;
- a.add(item);
+ a.add((Element) item);
}
- return (Element[]) a.toArray(new Element[a.size()]);
+ return a.toArray(new Element[a.size()]);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ErrorReceiverFilter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ErrorReceiverFilter.java
index 96078c9..c1102c5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ErrorReceiverFilter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ErrorReceiverFilter.java
@@ -39,19 +39,23 @@
private boolean hadError = false;
public final boolean hadError() { return hadError; }
+ @Override
public void info(SAXParseException exception) {
if(core!=null) core.info(exception);
}
+ @Override
public void warning(SAXParseException exception) {
if(core!=null) core.warning(exception);
}
+ @Override
public void error(SAXParseException exception) {
hadError = true;
if(core!=null) core.error(exception);
}
+ @Override
public void fatalError(SAXParseException exception) {
hadError = true;
if(core!=null) core.fatalError(exception);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkContentHandler.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkContentHandler.java
index 94cd6cf..2138ea5 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkContentHandler.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkContentHandler.java
@@ -55,56 +55,67 @@
private final ContentHandler lhs,rhs;
+ @Override
public void setDocumentLocator (Locator locator) {
lhs.setDocumentLocator(locator);
rhs.setDocumentLocator(locator);
}
+ @Override
public void startDocument() throws SAXException {
lhs.startDocument();
rhs.startDocument();
}
+ @Override
public void endDocument () throws SAXException {
lhs.endDocument();
rhs.endDocument();
}
+ @Override
public void startPrefixMapping (String prefix, String uri) throws SAXException {
lhs.startPrefixMapping(prefix,uri);
rhs.startPrefixMapping(prefix,uri);
}
+ @Override
public void endPrefixMapping (String prefix) throws SAXException {
lhs.endPrefixMapping(prefix);
rhs.endPrefixMapping(prefix);
}
+ @Override
public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException {
lhs.startElement(uri,localName,qName,attributes);
rhs.startElement(uri,localName,qName,attributes);
}
+ @Override
public void endElement (String uri, String localName, String qName) throws SAXException {
lhs.endElement(uri,localName,qName);
rhs.endElement(uri,localName,qName);
}
+ @Override
public void characters (char ch[], int start, int length) throws SAXException {
lhs.characters(ch,start,length);
rhs.characters(ch,start,length);
}
+ @Override
public void ignorableWhitespace (char ch[], int start, int length) throws SAXException {
lhs.ignorableWhitespace(ch,start,length);
rhs.ignorableWhitespace(ch,start,length);
}
+ @Override
public void processingInstruction (String target, String data) throws SAXException {
lhs.processingInstruction(target,data);
rhs.processingInstruction(target,data);
}
+ @Override
public void skippedEntity (String name) throws SAXException {
lhs.skippedEntity(name);
rhs.skippedEntity(name);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
index cb3bf06..b72a3ab 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
@@ -30,6 +30,7 @@
this.rhs = rhs;
}
+ @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
String sId = systemId == null ? "" : systemId;
InputSource is = lhs.resolveEntity(publicId, sId);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/MimeTypeRange.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/MimeTypeRange.java
index a624c43..5af40fd 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/MimeTypeRange.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/MimeTypeRange.java
@@ -27,7 +27,7 @@
public final String majorType;
public final String subType;
- public final Map<String,String> parameters = new HashMap<String, String>();
+ public final Map<String,String> parameters = new HashMap<>();
/**
* Each media-range MAY be followed by one or more accept-params,
@@ -44,7 +44,7 @@
public static List<MimeTypeRange> parseRanges(String s) throws ParseException {
StringCutter cutter = new StringCutter(s,true);
- List<MimeTypeRange> r = new ArrayList<MimeTypeRange>();
+ List<MimeTypeRange> r = new ArrayList<>();
while(cutter.length()>0) {
r.add(new MimeTypeRange(cutter));
}
@@ -112,6 +112,7 @@
return new MimeType(toString());
}
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder(majorType+'/'+subType);
if(q!=1)
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NamespaceContextAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NamespaceContextAdapter.java
index ac4eb16..3f21137 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NamespaceContextAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NamespaceContextAdapter.java
@@ -31,15 +31,18 @@
this.xstr = xstr;
}
+ @Override
public String getNamespaceURI(String prefix) {
return xstr.resolvePrefix(prefix);
}
+ @Override
public String getPrefix(String namespaceURI) {
return null;
}
- public Iterator getPrefixes(String namespaceURI) {
- return Collections.EMPTY_LIST.iterator();
+ @Override
+ public Iterator<String> getPrefixes(String namespaceURI) {
+ return Collections.<String>emptyList().iterator();
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NullStream.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NullStream.java
index 48b79fd..140a6ed 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NullStream.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/NullStream.java
@@ -21,18 +21,23 @@
*/
public class NullStream extends OutputStream {
+ @Override
public void write(int b) throws IOException {
}
+ @Override
public void close() throws IOException {
}
+ @Override
public void flush() throws IOException {
}
+ @Override
public void write(byte[] b, int off, int len) throws IOException {
}
+ @Override
public void write(byte[] b) throws IOException {
}
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ReadOnlyAdapter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ReadOnlyAdapter.java
index 1a0254f..88dc8a4 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ReadOnlyAdapter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ReadOnlyAdapter.java
@@ -18,6 +18,7 @@
* @author Kohsuke Kawaguchi
*/
public abstract class ReadOnlyAdapter<OnTheWire,InMemory> extends XmlAdapter<OnTheWire,InMemory> {
+ @Override
public final OnTheWire marshal(InMemory onTheWire) {
// the unmarshaller uses this method
// to get the current collection object from the property.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/SubtreeCutter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/SubtreeCutter.java
index 85d9923..95a4613 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/SubtreeCutter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/SubtreeCutter.java
@@ -45,6 +45,7 @@
private ContentHandler next;
+ @Override
public void startDocument() throws SAXException {
cutDepth=0;
super.startDocument();
@@ -65,6 +66,7 @@
cutDepth=1;
}
+ @Override
public void setContentHandler(ContentHandler handler) {
next = handler;
// changes take effect immediately unless the sub-tree is being pruned
@@ -72,12 +74,14 @@
super.setContentHandler(handler);
}
+ @Override
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
if(cutDepth>0)
cutDepth++;
super.startElement(uri, localName, qName, atts);
}
+ @Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
super.endElement(namespaceURI, localName, qName);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/writer/SignatureWriter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/writer/SignatureWriter.java
index e985b8c..8452e11 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/writer/SignatureWriter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/writer/SignatureWriter.java
@@ -55,7 +55,7 @@
/** All the ClassItems in this grammar. */
private final Collection<? extends ClassOutline> classes;
/** Map from content interfaces to ClassItem. */
- private final Map<JDefinedClass,ClassOutline> classSet = new HashMap<JDefinedClass,ClassOutline>();
+ private final Map<JDefinedClass,ClassOutline> classSet = new HashMap<>();
private final Writer out;
private int indent=0;
@@ -72,7 +72,8 @@
private void dump() throws IOException {
// collect packages used in the class.
- Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() {
+ Set<JPackage> packages = new TreeSet<>(new Comparator<JPackage>() {
+ @Override
public int compare(JPackage lhs, JPackage rhs) {
return lhs.name().compareTo(rhs.name());
}
diff --git a/jaxb-ri/xjc/src/main/java/module-info.java b/jaxb-ri/xjc/src/main/java/module-info.java
index 0f9360b..bb1e9aa 100644
--- a/jaxb-ri/xjc/src/main/java/module-info.java
+++ b/jaxb-ri/xjc/src/main/java/module-info.java
@@ -39,10 +39,13 @@
exports com.sun.tools.xjc;
exports com.sun.tools.xjc.api;
exports com.sun.tools.xjc.generator.bean;
+ exports com.sun.tools.xjc.generator.bean.field;
exports com.sun.tools.xjc.model;
+ exports com.sun.tools.xjc.model.nav;
exports com.sun.tools.xjc.outline;
exports com.sun.tools.xjc.reader;
exports com.sun.tools.xjc.reader.internalizer;
+ exports com.sun.tools.xjc.reader.xmlschema;
exports com.sun.tools.xjc.reader.xmlschema.bindinfo;
exports com.sun.tools.xjc.util;
diff --git a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/addon/DebugPlugin.java b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/addon/DebugPlugin.java
index 089404f..979756c 100644
--- a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/addon/DebugPlugin.java
+++ b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/addon/DebugPlugin.java
@@ -23,22 +23,27 @@
* @author Kohsuke Kawaguchi
*/
public class DebugPlugin extends Plugin {
+ @Override
public String getOptionName() {
return "Xdebug";
}
+ @Override
public String getUsage() {
return " -Xdebug : test various plug-in functionalities";
}
+ @Override
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) {
return true;
}
+ @Override
public List<String> getCustomizationURIs() {
return Arrays.asList("http://jaxb.dev.java.net/test");
}
+ @Override
public boolean isCustomizationTagName(String nsUri, String localName) {
return true;
}
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSDeclaration.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSDeclaration.java
index 5ae1c94..52e1fa9 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSDeclaration.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSDeclaration.java
@@ -35,6 +35,7 @@
* @deprecated use the isGlobal method, which always returns
* the opposite of this function. Or the isLocal method.
*/
+ @Deprecated
boolean isAnonymous();
/**
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSElementDecl.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSElementDecl.java
index ba1d299..b4e72a5 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSElementDecl.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSElementDecl.java
@@ -89,6 +89,7 @@
* inefficient when working with a large schema. Use
* {@link #getSubstitutables()} instead.
*/
+ @Deprecated
XSElementDecl[] listSubstitutables();
/**
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSSchema.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSSchema.java
index f8dc9b7..250eda6 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSSchema.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSSchema.java
@@ -113,6 +113,7 @@
* this method from {@link XSSchema} and not from {@link XSComponent},
* there's something wrong with your code.
*/
+ @Deprecated
SchemaDocument getSourceDocument();
/**
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/DeclarationImpl.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/DeclarationImpl.java
index 9db6f81..d0835b3 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/DeclarationImpl.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/DeclarationImpl.java
@@ -35,6 +35,7 @@
private final boolean anonymous;
/** @deprecated */
+ @Deprecated
public boolean isAnonymous() { return anonymous; }
public final boolean isGlobal() { return !isAnonymous(); }
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/ElementDecl.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/ElementDecl.java
index 6df8930..8e06c01 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/ElementDecl.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/ElementDecl.java
@@ -120,6 +120,7 @@
* @deprecated
*/
@Override
+ @Deprecated
public XSElementDecl[] listSubstitutables() {
Set<? extends XSElementDecl> s = getSubstitutables();
return s.toArray(new XSElementDecl[s.size()]);
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/SAXParserFactoryAdaptor.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/SAXParserFactoryAdaptor.java
index b373fb6..8528f06 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/SAXParserFactoryAdaptor.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/SAXParserFactoryAdaptor.java
@@ -32,6 +32,7 @@
* @author
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
+@Deprecated
public class SAXParserFactoryAdaptor extends SAXParserFactory {
private final XMLParser parser;
@@ -59,6 +60,7 @@
/**
* @deprecated
*/
+ @Deprecated
public org.xml.sax.Parser getParser() throws SAXException {
return new XMLReaderAdapter(reader);
}
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/scd/SimpleCharStream.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/scd/SimpleCharStream.java
index 94cbe57..e711848 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/scd/SimpleCharStream.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/scd/SimpleCharStream.java
@@ -212,7 +212,7 @@
* @deprecated
* @see #getEndColumn
*/
-
+ @Deprecated
public int getColumn() {
return bufcolumn[bufpos];
}
@@ -221,7 +221,7 @@
* @deprecated
* @see #getEndLine
*/
-
+ @Deprecated
public int getLine() {
return bufline[bufpos];
}
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/JAXPParser.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/JAXPParser.java
index dbee778..d267210 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/JAXPParser.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/JAXPParser.java
@@ -49,6 +49,7 @@
* security features initialized by setting
* XMLConstants.FEATURE_SECURE_PROCESSING feature.
*/
+ @Deprecated
public JAXPParser() {
this( SAXParserFactory.newInstance());
}
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/XSOMParser.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/XSOMParser.java
index 8be9165..1068488 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/XSOMParser.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/parser/XSOMParser.java
@@ -53,6 +53,7 @@
* security features initialized by setting
* XMLConstants.FEATURE_SECURE_PROCESSING feature.
*/
+ @Deprecated
public XSOMParser() {
this(new JAXPParser());
}