/** * Gets the refactorings represented by the specified history. * * @param scope * the synchronization scope * @param history * the refactoring history * @param set * the set of refactoring descriptor proxies */ private static void getRefactorings(final ISynchronizationScope scope, final RefactoringHistory history, final Set set) { final ResourceMapping mapping= (ResourceMapping) history.getAdapter(ResourceMapping.class); if (mapping instanceof AbstractRefactoringHistoryResourceMapping) { final AbstractRefactoringHistoryResourceMapping extended= (AbstractRefactoringHistoryResourceMapping) mapping; final IResource resource= extended.getResource(); if (resource != null && scope.contains(resource)) set.addAll(Arrays.asList(history.getDescriptors())); } }
/** * Does the specified refactoring history contain any refactorings in the * scope? * * @param scope * the synchronization scope * @param history * the refactoring history * @return <code>true</code> if any refactorings are in the scope, * <code>false</code> otherwise */ private static boolean hasRefactorings(final ISynchronizationScope scope, final RefactoringHistory history) { final ResourceMapping mapping= (ResourceMapping) history.getAdapter(ResourceMapping.class); if (mapping instanceof AbstractRefactoringHistoryResourceMapping) { final AbstractRefactoringHistoryResourceMapping extended= (AbstractRefactoringHistoryResourceMapping) mapping; final IResource resource= extended.getResource(); if (resource != null) return scope.contains(resource); } return false; }