Community
Participate
Working Groups
While working on bug 330256 I noticed some weird package names when scanning for dependencies in binary class files. I traced it down to org.eclipse.pde.internal.ui.search.dependencies.PackageFinder.findPackagesInClassFiles(IClassFile[], IProgressMonitor). Here is the call stack: PackageFinder.getPackage(String) line: 185 PackageFinder.computeReferencedTypes(IClassFileReader, Set) line: 82 PackageFinder.findPackagesInClassFiles(IClassFile[], IProgressMonitor) line: 34 OrganizeManifestsProcessor$2(AddNewBinaryDependenciesOperation).findSecondaryDependencies(String[], Set, Map, Set, IBundle, boolean, IProgressMonitor) line: 40 OrganizeManifestsProcessor$2(AddNewDependenciesOperation).execute(IProgressMonitor) line: 84 ... The root cause seems to be in #extractFullyQualifiedType(). example input: extractFullyQualifiedType("Lcom/abc/MyClass$1;") resulting output: "new com.abc$MyClass(){}"
Created attachment 183158 [details] patch for PackageFinder Anonymous as well as inner classes aren't relevant for the package scanning. I therefor changed the implementation to remove everything after the '$' and renamed the methods to better indicate the intent.
Created attachment 183159 [details] patch for PackageFinder updated patch
At first I was concerned with changing the result of the method. However, in all cases we only care about the package. There might be some optimizing that could be done here, but the patch corrects the problem as described. Fixed in HEAD.
Verified in I20110802-2000