Community
Participate
Working Groups
In HEAD, the line: for (int i = 0; i < length; i++) { String typeArgument = typeArguments[i]; typeArgument.replace('/', '.'); <== HAS NO EFFECT buffer.append(Signature.toString(typeArgument)); if (i < length-1) buffer.append(','); } This is probably a bug and should be replaced by: typeArgument = typeArgument.replace('/', '.'); This also needs regression tests.
Found by findbugs http://findbugs.blogspot.com/2006/09/how-do-you-fix-obvious-bug.html
The type argument doesn't contain '/' anymore. The call: String[] typeArguments = new BindingKey(uniqueKey).getTypeArguments(); returns a string[] where '/' have been replaced with '.'. So no need to do it again. Jérôme, Could you please double-check that I didn't miss anything? org.eclipse.jdt.core.tests.model.ResolveTests_1_5#test0083 seems to be a regression test for this case. Thanks.
Created attachment 52610 [details] Proposed fix
Released for 3.3M3. All tests passed including existing ResolveTests_1_5#test0083. Jérôme, just confirm that '/' cannot be inside typeArguments. The call typeArgument.replace('/', '.') is a noop.
The spec of BindingKey#getTypeArguments() doesn't specify whether the signature is dot separated or slash separated. However the current implemation of BindingKey#getTypeArguments() always returns a dot separated signature. Since we control both implementations and since we have a regression test, the change is ok.
Verified code using History...