Summary: | [inline] method can't find the corresponding method declaration | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Benno Baumgartner <benno.baumgartner> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | markus.kell.r |
Version: | 3.2 | ||
Target Milestone: | 3.3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Benno Baumgartner
2006-03-28 11:16:03 EST
The problem is in CompilationUnit#findDeclaringNode(String key). In InlineMethodRefactoring.java:429, I call that method with key "Lxy/Try;&Ljava/lang/Class<!Ljava/lang/Class;+Ljava/lang/Object;96;>;.isEnum()Z", which comes from the invocation's binding for isEnum(). When I use #findDeclaringNode(methodBinding.getMethodDeclaration().getKey()), then it works. The javadoc tells "<li>method - a <code>MethodDeclaration</code> </li>" and "for parameterized or raw method bindings, the declaring node is that of the corresponding generic method." Although the isEnum() is neither a parameterized nor a generic method, I would expect that #findDeclaringNode(..) does the getMethodDeclaration() for me. The speciality of Object#getClass() does not seem to be the issue, since foo(ArrayList<String> as) { boolean b = as.isEmpty(); } also does not work. Not clear if we want to change this since no AST node exists for capture binding. A workaround exists as described in comment 1 (use getMethodDeclaration()). Will reconsider post 3.2. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |