Velocity
  1. Velocity
  2. VELOCITY-324

Cannot compile Velocity with JDK 1.5 due to use of the newly-reserved word "enum"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Build
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      Currently, Velocity doesn't compile with Java5 because it uses enum in the
      following classes:
      o.a.v.runtime.parser.Parser
      o.a.v.texen.Generator
      o.a.v.util.EnumerationIterator

      To avoid future issues, I think the source should be changed.

        1. Of course, you might have to do something with javacc for Parser...

        Activity

        Shinobu Kawai created issue -
        Hide
        Shinobu Kawai added a comment -

        Created an attachment (id=13562)
        Change enum to enumeration

        Show
        Shinobu Kawai added a comment - Created an attachment (id=13562) Change enum to enumeration
        Hide
        Daniel Rall added a comment -

        Shinobu's patch will not break backward compatibility, and will be committed.

        Show
        Daniel Rall added a comment - Shinobu's patch will not break backward compatibility, and will be committed.
        Hide
        Daniel Rall added a comment -
        • src/java/org/apache/velocity/runtime/parser/Parser.java
        • src/java/org/apache/velocity/texen/Generator.java
        • src/java/org/apache/velocity/util/EnumerationIterator.java
          Replaced use of JDK 1.5 reserved word "enum" with "enumeration" to
          allow compilation of Velocity on that platform.

        Issue: http://issues.apache.org/bugzilla/show_bug.cgi?id=32416
        Submitted by: Shinobu Kawai

        Sending src/java/org/apache/velocity/runtime/parser/Parser.java
        Sending src/java/org/apache/velocity/texen/Generator.java
        Sending src/java/org/apache/velocity/util/EnumerationIterator.java
        Transmitting file data ...
        Committed revision 106845.

        Show
        Daniel Rall added a comment - src/java/org/apache/velocity/runtime/parser/Parser.java src/java/org/apache/velocity/texen/Generator.java src/java/org/apache/velocity/util/EnumerationIterator.java Replaced use of JDK 1.5 reserved word "enum" with "enumeration" to allow compilation of Velocity on that platform. Issue: http://issues.apache.org/bugzilla/show_bug.cgi?id=32416 Submitted by: Shinobu Kawai Sending src/java/org/apache/velocity/runtime/parser/Parser.java Sending src/java/org/apache/velocity/texen/Generator.java Sending src/java/org/apache/velocity/util/EnumerationIterator.java Transmitting file data ... Committed revision 106845.
        Hide
        Shinobu Kawai added a comment -

        Created an attachment (id=13900)
        enum -> enumeration

        Show
        Shinobu Kawai added a comment - Created an attachment (id=13900) enum -> enumeration
        Hide
        Shinobu Kawai added a comment -

        I kind of saw this coming...

        Unless something is done with the output of javacc, this bug is just going to
        keep reappearing.

        Show
        Shinobu Kawai added a comment - I kind of saw this coming... Unless something is done with the output of javacc, this bug is just going to keep reappearing.
        Hide
        Will Glass-Husain added a comment -

        Oh. Just to be more explicit. Whenever Parser.jjt is changed, Parser.java is
        overwritten by javacc. So this patch (for Parser.java) is really not very
        useful in the long term.

        Show
        Will Glass-Husain added a comment - Oh. Just to be more explicit. Whenever Parser.jjt is changed, Parser.java is overwritten by javacc. So this patch (for Parser.java) is really not very useful in the long term.
        Hide
        Shinobu Kawai added a comment -

        One solution would be to upgrade JavaCC. I just tried it with 3.2, and it
        produced "e" instead. "ant test", and all of the JUnit tests I've made for
        Velocity also worked for it.

        Show
        Shinobu Kawai added a comment - One solution would be to upgrade JavaCC. I just tried it with 3.2, and it produced "e" instead. "ant test", and all of the JUnit tests I've made for Velocity also worked for it.
        Hide
        Will Glass-Husain added a comment -

        Yep, I think this is the solution. Before we close this bug, we should
        document this in the readme.

        Show
        Will Glass-Husain added a comment - Yep, I think this is the solution. Before we close this bug, we should document this in the readme.
        Hide
        Will Glass-Husain added a comment -

        Fixed. Used JavaCC 3.2, added note in BUILD_README. (revision # 125193)

        Show
        Will Glass-Husain added a comment - Fixed. Used JavaCC 3.2, added note in BUILD_README. (revision # 125193)
        Hide
        Will Glass-Husain added a comment -
            • Bug 35504 has been marked as a duplicate of this bug. ***
        Show
        Will Glass-Husain added a comment - Bug 35504 has been marked as a duplicate of this bug. ***
        Hide
        Will Glass-Husain added a comment -
            • Bug 35596 has been marked as a duplicate of this bug. ***
        Show
        Will Glass-Husain added a comment - Bug 35596 has been marked as a duplicate of this bug. ***
        Hide
        Will Glass-Husain added a comment -
            • Bug 36596 has been marked as a duplicate of this bug. ***
        Show
        Will Glass-Husain added a comment - Bug 36596 has been marked as a duplicate of this bug. ***
        Jeff Turner made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 32416 12315194
        Henning Schmiedehausen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12325199 ] Default workflow, editable Closed status [ 12551456 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551456 ] jira [ 12552135 ]

          People

          • Assignee:
            Daniel Rall
            Reporter:
            Shinobu Kawai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development