You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Richard Feit <ri...@bea.com> on 2005/05/06 21:56:30 UTC

Re: svn commit: r168643 - in /incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler: FlowControllerChecker.java grammar/WebappPathType.java

Umm... this was a fix for 
http://issues.apache.org/jira/browse/BEEHIVE-611 : Bogus warnings when 
inheriting action methods that forward to other actions

...not for BEEHIVE-549.

Rich

rich@apache.org wrote:

>Author: rich
>Date: Fri May  6 12:48:42 2005
>New Revision: 168643
>
>URL: http://svn.apache.org/viewcvs?rev=168643&view=rev
>Log:
>Fix for http://issues.apache.org/jira/browse/BEEHIVE-549 : Misleading warnings about missing annotation processors in Page Flow build
>
>tests: bvt in netui (WinXP)
>BB: self (linux)
>
>
>Modified:
>    incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java
>    incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
>
>Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java
>URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java?rev=168643&r1=168642&r2=168643&view=diff
>==============================================================================
>--- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java (original)
>+++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java Fri May  6 12:48:42 2005
>@@ -138,6 +138,13 @@
>         for ( int i = 0; i < methods.length; i++ )
>         {
>             MethodDeclaration method = methods[i];
>+            TypeDeclaration declaringType = method.getDeclaringType();
>+            
>+            //
>+            // Only check the method if it's in this class, or if it's inherited from a class that's *not* on sourcepath
>+            // (i.e., its SourcePosition is null).
>+            //
>+            if ( declaringType.equals( jclass ) || declaringType.getPosition() == null )
>             checkMethod( method, jclass );
>         }
> 
>@@ -487,11 +494,11 @@
>                     
>                     if ( isError )
>                     {
>-                        getDiagnostics().addErrorArrayArgs( ann, "message.method-inherited-file-not-found", args );
>+                        getDiagnostics().addErrorArrayArgs( jclass, "message.method-inherited-file-not-found", args );
>                     }
>                     else
>                     {
>-                        getDiagnostics().addWarningArrayArgs( ann, "message.method-inherited-file-not-found", args );
>+                        getDiagnostics().addWarningArrayArgs( jclass, "message.method-inherited-file-not-found", args );
>                     }
>                 }
>             }
>
>Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
>URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathType.java?rev=168643&r1=168642&r2=168643&view=diff
>==============================================================================
>--- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathType.java (original)
>+++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathType.java Fri May  6 12:48:42 2005
>@@ -62,6 +62,15 @@
>         _flowControllerInfo = fcInfo;
>     }
> 
>+    private static boolean isCheckableExtension( String filePath )
>+    {
>+        for ( int i = 0; i < CHECKABLE_EXTENSIONS.length; ++i )
>+        {
>+            if ( filePath.endsWith( CHECKABLE_EXTENSIONS[i] ) ) return true;
>+        }
>+        
>+        return false;
>+    }
>     
>     public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue value,
>                            AnnotationInstance[] parentAnnotations, MemberDeclaration classMember,
>@@ -92,23 +101,7 @@
>         //
>         // Make sure it's a filetype that should exist on the filesystem.  If not, ignore it.
>         //
>-        if ( ! checkAnyExtension() )
>-        {
>-            boolean isCheckableExtension = false;
>-            for ( int i = 0; i < CHECKABLE_EXTENSIONS.length; ++i )
>-            {
>-                if ( filePath.endsWith( CHECKABLE_EXTENSIONS[i] ) )
>-                {
>-                    isCheckableExtension = true;
>-                    break;
>-                }
>-            }
>-    
>-            if ( ! isCheckableExtension )
>-            {
>-                return null;
>-            }
>-        }
>+        if ( ! checkAnyExtension() && ! isCheckableExtension( filePath ) ) return null;
> 
>         boolean fileExists = true;
>         TypeDeclaration outerClass = CompilerUtils.getOutermostClass( classMember );
>@@ -185,6 +178,7 @@
>             throws FatalCompileTimeException
>     {
>         assert filePath.charAt( 0 ) != '/' : filePath + " is not a relative path";
>+        if ( ! isCheckableExtension( filePath ) ) return true;
>         return checkRelativePath( filePath, outerClass, null, true, false, env );
>     }
>     
>@@ -197,7 +191,6 @@
>     {
>         File fileToCheck = null;
>         boolean fileExists = true;
>-        File jpfSourceFile;
>         
>         if ( filePath.endsWith( JPF_FILE_EXTENSION_DOT ) )
>         {
>@@ -215,7 +208,7 @@
>             if ( fileToCheck == null ) fileExists = false;
>         }
>         // In certain error conditions (jpfFile == null), we can't determine the file.  In this case, just ignore.
>-        else if ( ( jpfSourceFile = CompilerUtils.getSourceFile( outerClass, false ) ) != null )
>+        else if ( CompilerUtils.getSourceFile( outerClass, false ) != null )
>         {
>             if ( allowFileInPageFlowSourceDir )
>             {
>
>
>
>  
>