| Summary: | ITypeBinding.getDeclaringMethod() returns null for local named class nested in a generic class | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jacek Sieka <arnetheduck> |
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr |
| Version: | 3.8 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | stalebug | ||
Jacek, could you please check if you can reproduce it using the latest stable 3.8 from http://download.eclipse.org/eclipse/downloads/eclipse3x.html ? (In reply to comment #0) > In the following example, if I call ITypeBinding.getDeclaredMethod() on the > ITypeBinding from the "new" expression, getDeclaredMethod() is null. > > If I use the type binding from the class S TypeDeclaration, getDeclaredMethod > is not null. Declared method in both cases is the constructor S(). Did you mean the "declaring method"? > This can be seen using the ASTView plugin - point it to "class S" and the > resolved type binding is correct. Point it to "new S" and the type binding is > not. > > Also, if the "class S" type binding is used in the comparison tray, isEqualTo > shows false when comparing with the second type binding. Using 3.8RC4, The binding key for class S is KEY: "Lp/NamedLocal<TT;>$75$S;" while the one for the class instantiation is KEY: "Lp/NamedLocal$75;". This may be a bug > Declared method in both cases is the constructor S(). Did you mean the > "declaring method"? Sorry, yes of course! - I updated the title accordingly but cannot change the description - it should be getDeclaringMethod everywhere. > Using 3.8RC4, The binding key for class S is KEY: "Lp/NamedLocal<TT;>$75$S;" > while the one for the class instantiation is KEY: "Lp/NamedLocal$75;". This may > be a bug If this is the case, it breaks isEqualTo which is cruical for analyzing the code. If it's still needed, I might have time tomorrow to try 3.8.. (In reply to comment #3) > If it's still needed, I might have time tomorrow to try 3.8.. Thanks, I could reproduce with 3.8 and I'll take a look. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Build Identifier: Version: 3.7.2 Build id: M20120208-0800 In the following example, if I call ITypeBinding.getDeclaredMethod() on the ITypeBinding from the "new" expression, getDeclaredMethod() is null. If I use the type binding from the class S TypeDeclaration, getDeclaredMethod is not null. This can be seen using the ASTView plugin - point it to "class S" and the resolved type binding is correct. Point it to "new S" and the type binding is not. Also, if the "class S" type binding is used in the comparison tray, isEqualTo shows false when comparing with the second type binding. Example: public class NamedLocal<T> { public void m() { class S { } new S(); } } Reproducible: Always Steps to Reproduce: 1. Open the class in ASTView 2. Look att the ClassInstanceCreation node (new S) 3. Declaring method is null which it should not be. Also, the binding is not "isEqualTo" the binding of the TypeDeclarationStatement (class S)