Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-545

maven-dependency-analyzer fails on classes containing constant long or double

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: maven-dependency-analyzer-1.7
    • Component/s: None
    • Labels:
      None

      Description

      The maven-dependency-analyzer was updated to parse the constant pool on each class file so that it can discover method references and constant references, but the ConstantPoolParser is missing two critical lines that cause it to throw an exception on any class file containing a constant long or constant double field. According to the Javadoc, the class was adapted from this stack overflow answer. If you look inside the switch statement at the cases for longs and doubles, it increments the index. But the ConstantPoolParser is missing this increment. This causes it to land here and throw an exception on all but the most trivial codebases. In this pull request I fixed the bug and updated one of the test classes to have a constant long field to prevent regressions.

        Issue Links

          Activity

          Hide
          jhaber Jonathan Haber added a comment -

          Anything I can do to move this along? The bug is very literally a blocker and renders the maven-dependency-analyzer completely unusable. And the fix that I PRed is quite trivial.

          Show
          jhaber Jonathan Haber added a comment - Anything I can do to move this along? The bug is very literally a blocker and renders the maven-dependency-analyzer completely unusable. And the fix that I PRed is quite trivial.
          Hide
          jhaber Jonathan Haber added a comment -

          Any update? The broken code is still in trunk as far as I can tell and renders the maven-dependency-analyzer completely unusable.

          Show
          jhaber Jonathan Haber added a comment - Any update? The broken code is still in trunk as far as I can tell and renders the maven-dependency-analyzer completely unusable.
          Hide
          jhaber Jonathan Haber added a comment -

          Just to be clear, this doesn't affect maven-dependency-analyzer-1.6. The broken code was only in trunk and never part of an official release.

          Show
          jhaber Jonathan Haber added a comment - Just to be clear, this doesn't affect maven-dependency-analyzer-1.6. The broken code was only in trunk and never part of an official release.
          Hide
          michael-o Michael Osipov added a comment -

          Fixed with r1755616.

          Show
          michael-o Michael Osipov added a comment - Fixed with r1755616 .
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/maven-shared/pull/10

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/maven-shared/pull/10
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in maven-shared #2810 (See https://builds.apache.org/job/maven-shared/2810/)
          MSHARED-545 maven-dependency-analyzer fails on classes containing constant long or double

          Submitted-by: Jonathan Haber <jhaber@hubspot.com>

          This fixes #10 (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1755616)

          • maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ConstantPoolParser.java
          • maven-dependency-analyzer/src/test/resources/java8methodRefs/src/main/java/inlinedStaticReference/Project.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in maven-shared #2810 (See https://builds.apache.org/job/maven-shared/2810/ ) MSHARED-545 maven-dependency-analyzer fails on classes containing constant long or double Submitted-by: Jonathan Haber <jhaber@hubspot.com> This fixes #10 (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1755616 ) maven-dependency-analyzer/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ConstantPoolParser.java maven-dependency-analyzer/src/test/resources/java8methodRefs/src/main/java/inlinedStaticReference/Project.java

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              jhaber Jonathan Haber
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development