mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
@Override annotations.
This commit is contained in:
parent
08a0e81c57
commit
7559df0558
6 changed files with 15 additions and 8 deletions
|
@ -54,10 +54,12 @@ public class ChangeExceptionHandler {
|
||||||
public NotCancelableProgressMonitor(IProgressMonitor monitor) {
|
public NotCancelableProgressMonitor(IProgressMonitor monitor) {
|
||||||
super(monitor);
|
super(monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCanceled(boolean b) {
|
public void setCanceled(boolean b) {
|
||||||
// ignore set cancel
|
// ignore set cancel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCanceled() {
|
public boolean isCanceled() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -142,6 +144,7 @@ public class ChangeExceptionHandler {
|
||||||
|
|
||||||
private void performUndo(final Change undo) {
|
private void performUndo(final Change undo) {
|
||||||
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
|
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
monitor.beginTask("", 11); //$NON-NLS-1$
|
monitor.beginTask("", 11); //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.refactoring;
|
package org.eclipse.cdt.internal.ui.refactoring;
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ import org.eclipse.cdt.ui.refactoring.CTextFileChange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf
|
* @author Emanuel Graf
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ChangeTreeSet {
|
public class ChangeTreeSet {
|
||||||
|
|
||||||
private static final class ChangePositionComparator implements Comparator<CTextFileChange> {
|
private static final class ChangePositionComparator implements Comparator<CTextFileChange> {
|
||||||
|
@Override
|
||||||
public int compare(CTextFileChange o1, CTextFileChange o2) {
|
public int compare(CTextFileChange o1, CTextFileChange o2) {
|
||||||
if(o1.getFile().equals(o2.getFile())){
|
if(o1.getFile().equals(o2.getFile())){
|
||||||
return o2.getEdit().getOffset() - o1.getEdit().getOffset();
|
return o2.getEdit().getOffset() - o1.getEdit().getOffset();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.refactoring;
|
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;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
|
|
||||||
public class IndexToASTNameHelper {
|
public class IndexToASTNameHelper {
|
||||||
|
|
||||||
public static List<IASTName> findNamesIn(IASTTranslationUnit tu, IBinding binding, IIndex index) {
|
public static List<IASTName> findNamesIn(IASTTranslationUnit tu, IBinding binding, IIndex index) {
|
||||||
BindingToAstNameMatcher visitor = new BindingToAstNameMatcher(binding, index);
|
BindingToAstNameMatcher visitor = new BindingToAstNameMatcher(binding, index);
|
||||||
tu.accept(visitor);
|
tu.accept(visitor);
|
||||||
|
@ -69,7 +68,6 @@ public class IndexToASTNameHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
class IndexNameToAstNameMatcher extends ASTVisitor {
|
class IndexNameToAstNameMatcher extends ASTVisitor {
|
||||||
|
|
||||||
private IASTName result;
|
private IASTName result;
|
||||||
private IBinding bindingToFind;
|
private IBinding bindingToFind;
|
||||||
private char[] charNameToFind;
|
private char[] charNameToFind;
|
||||||
|
@ -104,8 +102,10 @@ class IndexNameToAstNameMatcher extends ASTVisitor {
|
||||||
|
|
||||||
private boolean matchesIndexName(IASTName candidate) {
|
private boolean matchesIndexName(IASTName candidate) {
|
||||||
IASTFileLocation candidateLocation = candidate.getFileLocation();
|
IASTFileLocation candidateLocation = candidate.getFileLocation();
|
||||||
return locationToFind.getNodeOffset() == candidateLocation.getNodeOffset() && locationToFind.getNodeLength() == candidateLocation.getNodeLength()
|
return locationToFind.getNodeOffset() == candidateLocation.getNodeOffset() &&
|
||||||
&& locationToFind.getFileName().equals(candidateLocation.getFileName()) && CharArrayUtils.equals(candidate.getLookupKey(), charNameToFind);
|
locationToFind.getNodeLength() == candidateLocation.getNodeLength() &&
|
||||||
|
locationToFind.getFileName().equals(candidateLocation.getFileName()) &&
|
||||||
|
CharArrayUtils.equals(candidate.getLookupKey(), charNameToFind);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTName getMatch() {
|
public IASTName getMatch() {
|
||||||
|
@ -114,7 +114,6 @@ class IndexNameToAstNameMatcher extends ASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BindingToAstNameMatcher extends ASTVisitor {
|
class BindingToAstNameMatcher extends ASTVisitor {
|
||||||
|
|
||||||
private List<IASTName> results = new ArrayList<IASTName>();
|
private List<IASTName> results = new ArrayList<IASTName>();
|
||||||
private IBinding bindingToFind;
|
private IBinding bindingToFind;
|
||||||
private char[] toFindName;
|
private char[] toFindName;
|
||||||
|
|
|
@ -125,6 +125,7 @@ public class RefactoringASTCache implements IDisposable {
|
||||||
/**
|
/**
|
||||||
* @see IDisposable#dispose()
|
* @see IDisposable#dispose()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
Assert.isTrue(!fDisposed, "RefactoringASTCache.dispose() called more than once"); //$NON-NLS-1$
|
Assert.isTrue(!fDisposed, "RefactoringASTCache.dispose() called more than once"); //$NON-NLS-1$
|
||||||
fDisposed = true;
|
fDisposed = true;
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class RefactoringExecutionHelper {
|
||||||
this.fCancelable = cancelable;
|
this.fCancelable = cancelable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor pm) throws CoreException {
|
public void run(IProgressMonitor pm) throws CoreException {
|
||||||
try {
|
try {
|
||||||
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); //$NON-NLS-1$
|
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); //$NON-NLS-1$
|
||||||
|
@ -80,6 +81,7 @@ public class RefactoringExecutionHelper {
|
||||||
final boolean[] canceled= { false };
|
final boolean[] canceled= { false };
|
||||||
if (fForked) {
|
if (fForked) {
|
||||||
fParent.getDisplay().syncExec(new Runnable() {
|
fParent.getDisplay().syncExec(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
canceled[0]= showStatusDialog(status);
|
canceled[0]= showStatusDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -185,6 +187,7 @@ public class RefactoringExecutionHelper {
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
Runnable r= new Runnable() {
|
Runnable r= new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
manager.beginRule(rule, null);
|
manager.beginRule(rule, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,7 @@ public class RefactoringSaveHelper {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
IRunnableWithProgress runnable= new IRunnableWithProgress() {
|
IRunnableWithProgress runnable= new IRunnableWithProgress() {
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor pm) throws InterruptedException {
|
public void run(IProgressMonitor pm) throws InterruptedException {
|
||||||
int count= dirtyEditors.length;
|
int count= dirtyEditors.length;
|
||||||
pm.beginTask("", count); //$NON-NLS-1$
|
pm.beginTask("", count); //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue