### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.ui Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RippleMethodFinder2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RippleMethodFinder2.java,v retrieving revision 1.18 diff -u -r1.18 RippleMethodFinder2.java --- core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RippleMethodFinder2.java 5 Nov 2008 18:44:38 -0000 1.18 +++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RippleMethodFinder2.java 31 Oct 2009 22:22:06 -0000 @@ -239,8 +239,11 @@ IMethod alienDeclaration= (IMethod) iter.next(); IType alienType= alienDeclaration.getDeclaringType(); alienTypes.add(alienType); - if (alienType.isInterface()) - hasAlienInterfaces= true; + try { + if (alienType.isInterface()) + hasAlienInterfaces= true; + } catch (Exception ignore) { + } } if (alienTypes.size() == 0) //no nasty marriage scenarios without types to marry with... return (IMethod[]) relatedMethods.toArray(new IMethod[relatedMethods.size()]); @@ -272,9 +275,12 @@ IType alienType= (IType) iter.next(); IMethod alienMethod= (IMethod) fTypeToMethod.get(alienType); ITypeHierarchy hierarchy= getCachedHierarchy(alienType, owner, new SubProgressMonitor(pm, 1)); - if (hierarchy == null) - hierarchy= alienType.newTypeHierarchy(owner, new SubProgressMonitor(pm, 1)); - IType[] allSubtypes= hierarchy.getAllSubtypes(alienType); + try { + if (hierarchy == null) + hierarchy= alienType.newTypeHierarchy(owner, new SubProgressMonitor(pm, 1)); + } catch (Exception ignore) { + } + IType[] allSubtypes= hierarchy == null ? new IType[0] : hierarchy.getAllSubtypes(alienType); for (int i= 0; i < allSubtypes.length; i++) { IType subtype= allSubtypes[i]; if (relatedSubTypes.contains(subtype)) { @@ -318,10 +324,13 @@ IType root= (IType) iter.next(); ITypeHierarchy hierarchy= (ITypeHierarchy) fRootHierarchies.get(root); if (hierarchy == null) { - hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1)); - fRootHierarchies.put(root, hierarchy); + try { + hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1)); + fRootHierarchies.put(root, hierarchy); + } catch (Exception ignore) { + } } - if (hierarchy.contains(type)) + if (hierarchy != null && hierarchy.contains(type)) return hierarchy; } } @@ -404,7 +413,12 @@ } else { //check whether method in supertype is really overridden: IMember superMethod= (IMember) fTypeToMethod.get(supertype); - if (JavaModelUtil.isVisibleInHierarchy(superMethod, anchor.getPackageFragment())) { + boolean isVisibleInHierarchy = false; + try { + isVisibleInHierarchy = JavaModelUtil.isVisibleInHierarchy(superMethod, anchor.getPackageFragment()); + } catch (Exception ignore) { + } + if (isVisibleInHierarchy) { IType rep= fUnionFind.find(anchor); fUnionFind.union(rep, superRep); // current type is no root anymore