Beehive
  1. Beehive
  2. BEEHIVE-1158

An empty string value for validatorMerge in the @Jpf.Controller annotation causes a stack trace in the NetUI compiler

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1, 1.0.2, V.Next
    • Fix Version/s: V.Next
    • Component/s: NetUI
    • Labels:
      None

      Description

      An empty string value for the validatorMerge property in the @Jpf.Controller annotation causes the following stack trace during the page flow compile.

      [apt] java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      [apt] at java.lang.String.charAt(String.java:558)
      [apt] at org.apache.beehive.netui.compiler.CompilerUtils.getFileRelativeToSourceFile(CompilerUtils.java:1198)
      [apt] at org.apache.beehive.netui.compiler.genmodel.GenStrutsApp.getMergeFile(GenStrutsApp.java:460)
      [apt] at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.<init>(GenValidationModel.java:77)
      [apt] at org.apache.beehive.netui.compiler.FlowControllerGenerator.generate(FlowControllerGenerator.java:61)
      [apt] at org.apache.beehive.netui.compiler.processor.BaseCoreAnnotationProcessor.generate(BaseCoreAnnotationProcessor.java:100)
      [apt] at org.apache.beehive.netui.compiler.processor.TwoPhaseCoreAnnotationProcessor.generate(TwoPhaseCoreAnnotationProcessor.java:175)
      [apt] at org.apache.beehive.netui.compiler.processor.TwoPhaseCoreAnnotationProcessor.process(TwoPhaseCoreAnnotationProcessor.java:113)
      [apt] at org.apache.beehive.netui.compiler.processor.BaseCoreAnnotationProcessor.process(BaseCoreAnnotationProcessor.java:107)
      [apt] at org.apache.beehive.netui.compiler.apt.BaseAnnotationProcessorFactory$DelegatingAnnotationProcessor.process(BaseAnnotationProcessorFactory.java:75)
      [apt] at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)

      We need to place a check in the compiler to ensure that the value is not an empty string. I can make this fix and submit a test case as well.

        Activity

        Hide
        Carlin Rogers added a comment -

        Looks like there is a similar issue with strutsMerge property.

        Show
        Carlin Rogers added a comment - Looks like there is a similar issue with strutsMerge property.
        Hide
        Carlin Rogers added a comment -

        This is fixed with svn revision 476063. The revision includes a new NetUI compiler test for empty string error conditions with the strutsMerge and validatorMerge property.

        Show
        Carlin Rogers added a comment - This is fixed with svn revision 476063. The revision includes a new NetUI compiler test for empty string error conditions with the strutsMerge and validatorMerge property.
        Hide
        Russ Baker added a comment -

        I verified that the StringIndexOutOfBoundsException is not thrown during the 'apt' task, using an empty string value for the validatorMerge property in the @Jpf.Controller annotation; rather a compilation error happens with the following message:

        [apt] G:\projects\beehiveDist\trunk\netui\test\webapps\drt\src\bugs\j1158\Controller.java:24: File "" could not be found in the web application.
        [apt] public class Controller extends PageFlowController {
        [apt] ^

        I verified this against SVN 549584. I recommend that this bug be closed.

        Show
        Russ Baker added a comment - I verified that the StringIndexOutOfBoundsException is not thrown during the 'apt' task, using an empty string value for the validatorMerge property in the @Jpf.Controller annotation; rather a compilation error happens with the following message: [apt] G:\projects\beehiveDist\trunk\netui\test\webapps\drt\src\bugs\j1158\Controller.java:24: File "" could not be found in the web application. [apt] public class Controller extends PageFlowController { [apt] ^ I verified this against SVN 549584. I recommend that this bug be closed.
        Hide
        Russ Baker added a comment -

        I also tested the 'strutsMerge' property in the @Jpf.Controller annotation, and got the same result.

        [apt] G:\projects\beehiveDist\trunk\netui\test\webapps\drt\src\bugs\j1158\Controller.java:24: File "" could not be found in the web application.
        [apt] public class Controller extends PageFlowController {
        [apt] ^

        Show
        Russ Baker added a comment - I also tested the 'strutsMerge' property in the @Jpf.Controller annotation, and got the same result. [apt] G:\projects\beehiveDist\trunk\netui\test\webapps\drt\src\bugs\j1158\Controller.java:24: File "" could not be found in the web application. [apt] public class Controller extends PageFlowController { [apt] ^
        Hide
        Julie Zhuo added a comment -

        Close. See Russ' comments.

        Show
        Julie Zhuo added a comment - Close. See Russ' comments.

          People

          • Assignee:
            Julie Zhuo
            Reporter:
            Carlin Rogers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development