-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix silent NumberFormatException in SourceMapper #1834 #3543
Conversation
b03adc9
to
186b9b0
Compare
List of tests where the change is executed:
|
186b9b0
to
15e228a
Compare
Number-parsing part of the name of a classfile looks wrong, indeed, but let's dig a bit deeper:
So I suggest not to fix unnecessary code, but let's give @jarthana also a chance to chime in, if he has an idea what this code might be needed for. |
One more observation: with or without the block in question, Consider this block in this.anonymousCounter++;
if (this.anonymousCounter == this.anonymousClassName) {
this.types[this.typeDepth] = getType(this.binaryTypeOrModule.getElementName());
} else {
this.types[this.typeDepth] = getType(DeduplicationUtil.toString(typeInfo.name));
} if
|
AttachSourceTests.testInnerClass3 did evaluate the number to "2" |
15e228a
to
6998fbf
Compare
@stephan-herrmann what do we need to continue? |
eclipse-jdt#1834 tested by dom.ASTModelBridgeTests.testBinaryMemberTypeFromAnonymousClassFile1 dom.ASTModelBridgeTests.testBinaryMemberTypeFromAnonymousClassFile2 model.AttachSourceTests.testInnerClass2 model.AttachSourceTests.testInnerClass3 model.AttachSourceTests.testInnerClass4 model.AttachSourceTests.testInnerClass7 model.JavaSearchTests.testLocalVariableReference3 model.ResolveTests.testLocalNameForClassFile model.ResolveTests.testMethodDeclarationInAnonymous4 model.TypeResolveTests.testResolveTypeInBinary3
6998fbf
to
ab65fa9
Compare
Do we have any motivation to keep that code section? See my hint:
Debugging AttachSourceTests.testInnerClass3 I see the field used only to distinguish between using "" or "" as the classname :) -- The name of the classfile will always be determined inside |
RunModelTests confirms my theory. |
I created a new PR for that: #3583 |
#1834