Community
Participate
Working Groups
Build 20020617 1. Open type java.applet.Applet$AccessibleApplet.class 2. In Outline, select AccessibleApplet 3. Search for Type Declarations in Workspace Observe: None is found
Problem with SearchPattern that doesn't build the right pattern: the enclosing type is set to be empty for binary types. It should be the declaring types. Propose fix: /** * Returns the enclosing type names of the given type. */ private static char[][] enclosingTypeNames(IType type) { IJavaElement parent = type.getParent(); switch (parent.getElementType()) { case IJavaElement.CLASS_FILE: // For a binary type, the parent is not the enclosing type, but the declaring type is. // (see bug 20532 Declaration of member binary type not found) IType declaringType = type.getDeclaringType(); if (declaringType == null) { return NO_CHAR_CHAR; } else { return CharOperation.arrayConcat( enclosingTypeNames(declaringType), declaringType.getElementName ().toCharArray()); } case IJavaElement.COMPILATION_UNIT: return NO_CHAR_CHAR; case IJavaElement.TYPE: return CharOperation.arrayConcat( enclosingTypeNames((IType)parent), parent.getElementName().toCharArray()); default: return null; } }
Fix is good, indeed binary elements are not structured in the same way as source one. Source types are children of compilation unit, even nested types. But binary types are individually rooted in their corresponding classfile, requiring the pattern creation code to deal with them distinctly. Fix is simple, just looking at different information (declaring type instead of direct parent, which only works for source types). Should fix for F4
Indeed fix is simple and affects binary types only. It should be fixed for F4.
The problem does not exists in 1.0.
I cannot reproduce the problem in 20020618 (i.e. without the patch). Not sure what happened when I tested. Moreover the method BinaryType.getType(String) takes care of this case so this patch is not needed. The patch has also the side effect of reporting the declaration in the top level class file, where it should be in the member type class file. So we should not include this patch for F4.
Sorry, annotated wrong PR. Please ignore previous note.
Verified.
Fix got approved, released in 20020620.