1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

@Override annotations.

This commit is contained in:
Sergey Prigogin 2011-12-24 15:07:10 -08:00
parent 08a0e81c57
commit 7559df0558
6 changed files with 15 additions and 8 deletions

View file

@ -54,10 +54,12 @@ public class ChangeExceptionHandler {
public NotCancelableProgressMonitor(IProgressMonitor monitor) {
super(monitor);
}
@Override
public void setCanceled(boolean b) {
// ignore set cancel
}
@Override
public boolean isCanceled() {
return false;
@ -142,6 +144,7 @@ public class ChangeExceptionHandler {
private void performUndo(final Change undo) {
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
monitor.beginTask("", 11); //$NON-NLS-1$
try {

View file

@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Institute for Software - initial API and implementation
* Institute for Software - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring;
@ -21,11 +21,11 @@ import org.eclipse.cdt.ui.refactoring.CTextFileChange;
/**
* @author Emanuel Graf
*
*/
public class ChangeTreeSet {
private static final class ChangePositionComparator implements Comparator<CTextFileChange> {
@Override
public int compare(CTextFileChange o1, CTextFileChange o2) {
if(o1.getFile().equals(o2.getFile())){
return o2.getEdit().getOffset() - o1.getEdit().getOffset();

View file

@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Institute for Software - initial API and implementation
* Institute for Software - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring;
@ -28,7 +28,6 @@ import org.eclipse.cdt.core.index.IIndexName;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
public class IndexToASTNameHelper {
public static List<IASTName> findNamesIn(IASTTranslationUnit tu, IBinding binding, IIndex index) {
BindingToAstNameMatcher visitor = new BindingToAstNameMatcher(binding, index);
tu.accept(visitor);
@ -69,7 +68,6 @@ public class IndexToASTNameHelper {
}
class IndexNameToAstNameMatcher extends ASTVisitor {
private IASTName result;
private IBinding bindingToFind;
private char[] charNameToFind;
@ -104,8 +102,10 @@ class IndexNameToAstNameMatcher extends ASTVisitor {
private boolean matchesIndexName(IASTName candidate) {
IASTFileLocation candidateLocation = candidate.getFileLocation();
return locationToFind.getNodeOffset() == candidateLocation.getNodeOffset() && locationToFind.getNodeLength() == candidateLocation.getNodeLength()
&& locationToFind.getFileName().equals(candidateLocation.getFileName()) && CharArrayUtils.equals(candidate.getLookupKey(), charNameToFind);
return locationToFind.getNodeOffset() == candidateLocation.getNodeOffset() &&
locationToFind.getNodeLength() == candidateLocation.getNodeLength() &&
locationToFind.getFileName().equals(candidateLocation.getFileName()) &&
CharArrayUtils.equals(candidate.getLookupKey(), charNameToFind);
}
public IASTName getMatch() {
@ -114,7 +114,6 @@ class IndexNameToAstNameMatcher extends ASTVisitor {
}
class BindingToAstNameMatcher extends ASTVisitor {
private List<IASTName> results = new ArrayList<IASTName>();
private IBinding bindingToFind;
private char[] toFindName;

View file

@ -125,6 +125,7 @@ public class RefactoringASTCache implements IDisposable {
/**
* @see IDisposable#dispose()
*/
@Override
public void dispose() {
Assert.isTrue(!fDisposed, "RefactoringASTCache.dispose() called more than once"); //$NON-NLS-1$
fDisposed = true;

View file

@ -69,6 +69,7 @@ public class RefactoringExecutionHelper {
this.fCancelable = cancelable;
}
@Override
public void run(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); //$NON-NLS-1$
@ -80,6 +81,7 @@ public class RefactoringExecutionHelper {
final boolean[] canceled= { false };
if (fForked) {
fParent.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
canceled[0]= showStatusDialog(status);
}
@ -185,6 +187,7 @@ public class RefactoringExecutionHelper {
try {
try {
Runnable r= new Runnable() {
@Override
public void run() {
manager.beginRule(rule, null);
}

View file

@ -130,6 +130,7 @@ public class RefactoringSaveHelper {
return false;
} else {
IRunnableWithProgress runnable= new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor pm) throws InterruptedException {
int count= dirtyEditors.length;
pm.beginTask("", count); //$NON-NLS-1$