Maven 1.x JXR Plugin
  1. Maven 1.x JXR Plugin
  2. MPJXR-19

JXR can't process Java 5 enum classes.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.3
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      Description

      My project consists of the default App.java class, from running "maven genapp", and the following Java 5 enum class, State.java:

      package example.app;

      import java.awt.Color;

      public enum State
      {
      OK, WARN, CRITICAL;
      }

      The project compiles fine. When I run "maven site", I get the following error from JXR:

      [echo] Generating the Source Xref...
      maven-jxr-plugin:report:
      [echo]
      PackageManager -> parsing... example/app/App.java
      PackageManager -> parsing... example/app/State.java
      Unable to process /home/sscaring/tmp/test/src/java/example/app/State.java => /home/sscaring/tmp/test/target/docs/xref/example/app/State.html

      BUILD FAILED
      java.lang.NullPointerException
      at org.apache.maven.jxr.CodeTransform.getHeader(CodeTransform.java:617)
      at org.apache.maven.jxr.CodeTransform.transform(CodeTransform.java:687)
      at org.apache.maven.jxr.JXR.transform(JXR.java:225)
      at org.apache.maven.jxr.JXR.process(JXR.java:138)
      at org.apache.maven.jxr.JXR.<init>(JXR.java:93)
      at org.apache.maven.jxr.JxrBean.xref(JxrBean.java:95)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.apache.commons.jelly.impl.DynamicBeanTag.doTag(DynamicBeanTag.java:230)
      at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:145)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
      at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
      at com.werken.werkz.Goal.fire(Goal.java:639)
      at com.werken.werkz.Goal.attain(Goal.java:575)
      at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
      at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
      at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
      at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:145)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
      at com.werken.werkz.Goal.fire(Goal.java:639)
      at com.werken.werkz.Goal.attain(Goal.java:575)
      at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
      at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
      at com.werken.werkz.Goal.fire(Goal.java:639)
      at com.werken.werkz.Goal.attain(Goal.java:575)
      at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
      at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:634)
      at org.apache.maven.MavenSession.attainGoals(MavenSession.java:266)
      at org.apache.maven.cli.App.doMain(App.java:486)
      at org.apache.maven.cli.App.main(App.java:1215)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at com.werken.forehead.Forehead.run(Forehead.java:551)
      at com.werken.forehead.Forehead.main(Forehead.java:581)
      File...... /home/sscaring/.maven/cache/maven-jxr-plugin-1.4.1/plugin.jelly
      Element... jxr:jxr
      Line...... 97
      Column.... 31
      java.lang.NullPointerException
      Total time: 8 seconds
      Finished at: Fri Sep 24 08:23:09 EDT 2004

      JXR does successfully create the x-ref for the App.java class. Thanks,

      -Stephen

        Activity

        Hide
        Stephen Scaringi added a comment -

        Hello,

        It looks like this can be fixed by adding the following to line 110 of JavaFileImple.parse():

        stok.sval.equals("enum"))

        -Stephen

        Show
        Stephen Scaringi added a comment - Hello, It looks like this can be fixed by adding the following to line 110 of JavaFileImple.parse(): stok.sval.equals("enum")) -Stephen
        Hide
        Carlos Sanchez added a comment -

        Could you post the file that it's causing the error?

        Show
        Carlos Sanchez added a comment - Could you post the file that it's causing the error?

          People

          • Assignee:
            Carlos Sanchez
            Reporter:
            Stephen Scaringi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: