Community
Participate
Working Groups
In public static char[] createCharArrayTypeSignature(char[] typeName, boolean isResolved), when a complex type has a package name starting with letters resembling any primitive types, eg. "interation.test.MyData" or "longtest.MyData", it resolves to the primitive type, but not the correct complex type. The reason is that in createCharArrayTypeSignature, it has a big switch statement, and the comparison method CharOperation.fragmentEquals does a check simiar to "start with". switch (typeName[0]) { // primitive type? case 'b' : if (CharOperation.fragmentEquals(BOOLEAN, typeName, 0, true)) { sig = new char[arrayCount+1]; sig[arrayCount] = C_BOOLEAN; break; } else if (CharOperation.fragmentEquals(BYTE, typeName, 0, true)) { sig = new char[arrayCount+1]; sig[arrayCount] = C_BYTE; break; } ... case 'i': if (CharOperation.fragmentEquals(INT, typeName, 0, true)) { sig = new char[arrayCount+1]; sig[arrayCount] = C_INT; break; } This is the call stack: org.eclipse.jdt.core.Signature.createCharArrayTypeSignature(char[], boolean) line: 435 org.eclipse.jdt.core.Signature.createTypeSignature(char[], boolean) line: 414 org.eclipse.jdt.internal.core.SourceMethod.getReturnType() line: 127 com.ibm.etools.java.adapters.jdom.JavaMethodJDOMAdaptor.setReturnType() line: 258 com.ibm.etools.java.adapters.jdom.JavaMethodJDOMAdaptor.reflectValues() line: 183 com.ibm.etools.java.adapters.jdom.JavaMethodJDOMAdaptor (com.ibm.etools.java.adapters.ReflectionAdaptor).reflectValuesIfNecessary() line: 121 com.ibm.etools.java.adapters.jdom.JavaMethodJDOMAdaptor (com.ibm.etools.java.adapters.JavaReflectionAdaptor).reflectValuesIfNecessary() line: 251
Reproduced. I am investigating.
Fixed and released in HEAD. Regression tests added.
Verified
would it be possible to get this fix backported to the 2.1.2 stream