java.lang.ClassCastException: java.lang.String is thrown when compiling a 
PageFlow with an invalid value for the "redirect" attribute
-------------------------------------------------------------------------------------------------------------------------------------

         Key: BEEHIVE-496
         URL: http://issues.apache.org/jira/browse/BEEHIVE-496
     Project: Beehive
        Type: Bug
  Components: NetUI  
    Versions: V1    
    Reporter: Alejandro Ramirez
 Assigned to: Rich Feit 
    Priority: Minor
     Fix For: V1


1.- Unzip the attached pageflow into a beehive enabled webapp.
2.- Attempt to compile the webapp.
Expected:  The attached pageflow should throw a compiler error since we are 
providing an invalid value for the "redirect" attribute in the following 
forward:
   @Jpf.Action(forwards = {
            @Jpf.Forward(
                name = "pg1",path = "Pg1.jsp",redirect = badValue)
        })
    protected Forward page1()
        {
        return new Forward("pg1");
        }

Actual:  There is a compiler error thrown.  However, there is also an uncaught 
ClassCastException:

[apt] D:\temp\beehiveSharedFlows\WEB-INF\.tmpbeansrc\Test11\Controller.java:37: 
cannot find symbol
      [apt] symbol  : variable badValue
      [apt] location: class Test11.Controller
      [apt] redirect = badValue)
      [apt] ^
      [apt] java.lang.ClassCastException: java.lang.String
      [apt] at 
org.apache.beehive.netui.compiler.CompilerUtils.getBoolean(CompilerUtils.java:224)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenForwardModel.<init>(GenForwardModel.java:42)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenForwardModel.addForwards(GenForwardModel.java:160)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenForwardModel.addForwards(GenForwardModel.java:150)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenActionModel.getForwards(GenActionModel.java:222)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenActionModel.init(GenActionModel.java:110)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenActionModel.<init>(GenActionModel.java:49)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenStrutsApp.addActionMethods(GenStrutsApp.java:273)
      [apt] at 
org.apache.beehive.netui.compiler.genmodel.GenStrutsApp.<init>(GenStrutsApp.java:117)
      [apt] at 
org.apache.beehive.netui.compiler.PageFlowGenerator.createStrutsApp(PageFlowGenerator.java:45)
      [apt] at 
org.apache.beehive.netui.compiler.FlowControllerGenerator.generate(FlowControllerGenerator.java:55)
      [apt] at 
org.apache.beehive.netui.compiler.apt.BaseAnnotationProcessor.generate(BaseAnnotationProcessor.java:97)
      [apt] at 
org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor.generate(TwoPhaseAnnotationProcessor.java:120)
      [apt] at 
org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor.process(TwoPhaseAnnotationProcessor.java:90)
      [apt] at 
org.apache.beehive.netui.compiler.apt.BaseAnnotationProcessor.process(BaseAnnotationProcessor.java:104)
      [apt] at 
com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
      [apt] at com.sun.tools.apt.comp.Apt.main(Apt.java:404)
      [apt] at 
com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:440)
      [apt] at com.sun.tools.apt.main.Main.compile(Main.java:1017)
      [apt] at com.sun.tools.apt.main.Main.compile(Main.java:907)
      [apt] at com.sun.tools.apt.Main.compile(Main.java:41)
      [apt] at com.sun.tools.apt.Main.main(Main.java:32)
      [apt] 
D:\temp\beehiveSharedFlows\WEB-INF\.tmpbeansrc\Test11\Controller.java:19: Could 
not generate output file null.
      [apt] public class Controller extends PageFlowController
      [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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to