Author: rich
Date: Thu Sep 16 12:06:26 2004
New Revision: 46196

Modified:
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/BaseValidationRuleGrammar.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/ForwardGrammar.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/UniqueValueType.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowFormBeanConfig.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
   
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
   
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
Log:
- Fixed a ClassCastException in PageFlowActionServlet (!) that occurred when a 
page flow contained a public static inner class.
- Fixed a number of NPEs that occurred due to unresolvable types in user code.
- Fixed to ensure that the 'duplicate page flows' error gets added even if the 
page flow files contain classes with the same names.

DRT: netui (WinXP)
BB: self (linux)



Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     Thu Sep 16 12:06:26 2004
@@ -25,6 +25,7 @@
 import com.sun.mirror.type.DeclaredType;
 import com.sun.mirror.type.InterfaceType;
 import com.sun.mirror.util.SourcePosition;
+import com.sun.mirror.util.DeclarationVisitor;
 
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -33,15 +34,20 @@
 import java.util.Map;
 import java.util.List;
 import java.util.Iterator;
+import java.util.Collections;
 import java.io.File;
+import java.lang.annotation.Annotation;
 
 
 public class CompilerUtils
         implements JpfLanguageConstants
 {
+    private static final ErrorTypeDeclaration ERROR_TYPE_DECLARATION = new 
ErrorTypeDeclaration();
+    
+    
     public static boolean isJpfAnnotation( AnnotationMirror annotation, String 
unqualifiedName )
     {
-        String annotationName = 
annotation.getAnnotationType().getDeclaration().getQualifiedName();
+        String annotationName = getDeclaration( annotation.getAnnotationType() 
).getQualifiedName();
         return annotationName.equals( ANNOTATION_QUALIFIER + unqualifiedName );
     }
     
@@ -52,7 +58,7 @@
         
         for ( AnnotationMirror i : annotations )
         {
-            String iName = 
i.getAnnotationType().getDeclaration().getQualifiedName();
+            String iName = getDeclaration( i.getAnnotationType() 
).getQualifiedName();
             if ( unqualifiedName.equals( iName ) ) return i;
         }
         
@@ -105,7 +111,10 @@
         //
         if ( defaultIsNull ) return null;
         
-        for ( AnnotationTypeElementDeclaration j : 
annotation.getAnnotationType().getDeclaration().getMethods() )
+        AnnotationTypeDeclaration typeDecl = 
annotation.getAnnotationType().getDeclaration();
+        if ( typeDecl == null ) return null;    // type declaration is null in 
the case of error type
+        
+        for ( AnnotationTypeElementDeclaration j : typeDecl.getMethods() )
         {
             if ( memberName.equals( j.getSimpleName() ) ) return 
j.getDefaultValue();
         }
@@ -235,12 +244,12 @@
     
     public static String getQualifiedName( AnnotationMirror annotation )
     {
-        return 
annotation.getAnnotationType().getDeclaration().getQualifiedName();
+        return getDeclaration( annotation.getAnnotationType() 
).getQualifiedName();
     }
     
     public static String getSimpleName( AnnotationMirror annotation )
     {
-        return annotation.getAnnotationType().getDeclaration().getSimpleName();
+        return getDeclaration( annotation.getAnnotationType() 
).getSimpleName();
     }
     
     public static AnnotationMirror getAnnotation( AnnotationMirror annotation, 
String memberName, boolean defaultIsNull )
@@ -289,7 +298,7 @@
         
         if ( superclass != null )
         {
-            return getClassMethod( superclass.getDeclaration(), methodName, 
desiredAnnotation, true );
+            return getClassMethod( getDeclaration( superclass ), methodName, 
desiredAnnotation, true );
         }
         
         return null;
@@ -325,7 +334,7 @@
         
         if ( superclass != null )
         {
-            return getClassField( superclass.getDeclaration(), fieldName, 
desiredAnnotation, true );
+            return getClassField( getDeclaration( superclass ), fieldName, 
desiredAnnotation, true );
         }
         
         return null;
@@ -362,7 +371,7 @@
         
         if ( superclass != null )
         {
-            getClassMethods( superclass.getDeclaration(), desiredAnnotation, 
true, results );
+            getClassMethods( getDeclaration( superclass ), desiredAnnotation, 
true, results );
         }
     }
     
