Uploaded image for project: '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
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Build
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • Bugzilla Id:
      32416

      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

        Hide
        shinobu Shinobu Kawai added a comment -

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

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

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

        Show
        dlr Daniel Rall added a comment - Shinobu's patch will not break backward compatibility, and will be committed.
        Hide
        dlr 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
        dlr 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 Shinobu Kawai added a comment -

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

        Show
        shinobu Shinobu Kawai added a comment - Created an attachment (id=13900) enum -> enumeration
        Hide
        shinobu 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 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
        wglass@forio.com 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
        wglass@forio.com 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 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 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
        wglass@forio.com 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
        wglass@forio.com 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
        wglass@forio.com Will Glass-Husain added a comment -

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

        Show
        wglass@forio.com Will Glass-Husain added a comment - Fixed. Used JavaCC 3.2, added note in BUILD_README. (revision # 125193)
        Hide
        wglass@forio.com Will Glass-Husain added a comment -
            • Bug 35504 has been marked as a duplicate of this bug. ***
        Show
        wglass@forio.com Will Glass-Husain added a comment - Bug 35504 has been marked as a duplicate of this bug. ***
        Hide
        wglass@forio.com Will Glass-Husain added a comment -
            • Bug 35596 has been marked as a duplicate of this bug. ***
        Show
        wglass@forio.com Will Glass-Husain added a comment - Bug 35596 has been marked as a duplicate of this bug. ***
        Hide
        wglass@forio.com Will Glass-Husain added a comment -
            • Bug 36596 has been marked as a duplicate of this bug. ***
        Show
        wglass@forio.com Will Glass-Husain added a comment - Bug 36596 has been marked as a duplicate of this bug. ***

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development