After looking further into javap source code, I discovered why the following difference in the output happens:

-         1: getfield      #2                  // Field buildables:Lhudson/model/Queue$ItemList;
+         1: getfield      #2                  // Field hudson/model/Queue.buildables:Lhudson/model/Queue$ItemList;

When printing the content of constant pool for these instructions, javap attempts to simplify the reference within the same class by omitting the class name as follows:

        int tag = cpInfo.getTag();
        switch (tag) {
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_Fieldref:
                // simplify references within this class
                CPRefInfo ref = (CPRefInfo) cpInfo;
                try {
                    if (ref.class_index == classFile.this_class)
                         cpInfo = classFile.constant_pool.get(ref.name_and_type_index);
                } catch (ConstantPool.InvalidIndex e) {
                    // ignore, for now
                }
        }
        print(tagName(tag) + " " + stringValue(cpInfo));

This check compares the constant pool index, not the actual content. The fieldref constant pool remains unchanged at #283.#624 before/after transformation, but classFile.this_class that references the class name itself changes from #283 to #400.

The constant pool entry #400 is "Class #891", just like #283. IOW, javac produces Queue.class that contains two identical constant pool entries, which is suprising.

It is still unclear as to whether this difference in the class file triggers the "incompatible InnerClasses attribute" problem.

I think the next step is to modify class file to insert InnerClass attribute for Queue$ItemList, as the lack of this entry does seem to violate JVM spec. If that is the case, the question remains as to why J9VM was happy with the class before transformation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to