You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Rich Feit (JIRA)" <be...@incubator.apache.org> on 2005/06/22 19:09:17 UTC

[jira] Commented: (BEEHIVE-831) NPE if a required annotation attribute is missing for @Jpf.ValidateRequired

    [ http://issues.apache.org/jira/browse/BEEHIVE-831?page=comments#action_12314244 ] 

Rich Feit commented on BEEHIVE-831:
-----------------------------------

This is a general problem with apt.  What *should* happen is this:

    - javac checking runs.  If javac generates any errors, stop processing.
    - apt runs.  If apt generates any errors, stop processing.
    - javac build runs.

What actually happens is this:
    - apt runs.  If apt generates any errors, stop processing.
    - javac check/build runs.

> NPE if a required annotation attribute is missing for @Jpf.ValidateRequired
> ---------------------------------------------------------------------------
>
>          Key: BEEHIVE-831
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-831
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: v1m1
>     Reporter: Rich Feit
>     Assignee: Rich Feit
>      Fix For: V1

>
> Repro:
>     - Add the following annotation to a form bean getter on an inner class of a page flow:
>         @Jpf.ValidatableProperty(
>             validateMinLength=@Jpf.ValidateMinLength()
>         )
>     - Build the page flow.
> EXPECTED: an error that says the 'chars' attribute is required for @Jpf.ValidateMinLength
> ACTUAL: the following exception:
>     java.lang.NullPointerException
>         at org.apache.beehive.netui.compiler.genmodel.DefaultValidatorRuleFactory.getFieldRule(DefaultValidatorRuleFactory.java:85)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.getFieldRule(GenValidationModel.java:369)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.addFieldRuleFromAnnotation(GenValidationModel.java:352)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.addFieldRules(GenValidationModel.java:331)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.addRulesFromAnnotation(GenValidationModel.java:161)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.addRulesFromBeanClass(GenValidationModel.java:133)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.addRulesFromBeans(GenValidationModel.java:94)
>         at org.apache.beehive.netui.compiler.genmodel.GenValidationModel.<init>(GenValidationModel.java:72)
>         at org.apache.beehive.netui.compiler.FlowControllerGenerator.generate(FlowControllerGenerator.java:61)
>         at org.apache.beehive.netui.compiler.processor.BaseAnnotationProcessor.generate(BaseAnnotationProcessor.java:99)
>         at org.apache.beehive.netui.compiler.processor.TwoPhaseAnnotationProcessor.generate(TwoPhaseAnnotationProcessor.java:144)
>         at org.apache.beehive.netui.compiler.processor.TwoPhaseAnnotationProcessor.process(TwoPhaseAnnotationProcessor.java:89)
>         at org.apache.beehive.netui.compiler.processor.BaseAnnotationProcessor.process(BaseAnnotationProcessor.java:106)
>         at org.apache.beehive.netui.compiler.apt.BaseAnnotationProcessorFactory$DelegatingAnnotationProcessor.process(BaseAnnotationProcessorFactory.java:64)
>         at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
>         at com.sun.tools.apt.comp.Apt.main(Apt.java:404)
>         at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:440)
>         at com.sun.tools.apt.main.Main.compile(Main.java:1017)
>         at com.sun.tools.apt.main.Main.compile(Main.java:907)
>         at com.sun.tools.apt.Main.compile(Main.java:41)
>         at com.sun.tools.apt.Main.main(Main.java:32)
> This is happening because javac runs *after* annotation processing, so that missing annotation members don't fail the build in time.

-- 
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