return status; final IType extractedType= computeExtractedType(fTypeName); setDestinationType(extractedType); final List subTypes= new ArrayList(Arrays.asList(fTypesToExtract)); if (!subTypes.contains(declaring))
/** * Computes the destination type based on the new name. * * @param name the new name * @return the destination type */ public IType computeExtractedType(final String name) { if (name != null && !name.equals("")) {//$NON-NLS-1$ final IType declaring= getDeclaringType(); try { final ICompilationUnit[] units= declaring.getPackageFragment().getCompilationUnits(fOwner); final String newName= JavaModelUtil.getRenamedCUName(declaring.getCompilationUnit(), name); ICompilationUnit result= null; for (int index= 0; index < units.length; index++) { if (units[index].getElementName().equals(newName)) result= units[index]; } if (result != null) { final IType type= result.getType(name); setDestinationType(type); return type; } } catch (JavaModelException exception) { JavaPlugin.log(exception); } } return null; }
/** * Computes the destination type based on the new name. * * @param name the new name * @return the destination type */ public IType computeExtractedType(final String name) { if (name != null && !name.equals("")) {//$NON-NLS-1$ final IType declaring= getDeclaringType(); try { final ICompilationUnit[] units= declaring.getPackageFragment().getCompilationUnits(fOwner); final String newName= JavaModelUtil.getRenamedCUName(declaring.getCompilationUnit(), name); ICompilationUnit result= null; for (int index= 0; index < units.length; index++) { if (units[index].getElementName().equals(newName)) result= units[index]; } if (result != null) { final IType type= result.getType(name); setDestinationType(type); return type; } } catch (JavaModelException exception) { JavaPlugin.log(exception); } } return null; }
return status; final IType extractedType= computeExtractedType(fTypeName); setDestinationType(extractedType); final List<IType> subTypes= new ArrayList<>(Arrays.asList(fTypesToExtract)); if (!subTypes.contains(declaring))
/** * Computes the destination type based on the new name. * * @param name the new name * @return the destination type */ public IType computeExtractedType(final String name) { if (name != null && !name.equals("")) {//$NON-NLS-1$ final IType declaring= getDeclaringType(); try { final ICompilationUnit[] units= declaring.getPackageFragment().getCompilationUnits(fOwner); final String newName= JavaModelUtil.getRenamedCUName(declaring.getCompilationUnit(), name); ICompilationUnit result= null; for (int index= 0; index < units.length; index++) { if (units[index].getElementName().equals(newName)) result= units[index]; } if (result != null) { final IType type= result.getType(name); setDestinationType(type); return type; } } catch (JavaModelException exception) { JavaPlugin.log(exception); } } return null; }
return status; final IType extractedType= computeExtractedType(fTypeName); setDestinationType(extractedType); final List<IType> subTypes= new ArrayList<>(Arrays.asList(fTypesToExtract)); if (!subTypes.contains(declaring))