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 2ef5235..f64d7de 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
@@ -218,7 +218,7 @@
 
     @Override
     public void execute() throws BuildException {
-        userLoader = new AntClassLoader(project, classpath);
+        userLoader = new AntClassLoader(getProject(), classpath);
         try {
             // find clsses to be bound
             for (String path : classpath.list()) {
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
index 3dbca53..d194fcc 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
@@ -24,6 +24,11 @@
 public class JExportsTest extends JTestModuleDirective {
 
     /**
+     * Default constructor.
+     */
+    public JExportsTest() {}
+
+    /**
      * Test of getType method to make sure that it returns ExportsDirective.
      */
     @Test
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
index d88b7c7..9e4ca62 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
@@ -23,6 +23,11 @@
 public class JRequiresTest extends JTestModuleDirective {
 
     /**
+     * Default constructor.
+     */
+    public JRequiresTest() {}
+
+    /**
      * Test of generateModifiers method with all combinations of {@code local) and {@code public) modifiers.
      */
     @Test
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
index d0fd981..b2e039f 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
@@ -21,6 +21,11 @@
  */
 public abstract class JTestModuleDirective {
 
+    /**
+     * Default constructor.
+     */
+    public JTestModuleDirective() {}
+
     /** Character array writer used to verify code generation output. */
     protected CharArrayWriter out;
 
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
index 4812625..d09e9f5 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
@@ -13,8 +13,8 @@
 import com.sun.codemodel.JExpr;
 import com.sun.codemodel.tests.util.CodeModelTestsUtils;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
+import org.junit.Assert;
 
 /**
  * JExpr tests.
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
index 7b1ae60..b3e890a 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
@@ -11,6 +11,8 @@
 package org.glassfish.jaxb.core.v2.model.core;
 
 import org.glassfish.jaxb.core.v2.WellKnownNamespace;
+
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
 /**
@@ -23,7 +25,7 @@
  * @author Kohsuke Kawaguchi
  */
 public interface NonElement<T,C> extends TypeInfo<T,C> {
-    public static final QName ANYTYPE_NAME = new QName(WellKnownNamespace.XML_SCHEMA, "anyType");
+    public static final QName ANYTYPE_NAME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "anyType");
 
     /**
      * Gets the primary XML type ANYTYPE_NAME of the class.
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
index 46383b0..74e0f64 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
@@ -130,10 +130,8 @@
         /**
          * Replaces the type variables in {@code t} by its actual arguments.
          *
-         * @param decl
-         *      provides a list of type variables. See {@link GenericDeclaration#getTypeParameters()}
-         * @param args
-         *      actual arguments. See {@link ParameterizedType#getActualTypeArguments()}
+         * @param decl provides a list of type variables. See {@link GenericDeclaration#getTypeParameters()}
+         * @param args actual arguments. See {@link ParameterizedType#getActualTypeArguments()}
          */
         private Type bind(Type t, GenericDeclaration decl, ParameterizedType args) {
             return binder.visit(t, new BinderArg(decl, args.getActualTypeArguments()));
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java
index be173ab..f9bf2aa 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/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();
                         }
@@ -37,6 +38,7 @@
         } 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();
                         }
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
index 1a541fd..a731569 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
@@ -10,6 +10,7 @@
 
 package org.glassfish.jaxb.core.v2.model.util;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
 import org.glassfish.jaxb.core.v2.TODO;
@@ -29,7 +30,7 @@
      */
     public static QName calcArrayTypeName(QName n) {
         String uri;
-        if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
+        if(n.getNamespaceURI().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
             TODO.checkSpec("this URI");
             uri = "http://jaxb.dev.java.net/array";
         } else
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
index 85f01de..a4784ba 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
@@ -15,6 +15,7 @@
 import org.apache.tools.ant.taskdefs.Javac;
 import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter;
 import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.util.StringUtils;
 
 import javax.annotation.processing.Processor;
 import javax.tools.DiagnosticCollector;
@@ -35,6 +36,11 @@
 public abstract class ApBasedTask extends Javac {
 
     /**
+     * Default constructor.
+     */
+    protected ApBasedTask() {}
+
+    /**
      * Implemented by the derived class to set up command line switches passed to annotation processing.
      */
     protected abstract void setupCommandlineSwitches(Commandline cmd);
@@ -44,12 +50,14 @@
             setJavac(ApBasedTask.this);
         }
 
+        @Override
         protected Commandline setupModernJavacCommandlineSwitches(Commandline cmd) {
             super.setupModernJavacCommandlineSwitches(cmd);
             setupCommandlineSwitches(cmd);
             return cmd;
         }
 
+        @Override
         protected void logAndAddFilesToCompile(Commandline cmd) {
             attributes.log("Compilation " + cmd.describeArguments(),
                            Project.MSG_VERBOSE);
@@ -60,13 +68,13 @@
             }
             niceSourceList.append(" to be compiled:");
 
-            niceSourceList.append(lSep);
+            niceSourceList.append(System.lineSeparator());
 
             StringBuilder tempbuilder = new StringBuilder();
             for (File aCompileList : compileList) {
                 String arg = aCompileList.getAbsolutePath();
                 // cmd.createArgument().setValue(arg); --> we don't need compile list withing cmd arguments
-                tempbuilder.append("    ").append(arg).append(lSep);
+                tempbuilder.append("    ").append(arg).append(System.lineSeparator());
                 niceSourceList.append(tempbuilder);
                 tempbuilder.setLength(0);
             }
@@ -80,10 +88,11 @@
      */
     private final class InternalApAdapter extends ApAdapter {
 
+        @Override
         public boolean execute() throws BuildException {
             try {
                 JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
-                DiagnosticCollector diagnostics = new DiagnosticCollector();
+                DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
                 StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
                 Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(Arrays.asList(compileList));
                 JavaCompiler.CompilationTask task = compiler.getTask(
@@ -118,6 +127,7 @@
 //        }
 //    }
 
+    @Override
     protected void compile() {
         if (compileList.length == 0) return;
 
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 25e140e..53dd51f 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
@@ -229,7 +229,8 @@
          * will be written, and return it as a {@link Result} object.
          *
          */
-        public Result createOutput( String namespaceUri, String suggestedFileName ) {
+        @Override
+        public Result createOutput(String namespaceUri, String suggestedFileName ) {
 
             // the user's preference takes a precedence
             if(schemas.containsKey(namespaceUri)) {
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
index e6249b7..931a972 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
@@ -87,7 +87,7 @@
      * @return
      *        A list of regular expression patterns {@link Pattern}
      */
-    public List getExcludePatterns(List<String> excludeContent ) {
+    public List<Pattern> getExcludePatterns(List<String> excludeContent ) {
         List<Pattern> excludeRegexList = new ArrayList<Pattern>();
         for (String excludes : excludeContent) {
             String regex = convertToRegex(excludes);
@@ -141,6 +141,7 @@
         return regex.toString();
     }
 
+    @Override
     protected void unexpectedX(String token) throws SAXException {
         errorHandler.error(
             new SAXParseException(Messages.UNEXPECTED_NGCC_TOKEN.format(
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
index 19d8ac1..92cd948 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
@@ -36,6 +36,11 @@
 
     private boolean fork = false;
 
+    /**
+     * Default constructor.
+     */
+    public SchemaGenBase() { super(); }
+
     private final CommandlineJava cmd = new CommandlineJava();
 
     CommandlineJava getCommandline() {
@@ -48,30 +53,36 @@
 
     private Path modulepath = null;
 
+    @Override
     public void setModulepath(Path mp) {
         this.modulepath = mp;
     }
 
+    @Override
     public Path getModulepath() {
         return this.modulepath;
     }
 
     private Path modulesourcepath = null;
 
+    @Override
     public void setModulesourcepath(Path msp) {
         this.modulesourcepath = msp;
     }
 
+    @Override
     public Path getModulesourcepath() {
         return this.modulesourcepath;
     }
 
     private Path upgrademodulepath = null;
 
+    @Override
     public void setUpgrademodulepath(Path ump) {
         this.upgrademodulepath = ump;
     }
 
+    @Override
     public Path getUpgrademodulepath() {
         return this.upgrademodulepath;
     }
@@ -136,18 +147,22 @@
         return this.addopens;
     }
 
+    @Override
     protected void setupCommandlineSwitches(Commandline cmd) {
         cmd.createArgument().setValue("-proc:only");
     }
 
+    @Override
     protected String getCompilationMessage() {
         return "Generating schema from ";
     }
 
+    @Override
     protected String getFailedMessage() {
         return "schema generation failed";
     }
 
+    @Override
     public void setFork(boolean flg) {
         fork = flg;
     }
@@ -174,6 +189,7 @@
         return this.episode;
     }
 
+    @Override
     protected Processor getProcessor() {
         Map<String, File> m = new HashMap<String, File>();
         for (SchemaGenBase.Schema schema : schemas) {
@@ -198,6 +214,11 @@
         private String namespace;
         private File file;
 
+        /**
+         * Default constructor.
+         */
+        public Schema() {}
+
         public void setNamespace(String namespace) {
             this.namespace = namespace;
         }
@@ -232,7 +253,7 @@
                 throw (BuildException) ex;
             } else {
                 throw new BuildException("Error starting " + "schemagen" + ": " + ex.getMessage(), ex,
-                    getLocation());
+                        getLocation());
             }
         }
     }
@@ -278,10 +299,10 @@
         }
 
         String antcp = loader != null
-            //taskedef cp
-            ? ((AntClassLoader) loader).getClasspath()
-            //system classloader, ie. env CLASSPATH=...
-            : System.getProperty("java.class.path");
+                //taskedef cp
+                ? ((AntClassLoader) loader).getClasspath()
+                //system classloader, ie. env CLASSPATH=...
+                : System.getProperty("java.class.path");
         // try to find tools.jar and add it to the cp
         // so the behaviour on all JDKs is the same
         // (avoid creating MaskingClassLoader on non-Mac JDKs)
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java
index 325b1df..ded0585 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/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();
                         }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
index 5a964c4..fa20453 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
@@ -22,7 +22,6 @@
     /**
      * Name of the annotation processing command-line option to take user-specified config files.
      * <p>
-     * <p>
      * It can take multiple file names separately by {@link File#pathSeparator}.
      */
     CONFIG_FILE_OPTION("jaxb.config"),
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
index 2125b64..0d9292e 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
@@ -37,24 +37,28 @@
         this(env.getMessager());
     }
 
+    @Override
     public void error(SAXParseException exception) {
         messager.printMessage(Diagnostic.Kind.ERROR, exception.getMessage());
         messager.printMessage(Diagnostic.Kind.ERROR, getLocation(exception));
         printDetail(exception);
     }
 
+    @Override
     public void fatalError(SAXParseException exception) {
         messager.printMessage(Diagnostic.Kind.ERROR, exception.getMessage());
         messager.printMessage(Diagnostic.Kind.ERROR, getLocation(exception));
         printDetail(exception);
     }
 
+    @Override
     public void warning(SAXParseException exception) {
         messager.printMessage(Diagnostic.Kind.WARNING, exception.getMessage());
         messager.printMessage(Diagnostic.Kind.WARNING, getLocation(exception));
         printDetail(exception);
     }
 
+    @Override
     public void info(SAXParseException exception) {
         printDetail(exception);
     }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
index 4657b35..6e91746 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
@@ -85,6 +85,7 @@
         try {
             model.generateSchema(
                     new SchemaOutputResolver() {
+                        @Override
                         public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
                             File file;
                             OutputStream out;
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java
index 6636eb9..22e762b 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/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();
                         }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
index f8a950b..e1bc038 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
@@ -123,10 +123,12 @@
         }
     }
 
+    @Override
     public List<String> getClassList() {
         return classList;
     }
 
+    @Override
     public QName getXmlTypeName(Reference javaType) {
         NonElement<TypeMirror, TypeElement> ti = refMap.get(javaType);
 
@@ -149,10 +151,12 @@
         return types.getTypeInfo(ref);
     }
 
+    @Override
     public void generateSchema(SchemaOutputResolver outputResolver, ErrorListener errorListener) throws IOException {
         getSchemaGenerator().write(outputResolver,errorListener);
     }
 
+    @Override
     public void generateEpisodeFile(Result output) {
         getSchemaGenerator().writeEpisodeFile(ResultFactory.createSerializer(output));
     }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
index 1d9228b..455611b 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
@@ -41,6 +41,7 @@
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public class JavaCompilerImpl implements JavaCompiler {
+    @Override
     public J2SJAXBModel bind(
         Collection<Reference> rootClasses,
         Map<QName,Reference> additionalElementDecls,
@@ -87,6 +88,7 @@
             this.messager = messager;
         }
 
+        @Override
         public void error(IllegalAnnotationException e) {
             String error = e.toString();
             messager.printMessage(Diagnostic.Kind.ERROR, error);
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
index bdb6927..ebcc569 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
@@ -102,6 +102,7 @@
      * @return The number of attributes in the list.
      * @see org.xml.sax.Attributes#getLength
      */
+    @Override
     public int getLength ()
     {
     return length;
@@ -116,6 +117,7 @@
      *         available, or null if the index is out of range.
      * @see org.xml.sax.Attributes#getURI
      */
+    @Override
     public String getURI (int index)
     {
     if (index >= 0 && index < length) {
@@ -134,6 +136,7 @@
      *         none is available, or null if the index if out of range.
      * @see org.xml.sax.Attributes#getLocalName
      */
+    @Override
     public String getLocalName (int index)
     {
     if (index >= 0 && index < length) {
@@ -152,6 +155,7 @@
      *         none is available, or null if the index is out of bounds.
      * @see org.xml.sax.Attributes#getQName
      */
+    @Override
     public String getQName (int index)
     {
     if (index >= 0 && index < length) {
@@ -170,6 +174,7 @@
      *         if the index is out of bounds.
      * @see org.xml.sax.Attributes#getType(int)
      */
+    @Override
     public String getType (int index)
     {
     if (index >= 0 && index < length) {
@@ -187,6 +192,7 @@
      * @return The attribute's value or null if the index is out of bounds.
      * @see org.xml.sax.Attributes#getValue(int)
      */
+    @Override
     public String getValue (int index)
     {
     if (index >= 0 && index < length) {
@@ -210,6 +216,7 @@
      * @return The attribute's index, or -1 if none matches.
      * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
      */
+    @Override
     public int getIndex (String uri, String localName)
     {
     int max = length * 5;
@@ -229,6 +236,7 @@
      * @return The attribute's index, or -1 if none matches.
      * @see org.xml.sax.Attributes#getIndex(java.lang.String)
      */
+    @Override
     public int getIndex (String qName)
     {
     int max = length * 5;
@@ -251,6 +259,7 @@
      *         matching attribute.
      * @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String)
      */
+    @Override
     public String getType (String uri, String localName)
     {
     int max = length * 5;
@@ -271,6 +280,7 @@
      *         matching attribute.
      * @see org.xml.sax.Attributes#getType(java.lang.String)
      */
+    @Override
     public String getType (String qName)
     {
     int max = length * 5;
@@ -293,6 +303,7 @@
      *         matching attribute.
      * @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String)
      */
+    @Override
     public String getValue (String uri, String localName)
     {
     int max = length * 5;
@@ -313,6 +324,7 @@
      *         matching attribute.
      * @see org.xml.sax.Attributes#getValue(java.lang.String)
      */
+    @Override
     public String getValue (String qName)
     {
     int max = length * 5;
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 0ef26d9..e78a885 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
@@ -34,6 +34,7 @@
     protected String $localName;
     protected String $qname;
 
+    @Override
     public final NGCCRuntime getRuntime() {
         return($runtime);
     }
@@ -62,6 +63,7 @@
     private void action3()throws SAXException {
         $runtime.processList(__text);}
 
+    @Override
     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -121,6 +123,7 @@
         }
     }
 
+    @Override
     public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -185,6 +188,7 @@
         }
     }
 
+    @Override
     public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -216,6 +220,7 @@
         }
     }
 
+    @Override
     public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -247,6 +252,7 @@
         }
     }
 
+    @Override
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
@@ -306,6 +312,7 @@
         }
     }
 
+    @Override
     public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
         switch(cookie) {
         }
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 43c56e2..6c17ad7 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
@@ -35,6 +35,7 @@
     protected String $localName;
     protected String $qname;
 
+    @Override
     public final NGCCRuntime getRuntime() {
         return($runtime);
     }
@@ -57,6 +58,7 @@
         baseDir = $runtime.getBaseDir(bd);
 }
 
+    @Override
     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -132,6 +134,7 @@
         }
     }
 
+    @Override
     public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -179,6 +182,7 @@
         }
     }
 
+    @Override
     public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -214,6 +218,7 @@
         }
     }
 
+    @Override
     public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -249,6 +254,7 @@
         }
     }
 
+    @Override
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
@@ -281,6 +287,7 @@
         }
     }
 
+    @Override
     public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
         switch(cookie) {
         case 19:
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
index 77eae2a..c7ab920 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
@@ -35,6 +35,7 @@
     /** event receiverse. */
     protected NGCCEventReceiver[] _receivers;
     
+    @Override
     public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler) {
         for( int i=0; i<_receivers.length; i++ )
             if( _receivers[i]==oldHandler ) {
@@ -76,6 +77,7 @@
      */
     private int lockCount=0;
     
+    @Override
     public void enterElement(
         String uri, String localName, String qname,Attributes atts) throws SAXException {
         
@@ -92,6 +94,7 @@
         
         _receivers[lockedReceiver].enterElement(uri,localName,qname,atts);
     }
+    @Override
     public void leaveElement(String uri, String localName, String qname) throws SAXException {
         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
 
@@ -100,6 +103,7 @@
         else
             _receivers[lockedReceiver].leaveElement(uri,localName,qname);
     }
+    @Override
     public void enterAttribute(String uri, String localName, String qname) throws SAXException {
         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
         
@@ -114,6 +118,7 @@
                 
         _receivers[lockedReceiver].enterAttribute(uri,localName,qname);
     }
+    @Override
     public void leaveAttribute(String uri, String localName, String qname) throws SAXException {
         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
         
@@ -122,6 +127,7 @@
         else
             _receivers[lockedReceiver].leaveAttribute(uri,localName,qname);
     }
+    @Override
     public void text(String value) throws SAXException {
         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
         
@@ -307,30 +313,35 @@
 //
 //
     
-    public void sendEnterAttribute( int threadId,
-        String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendEnterAttribute(int threadId,
+                                   String uri, String local, String qname) throws SAXException {
         
         _receivers[threadId].enterAttribute(uri,local,qname);
     }
 
-    public void sendEnterElement( int threadId,
-        String uri, String local, String qname, Attributes atts) throws SAXException {
+    @Override
+    public void sendEnterElement(int threadId,
+                                 String uri, String local, String qname, Attributes atts) throws SAXException {
         
         _receivers[threadId].enterElement(uri,local,qname,atts);
     }
 
-    public void sendLeaveAttribute( int threadId,
-        String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendLeaveAttribute(int threadId,
+                                   String uri, String local, String qname) throws SAXException {
         
         _receivers[threadId].leaveAttribute(uri,local,qname);
     }
 
-    public void sendLeaveElement( int threadId,
-        String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendLeaveElement(int threadId,
+                                 String uri, String local, String qname) throws SAXException {
         
         _receivers[threadId].leaveElement(uri,local,qname);
     }
 
+    @Override
     public void sendText(int threadId, String value) throws SAXException {
         _receivers[threadId].text(value);
     }
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 fbb10c6..230c8aa 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
@@ -97,7 +97,8 @@
     // current content handler can be acccessed via set/getContentHandler.
 
     private Locator locator;
-    public void setDocumentLocator( Locator _loc ) { this.locator=_loc; }
+    @Override
+    public void setDocumentLocator(Locator _loc ) { this.locator=_loc; }
     /**
      * Gets the source location of the current event.
      *
@@ -109,7 +110,7 @@
 
 
     /** stack of {@link Attributes}. */
-    private final Stack<AttributesImpl> attStack = new Stack();
+    private final Stack<AttributesImpl> attStack = new Stack<>();
     /** current attributes set. always equal to attStack.peek() */
     private AttributesImpl currentAtts;
 
@@ -134,7 +135,8 @@
     /** The current NGCCHandler. Always equals to handlerStack.peek() */
     private NGCCEventReceiver currentHandler;
 
-    public int replace( NGCCEventReceiver o, NGCCEventReceiver n ) {
+    @Override
+    public int replace(NGCCEventReceiver o, NGCCEventReceiver n ) {
         if(o!=currentHandler)
             throw new IllegalStateException();  // bug of RelaxNGCC
         currentHandler = n;
@@ -221,6 +223,7 @@
             currentHandler.text(t.nextToken());
     }
 
+    @Override
     public void startElement(String uri, String localname, String qname, Attributes atts)
             throws SAXException {
 
@@ -265,6 +268,7 @@
         nsEffectivePtr = nsEffectiveStack.pop();
     }
 
+    @Override
     public void endElement(String uri, String localname, String qname)
             throws SAXException {
 
@@ -290,12 +294,14 @@
 //        System.out.println("endElement:"+localname);
     }
 
+    @Override
     public void characters(char[] ch, int start, int length) throws SAXException {
         if(redirect!=null)
             redirect.characters(ch,start,length);
         else
             text.append(ch,start,length);
     }
+    @Override
     public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
         if(redirect!=null)
             redirect.ignorableWhitespace(ch,start,length);
@@ -319,7 +325,8 @@
     }
 
 
-    public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+    @Override
+    public void startPrefixMapping(String prefix, String uri ) throws SAXException {
         if(redirect!=null)
             redirect.startPrefixMapping(prefix,uri);
         else {
@@ -328,7 +335,8 @@
         }
     }
 
-    public void endPrefixMapping( String prefix ) throws SAXException {
+    @Override
+    public void endPrefixMapping(String prefix ) throws SAXException {
         if(redirect!=null)
             redirect.endPrefixMapping(prefix);
         else {
@@ -337,12 +345,14 @@
         }
     }
 
-    public void skippedEntity( String name ) throws SAXException {
+    @Override
+    public void skippedEntity(String name ) throws SAXException {
         if(redirect!=null)
             redirect.skippedEntity(name);
     }
 
-    public void processingInstruction( String target, String data ) throws SAXException {
+    @Override
+    public void processingInstruction(String target, String data ) throws SAXException {
         if(redirect!=null)
             redirect.processingInstruction(target,data);
     }
@@ -350,6 +360,7 @@
     /** Impossible token. This value can never be a valid XML name. */
     static final String IMPOSSIBLE = "\u0000";
 
+    @Override
     public void endDocument() throws SAXException {
         // consume the special "end document" token so that all the handlers
         // currently at the stack will revert to their respective parents.
@@ -369,6 +380,7 @@
 
         reset();
     }
+    @Override
     public void startDocument() {}
 
 
@@ -380,30 +392,35 @@
 //
 //
 
-    public void sendEnterAttribute( int threadId,
-                                    String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendEnterAttribute(int threadId,
+                                   String uri, String local, String qname) throws SAXException {
 
         currentHandler.enterAttribute(uri,local,qname);
     }
 
-    public void sendEnterElement( int threadId,
-                                  String uri, String local, String qname, Attributes atts) throws SAXException {
+    @Override
+    public void sendEnterElement(int threadId,
+                                 String uri, String local, String qname, Attributes atts) throws SAXException {
 
         currentHandler.enterElement(uri,local,qname,atts);
     }
 
-    public void sendLeaveAttribute( int threadId,
-                                    String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendLeaveAttribute(int threadId,
+                                   String uri, String local, String qname) throws SAXException {
 
         currentHandler.leaveAttribute(uri,local,qname);
     }
 
-    public void sendLeaveElement( int threadId,
-                                  String uri, String local, String qname) throws SAXException {
+    @Override
+    public void sendLeaveElement(int threadId,
+                                 String uri, String local, String qname) throws SAXException {
 
         currentHandler.leaveElement(uri,local,qname);
     }
 
+    @Override
     public void sendText(int threadId, String value) throws SAXException {
         currentHandler.text(value);
     }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
index 2a59790..5e0ba20 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
@@ -31,6 +31,7 @@
     protected String $localName;
     protected String $qname;
 
+    @Override
     public final NGCCRuntime getRuntime() {
         return($runtime);
     }
@@ -50,6 +51,7 @@
         location = new File(baseDir,loc);
 }
 
+    @Override
     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -104,6 +106,7 @@
         }
     }
 
+    @Override
     public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -158,6 +161,7 @@
         }
     }
 
+    @Override
     public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -199,6 +203,7 @@
         }
     }
 
+    @Override
     public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
         int $ai;
         $uri = $__uri;
@@ -250,6 +255,7 @@
         }
     }
 
+    @Override
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
@@ -298,6 +304,7 @@
         }
     }
 
+    @Override
     public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
         switch(cookie) {
         }
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
index 913728a..5299931 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
@@ -60,6 +60,7 @@
         this.primitiveByte = env.getTypeUtils().getPrimitiveType(TypeKind.BYTE);
     }
 
+    @Override
     public TypeElement getSuperClass(TypeElement typeElement) {
         if (typeElement.getKind().equals(ElementKind.CLASS)) {
             TypeMirror sup = typeElement.getSuperclass();
@@ -71,26 +72,32 @@
         return env.getElementUtils().getTypeElement(Object.class.getName());
     }
 
+    @Override
     public TypeMirror getBaseClass(TypeMirror type, TypeElement sup) {
         return baseClassFinder.visit(type, sup);
     }
 
+    @Override
     public String getClassName(TypeElement t) {
         return t.getQualifiedName().toString();
     }
 
+    @Override
     public String getTypeName(TypeMirror typeMirror) {
         return typeMirror.toString();
     }
 
+    @Override
     public String getClassShortName(TypeElement t) {
         return t.getSimpleName().toString();
     }
 
+    @Override
     public Collection<VariableElement> getDeclaredFields(TypeElement typeElement) {
         return ElementFilter.fieldsIn(typeElement.getEnclosedElements());
     }
 
+    @Override
     public VariableElement getDeclaredField(TypeElement clazz, String fieldName) {
         for (VariableElement fd : ElementFilter.fieldsIn(clazz.getEnclosedElements())) {
             if (fd.getSimpleName().toString().equals(fieldName))
@@ -99,34 +106,42 @@
         return null;
     }
 
+    @Override
     public Collection<ExecutableElement> getDeclaredMethods(TypeElement typeElement) {
         return ElementFilter.methodsIn(typeElement.getEnclosedElements());
     }
 
+    @Override
     public TypeElement getDeclaringClassForField(VariableElement f) {
         return (TypeElement) f.getEnclosingElement();
     }
 
+    @Override
     public TypeElement getDeclaringClassForMethod(ExecutableElement m) {
         return (TypeElement) m.getEnclosingElement();
     }
 
+    @Override
     public TypeMirror getFieldType(VariableElement f) {
         return f.asType();
     }
 
+    @Override
     public String getFieldName(VariableElement f) {
         return f.getSimpleName().toString();
     }
 
+    @Override
     public String getMethodName(ExecutableElement m) {
         return m.getSimpleName().toString();
     }
 
+    @Override
     public TypeMirror getReturnType(ExecutableElement m) {
         return m.getReturnType();
     }
 
+    @Override
     public TypeMirror[] getMethodParameters(ExecutableElement m) {
         Collection<? extends VariableElement> ps = m.getParameters();
         TypeMirror[] r = new TypeMirror[ps.size()];
@@ -136,10 +151,12 @@
         return r;
     }
 
+    @Override
     public boolean isStaticMethod(ExecutableElement m) {
         return hasModifier(m, Modifier.STATIC);
     }
 
+    @Override
     public boolean isFinalMethod(ExecutableElement m) {
         return hasModifier(m, Modifier.FINAL);
     }
@@ -148,6 +165,7 @@
         return d.getModifiers().contains(mod);
     }
 
+    @Override
     public boolean isSubClassOf(TypeMirror sub, TypeMirror sup) {
         if(sup==DUMMY)
         // see ref(). if the sub type is known to Annotation Processing,
@@ -157,7 +175,7 @@
         return env.getTypeUtils().isSubtype(sub,sup);
     }
 
-    private String getSourceClassName(Class clazz) {
+    private String getSourceClassName(Class<?> clazz) {
         Class<?> d = clazz.getDeclaringClass();
         if(d==null)
             return clazz.getName();
@@ -167,7 +185,8 @@
         }
     }
 
-    public TypeMirror ref(Class c) {
+    @Override
+    public TypeMirror ref(Class<?> c) {
         if(c.isArray())
             return env.getTypeUtils().getArrayType( ref(c.getComponentType()) );
         if(c.isPrimitive())
@@ -186,11 +205,13 @@
         return env.getTypeUtils().getDeclaredType(t);
     }
 
+    @Override
     public TypeMirror use(TypeElement t) {
         assert t != null;
         return env.getTypeUtils().getDeclaredType(t);
     }
 
+    @Override
     public TypeElement asDecl(TypeMirror m) {
         m = env.getTypeUtils().erasure(m);
         if (m.getKind().equals(TypeKind.DECLARED)) {
@@ -200,10 +221,12 @@
             return null;
     }
 
-    public TypeElement asDecl(Class c) {
+    @Override
+    public TypeElement asDecl(Class<?> c) {
         return env.getElementUtils().getTypeElement(getSourceClassName(c));
     }
 
+    @Override
     public TypeMirror erasure(TypeMirror t) {
         Types tu = env.getTypeUtils();
         t = tu.erasure(t);
@@ -218,14 +241,17 @@
         return t;
     }
 
+    @Override
     public boolean isAbstract(TypeElement clazz) {
         return hasModifier(clazz,Modifier.ABSTRACT);
     }
 
+    @Override
     public boolean isFinal(TypeElement clazz) {
         return hasModifier(clazz, Modifier.FINAL);
     }
 
+    @Override
     public VariableElement[] getEnumConstants(TypeElement clazz) {
         List<? extends Element> elements = env.getElementUtils().getAllMembers(clazz);
         Collection<VariableElement> constants = new ArrayList<VariableElement>();
@@ -237,10 +263,12 @@
         return constants.toArray(new VariableElement[constants.size()]);
     }
 
+    @Override
     public TypeMirror getVoidType() {
         return env.getTypeUtils().getNoType(TypeKind.VOID);
     }
 
+    @Override
     public String getPackageName(TypeElement clazz) {
         return env.getElementUtils().getPackageOf(clazz).getQualifiedName().toString();
     }
@@ -250,10 +278,12 @@
         return env.getElementUtils().getTypeElement(packageName + ".ObjectFactory");
     }
 
+    @Override
     public boolean isBridgeMethod(ExecutableElement method) {
         return method.getModifiers().contains(Modifier.VOLATILE);
     }
 
+    @Override
     public boolean isOverriding(ExecutableElement method, TypeElement base) {
         Elements elements = env.getElementUtils();
 
@@ -269,14 +299,17 @@
         }
     }
 
+    @Override
     public boolean isInterface(TypeElement clazz) {
         return clazz.getKind().isInterface();
     }
 
+    @Override
     public boolean isTransient(VariableElement f) {
         return f.getModifiers().contains(Modifier.TRANSIENT);
     }
 
+    @Override
     public boolean isInnerClass(TypeElement clazz) {
         return clazz.getEnclosingElement() != null && !clazz.getModifiers().contains(Modifier.STATIC);
     }
@@ -286,10 +319,12 @@
         return env.getTypeUtils().isSameType(t1, t2);
     }
 
+    @Override
     public boolean isArray(TypeMirror type) {
         return type != null && type.getKind().equals(TypeKind.ARRAY);
     }
 
+    @Override
     public boolean isArrayButNotByteArray(TypeMirror t) {
         if(!isArray(t))
             return false;
@@ -300,6 +335,7 @@
         return !ct.equals(primitiveByte);
     }
 
+    @Override
     public TypeMirror getComponentType(TypeMirror t) {
         if (isArray(t)) {
             ArrayType at = (ArrayType) t;
@@ -309,6 +345,7 @@
         throw new IllegalArgumentException();
     }
 
+    @Override
     public TypeMirror getTypeArgument(TypeMirror typeMirror, int i) {
         if (typeMirror != null && typeMirror.getKind().equals(TypeKind.DECLARED)) {
             DeclaredType declaredType = (DeclaredType) typeMirror;
@@ -317,6 +354,7 @@
         } else throw new IllegalArgumentException();
     }
 
+    @Override
     public boolean isParameterizedType(TypeMirror typeMirror) {
         if (typeMirror != null && typeMirror.getKind().equals(TypeKind.DECLARED)) {
             DeclaredType d = (DeclaredType) typeMirror;
@@ -325,6 +363,7 @@
         return false;
     }
 
+    @Override
     public boolean isPrimitive(TypeMirror t) {
         return t.getKind().isPrimitive();
     }
@@ -342,7 +381,8 @@
         primitives.put(Character.TYPE, TypeKind.CHAR);
     }
 
-    public TypeMirror getPrimitive(Class primitiveType) {
+    @Override
+    public TypeMirror getPrimitive(Class<?> primitiveType) {
         assert primitiveType.isPrimitive();
         if(primitiveType==void.class)
             return getVoidType();
@@ -364,34 +404,41 @@
         }
 
 //        @Override
+        @Override
         public List<? extends AnnotationMirror> getAnnotationMirrors() {
             throw new IllegalStateException();
         }
 
 //        @Override
+        @Override
         public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
             throw new IllegalStateException();
         }
 
 //        @Override
+        @Override
         public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
             throw new IllegalStateException();
         }
     };
 
+    @Override
     public Location getClassLocation(TypeElement typeElement) {
         Trees trees = Trees.instance(env);
         return getLocation(typeElement.getQualifiedName().toString(), trees.getPath(typeElement));
     }
 
+    @Override
     public Location getFieldLocation(VariableElement variableElement) {
         return getLocation(variableElement);
     }
 
+    @Override
     public Location getMethodLocation(ExecutableElement executableElement) {
         return getLocation(executableElement);
     }
 
+    @Override
     public boolean hasDefaultConstructor(TypeElement t) {
         if (t == null || !t.getKind().equals(ElementKind.CLASS))
             return false;
@@ -403,18 +450,22 @@
         return false;
     }
 
+    @Override
     public boolean isStaticField(VariableElement f) {
         return hasModifier(f,Modifier.STATIC);
     }
 
+    @Override
     public boolean isPublicMethod(ExecutableElement m) {
         return hasModifier(m,Modifier.PUBLIC);
     }
 
+    @Override
     public boolean isPublicField(VariableElement f) {
         return hasModifier(f,Modifier.PUBLIC);
     }
 
+    @Override
     public boolean isEnum(TypeElement t) {
         return t != null && t.getKind().equals(ElementKind.ENUM);
     }
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
index da84bc4..b0a580a 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
@@ -34,7 +34,7 @@
  * @author Kohsuke Kawaguchi
  */
 abstract class PropertyInfoImpl<T,C,F,M>
-    implements PropertyInfo<T,C>, Locatable, Comparable<PropertyInfoImpl> /*by their names*/ {
+    implements PropertyInfo<T,C>, Locatable, Comparable<PropertyInfoImpl<T,C,F,M>> /*by their names*/ {
 
     /**
      * Object that reads annotations.
@@ -357,7 +357,7 @@
     }
 
     @Override
-    public int compareTo(PropertyInfoImpl that) {
+    public int compareTo(PropertyInfoImpl<T,C,F,M> that) {
         return this.getName().compareTo(that.getName());
     }
 
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
index 5d51759..a0a1832 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
@@ -123,21 +123,21 @@
             final C je = nav.asDecl(JAXBElement.class);
 
             for( XmlElementRef r : ann ) {
-                boolean yield;
+                boolean _yield;
                 T type = reader.getClassValue(r,"type");
                 if(nav().isSameType(type, defaultType))
                     type = nav.erasure(getIndividualType());
                 if(nav.getBaseClass(type,je)!=null)
-                    yield = addGenericElement(r);
+                    _yield = addGenericElement(r);
                 else
-                    yield = addAllSubtypes(type);
+                    _yield = addAllSubtypes(type);
 
                 // essentially "isRequired &= isRequired(r)" except that we'd like to skip evaluating isRequird(r)
                 // if the value is already false.
                 if(isRequired && !isRequired(r))
                     isRequired = false;
 
-                if(last && !yield) {
+                if(last && !_yield) {
                     // a reference didn't produce any type.
                     // diagnose the problem
                     if(nav().isSameType(type, nav.ref(JAXBElement.class))) {
@@ -162,7 +162,7 @@
         }
 
         for (ReferencePropertyInfoImpl<T, C, F, M> info : subTypes) {
-            PropertySeed sd = info.seed;
+            PropertySeed<T, C, F, M> sd = info.seed;
             refs = sd.readAnnotation(XmlElementRefs.class);
             ref = sd.readAnnotation(XmlElementRef.class);
 
@@ -192,19 +192,19 @@
                 final C je = nav.asDecl(JAXBElement.class);
 
                 for( XmlElementRef r : ann ) {
-                    boolean yield;
+                    boolean _yield;
                     T type = reader.getClassValue(r,"type");
                     if (nav().isSameType(type, defaultType)) {
                         type = nav.erasure(getIndividualType());
                     }
                     if (nav.getBaseClass(type,je) != null) {
-                        yield = addGenericElement(r, info);
+                        _yield = addGenericElement(r, info);
 
                     } else {
-                        yield = addAllSubtypes(type);
+                        _yield = addAllSubtypes(type);
                     }
 
-                    if(last && !yield) {
+                    if(last && !_yield) {
                         // a reference didn't produce any type.
                         // diagnose the problem
                         if(nav().isSameType(type, nav.ref(JAXBElement.class))) {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
index 6f30472..a150551 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
@@ -37,6 +37,7 @@
 import javax.imageio.ImageIO;
 import javax.imageio.ImageWriter;
 import javax.imageio.stream.ImageOutputStream;
+import javax.xml.XMLConstants;
 import javax.xml.datatype.DatatypeConstants;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
@@ -158,7 +159,7 @@
     public static final Map<Type,RuntimeBuiltinLeafInfoImpl<?>> LEAVES = new HashMap<Type, RuntimeBuiltinLeafInfoImpl<?>>();
 
     private static QName createXS(String typeName) {
-        return new QName(WellKnownNamespace.XML_SCHEMA,typeName);
+        return new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,typeName);
     }
 
     public static final RuntimeBuiltinLeafInfoImpl<String> STRING;
@@ -276,7 +277,7 @@
                     QName type = xs.getSchemaType();
                     GregorianCalendar cal = new GregorianCalendar(0,0,0);
                     cal.setTime(v);
-                    if ((type != null) && (WellKnownNamespace.XML_SCHEMA.equals(type.getNamespaceURI())) &&
+                    if ((type != null) && (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespaceURI())) &&
                             DATE.equals(type.getLocalPart())) {
                         return DatatypeConverterImpl._printDate(cal);
                     } else {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
index f224cea..2503e87 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
@@ -41,10 +41,7 @@
 import javax.xml.stream.XMLStreamException;
 import java.io.IOException;
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
+import java.lang.reflect.*;
 import java.util.List;
 import java.util.Map;
 
@@ -83,8 +80,8 @@
                 factoryAnn = findXmlAccessorFactoryAnnotation(clazz);
                 if (factoryAnn != null) {
                     try {
-                        accFactory = factoryAnn.value().newInstance();
-                    } catch (InstantiationException e) {
+                        accFactory = factoryAnn.value().getConstructor().newInstance();
+                    } catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) {
                         builder.reportError(new IllegalAnnotationException(
                                 Messages.ACCESSORFACTORY_INSTANTIATION_EXCEPTION.format(
                                 factoryAnn.getClass().getName(), nav().getClassName(clazz)), this));
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
index 3c70370..f9ee8e8 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
@@ -27,6 +27,7 @@
 import jakarta.activation.MimeType;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -133,7 +134,7 @@
     }
 
     private static QName createXSSimpleType() {
-        return new QName(WellKnownNamespace.XML_SCHEMA,"anySimpleType");
+        return new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anySimpleType");
     }
 
     /**
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
index afbf6a4..4ebdfeb 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
@@ -24,6 +24,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -37,6 +38,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -50,6 +52,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
index bbda9b5..8c0337e 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
@@ -22,6 +22,7 @@
 import org.w3c.dom.*;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.io.IOException;
@@ -36,7 +37,7 @@
     private boolean nilIncluded = false;
     
     public AnyTypeBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo anyTypeInfo) {
-        super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
+        super(grammar, anyTypeInfo, Object.class, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anyType"), false, true, false);
     }
 
     @Override
@@ -102,7 +103,7 @@
             String local = a.getLocalName();
             String name = a.getName();
             if(local==null) local = name;
-            if (uri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE) && ("nil".equals(local))) {
+            if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(uri) && ("nil".equals(local))) {
                 isNilIncluded = true;
             }
             if(name.startsWith("xmlns")) continue;// DOM reports ns decls as attributes
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
index 33b4377..6e6dcf3 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
@@ -32,6 +32,7 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.LocatorImpl;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.io.IOException;
@@ -357,7 +358,7 @@
                 } else {
                     p.serializeAttributes(bean,target);
                 }
-                if (p.attName.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE, "nil")) {
+                if (p.attName.equals(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "nil")) {
                     isNilIncluded = true;
                 }
             } catch (AccessorException e) {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
index 41dd77a..1e8f991 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
@@ -35,6 +35,7 @@
 import jakarta.xml.bind.helpers.ValidationEventLocatorImpl;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.transform.Source;
@@ -260,7 +261,7 @@
         if(!seenRoot) {
             seenRoot = true;
             if(schemaLocation!=null || noNsSchemaLocation!=null) {
-                int p = nsContext.getPrefixIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE);
+                int p = nsContext.getPrefixIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
                 if(schemaLocation!=null)
                     out.attribute(p,"schemaLocation",schemaLocation);
                 if(noNsSchemaLocation!=null)
@@ -634,7 +635,7 @@
                                 getCurrentLocation(fieldName)));
                         // recover by not printing @xsi:type
                     } else {
-                        getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+                        getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
                         getNamespaceContext().declareNamespace(actualTypeName.getNamespaceURI(),null,false);
                     }
                 }
@@ -642,19 +643,19 @@
             actual.serializeURIs(child,this);
 
             if (nillable) {
-                getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+                getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
             }
             
             endNamespaceDecls(child);
             if(!asExpected) {
-                attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type",
+                attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"type",
                     DatatypeConverter.printQName(actualTypeName,getNamespaceContext()));
             }
 
             actual.serializeAttributes(child,this);
             boolean nilDefined = actual.isNilIncluded();
             if ((nillable) && (!nilDefined)) {
-                attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true");
+                attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil","true");
             }
             
             endAttributes();
@@ -756,9 +757,9 @@
      * </pre>
      */
     public final void writeXsiNilTrue() throws SAXException, IOException, XMLStreamException {
-        getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+        getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
         endNamespaceDecls(null);
-        attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true");
+        attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil","true");
         endAttributes();
     }
 
@@ -898,7 +899,7 @@
             }
 
             if(schemaLocation!=null || noNsSchemaLocation!=null) {
-                nsContext.declareNsUri(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+                nsContext.declareNsUri(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
             }
         }
 
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
index 6ac4796..5fe03eb 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
@@ -536,9 +536,9 @@
     private static final NamespacePrefixMapper defaultNamespacePrefixMapper = new NamespacePrefixMapper() {
         @Override
         public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
-            if( namespaceUri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE) )
+            if( XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(namespaceUri) )
                 return "xsi";
-            if( namespaceUri.equals(WellKnownNamespace.XML_SCHEMA) )
+            if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespaceUri) )
                 return "xs";
             if( namespaceUri.equals(WellKnownNamespace.XML_MIME_URI) )
                 return "xmime";
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
index 6d6611f..19c71cc 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
@@ -24,6 +24,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -37,6 +38,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -50,6 +52,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
index 0ae6951..6573f79 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
@@ -34,12 +34,10 @@
 /**
  * Accesses a particular property of a bean.
  * <p>
- * <p>
  * This interface encapsulates the access to the actual data store.
  * The intention is to generate implementations for a particular bean
  * and a property to improve the performance.
  * <p>
- * <p>
  * Accessor can be used as a receiver. Upon receiving an object
  * it sets that to the field.
  *
@@ -359,7 +357,6 @@
     /**
      * A version of {@link GetterSetterReflection} that doesn't have any setter.
      * <p>
-     * <p>
      * This provides a user-friendly error message.
      */
     public static class GetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {
@@ -376,7 +373,6 @@
     /**
      * A version of {@link GetterSetterReflection} thaat doesn't have any getter.
      * <p>
-     * <p>
      * This provides a user-friendly error message.
      */
     public static class SetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
index 6428ff1..2242036 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
@@ -24,6 +24,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -37,6 +38,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -50,6 +52,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
index 40abaed..7e88077 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
@@ -19,6 +19,7 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import java.util.Collection;
 
@@ -50,7 +51,7 @@
 
         // look for @xsi:type
         Attributes atts = ea.atts;
-        int idx = atts.getIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE, "type");
+        int idx = atts.getIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "type");
 
         if (idx >= 0) {
             String value = atts.getValue(idx);
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
index 71da93d..ed48a57 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
@@ -24,6 +24,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -37,6 +38,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -50,6 +52,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
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 c05c170..2ed1ca2 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
@@ -27,6 +27,7 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import java.util.Collection;
 import java.util.HashMap;
@@ -180,7 +181,7 @@
                         xacc.parse(child,avalue);
                     } else if (attCatchAll!=null) {
                         String qname = atts.getQName(i);
-                        if(atts.getURI(i).equals(WellKnownNamespace.XML_SCHEMA_INSTANCE))
+                        if(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(atts.getURI(i)))
                             continue;   // xsi:* attributes are meant to be processed by us, not by user apps.
                         Object o = state.getTarget();
                         Map<QName,String> map = attCatchAll.get(o);
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
index 490ba96..cc6e195 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
@@ -17,6 +17,7 @@
 import jakarta.xml.bind.JAXBElement;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import java.util.Collection;
 
@@ -37,7 +38,7 @@
 
     @Override
     protected Loader selectLoader(UnmarshallingContext.State state, TagName ea) throws SAXException {
-        int idx = ea.atts.getIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil");
+        int idx = ea.atts.getIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil");
 
         if (idx!=-1) {
             Boolean b = DatatypeConverterImpl._parseBoolean(ea.atts.getValue(idx));
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
index a77b4fa..e11c331 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
@@ -17,6 +17,7 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import java.util.Collection;
 import java.util.Collections;
@@ -100,7 +101,7 @@
         return beanInfo;
     }
 
-    static final QName XsiTypeQNAME = new QName(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type");
+    static final QName XsiTypeQNAME = new QName(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"type");
 
     @Override
     public Collection<QName> getExpectedAttributes() {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
index 7eca34c..e68ba06 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
@@ -36,6 +36,7 @@
 import org.glassfish.jaxb.runtime.v2.schemagen.xmlschema.*;
 import org.xml.sax.SAXParseException;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.transform.Result;
 import javax.xml.transform.stream.StreamResult;
@@ -49,7 +50,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import static org.glassfish.jaxb.core.v2.WellKnownNamespace.XML_SCHEMA;
 import static org.glassfish.jaxb.runtime.v2.schemagen.Util.*;
 
 /**
@@ -390,7 +390,7 @@
 
         // we create a Namespace object for the XML Schema namespace
         // as a side-effect, but we don't want to generate it.
-        namespaces.remove(WellKnownNamespace.XML_SCHEMA);
+        namespaces.remove(XMLConstants.W3C_XML_SCHEMA_NS_URI);
 
         // first create the outputs for all so that we can resolve references among
         // schema files when we write
@@ -537,7 +537,7 @@
 
             String nsUri = qname.getNamespaceURI();
 
-            if (nsUri.equals(XML_SCHEMA)) {
+            if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsUri)) {
                 // no need to explicitly refer to XSD namespace
                 return;
             }
@@ -584,9 +584,9 @@
 
                 // declare XML Schema namespace to be xs, but allow the user to override it.
                 // if 'xs' is used for other things, we'll just let TXW assign a random prefix
-                if(!xmlNs.containsValue(WellKnownNamespace.XML_SCHEMA)
+                if(!xmlNs.containsValue(XMLConstants.W3C_XML_SCHEMA_NS_URI)
                 && !xmlNs.containsKey("xs"))
-                    schema._namespace(WellKnownNamespace.XML_SCHEMA,"xs");
+                    schema._namespace(XMLConstants.W3C_XML_SCHEMA_NS_URI,"xs");
                 schema.version("1.0");
 
                 if(uri.length()!=0)
@@ -685,10 +685,10 @@
             // ID / IDREF handling
             switch(typeRef.getSource().id()) {
             case ID:
-                th._attribute(refAttName, new QName(WellKnownNamespace.XML_SCHEMA, "ID"));
+                th._attribute(refAttName, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "ID"));
                 return;
             case IDREF:
-                th._attribute(refAttName, new QName(WellKnownNamespace.XML_SCHEMA, "IDREF"));
+                th._attribute(refAttName, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "IDREF"));
                 return;
             case NONE:
                 // no ID/IDREF, so continue on and generate the type
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
index 8127970..1c9947e 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
@@ -25,14 +25,17 @@
         this.project = p;
     }
 
+    @Override
     public void error(SAXParseException e) {
         print(e,Project.MSG_ERR);
     }
 
+    @Override
     public void fatalError(SAXParseException e) {
         print(e,Project.MSG_ERR);
     }
 
+    @Override
     public void warning(SAXParseException e) {
         print(e,Project.MSG_WARN);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
index 298507a..cc21aea 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
@@ -27,16 +27,19 @@
         this.out = out;
     }
 
+    @Override
     public void error(SAXParseException exception) {
         out.print("[ERROR]   ");
         print(exception);
     }
 
+    @Override
     public void fatalError(SAXParseException exception) {
         out.print("[FATAL]   ");
         print(exception);
     }
 
+    @Override
     public void warning(SAXParseException exception) {
         out.print("[WARNING] ");
         print(exception);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
index 4509128..3926d07 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
@@ -19,8 +19,11 @@
  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
 public interface ErrorListener extends ErrorHandler {
+    @Override
     abstract void error (SAXParseException exception);
+    @Override
     abstract void fatalError (SAXParseException exception);
+    @Override
     abstract void warning (SAXParseException exception);
 
 }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
index 26be0c1..7f9d094 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
@@ -19,6 +19,12 @@
  */
 public class NameUtil {
 
+    /**
+     * Default constructor.
+     */
+    private NameUtil() {
+    }
+
     protected static boolean isPunct(char c) {
         return (c == '-' || c == '.' || c == ':' || c == '_' || c == '\u00b7'
                 || c == '\u0387' || c == '\u06dd' || c == '\u06de');
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
index c09a74d..1d1184f 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
@@ -45,16 +45,7 @@
 import com.sun.tools.rngdatatype.DatatypeLibrary;
 import com.sun.tools.rngdatatype.DatatypeLibraryFactory;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import java.util.Vector;
+import java.util.ServiceLoader;
 
 /**
  * @author Kohsuke Kawaguchi
@@ -66,9 +57,11 @@
         this.parseable = parseable;
     }
 
+    @Override
     public NodeSet build(TxwOptions options) throws IllegalSchemaException {
         SchemaBuilderImpl stage1 = new SchemaBuilderImpl(options.codeModel);
         DatatypeLibraryLoader loader = new DatatypeLibraryLoader(getClass().getClassLoader());
+        @SuppressWarnings("unchecked")
         Leaf pattern = (Leaf)parseable.parse(new CheckingSchemaBuilder(stage1,options.errorListener,
             new CascadingDatatypeLibraryFactory(
                 new BuiltinDatatypeLibraryFactory(loader),loader)));
@@ -77,17 +70,15 @@
     }
 
     private static final class DatatypeLibraryLoader implements DatatypeLibraryFactory {
-        private final Service service;
+        private final ServiceLoader<DatatypeLibraryFactory> service;
 
         private DatatypeLibraryLoader(ClassLoader cl) {
-            service = new Service(DatatypeLibraryFactory.class,cl);
+            service = ServiceLoader.load(DatatypeLibraryFactory.class, cl);
         }
 
+        @Override
         public DatatypeLibrary createDatatypeLibrary(String uri) {
-            for (Enumeration e = service.getProviders();
-                 e.hasMoreElements();) {
-                DatatypeLibraryFactory factory
-                        = (DatatypeLibraryFactory) e.nextElement();
+            for (DatatypeLibraryFactory factory : service) {
                 DatatypeLibrary library = factory.createDatatypeLibrary(uri);
                 if (library != null)
                     return library;
@@ -95,129 +86,5 @@
             return null;
         }
 
-        private static class Service {
-            private final Class serviceClass;
-            private /*final*/ Enumeration configFiles;
-            private Enumeration classNames = null;
-            private final Vector providers = new Vector();
-            private ClassLoader cl;
-
-            private class ProviderEnumeration implements Enumeration {
-                private int nextIndex = 0;
-
-                public boolean hasMoreElements() {
-                    return nextIndex < providers.size() || moreProviders();
-                }
-
-                public Object nextElement() {
-                    try {
-                        return providers.elementAt(nextIndex++);
-                    } catch (ArrayIndexOutOfBoundsException e) {
-                        throw new NoSuchElementException();
-                    }
-                }
-            }
-
-            public Service(Class cls, ClassLoader cl) {
-                this.cl = cl;
-                serviceClass = cls;
-                String resName = "META-INF/services/" + serviceClass.getName();
-                try {
-                    configFiles = cl.getResources(resName);
-                } catch (IOException e) {
-                    configFiles = new Vector().elements();
-                }
-            }
-
-            public Enumeration getProviders() {
-                return new ProviderEnumeration();
-            }
-
-            synchronized private boolean moreProviders() {
-                for (; ;) {
-                    while (classNames == null) {
-                        if (!configFiles.hasMoreElements())
-                            return false;
-                        classNames = parseConfigFile((URL) configFiles.nextElement());
-                    }
-                    while (classNames.hasMoreElements()) {
-                        String className = (String) classNames.nextElement();
-                        try {
-                            Class cls = cl.loadClass(className);
-                            Object obj = cls.newInstance();
-                            if (serviceClass.isInstance(obj)) {
-                                providers.addElement(obj);
-                                return true;
-                            }
-                        }
-                        catch (ClassNotFoundException e) {
-                        }
-                        catch (InstantiationException e) {
-                        }
-                        catch (IllegalAccessException e) {
-                        }
-                        catch (LinkageError e) {
-                        }
-                    }
-                    classNames = null;
-                }
-            }
-
-            private static final int START = 0;
-            private static final int IN_NAME = 1;
-            private static final int IN_COMMENT = 2;
-
-            private static Enumeration parseConfigFile(URL url) {
-                try {
-                    InputStream in = url.openStream();
-                    Reader r;
-                    try {
-                        r = new InputStreamReader(in, "UTF-8");
-                    }
-                    catch (UnsupportedEncodingException e) {
-                        r = new InputStreamReader(in, "UTF8");
-                    }
-                    r = new BufferedReader(r);
-                    Vector tokens = new Vector();
-                    StringBuffer tokenBuf = new StringBuffer();
-                    int state = START;
-                    for (; ;) {
-                        int n = r.read();
-                        if (n < 0)
-                            break;
-                        char c = (char) n;
-                        switch (c) {
-                            case '\r':
-                            case '\n':
-                                state = START;
-                                break;
-                            case ' ':
-                            case '\t':
-                                break;
-                            case '#':
-                                state = IN_COMMENT;
-                                break;
-                            default:
-                                if (state != IN_COMMENT) {
-                                    state = IN_NAME;
-                                    tokenBuf.append(c);
-                                }
-                                break;
-                        }
-                        if (tokenBuf.length() != 0 && state != IN_NAME) {
-                            tokens.addElement(tokenBuf.toString());
-                            tokenBuf.setLength(0);
-                        }
-                    }
-                    if (tokenBuf.length() != 0)
-                        tokens.addElement(tokenBuf.toString());
-                    return tokens.elements();
-                }
-                catch (IOException e) {
-                    return null;
-                }
-            }
-        }
-
     }
 }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
index b3b23b8..81c6825 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
@@ -106,6 +106,7 @@
     /**
      * launch txw
      */
+    @Override
     public void execute() throws BuildException {
         options.errorListener = new AntErrorListener(getProject());
 
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
index f23d752..62d0897 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
@@ -26,6 +26,7 @@
         this.in = in;
     }
 
+    @Override
     public NodeSet build(TxwOptions options) throws SAXException {
         XSOMParser xsom = new XSOMParser();
         xsom.parse(in);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
index 06d389c..f064bcb 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
@@ -19,15 +19,19 @@
  * @author Kohsuke Kawaguchi
  */
 final class AnnotationsImpl implements Annotations<ParsedElementAnnotation,LocatorImpl,CommentListImpl> {
+    @Override
     public void addAttribute(String ns, String localName, String prefix, String value, LocatorImpl locator) throws BuildException {
     }
 
+    @Override
     public void addElement(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
     }
 
+    @Override
     public void addComment(CommentListImpl commentList) throws BuildException {
     }
 
+    @Override
     public void addLeadingComment(CommentListImpl commentList) throws BuildException {
     }
 }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
index 2c0fd18..8bc7745 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
@@ -29,16 +29,20 @@
         this.type = type;
     }
 
+    @Override
     public Leaf makePattern(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return new Data(locator,type);
     }
 
+    @Override
     public void addParam(String name, String value, Context context, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
     }
 
+    @Override
     public void annotation(ParsedElementAnnotation parsedElementAnnotation) {
     }
 
+    @Override
     public Leaf makePattern(Leaf except, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return makePattern(locator,annotations);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
index b88b5ea..748eab4 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
@@ -28,6 +28,7 @@
         super(parent,grammar);
     }
 
+    @Override
     public void endDiv(LocatorImpl locator, AnnotationsImpl annotations) {
     }
 }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
index da5eb0c..4ebaa3a 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
@@ -28,14 +28,17 @@
         super(scope,new com.sun.tools.txw2.model.Grammar());
     }
 
+    @Override
     public Leaf endGrammar(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return new Ref(locator,grammar,com.sun.tools.txw2.model.Grammar.START);
     }
 
+    @Override
     public Leaf makeParentRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return parent.makeRef(name,locator,annotations);
     }
 
+    @Override
     public Leaf makeRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return new Ref(locator,grammar,name);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
index 76dd512..920e70d 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
@@ -37,21 +37,26 @@
         this.grammar = grammar;
     }
 
+    @Override
     public void topLevelAnnotation(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
     }
 
+    @Override
     public void topLevelComment(CommentListImpl commentList) throws BuildException {
     }
 
+    @Override
     public Div<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeDiv() {
         return new DivImpl(parent,grammar);
     }
 
+    @Override
     public Include<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeInclude() {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void define(String name, Combine combine, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         Define def = grammar.get(name);
         def.location = locator;
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
index a71b770..2842798 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
@@ -53,12 +53,14 @@
     }
 
 
+    @Override
     public Leaf expandPattern(Leaf leaf) throws BuildException {
         return leaf;
     }
 
 
 
+    @Override
     public NameClassBuilder getNameClassBuilder() throws BuildException {
         return ncb;
     }
@@ -69,52 +71,64 @@
         return leaves.get(0);
     }
 
+    @Override
     public Leaf makeChoice(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return merge(leaves);
     }
 
+    @Override
     public Leaf makeInterleave(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return merge(leaves);
     }
 
+    @Override
     public Leaf makeGroup(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return merge(leaves);
     }
 
+    @Override
     public Leaf makeOneOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return leaf;
     }
 
+    @Override
     public Leaf makeZeroOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return leaf.merge(new Empty(locator));
     }
 
+    @Override
     public Leaf makeOptional(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return leaf.merge(new Empty(locator));
     }
 
+    @Override
     public Leaf makeList(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return new List(locator,leaf);
     }
 
+    @Override
     public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return leaf.merge(new Data(locator,string));
     }
 
+    @Override
     public Leaf makeEmpty(LocatorImpl locator, AnnotationsImpl annotations) {
         return new Empty(locator);
     }
 
+    @Override
     public Leaf makeNotAllowed(LocatorImpl locator, AnnotationsImpl annotations) {
         // technically this is incorrect, but we won't be
         // able to handle <notAllowed/> correctly anyway.
         return new Empty(locator);
     }
 
+    @Override
     public Leaf makeText(LocatorImpl locator, AnnotationsImpl annotations) {
         return new Data(locator,string);
     }
 
+    @Override
     public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         Leaf r = null;
         for( QName n : nameClass.listNames() ) {
@@ -126,6 +140,7 @@
         return r;
     }
 
+    @Override
     public Leaf makeElement(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         Leaf r = null;
         for( QName n : nameClass.listNames() ) {
@@ -137,6 +152,7 @@
         return r;
     }
 
+    @Override
     public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl locator) throws BuildException {
         return new DataPatternBuilderImpl(getType(datatypeLibrary, type));
     }
@@ -147,51 +163,63 @@
         return t;
     }
 
+    @Override
     public Leaf makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
         return new Value(locator,getType(datatypeLibrary, type),value);
     }
 
+    @Override
     public Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> makeGrammar(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope) {
         return new GrammarImpl(scope);
     }
 
+    @Override
     public Leaf annotate(Leaf leaf, AnnotationsImpl annotations) throws BuildException {
         return leaf;
     }
 
+    @Override
     public Leaf annotateAfter(Leaf leaf, ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
         return leaf;
     }
 
+    @Override
     public Leaf makeErrorPattern() {
         return new Empty(null);
     }
 
+    @Override
     public boolean usesComments() {
         return false;
     }
 
+    @Override
     public Leaf makeExternalRef(Parseable current, String uri, String ns, Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException, IllegalSchemaException {
         // I'm not too sure if this is correct
         return current.parseExternal(uri, this, scope, ns );
     }
 
+    @Override
     public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber) {
         return new LocatorImpl(systemId,lineNumber,columnNumber);
     }
 
+    @Override
     public AnnotationsImpl makeAnnotations(CommentListImpl commentList, Context context) {
         return new AnnotationsImpl();
     }
 
+    @Override
     public ElementAnnotationBuilder<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl locator, CommentListImpl commentList, Context context) {
         return new ElementAnnotationBuilderImpl();
     }
 
+    @Override
     public CommentListImpl makeCommentList() {
         return null;
     }
 
+    @Override
     public Leaf commentAfter(Leaf leaf, CommentListImpl commentList) throws BuildException {
         return leaf;
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
index 36afd8e..2af91f2 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
@@ -77,34 +77,41 @@
         nodeSet.addAll(attGroups.values());
     }
 
+    @Override
     public Leaf simpleType(XSSimpleType simpleType) {
         return simpleType.apply((XSSimpleTypeFunction<Leaf>)this);
     }
 
+    @Override
     public Leaf particle(XSParticle particle) {
         return particle.getTerm().apply(this);
     }
 
+    @Override
     public Leaf empty(XSContentType empty) {
         return new Empty(empty.getLocator());
     }
 
+    @Override
     public Attribute attributeDecl(XSAttributeDecl decl) {
         return new Attribute(decl.getLocator(),
                         getQName(decl),
                         simpleType(decl.getType()));
     }
 
+    @Override
     public Attribute attributeUse(XSAttributeUse use) {
         return attributeDecl(use.getDecl());
     }
 
+    @Override
     public Leaf wildcard(XSWildcard wc) {
         // wildcard can be always written through the well-formedness method.
         // no need to generate anything for this.
         return new Empty(wc.getLocator());
     }
 
+    @Override
     public Leaf modelGroupDecl(XSModelGroupDecl mg) {
         Define def = modelGroups.get(mg);
         if(def==null) {
@@ -116,6 +123,7 @@
         return new Ref(mg.getLocator(),def);
     }
 
+    @Override
     public Leaf modelGroup(XSModelGroup mg) {
         XSParticle[] children = mg.getChildren();
         if(children.length==0)  return new Empty(mg.getLocator());
@@ -126,12 +134,14 @@
         return l;
     }
 
+    @Override
     public Leaf elementDecl(XSElementDecl e) {
         Element el = new Element(e.getLocator(),getQName(e),e.getType().apply(this));
         nodeSet.add(el);
         return el;
     }
 
+    @Override
     public Leaf complexType(XSComplexType ct) {
         Define def = complexTypes.get(ct);
         if(def==null) {
@@ -173,6 +183,7 @@
         }
     }
 
+    @Override
     public Leaf attGroupDecl(XSAttGroupDecl ag) {
         Define def = attGroups.get(ag);
         if(def==null) {
@@ -187,12 +198,14 @@
         return t.getName().equals("anyType") && t.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema");
     }
 
+    @Override
     public Leaf restrictionSimpleType(XSRestrictionSimpleType rst) {
         JType t = dtf.getType(rst.getTargetNamespace(),rst.getName());
         if(t!=null) return new Data(rst.getLocator(),t);
         return simpleType(rst.getSimpleBaseType());
     }
 
+    @Override
     public Leaf unionSimpleType(XSUnionSimpleType st) {
         Leaf l = simpleType(st.getMember(0));
         for( int i=1; i<st.getMemberSize(); i++ )
@@ -200,6 +213,7 @@
         return l;
     }
 
+    @Override
     public Leaf listSimpleType(XSListSimpleType st) {
         return new List(st.getLocator(),simpleType(st.getItemType()));
     }
@@ -241,26 +255,32 @@
 
 
 // won't be used
+    @Override
     public Leaf annotation(XSAnnotation xsAnnotation) {
         throw new IllegalStateException();
     }
 
+    @Override
     public Leaf schema(XSSchema xsSchema) {
         throw new IllegalStateException();
     }
 
+    @Override
     public Leaf facet(XSFacet xsFacet) {
         throw new IllegalStateException();
     }
 
+    @Override
     public Leaf notation(XSNotation xsNotation) {
         throw new IllegalStateException();
     }
 
+    @Override
     public Leaf identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
         throw new IllegalStateException();
     }
 
+    @Override
     public Leaf xpath(XSXPath xsxPath) {
         throw new IllegalStateException();
     }
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 0aa928d..a953bba 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
@@ -35,14 +35,17 @@
         super(location, name, leaf);
     }
 
+    @Override
     void declare(NodeSet nset) {
         ; // attributes won't produce a class
     }
 
+    @Override
     void generate(NodeSet nset) {
         ; // nothing
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         Set<JType> types = new HashSet<JType>();
 
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
index 0d6b8ee2..1057a76 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
@@ -26,10 +26,12 @@
         this.current = start;
     }
 
+    @Override
     public boolean hasNext() {
         return hasNext;
     }
 
+    @Override
     public Leaf next() {
         Leaf last = current;
         current = current.getNext();
@@ -39,6 +41,7 @@
         return last;
     }
 
+    @Override
     public void remove() {
         throw new UnsupportedOperationException();
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
index 1a6cf63..e954dac 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
@@ -31,10 +31,12 @@
         this.type = type;
     }
 
+    @Override
     public JType getDatatype(NodeSet nset) {
         return type;
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         createDataMethod(clazz,type,nset,props);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
index a60d7d9..f512283 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
@@ -48,6 +48,7 @@
         return hasOneChild() || name==Grammar.START;
     }
 
+    @Override
     void declare(NodeSet nset) {
         if(isInline())  return;
 
@@ -55,6 +56,7 @@
         clazz._implements(TypedXmlWriter.class);
     }
 
+    @Override
     void generate(NodeSet nset) {
         if(clazz==null)     return;
 
@@ -63,6 +65,7 @@
             l.generate(clazz,nset,props);
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         if(isInline()) {
             for( Leaf l : this )
@@ -73,6 +76,7 @@
         }
     }
 
+    @Override
     void prepare(NodeSet nset) {
         if(isInline() && leaf instanceof WriterNode && !name.equals(Grammar.START))
             ((WriterNode)leaf).alternativeName = name;
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 2db5100..e17b93b 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
@@ -66,15 +66,18 @@
         return new DataOnly();
     }
 
+    @Override
     void declare(NodeSet nset) {
         strategy = decideStrategy();
         strategy.declare(nset);
     }
 
+    @Override
     void generate(NodeSet nset) {
         strategy.generate(nset);
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         strategy.generate(clazz,nset,props);
     }
@@ -111,6 +114,7 @@
     private class ToInterface implements Strategy {
         private JDefinedClass clazz;
 
+        @Override
         public void declare(NodeSet nset) {
             String cname;
             if(alternativeName!=null)
@@ -125,12 +129,14 @@
             // TODO: namespace
         }
 
+        @Override
         public void generate(NodeSet nset) {
             HashSet<Prop> props = new HashSet<Prop>();
             for( Leaf l : Element.this )
                 l.generate(clazz,nset, props);
         }
 
+        @Override
         public void generate(JDefinedClass outer, NodeSet nset, Set<Prop> props) {
             if(props.add(new ElementProp(name,clazz)))
                 generateMethod(outer, nset, clazz);
@@ -147,11 +153,14 @@
             this.ref = ref;
         }
 
+        @Override
         public void declare(NodeSet nset) {
         }
+        @Override
         public void generate(NodeSet nset) {
         }
 
+        @Override
         public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
             if(props.add(new ElementProp(name,ref.def.clazz)))
                 generateMethod(clazz, nset, ref.def.clazz);
@@ -159,12 +168,15 @@
     }
 
     private class DataOnly implements Strategy {
+        @Override
         public void declare(NodeSet nset) {
         }
+        @Override
         public void generate(NodeSet nset) {
         }
 
         // TODO: code share with Attribute
+        @Override
         public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
             Set<JType> types = new HashSet<JType>();
 
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
index e463074..960d932 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
@@ -24,6 +24,7 @@
         super(location);
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         // noop
     }
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 e9d6fa9..dafc7b4 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
@@ -77,6 +77,7 @@
      */
     public final Iterable<Leaf> siblings() {
         return new Iterable<Leaf>() {
+            @Override
             public Iterator<Leaf> iterator() {
                 return new CycleIterator(Leaf.this);
             }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
index 19f510b..8c5ec9f 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
@@ -27,6 +27,7 @@
         super(location, leaf);
     }
 
+    @Override
     public JType getDatatype(NodeSet nset) {
         if(hasOneChild() && leaf instanceof Text) {
             return ((Text)leaf).getDatatype(nset).array();
@@ -35,6 +36,7 @@
         }
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         createDataMethod(clazz,getDatatype(nset),nset,props);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
index 9eae78e..df4619e 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
@@ -38,6 +38,7 @@
     /**
      * Iterates all the children.
      */
+    @Override
     public final Iterator<Leaf> iterator() {
         return new CycleIterator(leaf);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
index a43d956..d5bab92 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
@@ -23,6 +23,7 @@
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -111,8 +112,9 @@
         return b;
     }
 
+    @SuppressWarnings("unchecked")
     public <T extends WriterNode> Collection<T> subset(Class<T> t) {
-        ArrayList<T> r = new ArrayList<T>(size());
+        List<T> r = new ArrayList<T>(size());
         for( WriterNode n : this )
             if(t.isInstance(n))
                 r.add((T)n);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
index 8742395..6958e86 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
@@ -38,6 +38,7 @@
         return def.isInline();
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         def.generate(clazz,nset,props);
     }
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
index b50a709..a898720 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
@@ -39,10 +39,12 @@
         this.name = name;
     }
 
+    @Override
     void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
         createDataMethod(clazz,type,nset,props);
     }
 
+    @Override
     public JType getDatatype(NodeSet nset) {
         // TODO: enum support
         return type;
diff --git a/jaxb-ri/txw/compiler/src/main/java/module-info.java b/jaxb-ri/txw/compiler/src/main/java/module-info.java
index 0c728be..728ca77 100644
--- a/jaxb-ri/txw/compiler/src/main/java/module-info.java
+++ b/jaxb-ri/txw/compiler/src/main/java/module-info.java
@@ -20,4 +20,7 @@
     exports com.sun.tools.txw2;
     exports com.sun.tools.txw2.model;
     exports com.sun.tools.txw2.model.prop;
+
+    uses com.sun.tools.rngdatatype.DatatypeLibraryFactory;
+
 }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
index f337c7d..bcd3737 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
@@ -20,6 +20,7 @@
         super(document, nsResolver, obj);
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onCdata(buffer);
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
index 76c5781..b1c3fce 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
@@ -25,10 +25,12 @@
         document.writeValue(obj,nsResolver,buffer);
     }
 
+    @Override
     boolean concludesPendingStartTag() {
         return false;
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onComment(buffer);
     }
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 c846f68..771a38a 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
@@ -85,6 +85,7 @@
         return tail==null;
     }
 
+    @Override
     public Document getDocument() {
         return document;
     }
@@ -93,10 +94,12 @@
         return blocked && !isCommitted();
     }
 
+    @Override
     public void block() {
         blocked = true;
     }
 
+    @Override
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         if(method.getDeclaringClass()==TypedXmlWriter.class || method.getDeclaringClass()==Object.class) {
             // forward to myself
@@ -230,10 +233,12 @@
         tail = child;
     }
 
+    @Override
     public void commit() {
         commit(true);
     }
 
+    @Override
     public void commit(boolean includingAllPredecessors) {
         _commit(includingAllPredecessors);
         document.flush();
@@ -280,23 +285,28 @@
         this.prevOpen = null;
     }
 
+    @Override
     public void _attribute(String localName, Object value) {
         _attribute("",localName,value);
     }
 
+    @Override
     public void _attribute(String nsUri, String localName, Object value) {
         checkStartTag();
         startTag.addAttribute(nsUri,localName,value);
     }
 
+    @Override
     public void _attribute(QName attributeName, Object value) {
         _attribute(attributeName.getNamespaceURI(),attributeName.getLocalPart(),value);
     }
 
+    @Override
     public void _namespace(String uri) {
         _namespace(uri,false);
     }
 
+    @Override
     public void _namespace(String uri, String prefix) {
         if(prefix==null)
             throw new IllegalArgumentException();
@@ -304,41 +314,50 @@
         startTag.addNamespaceDecl(uri,prefix,false);
     }
 
