Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2090

Java Source And Class File Sequencers Should Create Nodes For Import Statements

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 3.7.0.Final
    • 3.6.0.Final
    • Sequencers
    • None

    Description

      Both Java sequencers can add nodes for import statements. For the source file sequencer, nodes can be created for each physical import statement contained in the source file. For the class file sequencer, nodes for import statements can be derived by looking at the constants pool of the javaassist.bytecode.ClassFile.

      It is worth noting that when an import statement with a wildcard is used, the import node(s) created by the two sequencers will be different. The source file sequencer will create one node for the wildcard import; while the class file sequencer will create a node for each referenced class within that imported package.

      I've implemented the changes to both sequencers here:

      https://github.com/elvisisking/modeshape/tree/java-imports

      A couple more things:

      • This new feature to the Java sequencers is needed by the dependency processing and de-sequencing features of Polyglotter, a data mapping project.
      • In the referenced code branch above, I've created a mixin for a java package. I apply this mixin to each unstructured node created for a java package. This is also something Polyglotter needs.

      Attachments

        Activity

          People

            dflorian@redhat.com Daniel Florian (Inactive)
            dflorian@redhat.com Daniel Florian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: