beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Feit (JIRA)" <...@beehive.apache.org>
Subject [jira] Commented: (BEEHIVE-901) Cannot forward to an inherited simple action
Date Tue, 30 Aug 2005 17:29:05 GMT
    [ http://issues.apache.org/jira/browse/BEEHIVE-901?page=comments#action_12320602 ] 

Rich Feit commented on BEEHIVE-901:
-----------------------------------

The diff is actually this (moving a loop inside of another loop):

Index: compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java
===================================================================
--- compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java (revision
264164)
+++ compiler-core/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java (working
copy)
@@ -66,7 +66,7 @@
                 int extensionPos = stringValue.lastIndexOf( ACTION_EXTENSION_DOT );
                 String actionMethodName = stringValue.substring( 0, extensionPos );
                 FlowControllerInfo fcInfo = getFlowControllerInfo();
-                boolean foundIt = actionExists( actionMethodName, outerType, null, getEnv(),
fcInfo, false );
+                boolean foundIt = actionExists( actionMethodName, outerType, null, getEnv(),
fcInfo, true );

                 if ( ! foundIt && actionMethodName.length() > 0 )
                 {
@@ -83,7 +83,7 @@
                         if ( sfTypeDecl != null )
                         {
                             actionMethodName = actionMethodName.substring( dot + 1 );
-                            foundIt = actionExists( actionMethodName, sfTypeDecl, null, getEnv(),
fcInfo, false );
+                            foundIt = actionExists( actionMethodName, sfTypeDecl, null, getEnv(),
fcInfo, true );
                         }
                     }
                 }
@@ -146,34 +146,32 @@
                 }
             }

-            ClassType superType = classDecl.getSuperclass();
-            classDecl = superType != null ? superType.getClassTypeDeclaration() : null;
-        } while ( classDecl != null );
-
-        //
-        // Next, look through the simple actions (annotations).
-        //
-        MergedControllerAnnotation mca = fcInfo.getMergedControllerAnnotation();
-        Collection simpleActionAnnotations =
-                checkInheritedActions
-                ? mca.getSimpleActions()
-                : CompilerUtils.getAnnotationArrayValue( type, CONTROLLER_TAG_NAME, SIMPLE_ACTIONS_ATTR,
true );
-
-        if ( simpleActionAnnotations != null )
-        {
-            for ( Iterator ii = simpleActionAnnotations.iterator(); ii.hasNext(); )
+            //
+            // Next, look through the simple actions (annotations).
+            //
+            Collection simpleActionAnnotations =
+                CompilerUtils.getAnnotationArrayValue( classDecl, CONTROLLER_TAG_NAME, SIMPLE_ACTIONS_ATTR,
true );
+
+            if ( simpleActionAnnotations != null )
             {
-                AnnotationInstance ann = ( AnnotationInstance ) ii.next();
-                String name = CompilerUtils.getString( ann, NAME_ATTR, false );
-
-                if ( actionName.equals( name )
-                     && ! CompilerUtils.annotationsAreEqual( ann, annotationToIgnore,
false, env ) )
+                for ( Iterator i = simpleActionAnnotations.iterator(); i.hasNext(); )
                 {
-                    return true;
+                    AnnotationInstance ann = ( AnnotationInstance ) i.next();
+                    String name = CompilerUtils.getString( ann, NAME_ATTR, false );
+
+                    if ( actionName.equals( name )
+                            && ! CompilerUtils.annotationsAreEqual( ann, annotationToIgnore,
false, env ) )
+                    {
+                        return true;
+                    }
                 }
             }
-        }
+
+            ClassType superType = classDecl.getSuperclass();
+            classDecl = superType != null ? superType.getClassTypeDeclaration() : null;
+        } while ( checkInheritedActions && classDecl != null );

+
         return false;
     }
 }

> Cannot forward to an inherited simple action
> --------------------------------------------
>
>          Key: BEEHIVE-901
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-901
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: v1m1
>     Reporter: Rich Feit
>     Assignee: Rich Feit
>      Fix For: V1

>
> Repro:
> Create and build the following page flow controllers:
> ---
> @Jpf.Controller(
>     simpleActions={
>         @Jpf.SimpleAction(name="simpleAction", path="index.jsp")
>     }
> )
> public abstract class BaseController extends PageFlowController
> {
> }
> ---
> @Jpf.Controller(
>     simpleActions={
>         @Jpf.SimpleAction(name="begin", action="simpleAction")
>     }
> )
> public class DerivedController extends BaseController
> {
> }
> ---
> EXPECTED: compiles file
> ACTUAL: get the following error:
>       [apt] C:\temp\todelete\inherit\WEB-INF\.tmpbeansrc\pageFlowCore\inheritActions\derived\Controller.java:14:
Action "simpleAction" was not found.
>       [apt] public class Controller extends pageFlowCore.inheritActions.base.Controller
>       [apt]        ^
>       [apt] 1 error

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message