+    @Override
     public void _namespace(String uri, boolean requirePrefix) {
         checkStartTag();
         startTag.addNamespaceDecl(uri,null,requirePrefix);
     }
 
+    @Override
     public void _pcdata(Object value) {
         // we need to allow this method even when startTag has already been completed.
         // checkStartTag();
         addChild(new Pcdata(document,startTag,value));
     }
 
+    @Override
     public void _cdata(Object value) {
         addChild(new Cdata(document,startTag,value));
     }
 
+    @Override
     public void _comment(Object value) throws UnsupportedOperationException {
         addChild(new Comment(document,startTag,value));
     }
 
+    @Override
     public <T extends TypedXmlWriter> T _element(String localName, Class<T> contentModel) {
         return _element(nsUri,localName,contentModel);
     }
 
+    @Override
     public <T extends TypedXmlWriter> T _element(QName tagName, Class<T> contentModel) {
         return _element(tagName.getNamespaceURI(),tagName.getLocalPart(),contentModel);
     }
 
+    @Override
     public <T extends TypedXmlWriter> T _element(Class<T> contentModel) {
         return _element(TXW.getTagName(contentModel),contentModel);
     }
 
+    @Override
     public <T extends TypedXmlWriter> T _cast(Class<T> facadeType) {
         return facadeType.cast(Proxy.newProxyInstance(facadeType.getClassLoader(),new Class<?>[]{facadeType},this));
     }
 
