You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cr...@apache.org on 2006/11/16 09:24:54 UTC

svn commit: r475633 - in /beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler: FlowControllerGenerator.java processor/PageFlowCoreAnnotationProcessor.java

Author: crogers
Date: Thu Nov 16 00:24:53 2006
New Revision: 475633

URL: http://svn.apache.org/viewvc?view=rev&rev=475633
Log:
Modified PageFlowCoreAnnotationProcessor.getGenerator() so that if the sourceFileInfo is null we just return a null generator and don't assert or NPE. Also removed an assert on an Exception in FlowControllerGenerator.generate() because there are cases where the exception is not an IOException and may extend RuntimeExcetion.

Tests: NetUI BVT (WinXP pass)


Modified:
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/PageFlowCoreAnnotationProcessor.java

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java?view=diff&rev=475633&r1=475632&r2=475633
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java Thu Nov 16 00:24:53 2006
@@ -78,7 +78,6 @@
         catch ( Exception e )
         {
             e.printStackTrace();    // @TODO log
-            assert e instanceof IOException : e.getClass().getName();
             getDiagnostics().addError( publicClass, "error.could-not-generate",
                                        app != null ? app.getStrutsConfigFile() : null, e.getMessage() );
         }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/PageFlowCoreAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/PageFlowCoreAnnotationProcessor.java?view=diff&rev=475633&r1=475632&r2=475633
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/PageFlowCoreAnnotationProcessor.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/PageFlowCoreAnnotationProcessor.java Thu Nov 16 00:24:53 2006
@@ -158,23 +158,23 @@
         CoreAnnotationProcessorEnv env = getAnnotationProcessorEnvironment();
         SourceFileInfo sourceFileInfo = getSourceFileInfo( classDecl );
 
-        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
-        {
-            assert sourceFileInfo != null : classDecl.getQualifiedName();
-            assert sourceFileInfo instanceof FlowControllerInfo : sourceFileInfo.getClass().getName();
-            return new PageFlowGenerator( env, ( FlowControllerInfo ) sourceFileInfo, diags );
+        if (CompilerUtils.isAssignableFrom(JPF_BASE_CLASS, classDecl, env)) {
+            if (sourceFileInfo != null) {
+                assert sourceFileInfo instanceof FlowControllerInfo : sourceFileInfo.getClass().getName();
+                return new PageFlowGenerator(env, (FlowControllerInfo) sourceFileInfo, diags);
+            }
         }
-        else if ( CompilerUtils.isAssignableFrom( SHARED_FLOW_BASE_CLASS, classDecl, env ) )
-        {
-            assert sourceFileInfo != null : classDecl.getQualifiedName();
-            assert sourceFileInfo instanceof FlowControllerInfo : sourceFileInfo.getClass().getName();
-            return new SharedFlowGenerator( env, ( FlowControllerInfo ) sourceFileInfo, diags );
+        else if (CompilerUtils.isAssignableFrom(SHARED_FLOW_BASE_CLASS, classDecl, env)) {
+            if (sourceFileInfo != null) {
+                assert sourceFileInfo instanceof FlowControllerInfo : sourceFileInfo.getClass().getName();
+                return new SharedFlowGenerator(env, (FlowControllerInfo) sourceFileInfo, diags);
+            }
         }
-        else if ( CompilerUtils.isAssignableFrom( FACES_BACKING_BEAN_CLASS, classDecl, env ) )
-        {
-            assert sourceFileInfo != null : classDecl.getQualifiedName();
-            assert sourceFileInfo instanceof FacesBackingInfo : sourceFileInfo.getClass().getName();
-            return new FacesBackingGenerator( env, sourceFileInfo, diags );
+        else if (CompilerUtils.isAssignableFrom(FACES_BACKING_BEAN_CLASS, classDecl, env)) {
+            if (sourceFileInfo != null) {
+                assert sourceFileInfo instanceof FacesBackingInfo : sourceFileInfo.getClass().getName();
+                return new FacesBackingGenerator(env, sourceFileInfo, diags);
+            }
         }
 
         return null;