You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/11/28 21:29:39 UTC

svn commit: r1414899 - /cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java

Author: dkulp
Date: Wed Nov 28 20:29:38 2012
New Revision: 1414899

URL: http://svn.apache.org/viewvc?rev=1414899&view=rev
Log:
Register the error listener sooner to catch parse errors

Modified:
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1414899&r1=1414898&r2=1414899&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java (original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java Wed Nov 28 20:29:38 2012
@@ -1402,6 +1402,10 @@ public class SourceGenerator {
     private JCodeModel createCodeModel(List<SchemaInfo> schemaElements, Set<String> type) {
         
         SchemaCompiler compiler = createCompiler(type);
+        Object elForRun = ReflectionInvokationHandler
+            .createProxyWrapper(new InnerErrorListener(),
+                            JAXBUtils.getParamClass(compiler, "setErrorListener"));
+        compiler.setErrorListener(elForRun);
         compiler.setEntityResolver(OASISCatalogManager.getCatalogManager(bus)
                                        .getEntityResolver());
         if (compilerArgs.size() > 0) {
@@ -1413,11 +1417,6 @@ public class SourceGenerator {
             compiler.getOptions().addBindFile(is);
         }
         
-        Object elForRun = ReflectionInvokationHandler
-            .createProxyWrapper(new InnerErrorListener(),
-                            JAXBUtils.getParamClass(compiler, "setErrorListener"));
-        
-        compiler.setErrorListener(elForRun);
         S2JJAXBModel intermediateModel = compiler.bind();
         JCodeModel codeModel = intermediateModel.generateCode(null, elForRun);
         JAXBUtils.logGeneratedClassNames(LOG, codeModel);