+    @Override
     public <T extends TypedXmlWriter> T _element(String nsUri, String localName, Class<T> contentModel) {
         ContainerElement child = new ContainerElement(document,this,nsUri,localName);
         addChild(child.startTag);
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 780690d..d83204d 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
@@ -46,41 +46,51 @@
         @SuppressWarnings({"unchecked", "rawtypes"})
         private DatatypeWriter<Object>[] BUILTIN_ARRAY = new DatatypeWriter[] {
             new DatatypeWriter<String>() {
+                @Override
                 public Class<String> getType() {
                     return String.class;
                 }
+                @Override
                 public void print(String s, NamespaceResolver resolver, StringBuilder buf) {
                     buf.append(s);
                 }
             },
             new DatatypeWriter<Integer>() {
+                @Override
                 public Class<Integer> getType() {
                     return Integer.class;
                 }
+                @Override
                 public void print(Integer i, NamespaceResolver resolver, StringBuilder buf) {
                     buf.append(i);
                 }
             },
             new DatatypeWriter<Float>() {
+                @Override
                 public Class<Float> getType() {
                     return Float.class;
                 }
+                @Override
                 public void print(Float f, NamespaceResolver resolver, StringBuilder buf) {
                     buf.append(f);
                 }
             },
             new DatatypeWriter<Double>() {
+                @Override
                 public Class<Double> getType() {
                     return Double.class;
                 }
+                @Override
                 public void print(Double d, NamespaceResolver resolver, StringBuilder buf) {
                     buf.append(d);
                 }
             },
             new DatatypeWriter<QName>() {
+                @Override
                 public Class<QName> getType() {
                     return QName.class;
                 }
+                @Override
                 public void print(QName qn, NamespaceResolver resolver, StringBuilder buf) {
                     String p = resolver.getPrefix(qn.getNamespaceURI());
                     if(p.length()!=0)
@@ -90,10 +100,12 @@
             }
         };
                 
+        @Override
         public DatatypeWriter<Object> get(int n) {
           return BUILTIN_ARRAY[n];
         }
 
+        @Override
         public int size() {
           return BUILTIN_ARRAY.length;
         }
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 6186e89..7c0e4d1 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
@@ -144,6 +144,7 @@
 
     // I wanted to hide those write method from users
     private final ContentVisitor visitor = new ContentVisitor() {
+        @Override
         public void onStartDocument() {
             // the startDocument token is used as the sentry, so this method shall never
             // be called.
@@ -151,34 +152,40 @@
             throw new IllegalStateException();
         }
 
+        @Override
         public void onEndDocument() {
             out.endDocument();
         }
 
+        @Override
         public void onEndTag() {
             out.endTag();
             inscopeNamespace.popContext();
             activeNamespaces = null;
         }
 
+        @Override
         public void onPcdata(StringBuilder buffer) {
             if(activeNamespaces!=null)
                 buffer = fixPrefix(buffer);
             out.text(buffer);
         }
 
+        @Override
         public void onCdata(StringBuilder buffer) {
             if(activeNamespaces!=null)
                 buffer = fixPrefix(buffer);
             out.cdata(buffer);
         }
 
+        @Override
         public void onComment(StringBuilder buffer) {
             if(activeNamespaces!=null)
                 buffer = fixPrefix(buffer);
             out.comment(buffer);
         }
 
+        @Override
         public void onStartTag(String nsUri, String localName, Attribute attributes, NamespaceDecl namespaces) {
             assert nsUri!=null;
             assert localName!=null;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
index 2733e96..fbf0981 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
@@ -14,10 +14,12 @@
  * @author Kohsuke Kawaguchi
  */
 final class EndDocument extends Content {
+    @Override
     boolean concludesPendingStartTag() {
         return true;
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onEndDocument();
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
index c99143b..f9b6f58 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
@@ -14,10 +14,12 @@
  * @author Kohsuke Kawaguchi
  */
 final class EndTag extends Content {
+    @Override
     boolean concludesPendingStartTag() {
         return true;
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onEndTag();
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
index a3ba782..b1ffafb 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
@@ -20,6 +20,7 @@
         super(document, nsResolver, obj);
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onPcdata(buffer);
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
index 8b762bb..41e1e66 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
@@ -14,10 +14,12 @@
  * @author Kohsuke Kawaguchi
  */
 final class StartDocument extends Content {
+    @Override
     boolean concludesPendingStartTag() {
         return true;
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onStartDocument();
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
index ca50b53..c2d0c3c 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
@@ -195,6 +195,7 @@
      * A {@link StartTag} can be only written after
      * we are sure that all the necessary namespace declarations are given.
      */
+    @Override
     boolean isReadyToCommit() {
         if(owner!=null && owner.isBlocked())
             return false;
@@ -206,6 +207,7 @@
         return false;
     }
 
+    @Override
     public void written() {
         firstAtt = lastAtt = null;
         uri = null;
@@ -215,14 +217,17 @@
         }
     }
 
+    @Override
     boolean concludesPendingStartTag() {
         return true;
     }
 
+    @Override
     void accept(ContentVisitor visitor) {
         visitor.onStartTag(uri,localName,firstAtt,firstNs);
     }
 
+    @Override
     public String getPrefix(String nsUri) {
         NamespaceDecl ns = addNamespaceDecl(nsUri,null,false);
         if(ns.prefix!=null)
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
index db670e4..72c14f3 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
@@ -25,6 +25,7 @@
         document.writeValue(obj,nsResolver,buffer);
     }
 
+    @Override
     boolean concludesPendingStartTag() {
         return false;
     }
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 a6c36ee..4f9cc6b 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
@@ -178,6 +178,7 @@
      *
      * @see XMLWriter#reset()
      */
+    @Override
     public void reset ()
     {
         depth = 0;
@@ -206,6 +207,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#startElement(String, String, String, Attributes)
      */
+    @Override
     public void startElement (String uri, String localName,
                               String qName, Attributes atts)
         throws SAXException
@@ -239,6 +241,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#endElement(String, String, String)
      */
+    @Override
     public void endElement (String uri, String localName, String qName)
         throws SAXException
     {
@@ -295,6 +298,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#characters(char[], int, int)
      */
+    @Override
     public void characters (char ch[], int start, int length)
         throws SAXException
     {
@@ -302,6 +306,7 @@
         super.characters(ch, start, length);
     }
 
+    @Override
     public void comment(char ch[], int start, int length) throws SAXException {
         if (depth > 0) {
             super.characters("\n");
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
index 6ced3ec..9c8553d 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
@@ -26,130 +26,162 @@
         this.writer = writer;
     }
 
+    @Override
     public void writeStartElement(String localName) throws XMLStreamException {
         writer.writeStartElement(localName);
     }
 
+    @Override
     public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
         writer.writeStartElement(namespaceURI, localName);
     }
 
+    @Override
     public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
         writer.writeStartElement(prefix, localName, namespaceURI);
     }
 
+    @Override
     public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
         writer.writeEmptyElement(namespaceURI, localName);
     }
 
+    @Override
     public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
         writer.writeEmptyElement(prefix, localName, namespaceURI);
     }
 
+    @Override
     public void writeEmptyElement(String localName) throws XMLStreamException {
         writer.writeEmptyElement(localName);
     }
 
+    @Override
     public void writeEndElement() throws XMLStreamException {
         writer.writeEndElement();
     }
 
+    @Override
     public void writeEndDocument() throws XMLStreamException {
         writer.writeEndDocument();
     }
 
+    @Override
     public void close() throws XMLStreamException {
         writer.close();
     }
 
+    @Override
     public void flush() throws XMLStreamException {
         writer.flush();
     }
 
+    @Override
     public void writeAttribute(String localName, String value) throws XMLStreamException {
         writer.writeAttribute(localName, value);
     }
 
+    @Override
     public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
         writer.writeAttribute(prefix, namespaceURI, localName, value);
     }
 
+    @Override
     public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
         writer.writeAttribute(namespaceURI, localName, value);
     }
 
+    @Override
     public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
         writer.writeNamespace(prefix, namespaceURI);
     }
 
+    @Override
     public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
         writer.writeDefaultNamespace(namespaceURI);
     }
 
+    @Override
     public void writeComment(String data) throws XMLStreamException {
         writer.writeComment(data);
     }
 
+    @Override
     public void writeProcessingInstruction(String target) throws XMLStreamException {
         writer.writeProcessingInstruction(target);
     }
 
+    @Override
     public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
         writer.writeProcessingInstruction(target, data);
     }
 
+    @Override
     public void writeCData(String data) throws XMLStreamException {
         writer.writeCData(data);
     }
 
+    @Override
     public void writeDTD(String dtd) throws XMLStreamException {
         writer.writeDTD(dtd);
     }
 
+    @Override
     public void writeEntityRef(String name) throws XMLStreamException {
         writer.writeEntityRef(name);
     }
 
+    @Override
     public void writeStartDocument() throws XMLStreamException {
         writer.writeStartDocument();
     }
 
+    @Override
     public void writeStartDocument(String version) throws XMLStreamException {
         writer.writeStartDocument(version);
     }
 
+    @Override
     public void writeStartDocument(String encoding, String version) throws XMLStreamException {
         writer.writeStartDocument(encoding, version);
     }
 
+    @Override
     public void writeCharacters(String text) throws XMLStreamException {
         writer.writeCharacters(text);
     }
 
+    @Override
     public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
         writer.writeCharacters(text, start, len);
     }
 
+    @Override
     public String getPrefix(String uri) throws XMLStreamException {
         return writer.getPrefix(uri);
     }
 
+    @Override
     public void setPrefix(String prefix, String uri) throws XMLStreamException {
         writer.setPrefix(prefix, uri);
     }
 
+    @Override
     public void setDefaultNamespace(String uri) throws XMLStreamException {
         writer.setDefaultNamespace(uri);
     }
 
+    @Override
     public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
         writer.setNamespaceContext(context);
     }
 
+    @Override
     public NamespaceContext getNamespaceContext() {
         return writer.getNamespaceContext();
     }
 
+    @Override
     public Object getProperty(String name) throws IllegalArgumentException {
         return writer.getProperty(name);
     }
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 cca6bff..dcdef05 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
@@ -65,46 +65,57 @@
     }
 
     // XmlSerializer api's - delegate to SaxSerializer
