You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/11/29 00:00:07 UTC
svn commit: r349545 -
/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java
Author: rich
Date: Mon Nov 28 15:00:03 2005
New Revision: 349545
URL: http://svn.apache.org/viewcvs?rev=349545&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-1015 : NPE when compiling a JSF backing bean in the same package as an invalid page flow controller
tests: bvt in netui (WinXP)
BB: same (linux)
Modified:
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java
Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java?rev=349545&r1=349544&r2=349545&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingChecker.java Mon Nov 28 15:00:03 2005
@@ -53,23 +53,28 @@
if ( CompilerUtils.isPageFlowClass( classDecl, getEnv() ) ) jpfClass = classDecl;
}
- FlowControllerInfo fcInfo = new FlowControllerInfo( jpfClass );
- fcInfo.startBuild( getEnv(), jpfClass );
-
- CommandHandlerGrammar chg =
- new CommandHandlerGrammar( getEnv(), getDiagnostics(), getRuntimeVersionChecker(), jpfClass, fcInfo );
- MethodDeclaration[] methods = CompilerUtils.getClassMethods( jclass, COMMAND_HANDLER_TAG_NAME );
-
- for ( int i = 0; i < methods.length; i++ )
- {
- MethodDeclaration method = methods[i];
- getFBSourceFileInfo().addCommandHandler( method.getSimpleName() );
- chg.check( CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ), null, method );
+ // Don't run these checks if there's no associated page flow controller (or if it's in error).
+ if (jpfClass != null) {
+ FlowControllerInfo fcInfo = new FlowControllerInfo( jpfClass );
+ fcInfo.startBuild( getEnv(), jpfClass );
+
+ CommandHandlerGrammar chg =
+ new CommandHandlerGrammar( getEnv(), getDiagnostics(), getRuntimeVersionChecker(), jpfClass, fcInfo );
+ MethodDeclaration[] methods = CompilerUtils.getClassMethods( jclass, COMMAND_HANDLER_TAG_NAME );
+
+ for ( int i = 0; i < methods.length; i++ )
+ {
+ MethodDeclaration method = methods[i];
+ getFBSourceFileInfo().addCommandHandler( method.getSimpleName() );
+ chg.check( CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ), null, method );
+ }
+
+ Map checkResultMap = new HashMap();
+ checkResultMap.put( JpfLanguageConstants.ExtraInfoKeys.facesBackingInfo, getSourceFileInfo() );
+ return checkResultMap;
}
- Map checkResultMap = new HashMap();
- checkResultMap.put( JpfLanguageConstants.ExtraInfoKeys.facesBackingInfo, getSourceFileInfo() );
- return checkResultMap;
+ return null;
}
protected FacesBackingInfo getFBSourceFileInfo()