@@ -394,7 +403,7 @@
         
         if ( superclass != null )
         {
-            getClassFields( superclass.getDeclaration(), true, results );
+            getClassFields( getDeclaration( superclass ), true, results );
         }
     }
     
@@ -426,7 +435,7 @@
         
         if ( superclass != null )
         {
-            getClassNestedTypes( superclass.getDeclaration(), true, results );
+            getClassNestedTypes( getDeclaration( superclass ), true, results );
         }
     }
         
@@ -455,7 +464,7 @@
     
     public static String getFormClassName( DeclaredType jclass, 
AnnotationProcessorEnvironment env )
     {
-        return getFormClassName( jclass.getDeclaration(), env );
+        return getFormClassName( getDeclaration( jclass ), env );
     }
     
     public static boolean isAbsoluteURL( String path )
@@ -473,7 +482,7 @@
     public static boolean isAssignableFrom( String className, TypeMirror type, 
AnnotationProcessorEnvironment env )
     {
         if ( ! ( type instanceof DeclaredType ) ) return false;
-        return isAssignableFrom( className, ( ( DeclaredType ) type 
).getDeclaration(), env );
+        return isAssignableFrom( className, getDeclaration( ( DeclaredType ) 
type ), env );
     }
     
     public static boolean isAssignableFrom( TypeDeclaration base, 
TypeDeclaration typeDecl )
@@ -485,13 +494,13 @@
             if ( typeDecl instanceof ClassDeclaration )
             {
                 ClassType superclass = ( ( ClassDeclaration ) typeDecl 
).getSuperclass();
-                if ( superclass != null && isAssignableFrom( base, 
superclass.getDeclaration() ) ) return true;
+                if ( superclass != null && isAssignableFrom( base, 
getDeclaration( superclass ) ) ) return true;
             }
             
             Collection< InterfaceType > superInterfaces = 
typeDecl.getSuperinterfaces();
             for ( InterfaceType superInterface : superInterfaces )
             {
-                if ( isAssignableFrom( base, superInterface.getDeclaration() ) 
) return true;
+                if ( isAssignableFrom( base, getDeclaration( superInterface ) 
) ) return true;
             }
         }
         
@@ -501,13 +510,13 @@
     public static boolean isAssignableFrom( TypeMirror base, TypeDeclaration 
cl )
     {
         if ( ! ( base instanceof DeclaredType ) ) return false;
-        return isAssignableFrom( ( ( DeclaredType ) base ).getDeclaration(), 
cl );
+        return isAssignableFrom( getDeclaration( ( DeclaredType ) base ), cl );
     }
     
     public static boolean isAssignableFrom( TypeDeclaration base, TypeMirror 
cl )
     {
         if ( ! ( cl instanceof DeclaredType ) ) return false;
-        return isAssignableFrom( base, ( ( DeclaredType ) cl 
).getDeclaration() );
+        return isAssignableFrom( base, getDeclaration( ( DeclaredType ) cl ) );
     }
     
     public static boolean isAssignableFrom( String className, TypeDeclaration 
cl, AnnotationProcessorEnvironment env )
@@ -519,7 +528,7 @@
     public static boolean isOfClass( TypeMirror type, String className, 
AnnotationProcessorEnvironment env )
     {
         if ( ! ( type instanceof DeclaredType ) ) return false;
-        return typesAreEqual( ( ( DeclaredType ) type ).getDeclaration(), 
env.getTypeDeclaration( className ) );
+        return typesAreEqual( getDeclaration( ( DeclaredType ) type ), 
env.getTypeDeclaration( className ) );
     }
     
     // TODO: this method will be unnecessary when CRXXXX is fixed.
@@ -618,7 +627,7 @@
     
     public static String getLoadableName( DeclaredType jclass )
     {
-        return getLoadableName( jclass.getDeclaration() );
+        return getLoadableName( getDeclaration( jclass ) );
     }
     
     public static boolean getMethodOrClassFlag( AnnotationMirror 
methodAnnotation, ClassDeclaration jclass,
@@ -883,5 +892,90 @@
         assert pathFromWebappRoot.startsWith( "/" ) : pathFromWebappRoot;
         String className = removeFileExtension( pathFromWebappRoot.substring( 
1 ) );
         return env.getTypeDeclaration( className.replace( '/', '.' ) );
+    }
+    
+    public static TypeDeclaration getDeclaration( DeclaredType type )
+    {
+        TypeDeclaration typeDecl = type.getDeclaration();
+        return typeDecl != null ? typeDecl : ERROR_TYPE_DECLARATION;
+    }
+    
+    private static class ErrorTypeDeclaration
+        implements TypeDeclaration
+    {
+        public PackageDeclaration getPackage()
+        {
+            throw new IllegalStateException( "not implemented " );
+        }
+
+        public String getQualifiedName()
+        {
+            return "<error>";
+        }
+
+        public Collection< TypeParameterDeclaration > getFormalTypeParameters()
+        {
+            return Collections.emptyList();
+        }
+
+        public Collection< InterfaceType > getSuperinterfaces()
+        {
+            return Collections.emptyList();
+        }
+
+        public Collection< FieldDeclaration > getFields()
+        {
+            return Collections.emptyList();
+        }
+
+        public Collection< ? extends MethodDeclaration > getMethods()
+        {
+            return Collections.emptyList();
+        }
+
+        public Collection< TypeDeclaration > getNestedTypes()
+        {
+            return Collections.emptyList();
+        }
+
+        public TypeDeclaration getDeclaringType()
+        {
+            return null;
+        }
+
+        public String getDocComment()
+        {
+            throw new IllegalStateException( "not implemented " );
+        }
+
+        public Collection< AnnotationMirror > getAnnotationMirrors()
+        {
+            return Collections.emptyList();
+        }
+
+        public < A extends Annotation > A getAnnotation( Class< A > aClass )
+        {
+            throw new IllegalStateException( "not implemented " );
+        }
+
+        public Collection< Modifier > getModifiers()
+        {
+            return Collections.emptyList();
+        }
+
+        public String getSimpleName()
+        {
+            return getQualifiedName();
+        }
+
+        public SourcePosition getPosition()
+        {
+            throw new IllegalStateException( "not implemented " );
+        }
+
+        public void accept( DeclarationVisitor declarationVisitor )
+        {
+            throw new IllegalStateException( "not implemented " );
+        }
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
     Thu Sep 16 12:06:26 2004
@@ -226,7 +226,9 @@
 
         for ( AnnotationMirror annotation : annotations )
         {
-            if ( 
annotation.getAnnotationType().getDeclaration().getSimpleName().equals( 
CONTROLLER_TAG_NAME ) )
+            AnnotationTypeDeclaration annotationTypeDecl = 
annotation.getAnnotationType().getDeclaration();
+            
+            if ( annotationTypeDecl != null && 
annotationTypeDecl.getSimpleName().equals( CONTROLLER_TAG_NAME ) )
             {
                 _controllerGrammar.check( annotation, null, jclass );
             }
@@ -258,7 +260,7 @@
         
         for ( AnnotationMirror annotation : annotations )
         {
-            String annotationName = 
annotation.getAnnotationType().getDeclaration().getSimpleName();
+            String annotationName = CompilerUtils.getDeclaration( 
annotation.getAnnotationType() ).getSimpleName();
             
             if ( annotationName.equals( ACTION_TAG_NAME ) )
             {
@@ -300,7 +302,7 @@
             }
             else
             {
-                argTypeDecl = ( ( DeclaredType ) argType ).getDeclaration();
+                argTypeDecl = CompilerUtils.getDeclaration( ( DeclaredType ) 
argType );
                 
                 if ( ! CompilerUtils.hasDefaultConstructor( argTypeDecl )
                         && ! CompilerUtils.isAssignableFrom( 
BEA_XMLOBJECT_CLASS_NAME, argType, getEnv() )
@@ -353,9 +355,10 @@
             if ( memberForm != null )
             {
                 TypeMirror memberFormType = memberForm.getType();
-                String memberFormTypeName = ( memberFormType instanceof 
DeclaredType )
-                                            ? ( ( DeclaredType ) 
memberFormType ).getDeclaration().getQualifiedName()
-                                            : memberFormType.toString();
+                String memberFormTypeName =
+                        memberFormType instanceof DeclaredType
+                        ? CompilerUtils.getDeclaration( ( DeclaredType ) 
memberFormType ).getQualifiedName()
+                        : memberFormType.toString();
                 
                 if ( nParameters == 0 )
                 {
@@ -386,7 +389,7 @@
             
             for ( AnnotationMirror ann : annotations )
             {
-                String annotationName = 
ann.getAnnotationType().getDeclaration().getQualifiedName();
+                String annotationName = CompilerUtils.getDeclaration( 
ann.getAnnotationType() ).getQualifiedName();
                 int pos = annotationName.indexOf( ANNOTATION_QUALIFIER );
                 
                 if ( pos != -1 )

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   Thu Sep 16 12:06:26 2004
@@ -34,6 +34,8 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
@@ -41,9 +43,9 @@
 
 public class PageFlowChecker
         extends FlowControllerChecker
-        implements JpfLanguageConstants
 {
     private static final FilenameFilter SHARED_FLOW_FILE_FILTER = new 
SharedFlowFileFilter();
+    private static final FilenameFilter JPF_FILE_FILTER = new JpfFileFilter();
     
     
     public PageFlowChecker( AnnotationProcessorEnvironment env, Diagnostics 
diagnostics, FlowControllerInfo fcInfo )    
@@ -51,11 +53,11 @@
         super( env, diagnostics, fcInfo );
     }
 
-    private static class PageFlowFileFilter implements FilenameFilter
+    private static class JpfFileFilter implements FilenameFilter
     {
         public boolean accept( File dir, String name )
         {
-            return name.endsWith( JPF_FILE_EXTENSION_DOT ) || name.endsWith( 
JAVA_FILE_EXTENSION_DOT );
+            return name.endsWith( JPF_FILE_EXTENSION_DOT );
         }
     }
     
@@ -133,21 +135,52 @@
 
     protected void doAdditionalClassChecks( ClassDeclaration jpfClass, File 
webappRoot )
     {
+        File jpfFile = CompilerUtils.getOriginalFile( jpfClass );
         PackageDeclaration pkg = jpfClass.getPackage();
         Collection< ClassDeclaration > packageClasses = pkg.getClasses();
-        ArrayList< String > overlapping = new ArrayList< String >();
-        ArrayList< File > overlappingFiles = new ArrayList< File >();
+        Set< String > overlapping = new HashSet< String >();
+        List< File > overlappingFiles = new ArrayList< File >();
         
+        //
+        // First go through the other classes in this package to look for 
other page flows.
+        //
         for ( ClassDeclaration classDecl : packageClasses )
         {
-            if ( ! classDecl.equals( jpfClass ) && 
CompilerUtils.isPageFlowClass( classDecl, getEnv() ) )
+            if ( CompilerUtils.isPageFlowClass( classDecl, getEnv() ) )
             {
                 File file = CompilerUtils.getOriginalFile( classDecl );
-                overlapping.add( file.getName() );
-                overlappingFiles.add( file );
+                
+                if ( ! jpfFile.equals( file ) )
+                {
+                    overlapping.add( file.getName() );
+                    overlappingFiles.add( file );
+                }
             }
         }
             
+        //
+        // Additionally, we'll go through the parent directory to make sure 
there are no other .jpf files.  This is
+        // a double-check for the case where duplicate files have the same 
class names inside them, which means that
+        // iterating through the list of package classes is hit or miss (only 
one of them will show up, and it may be
+        // this class or the duplicate class.
+        //
+        File parentDir = jpfFile.getParentFile();
+        File[] peers = parentDir.listFiles( JPF_FILE_FILTER );
+        for ( int i = 0; i < peers.length; i++ )
+        {
+            File peer = peers[i];
+            if ( ! peer.equals( jpfFile ) )
+            {
+                String name = peer.getName();
+                
+                if ( ! overlapping.contains( name ) )
+                {
+                    overlapping.add( name );
+                    overlappingFiles.add( peer );
+                }
+            }
+        }
+
         int len = overlapping.size();
         if ( len > 0 )
         {
@@ -167,7 +200,6 @@
         // Check the package name.
         //
         String jpfPackageName = pkg.getQualifiedName();
-        File parentDir = CompilerUtils.getOriginalFile( jpfClass 
).getAbsoluteFile().getParentFile();
         if ( parentDir.equals( webappRoot ) )
         {
             if ( jpfPackageName != null && jpfPackageName.length() > 0 )

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
   Thu Sep 16 12:06:26 2004
@@ -170,7 +170,7 @@
     protected String addFormBean( TypeMirror paramType, GenStrutsApp parentApp 
)
     {
         assert paramType instanceof DeclaredType : 
paramType.getClass().getName();  // checker should enforce this
-        TypeDeclaration decl = ( ( DeclaredType ) paramType ).getDeclaration();
+        TypeDeclaration decl = CompilerUtils.getDeclaration( ( DeclaredType ) 
paramType );
         String formBeanName = parentApp.addFormBean( decl, this );
         
         //

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     Thu Sep 16 12:06:26 2004
@@ -218,7 +218,7 @@
                 
                 if ( paramType instanceof DeclaredType )
                 {
-                    getMessageResourcesFromForm( ( ( DeclaredType ) paramType 
).getDeclaration(), actionModel );
+                    getMessageResourcesFromForm( CompilerUtils.getDeclaration( 
( DeclaredType ) paramType ), actionModel );
                 }
             }
         }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
       Thu Sep 16 12:06:26 2004
@@ -226,7 +226,7 @@
                     // Add the rules.  If the bean is derived from ActionForm, 
associate the rules with the *name* of
                     // the form; otherwise, associate them with the classname 
of the bean type.
                     //
-                    String formName = getFormBeanName( 
beanType.getDeclaration() );
+                    String formName = getFormBeanName( 
CompilerUtils.getDeclaration( beanType ) );
                     addRulesFromAnnotation( validationFieldAnnotation, 
formName, propName );
                 }
             }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/BaseValidationRuleGrammar.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/BaseValidationRuleGrammar.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/BaseValidationRuleGrammar.java
 Thu Sep 16 12:06:26 2004
@@ -88,7 +88,7 @@
              && CompilerUtils.getString( annotation, MESSAGE_ATTR, true ) == 
null )
         {
             addWarning( annotation, "warning.using-default-display-name",
-                        
parentAnnotations[0].getAnnotationType().getDeclaration().getSimpleName() );
+                        CompilerUtils.getDeclaration( 
parentAnnotations[0].getAnnotationType() ).getSimpleName() );
         }
         
         return super.onBeginCheck( annotation, parentAnnotations, classMember 
);

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
      (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
      Thu Sep 16 12:06:26 2004
@@ -105,10 +105,10 @@
         {
             TypeMirror handledExceptionType = 
parameters.iterator().next().getType();
             
-            if ( ! CompilerUtils.isAssignableFrom( handledExceptionType, 
exceptionType.getDeclaration() ) )
+            if ( ! CompilerUtils.isAssignableFrom( handledExceptionType, 
CompilerUtils.getDeclaration( exceptionType ) ) )
             {
                 addError( annotation, "error.incompatible-exception-handler", 
handlerMethod.getSimpleName(),
-                          exceptionType.getDeclaration().getQualifiedName() );
+                          CompilerUtils.getDeclaration( exceptionType 
).getQualifiedName() );
             }
         }
 

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/ForwardGrammar.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/ForwardGrammar.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/ForwardGrammar.java
    Thu Sep 16 12:06:26 2004
@@ -163,7 +163,10 @@
             }
             
             String actionName = ( String ) value.getValue();
-            String formTypeName = formBeanType != null ? 
formBeanType.getDeclaration().getQualifiedName() : null;
+            String formTypeName =
+                    formBeanType != null
+                    ? CompilerUtils.getDeclaration( formBeanType 
).getQualifiedName()
+                    : null;
             getFlowControllerInfo().addReturnAction( actionName, formTypeName 
);
         }
         

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/UniqueValueType.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/UniqueValueType.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/UniqueValueType.java
   Thu Sep 16 12:06:26 2004
@@ -149,7 +149,8 @@
                 if ( valueToCheck != null && ! valueToCheck.equals( member )
                      && valueToCheck.getValue().equals( memberValue ) )
                 {
-                    String annotationName = 
parentAnnotation.getAnnotationType().getDeclaration().getSimpleName();
+                    String annotationName =
+                            CompilerUtils.getDeclaration( 
parentAnnotation.getAnnotationType() ).getSimpleName();
                     
                     if ( includeEntityInMsg )
                     {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
    Thu Sep 16 12:06:26 2004
@@ -56,6 +56,8 @@
 import java.util.Locale;
 import java.util.Map;
 
+import static 
org.apache.beehive.netui.pageflow.internal.InternalConstants.ATTR_PREFIX;
+
 
 /**
  * Base class for user-written flow controllers - PageFlowControllers and 
Global.app.
@@ -65,8 +67,8 @@
 {
     private static final Logger _log = Logger.getInstance( 
FlowController.class );
     
-    private static final String ONCREATE_EXCEPTION_FORWARD = 
FlowController.class.getName() + ":onCreateException";
-    private static final String CACHEID_ACTION_METHODS = 
FlowController.class.getName() + ":actions";
+    private static final String ONCREATE_EXCEPTION_FORWARD = ATTR_PREFIX + 
"onCreateException";
+    private static final String CACHEID_ACTION_METHODS = ATTR_PREFIX + 
"actionMethods";
     private static final int DEFAULT_MAX_CONCURRENT_REQUEST_COUNT = 4;
     private static final String MAX_CONCURRENT_REQUESTS_PARAM = 
"pageflow-max-concurrent-requests";
     private static final int EXCEEDED_MAX_CONCURRENT_REQUESTS_ERRORCODE = 503;

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowFormBeanConfig.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowFormBeanConfig.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowFormBeanConfig.java
     Thu Sep 16 12:06:26 2004
@@ -18,12 +18,13 @@
 package org.apache.beehive.netui.pageflow.config;
 
 import org.apache.struts.config.FormBeanConfig;
+import org.apache.struts.action.ActionFormBean;
 
 
 /**
  * Class to handle our extensions to the Struts <form-bean> tag.
  */
-public class PageFlowFormBeanConfig extends FormBeanConfig
+public class PageFlowFormBeanConfig extends ActionFormBean
 {
     private String _actualType;  // applicable for non-ActionForm-derived form 
types
 

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    Thu Sep 16 12:06:26 2004
@@ -63,11 +63,11 @@
     private static final String APACHE_XMLOBJECT_CLASSNAME = 
"org.apache.xmlbeans.XmlObject";
     private static final Class BEA_XMLOBJECT_CLASS = loadClassNonFatal( 
BEA_XMLOBJECT_CLASSNAME );
     private static final Class APACHE_XMLOBJECT_CLASS = loadClassNonFatal( 
APACHE_XMLOBJECT_CLASSNAME );
-    private static final String FORWARDED_OUTPUT_FORM_ATTR = 
PageFlowUtils.class.getName() + "_forwardedForm";    
-    private static final String SINGLETON_PAGEFLOWS_ATTR_PREFIX = 
PageFlowUtils.class.getName() + "_singleton:";
-    private static final String ACTIONOUTPUT_MAP_ATTR = 
PageFlowUtils.class.getName() + "_actionOutputs";
-    private static final String BINDING_UPDATE_ERRORS_ATTR = 
PageFlowUtils.class.getName() + "_bindingUpdateErrors";
-    private static final String SHARED_FLOW_CLASSNAME_ATTR = 
PageFlowUtils.class.getName() + "_sharedFlowClass";
+    private static final String FORWARDED_OUTPUT_FORM_ATTR = ATTR_PREFIX + 
"forwardedForm";    
+    private static final String SINGLETON_PAGEFLOWS_ATTR_PREFIX = ATTR_PREFIX 
+ "singletonPageFlow:";
+    private static final String ACTIONOUTPUT_MAP_ATTR = ATTR_PREFIX + 
"actionOutputs";
+    private static final String BINDING_UPDATE_ERRORS_ATTR = ATTR_PREFIX + 
"bindingUpdateErrors";
+    private static final String SHARED_FLOW_CLASSNAME_ATTR = ATTR_PREFIX + 
"sharedFlowClass";
     private static final String CATALINA_HOME_PROP = "catalina.home";
     private static final String SERVER_ADAPTER_PROP = "pageflow.serveradapter";
     private static final String WL_SERVER_ADAPTER_CLASS = 
"com.bea.wlw.netui.pageflow.internal.WebLogicServerAdapter";

Modified: 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
 Thu Sep 16 12:06:26 2004
@@ -46,10 +46,11 @@
 {
     public static final String SCOPE_ID_PARAM = "jpfScopeID";
     
-    private static final String OVERRIDE_REQUEST_ATTR = 
ScopedServletUtils.class.getName() + "_overrideRequest";
-    private static final String OVERRIDE_RESPONSE_ATTR = 
ScopedServletUtils.class.getName() + "_overrideResponse";
-    private static final String ORIGINAL_URI_ATTR = 
ScopedServletUtils.class.getName() + "_originalURI";
-    private static final String DECODED_URI_ATTR = 
ScopedServletUtils.class.getName() + "_decodedURI";
+    static final String ATTR_PREFIX = "_netui:";
+    private static final String OVERRIDE_REQUEST_ATTR = ATTR_PREFIX + 
"overrideRequest";
+    private static final String OVERRIDE_RESPONSE_ATTR = ATTR_PREFIX + 
"overrideResponse";
+    private static final String ORIGINAL_URI_ATTR = ATTR_PREFIX + 
"originalURI";
+    private static final String DECODED_URI_ATTR = ATTR_PREFIX + "decodedURI";
     
     private static final Logger logger = Logger.getLogger( 
ScopedServletUtils.class );
     
@@ -424,4 +425,12 @@
         request.setAttribute( DECODED_URI_ATTR, decodedURI );
         return decodedURI;
     }
+    
+    /*
+    public static void setAttribute( HttpServletRequest request, boolean 
hideFromScopedRequests,
+                                     boolean excludeFromAutoPersist )
+    {
+        
+    }
+    */
 }

Modified: 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
 Thu Sep 16 12:06:26 2004
@@ -60,8 +60,9 @@
     private HashMap _additionalParameters;
 
 
-    private static final String OUR_SESSION_ATTR_NAME = 
ScopedRequest.class.getName() + ".scopedSession";
-    private static final String STORED_ATTRS_ATTR_NAME = 
ScopedRequest.class.getName() + ".storedAttrs";
+    static final String ATTR_PREFIX = "_netui:";
+    private static final String OUR_SESSION_ATTR_NAME = ATTR_PREFIX + 
"scopedSession";
+    private static final String STORED_ATTRS_ATTR_NAME = ATTR_PREFIX + 
"storedAttrs";
 
     private static final Logger logger = Logger.getLogger( 
ScopedRequestImpl.class );
 

Reply via email to