+    @Override
     public void startDocument() {
         serializer.startDocument();
     }
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         serializer.beginStartTag(uri, localName, prefix);
     }
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         serializer.writeAttribute(uri, localName, prefix, value);
     }
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         serializer.writeXmlns(prefix, uri);
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         serializer.endStartTag(uri, localName, prefix);
     }
 
+    @Override
     public void endTag() {
         serializer.endTag();
     }
 
+    @Override
     public void text(StringBuilder text) {
         serializer.text(text);
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         serializer.cdata(text);
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         serializer.comment(comment);
     }
 
+    @Override
     public void endDocument() {
         serializer.endDocument();
     }
 
+    @Override
     public void flush() {
         // no flushing
     }
@@ -165,12 +176,15 @@
         return _node;
     }
 
+    @Override
     public void startDocument() {
     }
 
+    @Override
     public void endDocument(){
     }
 
+    @Override
     public void startElement(String namespace, String localName, String qName, Attributes attrs){
 
         // some broken DOM implementatino (we confirmed it with SAXON)
@@ -231,11 +245,13 @@
         return _nodeStk.peek();
     }
 
+    @Override
     public void endElement(String namespace, String localName, String qName){
         _nodeStk.pop();
     }
 
 
+    @Override
     public void characters(char[] ch, int start, int length) {
         Node text;
         if(inCDATA)
@@ -245,52 +261,65 @@
         getParent().appendChild(text);
     }
 
+    @Override
     public void comment(char ch[], int start, int length) throws SAXException {
         getParent().appendChild(_document.createComment(new String(ch,start,length)));
     }
 
 
 
+    @Override
     public void ignorableWhitespace(char[] ch, int start, int length) {
     }
 
+    @Override
     public void processingInstruction(String target, String data) throws org.xml.sax.SAXException{
         Node node = _document.createProcessingInstruction(target, data);
         getParent().appendChild(node);
     }
 
+    @Override
     public void setDocumentLocator(Locator locator) {
     }
 
+    @Override
     public void skippedEntity(String name) {
     }
 
     private List<String> unprocessedNamespaces = new ArrayList<>();
 
+    @Override
     public void startPrefixMapping(String prefix, String uri) {
         unprocessedNamespaces.add(prefix);
         unprocessedNamespaces.add(uri);
     }
 
+    @Override
     public void endPrefixMapping(String prefix) {
     }
 
+    @Override
     public void startDTD(String name, String publicId, String systemId) throws SAXException {
     }
 
+    @Override
     public void endDTD() throws SAXException {
     }
 
+    @Override
     public void startEntity(String name) throws SAXException {
     }
 
+    @Override
     public void endEntity(String name) throws SAXException {
     }
 
+    @Override
     public void startCDATA() throws SAXException {
         inCDATA = true;
     }
 
+    @Override
     public void endCDATA() throws SAXException {
         inCDATA = false;
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
index c385b31..4d95cc1 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
@@ -29,6 +29,7 @@
     
     public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler();
     
+    @Override
     public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
         int limit = start+length;
         for (int i = start; i < limit; i++) {
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
index fe58c7b..d9823ea 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
@@ -26,50 +26,61 @@
         this.out = out;
     }
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         out.println('<'+prefix+':'+localName);
     }
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         out.println('@'+prefix+':'+localName+'='+value);
     }
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         out.println("xmlns:"+prefix+'='+uri);
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         out.println('>');
     }
 
+    @Override
     public void endTag() {
         out.println("</  >");
     }
 
+    @Override
     public void text(StringBuilder text) {
         out.println(text);
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         out.println("<![CDATA[");
         out.println(text);
         out.println("]]>");
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         out.println("<!--");
         out.println(comment);
         out.println("-->");
     }
 
+    @Override
     public void startDocument() {
         out.println("<?xml?>");
     }
 
+    @Override
     public void endDocument() {
         out.println("done");
     }
 
+    @Override
     public void flush() {
         out.println("flush");
     }
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 1767b45..5312a98 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
@@ -115,6 +115,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#startElement(String, String, String,Attributes)
      */
+    @Override
     public void startElement (String uri, String localName,
                               String qName, Attributes atts)
         throws SAXException {
@@ -153,6 +154,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#endElement(String, String, String)
      */
+    @Override
     public void endElement (String uri, String localName, String qName)
         throws SAXException
     {
@@ -209,6 +211,7 @@
      *            down the chain raises an exception.
      * @see XMLWriter#characters(char[], int, int)
      */
+    @Override
     public void characters (char ch[], int start, int length)
         throws SAXException
     {
@@ -216,6 +219,7 @@
         super.characters(ch, start, length);
     }
 
+    @Override
     public void comment(char ch[], int start, int length) throws SAXException {
         if (depth > 0) {
             writeNewLine();
@@ -225,31 +229,37 @@
             lexical.comment(ch,start,length);
     }
 
+    @Override
     public void startDTD(String name, String publicId, String systemId) throws SAXException {
         if(lexical!=null)
             lexical.startDTD(name, publicId, systemId);
     }
 
+    @Override
     public void endDTD() throws SAXException {
         if(lexical!=null)
             lexical.endDTD();
     }
 
+    @Override
     public void startEntity(String name) throws SAXException {
         if(lexical!=null)
             lexical.startEntity(name);
     }
 
+    @Override
     public void endEntity(String name) throws SAXException {
         if(lexical!=null)
             lexical.endEntity(name);
     }
 
+    @Override
     public void startCDATA() throws SAXException {
         if(lexical!=null)
             lexical.startCDATA();
     }
 
+    @Override
     public void endCDATA() throws SAXException {
         if(lexical!=null)
             lexical.endCDATA();
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 041f4cb..cca5218 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
@@ -115,66 +115,79 @@
     }
 
 
+    @Override
     public void writeStartDocument() throws XMLStreamException {
         super.writeStartDocument();
         super.writeCharacters("\n");
     }
 
+    @Override
     public void writeStartDocument(String version) throws XMLStreamException {
         super.writeStartDocument(version);
         super.writeCharacters("\n");
     }
 
+    @Override
     public void writeStartDocument(String encoding, String version) throws XMLStreamException {
         super.writeStartDocument(encoding, version);
         super.writeCharacters("\n");
     }
 
+    @Override
     public void writeStartElement(String localName) throws XMLStreamException {
         onStartElement();
         super.writeStartElement(localName);
     }
 
+    @Override
     public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
         onStartElement();
         super.writeStartElement(namespaceURI, localName);
     }
 
+    @Override
     public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
         onStartElement();
         super.writeStartElement(prefix, localName, namespaceURI);
     }
 
+    @Override
     public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
         onEmptyElement();
         super.writeEmptyElement(namespaceURI, localName);
     }
 
+    @Override
     public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
         onEmptyElement();
         super.writeEmptyElement(prefix, localName, namespaceURI);
     }
 
+    @Override
     public void writeEmptyElement(String localName) throws XMLStreamException {
         onEmptyElement();
         super.writeEmptyElement(localName);
     }
 
+    @Override
     public void writeEndElement() throws XMLStreamException {
         onEndElement();
         super.writeEndElement();
     }
 
+    @Override
     public void writeCharacters(String text) throws XMLStreamException {
         state = SEEN_DATA;
         super.writeCharacters(text);
     }
 
+    @Override
     public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
         state = SEEN_DATA;
         super.writeCharacters(text, start, len);
     }
 
+    @Override
     public void writeCData(String data) throws XMLStreamException {
         state = SEEN_DATA;
         super.writeCData(data);
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 6b36806..96020dc 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
@@ -62,6 +62,7 @@
 
     // XmlSerializer implementation
 
+    @Override
     public void startDocument() {
         try {
             writer.startDocument();
@@ -74,6 +75,7 @@
     // add in #writeXmlns and fired in #endStartTag
     private final Stack<String> prefixBindings = new Stack<>();
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         // defend against parsers that pass null in for "xmlns" prefix
         if (prefix == null) {
@@ -91,6 +93,7 @@
     // element stack
     private final Stack<String> elementBindings = new Stack<>();
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         // save element bindings for #endTag
         elementBindings.add(getQName(prefix, localName));
@@ -103,6 +106,7 @@
     // handler in #endStartTag
     private final AttributesImpl attrs = new AttributesImpl();
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         attrs.addAttribute(uri,
                 localName,
@@ -111,6 +115,7 @@
                 value.toString());
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         try {
             while (prefixBindings.size() != 0) {
@@ -130,6 +135,7 @@
         }
     }
 
+    @Override
     public void endTag() {
         try {
             writer.endElement(elementBindings.pop(), // uri
@@ -141,6 +147,7 @@
         }
     }
 
+    @Override
     public void text(StringBuilder text) {
         try {
             writer.characters(text.toString().toCharArray(), 0, text.length());
@@ -149,6 +156,7 @@
         }
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         if(lexical==null)
             throw new UnsupportedOperationException("LexicalHandler is needed to write PCDATA");
@@ -162,6 +170,7 @@
         }
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         try {
             if(lexical==null)
@@ -173,6 +182,7 @@
         }
     }
 
+    @Override
     public void endDocument() {
         try {
             writer.endDocument();
@@ -181,6 +191,7 @@
         }
     }
 
+    @Override
     public void flush() {
         // noop
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
index 1bc2a0e..628b7d4 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
@@ -36,6 +36,7 @@
         this.out = writer;
     }
 
+    @Override
     public void startDocument() {
         try {
             out.writeStartDocument();
@@ -44,6 +45,7 @@
         }
     }
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         try {
             out.writeStartElement(prefix, localName, uri);
@@ -52,6 +54,7 @@
         }
     }
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         try {
             out.writeAttribute(prefix, uri, localName, value.toString());
@@ -60,6 +63,7 @@
         }
     }
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         try {
             if (prefix.length() == 0) {
@@ -75,10 +79,12 @@
         }
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         // NO-OP
     }
 
+    @Override
     public void endTag() {
         try {
             out.writeEndElement();
@@ -87,6 +93,7 @@
         }
     }
 
+    @Override
     public void text(StringBuilder text) {
         try {
             out.writeCharacters(text.toString());
@@ -95,6 +102,7 @@
         }
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         try {
             out.writeCData(text.toString());
@@ -103,6 +111,7 @@
         }
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         try {
             out.writeComment(comment.toString());
@@ -111,6 +120,7 @@
         }
     }
 
+    @Override
     public void endDocument() {
         try {
             out.writeEndDocument();
@@ -120,6 +130,7 @@
         }
     }
 
+    @Override
     public void flush() {
         try {
             out.flush();
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
index bdcd6ba..7aa99aa 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
@@ -70,6 +70,7 @@
 
         // now delegate to the SaxSerializer
         serializer = new SaxSerializer(writer,writer,false) {
+            @Override
             public void endDocument() {
                 super.endDocument();
                 if(autoClose[0]!=null) {
@@ -104,46 +105,57 @@
     }
 
     // XmlSerializer api's - delegate to SaxSerializer
+    @Override
     public void startDocument() {
         serializer.startDocument();
     }
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         serializer.beginStartTag(uri, localName, prefix);
     }
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         serializer.writeAttribute(uri, localName, prefix, value);
     }
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         serializer.writeXmlns(prefix, uri);
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         serializer.endStartTag(uri, localName, prefix);
     }
 
+    @Override
     public void endTag() {
         serializer.endTag();
     }
 
+    @Override
     public void text(StringBuilder text) {
         serializer.text(text);
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         serializer.cdata(text);
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         serializer.comment(comment);
     }
 
+    @Override
     public void endDocument() {
         serializer.endDocument();
     }
 
+    @Override
     public void flush() {
         serializer.flush();
         try {
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
index 8d0be36..87433f9 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
@@ -41,10 +41,12 @@
         this.writer = writer;
     }
 
+    @Override
     public String getSystemId() {
         return systemId;
     }
 
+    @Override
     public void setSystemId(String systemId) {
         this.systemId = systemId;
     }
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
index 2d35915..83bce0e 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
@@ -26,46 +26,57 @@
         this.txw = txw;
     }
 
+    @Override
     public void startDocument() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void endDocument() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void beginStartTag(String uri, String localName, String prefix) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void writeXmlns(String prefix, String uri) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void endStartTag(String uri, String localName, String prefix) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void endTag() {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void text(StringBuilder text) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void cdata(StringBuilder text) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void comment(StringBuilder comment) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void flush() {
         throw new UnsupportedOperationException();
     }
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 d25eba9..d7b83da 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
@@ -388,7 +388,8 @@
     
 
     private final Map<String, String> locallyDeclaredPrefix = new HashMap<>();
-    public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+    @Override
+    public void startPrefixMapping(String prefix, String uri ) throws SAXException {
         locallyDeclaredPrefix.put(prefix,uri);
     }
     
@@ -407,6 +408,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#startDocument()
      */
+    @Override
     public void startDocument ()
         throws SAXException
     {
@@ -441,6 +443,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#endDocument()
      */
+    @Override
     public void endDocument ()
         throws SAXException
     {
@@ -481,6 +484,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
      */
+    @Override
     public void startElement (String uri, String localName,
                               String qName, Attributes atts)
         throws SAXException
@@ -551,6 +555,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
      */
+    @Override
     public void endElement (String uri, String localName, String qName)
         throws SAXException
     {
@@ -588,6 +593,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#characters(char[], int, int)
      */
+    @Override
     public void characters (char ch[], int start, int len)
         throws SAXException
     {
@@ -620,6 +626,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
      */
+    @Override
     public void ignorableWhitespace (char ch[], int start, int length)
         throws SAXException
     {
@@ -645,6 +652,7 @@
      *            the filter chain raises an exception.
      * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
      */
+    @Override
     public void processingInstruction (String target, String data)
         throws SAXException
     {
@@ -887,18 +895,23 @@
     }
 
 
+    @Override
     public void startDTD(String name, String publicId, String systemId) throws SAXException {
     }
 
+    @Override
     public void endDTD() throws SAXException {
     }
 
+    @Override
     public void startEntity(String name) throws SAXException {
     }
 
+    @Override
     public void endEntity(String name) throws SAXException {
     }
 
+    @Override
     public void startCDATA() throws SAXException {
         try {
             if (!startTagIsClosed) {
@@ -912,6 +925,7 @@
         }
     }
 
+    @Override
     public void endCDATA() throws SAXException {
         try {
             inCDATA = false;
@@ -921,6 +935,7 @@
         }
     }
 
+    @Override
     public void comment(char ch[], int start, int length) throws SAXException {
         try {
             output.write("<!--");
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 a957c06..1601301 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
@@ -198,8 +198,9 @@
             this.baseParser = baseParser;
         }
 
+        @Override
         public void parse(InputSource source, ContentHandler handler,
-            ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
+                          ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
             // set up the chain of handlers.
             handler = wrapBy( new ExtensionBindingChecker(XMLConstants.W3C_XML_SCHEMA_NS_URI,opt,errorReceiver), handler );
             handler = wrapBy( new IncorrectNamespaceURIChecker(errorReceiver), handler );
@@ -432,8 +433,9 @@
         XMLParser parser = new XMLParser() {
             private final JAXPParser base = new JAXPParser(XmlFactory.createParserFactory(opt.disableXmlSecurity));
 
+            @Override
             public void parse(InputSource source, ContentHandler handler,
-                ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
+                              ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
                 // set up the chain of handlers.
                 handler = wrapBy( new SpeculationChecker(), handler );
                 handler = wrapBy( new VersionChecker(null,errorReceiver,entityResolver), handler );
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
index 64c989b..a96484a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
@@ -34,10 +34,12 @@
  */
 public class PluginImpl extends Plugin {
 
+    @Override
     public String getOptionName() {
         return "Xpropertyaccessors";
     }
 
+    @Override
     public String getUsage() {
         return "  -Xpropertyaccessors :  Use XmlAccessType PROPERTY instead of FIELD for generated classes";
     }
@@ -47,7 +49,8 @@
         return 0;   // no option recognized
     }
 
-    public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
+    @Override
+    public boolean run(Outline model, Options opt, ErrorHandler errorHandler ) {
 
         for( ClassOutline co : model.getClasses() ) {
             Iterator<JAnnotationUse> ann = co.ref.annotations().iterator();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
index cf75664..0928a80 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
@@ -32,23 +32,28 @@
  * @author Kohsuke Kawaguchi
  */
 public class PluginImpl extends Plugin {
+    @Override
     public String getOptionName() {
         return "Xinject-code";
     }
 
+    @Override
     public List<String> getCustomizationURIs() {
         return Collections.singletonList(Const.NS);
     }
 
+    @Override
     public boolean isCustomizationTagName(String nsUri, String localName) {
         return Const.NS.equals(nsUri) && "code".equals(localName);
     }
 
+    @Override
     public String getUsage() {
         return "  -Xinject-code       :  inject specified Java code fragments into the generated code";
     }
 
     // meat of the processing
+    @Override
     public boolean run(@NotNull Outline model, Options opt, ErrorHandler errorHandler) {
         checkAndInject(model.getClasses());
         checkAndInject(model.getEnums());
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 5003bd4..1d30a8a 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
@@ -204,71 +204,88 @@
                 return "tns:" + decl.getName();
         }
 
+        @Override
         public String complexType(XSComplexType type) {
             return "~" + name(type);
         }
 
+        @Override
         public String simpleType(XSSimpleType simpleType) {
             return "~" + name(simpleType);
         }
 
+        @Override
         public String elementDecl(XSElementDecl decl) {
             return name(decl);
         }
 
         // the rest is doing nothing
+        @Override
         public String annotation(XSAnnotation ann) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String attGroupDecl(XSAttGroupDecl decl) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String attributeDecl(XSAttributeDecl decl) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String attributeUse(XSAttributeUse use) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String schema(XSSchema schema) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String facet(XSFacet facet) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String notation(XSNotation notation) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String identityConstraint(XSIdentityConstraint decl) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String xpath(XSXPath xpath) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String particle(XSParticle particle) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String empty(XSContentType empty) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String wildcard(XSWildcard wc) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String modelGroupDecl(XSModelGroupDecl decl) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String modelGroup(XSModelGroup group) {
             throw new UnsupportedOperationException();
         }
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 5b91bd1..41dd436 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
@@ -25,6 +25,8 @@
 import jakarta.xml.bind.annotation.adapters.NormalizedStringAdapter;
 import jakarta.xml.bind.annotation.adapters.XmlAdapter;
 import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import javax.xml.XMLConstants;
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.namespace.QName;
@@ -266,7 +268,7 @@
             this(c,typeName,org.glassfish.jaxb.core.v2.model.core.ID.NONE);
         }
         protected Builtin(Class<?> c, String typeName, ID id) {
-            super(NavigatorImpl.theInstance.ref(c), id, new QName(WellKnownNamespace.XML_SCHEMA,typeName));
+            super(NavigatorImpl.theInstance.ref(c), id, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,typeName));
             LEAVES.put(getType(),this);
         }
 
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 e565fb3..c280aba 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
@@ -26,6 +26,8 @@
 
 import org.glassfish.jaxb.core.v2.WellKnownNamespace;
 
+import javax.xml.XMLConstants;
+
 /**
  * Common code between {@code DTDExtensionBindingChecker} and {@link ExtensionBindingChecker}.
  *
@@ -162,7 +164,7 @@
 
     @Override
     public void startPrefixMapping(String prefix, String uri) throws SAXException {
-        if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return;
+        if (XMLConstants.XML_NS_URI.equals(uri)) return;
         super.startPrefixMapping(prefix, uri); //xml prefix shall not be declared based on jdk api javado
         nsSupport.pushContext();
         nsSupport.declarePrefix(prefix,uri);
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 f5ad8c0..5108f45 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
@@ -105,20 +105,24 @@
         this.name = name;
     }
 
+    @Override
     void normalize(List<Block> r, boolean optional) {
         Block o = new Block(optional,false);
         o.elements.add(this);
         r.add(o);
     }
 
+    @Override
     void addAllElements(Block b) {
         b.elements.add(this);
     }
 
+    @Override
     boolean isOptional() {
         return false;
     }
 
+    @Override
     boolean isRepeated() {
         return false;
     }
@@ -293,6 +297,7 @@
         }
     }
 
+    @Override
     public int compareTo(Element that) {
         return this.name.compareTo(that.name);
     }
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 5e7487d..6c36d5f 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
@@ -53,12 +53,14 @@
     
     private Locator locator;
     
+    @Override
     public void setDocumentLocator(Locator locator) {
         this.locator = locator;
         super.setDocumentLocator(locator);
     }
     
 
+    @Override
     public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
         super.startElement(namespaceURI, localName, qName, atts);
         
@@ -80,6 +82,7 @@
         }
     }
     
+    @Override
     public void endElement(String namespaceURI, String localName, String qName) {
         locatorTable.storeEndLocation( getCurrentElement(), locator );
         super.endElement(namespaceURI, localName, qName);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
index 93faa67..8496e28 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
@@ -51,6 +51,7 @@
         this.fallbackParser = fallbackParser;
     }
 
+    @Override
     public void parse(
         InputSource source,
         ContentHandler contentHandler,
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
index 9f2ce40..b9deeb9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
@@ -49,10 +49,12 @@
         this.clazz = clazz;
     }
 
+    @Override
     public Void onMixed(DMixedPattern p) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public Void onChoice(DChoicePattern p) {
         boolean old = insideOptional;
         insideOptional = true;
@@ -61,6 +63,7 @@
         return null;
     }
 
+    @Override
     public Void onOptional(DOptionalPattern p) {
         boolean old = insideOptional;
         insideOptional = true;
@@ -69,10 +72,12 @@
         return null;
     }
 
+    @Override
     public Void onZeroOrMore(DZeroOrMorePattern p) {
         return onRepeated(p,true);
     }
 
+    @Override
     public Void onOneOrMore(DOneOrMorePattern p) {
         return onRepeated(p,insideOptional);
 
@@ -95,6 +100,7 @@
         return null;
     }
 
+    @Override
     public Void onAttribute(DAttributePattern p) {
         // TODO: support multiple names
         QName name = p.getName().listNames().iterator().next();
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 fd775b4..13b46d2 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
@@ -27,6 +27,7 @@
 
     public final Set<DDefine> defs = new HashSet<>();
 
+    @Override
     public Void onGrammar(DGrammarPattern p) {
         for( DDefine def : p ) {
             defs.add(def);
@@ -40,6 +41,7 @@
      * We visit all {@link DDefine}s from {@link DGrammarPattern},
      * so no point in resolving refs.
      */
+    @Override
     public Void onRef(DRefPattern p) {
         return null;
     }
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 eafc137..28357f1 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
@@ -208,10 +208,12 @@
 
         // also look for root elements
         grammar.accept(new DPatternWalker() {
+            @Override
             public Void onRef(DRefPattern p) {
                 return null;    // stop recursion
             }
 
+            @Override
             public Void onElement(DElementPattern p) {
                 mapToClass(p);
                 return null;
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 c7f7279..b42e267 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
@@ -62,11 +62,13 @@
         return new RawTypeSet(refs,mul);
     }
 
+    @Override
     public Void onAttribute(DAttributePattern p) {
         // attributes form their own properties
         return null;
     }
 
+    @Override
     public Void onElement(DElementPattern p) {
         CTypeInfo[] tis = compiler.classes.get(p);
         if(tis!=null) {
@@ -79,11 +81,13 @@
         return null;
     }
 
+    @Override
     public Void onZeroOrMore(DZeroOrMorePattern p) {
         mul = mul.makeRepeated();
         return super.onZeroOrMore(p);
     }
 
+    @Override
     public Void onOneOrMore(DOneOrMorePattern p) {
         mul = mul.makeRepeated();
         return super.onOneOrMore(p);
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 55b54da..4e35820 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
@@ -45,6 +45,7 @@
         stack.clear();
     }
 
+    @Override
     public Void onRef(DRefPattern p) {
         if(!canInherit) {
             cannotBeInherited.add(p.getTarget());
@@ -65,6 +66,7 @@
 
         All the following code are the same
     */
+    @Override
     public Void onChoice(DChoicePattern p) {
         push(false);
         super.onChoice(p);
@@ -72,6 +74,7 @@
         return null;
     }
 
+    @Override
     public Void onAttribute(DAttributePattern p) {
         push(false);
         super.onAttribute(p);
@@ -79,6 +82,7 @@
         return null;
     }
 
+    @Override
     public Void onList(DListPattern p) {
         push(false);
         super.onList(p);
@@ -86,6 +90,7 @@
         return null;
     }
 
+    @Override
     public Void onMixed(DMixedPattern p) {
         push(false);
         super.onMixed(p);
@@ -93,6 +98,7 @@
         return null;
     }
 
+    @Override
     public Void onOneOrMore(DOneOrMorePattern p) {
         push(false);
         super.onOneOrMore(p);
@@ -100,6 +106,7 @@
         return null;
     }
 
+    @Override
     public Void onZeroOrMore(DZeroOrMorePattern p) {
         push(false);
         super.onZeroOrMore(p);
@@ -107,6 +114,7 @@
         return null;
     }
 
+    @Override
     public Void onOptional(DOptionalPattern p) {
         push(false);
         super.onOptional(p);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
index 453031e..496c3ac 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
@@ -52,19 +52,23 @@
     }
 
 
+    @Override
     public TypeUse onGrammar(DGrammarPattern p) {
         return CBuiltinLeafInfo.STRING;
     }
 
+    @Override
     public TypeUse onChoice(DChoicePattern p) {
         // can't support unions
         return CBuiltinLeafInfo.STRING;
     }
 
+    @Override
     public TypeUse onData(DDataPattern p) {
         return onDataType(p.getDatatypeLibrary(), p.getType());
     }
 
+    @Override
     public TypeUse onValue(DValuePattern p) {
         return onDataType(p.getDatatypeLibrary(),p.getType());
     }
@@ -81,10 +85,12 @@
         return CBuiltinLeafInfo.STRING;
     }
 
+    @Override
     public TypeUse onInterleave(DInterleavePattern p) {
         return onContainer(p);
     }
 
+    @Override
     public TypeUse onGroup(DGroupPattern p) {
         return onContainer(p);
     }
@@ -100,36 +106,44 @@
         return t;
     }
 
+    @Override
     public TypeUse onNotAllowed(DNotAllowedPattern p) {
         // TODO
         return error();
     }
 
+    @Override
     public TypeUse onEmpty(DEmptyPattern p) {
         return CBuiltinLeafInfo.STRING;
     }
 
+    @Override
     public TypeUse onList(DListPattern p) {
         return p.getChild().accept(this);
     }
 
+    @Override
     public TypeUse onOneOrMore(DOneOrMorePattern p) {
         return TypeUseFactory.makeCollection( p.getChild().accept(this) );
     }
 
+    @Override
     public TypeUse onZeroOrMore(DZeroOrMorePattern p) {
         return TypeUseFactory.makeCollection( p.getChild().accept(this) );
     }
 
+    @Override
     public TypeUse onOptional(DOptionalPattern p) {
         return CBuiltinLeafInfo.STRING;
     }
 
+    @Override
     public TypeUse onRef(DRefPattern p) {
         // TODO: check for enums
         return p.getTarget().getPattern().accept(this);
     }
 
+    @Override
     public TypeUse onText(DTextPattern p) {
         return CBuiltinLeafInfo.STRING;
     }
@@ -139,14 +153,17 @@
 // Not allowed in this context
 //
 //
+    @Override
     public TypeUse onAttribute(DAttributePattern p) {
         return error();
     }
 
+    @Override
     public TypeUse onElement(DElementPattern p) {
         return error();
     }
 
+    @Override
     public TypeUse onMixed(DMixedPattern p) {
         return error();
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
index 4ed8c4f..4a487da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
@@ -29,11 +29,13 @@
  */
 final class BindBlue extends ColorBinder {
 
+    @Override
     public void complexType(XSComplexType ct) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void elementDecl(XSElementDecl e) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
@@ -42,41 +44,49 @@
 
 
 
+    @Override
     public void wildcard(XSWildcard xsWildcard) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void attributeUse(XSAttributeUse use) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void modelGroup(XSModelGroup xsModelGroup) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void particle(XSParticle xsParticle) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void empty(XSContentType xsContentType) {
         // TODO
         throw new UnsupportedOperationException();
@@ -86,6 +96,7 @@
 /**
  * Components that always map to a type
  */
+    @Override
     public void simpleType(XSSimpleType type) {
         throw new IllegalStateException();
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
index 7a94e30..de4f369 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
@@ -34,6 +34,7 @@
 
     private final ComplexTypeFieldBuilder ctBuilder = Ring.get(ComplexTypeFieldBuilder.class);
 
+    @Override
     public void attGroupDecl(XSAttGroupDecl ag) {
         attContainer(ag);
     }
@@ -52,6 +53,7 @@
             builder.ying(w,cont);
     }
 
+    @Override
     public void complexType(XSComplexType ct) {
         ctBuilder.build(ct);
     }
@@ -63,36 +65,43 @@
 
 
 
+    @Override
     public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void wildcard(XSWildcard xsWildcard) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void modelGroup(XSModelGroup xsModelGroup) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void elementDecl(XSElementDecl xsElementDecl) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void particle(XSParticle xsParticle) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void empty(XSContentType xsContentType) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
@@ -104,11 +113,13 @@
     Components for which ying should yield to purple.
 
 */
+    @Override
     public void simpleType(XSSimpleType xsSimpleType) {
         // simple type always maps to a type, so this is never possible
         throw new IllegalStateException();
     }
 
+    @Override
     public void attributeUse(XSAttributeUse use) {
         // attribute use always maps to a property
         throw new IllegalStateException();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
index 591d45f..c40a2da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
@@ -33,11 +33,13 @@
  * @author Kohsuke Kawaguchi
  */
 public class BindPurple extends ColorBinder {
+    @Override
     public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
         // TODO
         throw new UnsupportedOperationException();
@@ -46,6 +48,7 @@
     /**
      * Attribute use always becomes a property.
      */
+    @Override
     public void attributeUse(XSAttributeUse use) {
         boolean hasFixedValue = use.getFixedValue()!=null;
         BIProperty pc = BIProperty.getCustomization(use);
@@ -93,6 +96,7 @@
     }
 
 
+    @Override
     public void complexType(XSComplexType ct) {
         CClass ctBean = selector.bindToType(ct,null,false);
         if(getCurrentBean()!=ctBean)
@@ -101,6 +105,7 @@
             getCurrentBean().setBaseClass(ctBean);
     }
 
+    @Override
     public void wildcard(XSWildcard xsWildcard) {
         // element wildcards are processed by particle binders,
         // so this one is for attribute wildcard.
@@ -108,30 +113,36 @@
         getCurrentBean().hasAttributeWildcard(true);
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void modelGroup(XSModelGroup xsModelGroup) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void elementDecl(XSElementDecl xsElementDecl) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void simpleType(XSSimpleType type) {
         createSimpleTypeProperty(type,"Value");
     }
 
+    @Override
     public void particle(XSParticle xsParticle) {
         // TODO
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void empty(XSContentType ct) {
         // empty generates nothing
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
index c7bcaf7..7cc1ae6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
@@ -34,10 +34,12 @@
 
     private final ComplexTypeFieldBuilder ctBuilder = Ring.get(ComplexTypeFieldBuilder.class);
 
+    @Override
     public void complexType(XSComplexType ct) {
         ctBuilder.build(ct);
     }
 
+    @Override
     public void wildcard(XSWildcard xsWildcard) {
         // TODO: implement this method later
         // I guess we might allow this to be mapped to a generic element property ---
@@ -46,6 +48,7 @@
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void elementDecl(XSElementDecl e) {
         SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
         stb.refererStack.push(e);    // referer is element
@@ -53,6 +56,7 @@
         stb.refererStack.pop();
     }
 
+    @Override
     public void simpleType(XSSimpleType type) {
         SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
         stb.refererStack.push(type);    // referer is itself
@@ -63,24 +67,31 @@
 /*
     Components that can never be mapped to a class
 */
+    @Override
     public void attGroupDecl(XSAttGroupDecl ag) {
         throw new IllegalStateException();
     }
+    @Override
     public void attributeDecl(XSAttributeDecl ad) {
         throw new IllegalStateException();
     }
+    @Override
     public void attributeUse(XSAttributeUse au) {
         throw new IllegalStateException();
     }
+    @Override
     public void empty(XSContentType xsContentType) {
         throw new IllegalStateException();
     }
+    @Override
     public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         throw new IllegalStateException();
     }
+    @Override
     public void modelGroup(XSModelGroup xsModelGroup) {
         throw new IllegalStateException();
     }
+    @Override
     public void particle(XSParticle p) {
         throw new IllegalStateException();
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
index d424db4..adaf335 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
@@ -26,24 +26,29 @@
  * @author Kohsuke Kawaguchi
  */
 public final class BindYellow extends ColorBinder {
+    @Override
     public void complexType(XSComplexType ct) {
     }
 
+    @Override
     public void wildcard(XSWildcard xsWildcard) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void elementDecl(XSElementDecl xsElementDecl) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void simpleType(XSSimpleType xsSimpleType) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
         // TODO: implement this method later
         throw new UnsupportedOperationException();
@@ -55,26 +60,32 @@
     Components that can never map to a type
 
 */
+    @Override
     public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
         throw new IllegalStateException();
     }
 
+    @Override
     public void attributeUse(XSAttributeUse use) {
         throw new IllegalStateException();
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         throw new IllegalStateException();
     }
 
+    @Override
     public void modelGroup(XSModelGroup xsModelGroup) {
         throw new IllegalStateException();
     }
 
+    @Override
     public void particle(XSParticle xsParticle) {
         throw new IllegalStateException();
     }
 
+    @Override
     public void empty(XSContentType xsContentType) {
         throw new IllegalStateException();
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
index bf734d7..e9623a6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
@@ -41,70 +41,87 @@
         this.core = core;
     }
 
+    @Override
     public CElement annotation(XSAnnotation xsAnnotation) {
         return core.annotation(xsAnnotation);
     }
 
+    @Override
     public CElement attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
         return core.attGroupDecl(xsAttGroupDecl);
     }
 
+    @Override
     public CElement attributeDecl(XSAttributeDecl xsAttributeDecl) {
         return core.attributeDecl(xsAttributeDecl);
     }
 
+    @Override
     public CElement attributeUse(XSAttributeUse xsAttributeUse) {
         return core.attributeUse(xsAttributeUse);
     }
 
+    @Override
     public CElement complexType(XSComplexType xsComplexType) {
         return core.complexType(xsComplexType);
     }
 
+    @Override
     public CElement schema(XSSchema xsSchema) {
         return core.schema(xsSchema);
     }
 
+    @Override
     public CElement facet(XSFacet xsFacet) {
         return core.facet(xsFacet);
     }
 
+    @Override
     public CElement notation(XSNotation xsNotation) {
         return core.notation(xsNotation);
     }
 
+    @Override
     public CElement simpleType(XSSimpleType xsSimpleType) {
         return core.simpleType(xsSimpleType);
     }
 
+    @Override
     public CElement particle(XSParticle xsParticle) {
         return core.particle(xsParticle);
     }
 
+    @Override
     public CElement empty(XSContentType xsContentType) {
         return core.empty(xsContentType);
     }
 
+    @Override
     public CElement wildcard(XSWildcard xsWildcard) {
         return core.wildcard(xsWildcard);
     }
 
+    @Override
     public CElement modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
         return core.modelGroupDecl(xsModelGroupDecl);
     }
 
+    @Override
     public CElement modelGroup(XSModelGroup xsModelGroup) {
         return core.modelGroup(xsModelGroup);
     }
 
+    @Override
     public CElement elementDecl(XSElementDecl xsElementDecl) {
         return core.elementDecl(xsElementDecl);
     }
 
+    @Override
     public CElement identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
         return core.identityConstraint(xsIdentityConstraint);
     }
 
+    @Override
     public CElement xpath(XSXPath xsxPath) {
         return core.xpath(xsxPath);
     }
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 427d1dc..5a4bc14 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
@@ -49,6 +49,8 @@
 
 import org.xml.sax.Locator;
 
+import javax.xml.XMLConstants;
+
 /**
  * Manages association between {@link XSComponent}s and generated
  * {@link CTypeInfo}s.
@@ -186,7 +188,7 @@
 
         classScopes.push(null);  // so that the getClassFactory method returns null
 
-        XSComplexType anyType = Ring.get(XSSchemaSet.class).getComplexType(WellKnownNamespace.XML_SCHEMA,"anyType");
+        XSComplexType anyType = Ring.get(XSSchemaSet.class).getComplexType(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anyType");
         bindMap.put(anyType,new Binding(anyType,CBuiltinLeafInfo.ANYTYPE));
     }
 
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
index 5d9b9fc..f011641 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
@@ -52,26 +52,32 @@
 
 
 
+    @Override
     public final void annotation(XSAnnotation xsAnnotation) {
         throw new IllegalStateException();
     }
 
+    @Override
     public final void schema(XSSchema xsSchema) {
         throw new IllegalStateException();
     }
 
+    @Override
     public final void facet(XSFacet xsFacet) {
         throw new IllegalStateException();
     }
 
+    @Override
     public final void notation(XSNotation xsNotation) {
         throw new IllegalStateException();
     }
 
+    @Override
     public final void identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
         throw new IllegalStateException();
     }
 
+    @Override
     public final void xpath(XSXPath xsxPath) {
         throw new IllegalStateException();
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
index 1a5fe4c..a594499 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
@@ -73,23 +73,28 @@
 
     protected final XSSchemaSet schemas = Ring.get(XSSchemaSet.class);
 
+    @Override
     public CElement attGroupDecl(XSAttGroupDecl decl) {
         return allow(decl,decl.getName());
     }
 
+    @Override
     public CElement attributeDecl(XSAttributeDecl decl) {
         return allow(decl,decl.getName());
     }
 
+    @Override
     public CElement modelGroup(XSModelGroup mgroup) {
         return never();
     }
 
+    @Override
     public CElement modelGroupDecl(XSModelGroupDecl decl) {
         return never();
     }
 
 
+    @Override
     public CElement complexType(XSComplexType type) {
         CElement ci = allow(type,type.getName());
         if(ci!=null)    return ci;
@@ -244,6 +249,7 @@
         return sole;
     }
 
+    @Override
     public CElement elementDecl(XSElementDecl decl) {
         CElement r = allow(decl,decl.getName());
 
@@ -288,20 +294,25 @@
         return r;
     }
 
-    public CClassInfo empty( XSContentType ct ) { return null; }
+    @Override
+    public CClassInfo empty(XSContentType ct ) { return null; }
 
+    @Override
     public CClassInfo identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
         return never();
     }
 
+    @Override
     public CClassInfo xpath(XSXPath xsxPath) {
         return never();
     }
 
+    @Override
     public CClassInfo attributeUse(XSAttributeUse use) {
         return never();
     }
 
+    @Override
     public CElement simpleType(XSSimpleType type) {
         CElement c = allow(type,type.getName());
         if(c!=null) return c;
@@ -314,30 +325,36 @@
         return never();
     }
 
+    @Override
     public CClassInfo particle(XSParticle particle) {
         return never();
     }
 
+    @Override
     public CClassInfo wildcard(XSWildcard wc) {
         return never();
     }
 
 
     // these methods won't be used
+    @Override
     public CClassInfo annotation(XSAnnotation annon) {
         assert false;
         return null;
     }
 
+    @Override
     public CClassInfo notation(XSNotation not) {
         assert false;
         return null;
     }
 
+    @Override
     public CClassInfo facet(XSFacet decl) {
         assert false;
         return null;
     }
+    @Override
     public CClassInfo schema(XSSchema schema) {
         assert false;
         return null;
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 cb9e311..7a759a9 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
@@ -151,11 +151,13 @@
          */
         private XSParticle outerParticle;
 
+        @Override
         public void elementDecl(XSElementDecl decl) {
             check(outerParticle);
             mark(outerParticle);
         }
 
+        @Override
         public void modelGroup(XSModelGroup mg) {
             // choice gets mapped to a property
             if(mg.getCompositor()== XSModelGroup.Compositor.CHOICE && builder.getGlobalBinding().isChoiceContentPropertyEnabled()) {
@@ -167,10 +169,12 @@
                 particle(child);
         }
 
+        @Override
         public void modelGroupDecl(XSModelGroupDecl decl) {
             modelGroup(decl.getModelGroup());
         }
 
+        @Override
         public void wildcard(XSWildcard wc) {
             mark(outerParticle);
         }
@@ -350,21 +354,25 @@
             }
         }
 
-        public void elementDecl( XSElementDecl e ) {
+        @Override
+        public void elementDecl(XSElementDecl e ) {
             // because the corresponding particle must be marked.
             assert false;
         }
 
-        public void wildcard( XSWildcard wc ) {
+        @Override
+        public void wildcard(XSWildcard wc ) {
             // because the corresponding particle must be marked.
             assert false;
         }
 
-        public void modelGroupDecl( XSModelGroupDecl decl ) {
+        @Override
+        public void modelGroupDecl(XSModelGroupDecl decl ) {
             modelGroup(decl.getModelGroup());
         }
 
-        public void modelGroup( XSModelGroup mg ) {
+        @Override
+        public void modelGroup(XSModelGroup mg ) {
             boolean oldIOP = insideOptionalParticle;
             insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;
 
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 2a2d453..b4fef02 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
@@ -55,6 +55,7 @@
      * We can only have one {@link XmlAnyElement} property,
      * so all the wildcards need to be treated as one node.
      */
+    @Override
     public Expression wildcard(XSWildcard wc) {
         if(wildcard==null)
             wildcard = new GWildcardElement();
@@ -63,10 +64,12 @@
         return wildcard;
     }
 
+    @Override
     public Expression modelGroupDecl(XSModelGroupDecl decl) {
         return modelGroup(decl.getModelGroup());
     }
 
+    @Override
     public Expression modelGroup(XSModelGroup group) {
         XSModelGroup.Compositor comp = group.getCompositor();
         if(comp==XSModelGroup.CHOICE) {
@@ -90,6 +93,7 @@
         }
     }
 
+    @Override
     public Element elementDecl(XSElementDecl decl) {
         QName n = BGMBuilder.getName(decl);
 
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
index 8a10430..d98a9d8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
@@ -45,14 +45,17 @@
         return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) );
     }
 
+    @Override
     public Multiplicity wildcard(XSWildcard wc) {
         return ONE;
     }
 
+    @Override
     public Multiplicity modelGroupDecl(XSModelGroupDecl decl) {
         return modelGroup(decl.getModelGroup());
     }
 
+    @Override
     public Multiplicity modelGroup(XSModelGroup group) {
         boolean isChoice = group.getCompositor() == XSModelGroup.CHOICE;
 
@@ -74,6 +77,7 @@
         return r;
     }
 
+    @Override
     public Multiplicity elementDecl(XSElementDecl decl) {
         return ONE;
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
index d1675f9..fa0e253 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
@@ -186,14 +186,17 @@
              */
             private boolean rep = repeated;
 
+            @Override
             public void wildcard(XSWildcard wc) {
                 append("any");
             }
 
+            @Override
             public void modelGroupDecl(XSModelGroupDecl mgd) {
                 modelGroup(mgd.getModelGroup());
             }
 
+            @Override
             public void modelGroup(XSModelGroup mg) {
                 String operator;
                 if(mg.getCompositor()==XSModelGroup.CHOICE)     operator = "Or";
@@ -212,6 +215,7 @@
                 }
             }
 
+            @Override
             public void elementDecl(XSElementDecl ed) {
                 append(ed.getName());
             }
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 944d918..adf50ab 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
@@ -100,19 +100,23 @@
         }
     }
 
+    @Override
     public void wildcard(XSWildcard wc) {
         refs.add(new WildcardRef(wc));
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl decl) {
         modelGroup(decl.getModelGroup());
     }
 
+    @Override
     public void modelGroup(XSModelGroup group) {
         for( XSParticle p : group.getChildren())
             particle(p);
     }
 
+    @Override
     public void elementDecl(XSElementDecl decl) {
 
         QName n = BGMBuilder.getName(decl);
@@ -156,23 +160,28 @@
             }
         }
 
+        @Override
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
             // we don't allow a mapping to typeRef if the wildcard is present
             throw new IllegalStateException();
         }
 
+        @Override
         protected void toElementRef(CReferencePropertyInfo prop) {
             prop.setWildcard(mode);
         }
 
+        @Override
         protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
             return RawTypeSet.Mode.MUST_BE_REFERENCE;
         }
 
+        @Override
         protected boolean isListOfValues() {
             return false;
         }
 
+        @Override
         protected ID id() {
             return ID.NONE;
         }
@@ -190,14 +199,17 @@
             this.target = target;
         }
 
+        @Override
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
             return new CTypeRef(target,decl);
         }
 
+        @Override
         protected void toElementRef(CReferencePropertyInfo prop) {
             prop.getElements().add(target);
         }
 
+        @Override
         protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
             // if element substitution can occur, no way it can be mapped to a list of types
             if(decl.getSubstitutables().size()>1)
@@ -206,10 +218,12 @@
             return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
         }
 
+        @Override
         protected boolean isListOfValues() {
             return false;
         }
 
+        @Override
         protected ID id() {
             return ID.NONE;
         }
@@ -227,6 +241,7 @@
             this.target = target;
         }
 
+        @Override
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
             assert !target.isCollection();
             CAdapter a = target.getProperty().getAdapter();
@@ -235,10 +250,12 @@
             return new CTypeRef(target.getContentType(),decl);
         }
 
+        @Override
         protected void toElementRef(CReferencePropertyInfo prop) {
             prop.getElements().add(target);
         }
 
+        @Override
         protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
             // if element substitution can occur, no way it can be mapped to a list of types
             if(decl.getSubstitutables().size()>1)
@@ -268,10 +285,12 @@
                 return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
         }
 
+        @Override
         protected boolean isListOfValues() {
             return target.getProperty().isValueList();
         }
 
+        @Override
         protected ID id() {
             return target.getProperty().id();
         }
@@ -298,6 +317,7 @@
             target = r;
         }
 
+        @Override
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
             if(ep!=null && target.getAdapterUse()!=null)
                 ep.setAdapter(target.getAdapterUse());
@@ -311,6 +331,7 @@
          *
          * This method generates such an element class and returns it.
          */
+        @Override
         protected void toElementRef(CReferencePropertyInfo prop) {
             CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
             Model model = Ring.get(Model.class);
@@ -331,6 +352,7 @@
             }
         }
 
+        @Override
         protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
             // if we have an adapter or IDness, which requires special
             // annotation, and there's more than one element,
@@ -348,10 +370,12 @@
             return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
         }
 
+        @Override
         protected boolean isListOfValues() {
             return target.isCollection();
         }
 
+        @Override
         protected ID id() {
             return target.idUse();
         }
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 b8893c7..850e70c 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
@@ -63,6 +63,7 @@
         }
     }
 
+    @Override
     public void schema(XSSchema xs) {
         if(!visited.add(xs))       return;
 
@@ -75,6 +76,7 @@
         }
     }
 
+    @Override
     public void elementDecl(XSElementDecl e) {
         if(!visited.add(e))       return;
 
@@ -82,6 +84,7 @@
         e.getType().visit(this);
     }
 
+    @Override
     public void complexType(XSComplexType ct) {
         if(!visited.add(ct))       return;
 
@@ -90,12 +93,14 @@
         ct.getContentType().visit(this);
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl decl) {
         if(!visited.add(decl))  return;
 
         modelGroup(decl.getModelGroup());
     }
 
+    @Override
     public void modelGroup(XSModelGroup group) {
         if(!visited.add(group))  return;
 
@@ -104,6 +109,7 @@
         }
     }
 
+    @Override
     public void particle(XSParticle particle) {
         // since the particle method is side-effect free, no need to check for double-visit.
         particle.getTerm().visit(this);
@@ -111,16 +117,27 @@
 
 
     // things we don't care
+    @Override
     public void simpleType(XSSimpleType simpleType) {}
+    @Override
     public void annotation(XSAnnotation ann) {}
+    @Override
     public void attGroupDecl(XSAttGroupDecl decl) {}
+    @Override
     public void attributeDecl(XSAttributeDecl decl) {}
+    @Override
     public void attributeUse(XSAttributeUse use) {}
+    @Override
     public void facet(XSFacet facet) {}
+    @Override
     public void notation(XSNotation notation) {}
+    @Override
     public void identityConstraint(XSIdentityConstraint decl) {}
+    @Override
     public void xpath(XSXPath xp) {}
+    @Override
     public void wildcard(XSWildcard wc) {}
+    @Override
     public void empty(XSContentType empty) {}
 
     /**
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 8298f33..3ebb7b0 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
@@ -69,6 +69,8 @@
 
 import org.xml.sax.Locator;
 
+import javax.xml.XMLConstants;
+
 /**
  * Builds {@link TypeUse} from simple types.
  *
@@ -272,6 +274,7 @@
 
     public final XSSimpleTypeFunction<TypeUse> composer = new XSSimpleTypeFunction<TypeUse>() {
 
+        @Override
         public TypeUse listSimpleType(XSListSimpleType type) {
             // bind item type individually and then compose them into a list
             // facets on the list shouldn't be taken account when binding item types,
@@ -283,6 +286,7 @@
             return tu;
         }
 
+        @Override
         public TypeUse unionSimpleType(XSUnionSimpleType type) {
             boolean isCollection = false;
             for (int i = 0; i < type.getMemberSize(); i++)
@@ -297,6 +301,7 @@
             return r;
         }
 
+        @Override
         public TypeUse restrictionSimpleType(XSRestrictionSimpleType type) {
             // just process the base type.
             return compose(type.getSimpleBaseType());
@@ -367,7 +372,7 @@
 
 
         // if the type is built in, look for the default binding
-        if(type.getTargetNamespace().equals(WellKnownNamespace.XML_SCHEMA)) {
+        if(XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getTargetNamespace())) {
             String name = type.getName();
             if(name!=null) {
                 r = lookupBuiltin(name);
@@ -479,7 +484,7 @@
      */
     public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
         do {
-            if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
+            if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getTargetNamespace()) ) {
                 // type must be derived from one of these types
                 String localName = type.getName();
                 if( localName!=null ) {
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 ee323c9..6c013ec 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
@@ -134,23 +134,28 @@
     }
 
 
+    @Override
     public void annotation(XSAnnotation ann) {}
     
+    @Override
     public void attGroupDecl(XSAttGroupDecl decl) {
         if(check(decl))
             attContainer(decl);
     }
 
+    @Override
     public void attributeDecl(XSAttributeDecl decl) {
         if(check(decl))
             decl.getType().visit((XSSimpleTypeVisitor)this);
     }
 
+    @Override
     public void attributeUse(XSAttributeUse use) {
         if(check(use))
             use.getDecl().visit(this);
     }
 
+    @Override
     public void complexType(XSComplexType type) {
         if(check(type)) {
             // don't need to check the base type -- it must be global, thus
@@ -171,27 +176,33 @@
         if(wc!=null)        wc.visit(this);
     }
 
+    @Override
     public void schema(XSSchema schema) {
         check(schema);
     }
 
+    @Override
     public void facet(XSFacet facet) {
         check(facet);
     }
 
+    @Override
     public void notation(XSNotation notation) {
         check(notation);
     }
 
+    @Override
     public void wildcard(XSWildcard wc) {
         check(wc);
     }
 
+    @Override
     public void modelGroupDecl(XSModelGroupDecl decl) {
         if(check(decl))
             decl.getModelGroup().visit(this);
     }
 
+    @Override
     public void modelGroup(XSModelGroup group) {
         if(check(group)) {
             for( int i=0; i<group.getSize(); i++ )
@@ -199,6 +210,7 @@
         }
     }
 
+    @Override
     public void elementDecl(XSElementDecl decl) {
         if(check(decl)) {
             decl.getType().visit(this);
@@ -207,30 +219,36 @@
         }
     }
 
+    @Override
     public void simpleType(XSSimpleType simpleType) {
         if(check(simpleType))
             simpleType.visit( (XSSimpleTypeVisitor)this );
     }
 
+    @Override
     public void particle(XSParticle particle) {
         if(check(particle))
             particle.getTerm().visit(this);
     }
 
+    @Override
     public void empty(XSContentType empty) {
         check(empty);
     }
 
+    @Override
     public void listSimpleType(XSListSimpleType type) {
         if(check(type))
             type.getItemType().visit((XSSimpleTypeVisitor)this);
     }
 
+    @Override
     public void restrictionSimpleType(XSRestrictionSimpleType type) {
         if(check(type))
             type.getBaseType().visit(this);
     }
 
+    @Override
     public void unionSimpleType(XSUnionSimpleType type) {
         if(check(type)) {
             for( int i=0; i<type.getMemberSize(); i++ )
@@ -238,6 +256,7 @@
         }
     }
 
+    @Override
     public void identityConstraint(XSIdentityConstraint id) {
         if(check(id)) {
             id.getSelector().visit(this);
@@ -246,6 +265,7 @@
         }
     }
 
+    @Override
     public void xpath(XSXPath xp) {
         check(xp);
     }
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
index 40af7dc..a944213 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
@@ -39,10 +39,12 @@
         return wc.apply(theInstance);
     }
 
+    @Override
     public NameClass any(XSWildcard.Any wc) {
         return NameClass.ANY;
     }
 
+    @Override
     public NameClass other(XSWildcard.Other wc) {
         return new AnyNameExceptNameClass(
             new ChoiceNameClass(
@@ -50,6 +52,7 @@
                 new NsNameClass(wc.getOtherNamespace())));
     }
 
+    @Override
     public NameClass union(XSWildcard.Union wc) {
         NameClass nc = null;
         for (Iterator itr = wc.iterateNamespaces(); itr.hasNext();) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
index 3c4d088..cdd1f40 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
@@ -50,12 +50,14 @@
      */
     private ValidatorHandler validator;
 
+    @Override
     public AnnotationParser create() {
         return new AnnotationParser() {
             private Unmarshaller u = BindInfo.getCustomizationUnmarshaller();
 
             private UnmarshallerHandler handler;
 
+            @Override
             public ContentHandler getContentHandler(
                 AnnotationContext context, String parentElementName,
                 final ErrorHandler errorHandler, EntityResolver entityResolver ) {
@@ -104,7 +106,8 @@
                 };
             }
 
-            public BindInfo getResult( Object existing ) {
+            @Override
+            public BindInfo getResult(Object existing ) {
                 if(handler==null)
                     // interface contract violation.
                     // the getContentHandler method must have been called.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
index ea89efd..0b634e8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
@@ -14,6 +14,8 @@
 import jakarta.xml.bind.annotation.XmlAttribute;
 import jakarta.xml.bind.annotation.XmlRootElement;
 import jakarta.xml.bind.annotation.adapters.XmlAdapter;
+
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.JClass;
@@ -74,6 +76,7 @@
      */
     public abstract TypeUse getTypeUse( XSSimpleType owner );
 
+    @Override
     public QName getName() { return NAME; }
     
     /** Name of the conversion declaration. */
@@ -94,6 +97,7 @@
             this.transducer = transducer;
         }
 
+        @Override
         public TypeUse getTypeUse(XSSimpleType owner) {
             return transducer;
         }
@@ -136,6 +140,7 @@
          */
         private TypeUse typeUse;
 
+        @Override
         public TypeUse getTypeUse(XSSimpleType owner) {
             if(typeUse!=null)
                 return typeUse;
@@ -277,7 +282,7 @@
         private String findBaseConversion(XSSimpleType owner) {
             // find the base simple type mapping.
             for( XSSimpleType st=owner; st!=null; st = st.getSimpleBaseType() ) {
-                if( !WellKnownNamespace.XML_SCHEMA.equals(st.getTargetNamespace()) )
+                if( !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(st.getTargetNamespace()) )
                     continue;   // user-defined type
 
                 String name = st.getName().intern();
@@ -289,6 +294,7 @@
             return null;
         }
 
+        @Override
         public QName getName() { return NAME; }
 
         /** Name of the conversion declaration. */
@@ -306,6 +312,7 @@
 
         private TypeUse typeUse;
 
+        @Override
         public TypeUse getTypeUse(XSSimpleType owner) {
             if(typeUse!=null)
                 return typeUse;
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 5b78dad..3d600b0 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
@@ -20,6 +20,8 @@
 import jakarta.xml.bind.annotation.XmlEnumValue;
 import jakarta.xml.bind.annotation.XmlRootElement;
 import jakarta.xml.bind.annotation.XmlTransient;
+
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.ClassType;
@@ -384,7 +386,7 @@
         super.setParent(parent);
         // fill in the remaining default values
         if(enumBaseTypes==null)
-            enumBaseTypes = Collections.singleton(new QName(WellKnownNamespace.XML_SCHEMA,"string"));
+            enumBaseTypes = Collections.singleton(new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"string"));
 
         this.defaultProperty = new BIProperty(getLocation(),null,null,null,
                 collectionType, fixedAttributeAsConstantProperty, optionalProperty, generateElementProperty );
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 de3340d..969ee03 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
@@ -578,14 +578,17 @@
      * a fixed value constraint.
      */
     private final XSFinder hasFixedValue = new XSFinder() {
+        @Override
         public Boolean attributeDecl(XSAttributeDecl decl) {
             return decl.getFixedValue()!=null;
         }
 
+        @Override
         public Boolean attributeUse(XSAttributeUse use) {
             return use.getFixedValue()!=null;
         }
         
+        @Override
         public Boolean schema(XSSchema s) {
             // we allow globalBindings to have isConstantProperty==true,
             // so this method returns true to allow this.
@@ -666,73 +669,90 @@
     
     private final static XSFunction<XSComponent> defaultCustomizationFinder = new XSFunction<XSComponent>() {
 
+        @Override
         public XSComponent attributeUse(XSAttributeUse use) {
             return use.getDecl();   // inherit from the declaration
         }
 
+        @Override
         public XSComponent particle(XSParticle particle) {
             return particle.getTerm(); // inherit from the term
         }
 
+        @Override
         public XSComponent schema(XSSchema schema) {
             // no more delegation
             return null;
         }
 
         // delegates to the context schema object
+        @Override
         public XSComponent attributeDecl(XSAttributeDecl decl) {
             return decl.getOwnerSchema();
         }
 
+        @Override
         public XSComponent wildcard(XSWildcard wc) {
             return wc.getOwnerSchema();
         }
 
+        @Override
         public XSComponent modelGroupDecl(XSModelGroupDecl decl) {
             return decl.getOwnerSchema();
         }
 
+        @Override
         public XSComponent modelGroup(XSModelGroup group) {
             return group.getOwnerSchema();
         }
 
+        @Override
         public XSComponent elementDecl(XSElementDecl decl) {
             return decl.getOwnerSchema();
         }
 
+        @Override
         public XSComponent complexType(XSComplexType type) {
             return type.getOwnerSchema();
         }
 
+        @Override
         public XSComponent simpleType(XSSimpleType st) {
             return st.getOwnerSchema();
         }
 
         // property customizations are not allowed on these components.
+        @Override
         public XSComponent attGroupDecl(XSAttGroupDecl decl) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent empty(XSContentType empty) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent annotation(XSAnnotation xsAnnotation) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent facet(XSFacet xsFacet) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent notation(XSNotation xsNotation) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent identityConstraint(XSIdentityConstraint x) {
             throw new IllegalStateException();
         }
 
+        @Override
         public XSComponent xpath(XSXPath xsxPath) {
             throw new IllegalStateException();
         }
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 91c9f91..2ee45a6 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
@@ -26,6 +26,8 @@
 import jakarta.xml.bind.annotation.XmlMixed;
 import jakarta.xml.bind.annotation.XmlRootElement;
 import jakarta.xml.bind.annotation.XmlType;
+
+import javax.xml.XMLConstants;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.dom.DOMSource;
@@ -54,8 +56,8 @@
  * @author
  *     Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
  */
-@XmlRootElement(namespace= WellKnownNamespace.XML_SCHEMA,name="annotation")
-@XmlType(namespace=WellKnownNamespace.XML_SCHEMA,name="foobar")
+@XmlRootElement(namespace= XMLConstants.W3C_XML_SCHEMA_NS_URI,name="annotation")
+@XmlType(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI,name="foobar")
 public final class BindInfo implements Iterable<BIDeclaration> {
 
     private BGMBuilder builder;
@@ -66,7 +68,7 @@
     /**
      * Documentation taken from {@code <xs:documentation>s}.
      */
-    @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+    @XmlElement(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI)
     private Documentation documentation;
 
     /**
@@ -120,7 +122,7 @@
                     DomHandlerEx.DomAndLocation e = (DomHandlerEx.DomAndLocation)o;
                     String nsUri = e.element.getNamespaceURI();
                     if(nsUri==null || nsUri.equals("")
-                    || nsUri.equals(WellKnownNamespace.XML_SCHEMA))
+                    || XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsUri))
                         continue;   // this is definitely not a customization
                     bi.addDecl(new BIXPluginCustomization(e.element,e.loc));
                 }
@@ -130,7 +132,7 @@
 
 
     // only used by JAXB
-    @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+    @XmlElement(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI)
     void setAppinfo(AppInfo aib) {
         aib.addTo(this);
     }
@@ -217,15 +219,18 @@
                     Writer fw = new FilterWriter(w) {
                         char[] buf = new char[1];
 
+                        @Override
                         public void write(int c) throws IOException {
                             buf[0] = (char)c;
                             write(buf,0,1);
                         }
 
+                        @Override
                         public void write(char[] cbuf, int off, int len) throws IOException {
                             MinimumEscapeHandler.theInstance.escape(cbuf,off,len,false,out);
                         }
 
+                        @Override
                         public void write(String str, int off, int len) throws IOException {
                             write(str.toCharArray(),off,len);
                         }
@@ -262,6 +267,7 @@
     
     public BIDeclaration get( int idx ) { return decls.get(idx); }
 
+    @Override
     public Iterator<BIDeclaration> iterator() {
         return decls.iterator();
     }
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 a3a8960..73bef18 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
@@ -20,6 +20,8 @@
 import org.xml.sax.XMLFilter;
 import org.xml.sax.helpers.XMLFilterImpl;
 
+import javax.xml.XMLConstants;
+
 /**
  * {@link XMLFilter} that can fork an event to another {@link ContentHandler}
  * in the middle.
@@ -93,7 +95,7 @@
 
     @Override
     public void startPrefixMapping(String prefix, String uri) throws SAXException {
-        if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
+        if (XMLConstants.XML_NS_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
         if(side!=null)
             side.startPrefixMapping(prefix,uri);
         namespaces.add(prefix);
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 d6b1c79..0d6837c 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
@@ -69,6 +69,7 @@
             return nc;
         }
 
+        @Override
         public NameClass elementDecl(XSElementDecl decl) {
             return getNameClass(decl);
         }
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 de67e16..aa7ccfb 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
@@ -43,6 +43,7 @@
         XSContentType contentType = ct.getContentType();
 
         contentType.visit(new XSContentTypeVisitor() {
+            @Override
             public void simpleType(XSSimpleType st) {
                 builder.recordBindingMode(ct,ComplexTypeBindingMode.NORMAL);
 
@@ -55,6 +56,7 @@
                 selector.getCurrentBean().addProperty(p);
             }
 
+            @Override
             public void particle(XSParticle p) {
                 // determine the binding of this complex type.
 
@@ -69,6 +71,7 @@
 
             }
 
+            @Override
             public void empty(XSContentType e) {
                 builder.recordBindingMode(ct,NORMAL);
             }
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 db8c949..49ed038 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
@@ -14,6 +14,7 @@
 import java.util.Set;
 import java.util.Stack;
 
+import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
 import com.sun.tools.xjc.reader.Const;
@@ -139,7 +140,7 @@
         QName newElement = new QName(namespaceURI,localName);
         
         if( newElement.getNamespaceURI().equals(Const.JAXB_NSURI)
-         && top().getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA) ) {
+         && XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(top().getNamespaceURI()) ) {
             // we hit a JAXB customization. the stack top should be
             // <xs:appinfo>
             if( elementNames.size()>=3 ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
index 8a976eb..75b196e 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
@@ -19,6 +19,8 @@
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.XMLFilterImpl;
 
+import javax.xml.XMLConstants;
+
 /**
  * This filter detects the use of incorrect JAXB namespace URI.
  * 
@@ -77,7 +79,7 @@
 
     @Override
     public void startPrefixMapping(String prefix, String uri) throws SAXException {
-        if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
+        if (XMLConstants.XML_NS_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
         if( prefix.equals("jaxb") )
             isJAXBPrefixUsed = true;
         if( uri.equals(Const.JAXB_NSURI) )
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 1f2d953..0ed45a8 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
@@ -21,6 +21,8 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.helpers.XMLFilterImpl;
 
+import javax.xml.XMLConstants;
+
 /**
  * XML Schema specific internalization logic.
  * 
@@ -40,7 +42,7 @@
         
         @Override
         protected String findExternalResource( String nsURI, String localName, Attributes atts) {
-            if( WellKnownNamespace.XML_SCHEMA.equals(nsURI)
+            if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsURI)
             && ("import".equals(localName) || "include".equals(localName) ) )
                 return atts.getValue("schemaLocation");
             else
@@ -55,19 +57,19 @@
 
     @Override
     public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
-        return WellKnownNamespace.XML_SCHEMA.equals(target.getNamespaceURI());
+        return XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(target.getNamespaceURI());
     }
 
     @Override
     public Element refineTarget(Element target) {
         // look for existing xs:annotation
-        Element annotation = DOMUtils.getFirstChildElement(target, WellKnownNamespace.XML_SCHEMA, "annotation");
+        Element annotation = DOMUtils.getFirstChildElement(target, XMLConstants.W3C_XML_SCHEMA_NS_URI, "annotation");
         if(annotation==null)
             // none exists. need to make one
             annotation = insertXMLSchemaElement( target, "annotation" );
         
         // then look for appinfo
-        Element appinfo = DOMUtils.getFirstChildElement(annotation, WellKnownNamespace.XML_SCHEMA, "appinfo" );
+        Element appinfo = DOMUtils.getFirstChildElement(annotation, XMLConstants.W3C_XML_SCHEMA_NS_URI, "appinfo" );
         if(appinfo==null)
             // none exists. need to make one
             appinfo = insertXMLSchemaElement( annotation, "appinfo" );
@@ -90,7 +92,7 @@
         if(idx==-1)     qname = localName;
         else            qname = qname.substring(0,idx+1)+localName;
         
-        Element child = parent.getOwnerDocument().createElementNS( WellKnownNamespace.XML_SCHEMA, qname );
+        Element child = parent.getOwnerDocument().createElementNS( XMLConstants.W3C_XML_SCHEMA_NS_URI, qname );
         
         NodeList children = parent.getChildNodes();
         
diff --git a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
index 15be363..3a2b2a0 100644
--- a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
+++ b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
@@ -15,6 +15,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamConstants;
@@ -129,7 +130,7 @@
             if( n.getNodeType()==Node.ELEMENT_NODE ) {
                 Element x = (Element)n;
                 if(x.getLocalName().equals("schema")
-                && x.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA))
+                && XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(x.getNamespaceURI()))
                     return x;
 
                 x = findSchemas(x);
