JDK-6500594 : DeclaredType.getActualTypeArguments() returns different values based on the javac debug option
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 2.0
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-12-05
  • Updated: 2010-08-19
  • Resolved: 2006-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
Sample testcase attached.
Because of this behavior, WsGen is generating incorrect classes when the WebServices it compiles uses java.xml.ws.Holder<T> as WebParam, and many TCK tests are failing.

In the testcase, for
public void testHolder(Holder<String> param) {    }

public void visitMethodDeclaration(MethodDeclaration method) {
                System.out.println(method.getSimpleName());
                for (ParameterDeclaration param : method.getParameters()) {
                    TypeMirror type = param.getType();
                    System.out.println(type);
                    if (type instanceof DeclaredType) {
                        Collection<TypeMirror> argTypes = ((DeclaredType) type).getActualTypeArguments();
                        System.out.println(argTypes.size());
                        if (argTypes.size() == 1) {
                            TypeMirror mirror = argTypes.iterator().next();
                            System.out.println("argsTypes.iterator().next(): " + mirror);
                        }
                    }
                }
            }

argTypes.size is 0 when the sources are compiled with debug option. We expect the argTypes.iterator.next() to be String.

Output Without debug option:
test.Bar
testHolder
ann.Holder<java.lang.String>
1
argsTypes.iterator().next(): java.lang.String

Output With debug option:
test.Bar
testHolder
ann.Holder
0