Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-862

Rebuilding parser using javacc 4.1 loses Node import

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.x, 2.0
    • Build
    • None
    • Patch

    Description

      JavaCC 4.2 loses the "org.apache.velocity.runtime.parser.node.Node" import for JJTParserState.java when rebuilding the parser.

      Adding nodepackage="org.apache.velocity.runtime.parser.node" to the jjtree ant task in the build script will add the following import automatically which is better than no import or manually adding the import later:

      import org.apache.velocity.runtime.parser.*;

      Attachments

        1. build.xml-parser-imports-v3.patch
          0.7 kB
          Mike Kienenberger

        Activity

          Hold off on this one. I hadn't tried building the jar after regenerating the parser files, and apparently wildcard import is causing unexpected problems.

          mkienenb Mike Kienenberger added a comment - Hold off on this one. I hadn't tried building the jar after regenerating the parser files, and apparently wildcard import is causing unexpected problems.

          Oops. Yes, I hadn't realized that this was changing the package of the generated classes and not just adding an import. I'll have to work out something else.

          mkienenb Mike Kienenberger added a comment - Oops. Yes, I hadn't realized that this was changing the package of the generated classes and not just adding an import. I'll have to work out something else.

          This is an uglier solution (after-the-fact ant <replace> task of the package declaration with the package + import) but it works, and there's precedent already set of using <replace> to repair the generated files.

          mkienenb Mike Kienenberger added a comment - This is an uglier solution (after-the-fact ant <replace> task of the package declaration with the package + import) but it works, and there's precedent already set of using <replace> to repair the generated files.

          Forgot to replace tabs with spaces. Fixed v3

          mkienenb Mike Kienenberger added a comment - Forgot to replace tabs with spaces. Fixed v3

          Applied patch to 1.x trunk.

          mkienenb Mike Kienenberger added a comment - Applied patch to 1.x trunk.

          Reopening at Nathan's suggestion that we may want to apply this to 2.x

          mkienenb Mike Kienenberger added a comment - Reopening at Nathan's suggestion that we may want to apply this to 2.x
          cbrisson Claude Brisson added a comment -

          We now use javacc 5, and the parser build is integrated in maven.

           

          cbrisson Claude Brisson added a comment - We now use javacc 5, and the parser build is integrated in maven.  

          People

            cbrisson Claude Brisson
            mkienenb Mike Kienenberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: