1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

Bug 337487 - Bad exception handling in Codan

This commit is contained in:
Alena Laskavaia 2011-02-24 02:23:23 +00:00
parent 59efc020b2
commit 1d85f97705
8 changed files with 26 additions and 25 deletions

View file

@ -35,7 +35,6 @@ public abstract class AbstractAstRewriteQuickFix extends AbstractCodanCMarkerRes
try {
index = getIndexFromMarker(marker);
} catch (CoreException e) {
e.printStackTrace();
CheckersUiActivator.log(e);
return;
}
@ -51,7 +50,7 @@ public abstract class AbstractAstRewriteQuickFix extends AbstractCodanCMarkerRes
index.releaseReadLock();
}
} catch (Exception e) {
e.printStackTrace();
CheckersUiActivator.log(e);
}
}

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@ -60,7 +61,7 @@ public class QuickFixCreateField extends AbstractAstRewriteQuickFix {
Change c = r.rewriteAST();
c.perform(new NullProgressMonitor());
} catch (CoreException e) {
e.printStackTrace();
CheckersUiActivator.log(e);
}
}

View file

@ -12,6 +12,7 @@ package org.eclipse.cdt.codan.internal.checkers;
import java.util.regex.Pattern;
import org.eclipse.cdt.codan.checkers.CodanCheckersActivator;
import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.codan.core.model.ICheckerWithPreferences;
import org.eclipse.cdt.codan.core.model.IProblem;
@ -73,7 +74,7 @@ public class NamingConventionFunctionChecker extends AbstractIndexAstChecker imp
}
});
} catch (Exception e) {
e.printStackTrace();
CodanCheckersActivator.log(e);
}
}

View file

@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers;
import org.eclipse.cdt.codan.checkers.CodanCheckersActivator;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@ -143,13 +144,13 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
}
}
} catch (DOMException e) {
e.printStackTrace();
CodanCheckersActivator.log(e);
}
return PROCESS_CONTINUE;
}
});
} catch (Exception e) {
e.printStackTrace();
CodanCheckersActivator.log(e);
}
}

View file

@ -95,7 +95,6 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry {
try {
((ICheckerWithPreferences) c).initPreferences((IProblemWorkingCopy) p);
} catch (Throwable t) {
t.printStackTrace();
CodanCorePlugin.log(t);
}
}

View file

@ -93,7 +93,7 @@ public class CodanMarkerProblemReporter extends AbstractProblemReporter implemen
try {
file.deleteMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, true, IResource.DEPTH_ZERO);
} catch (CoreException ce) {
ce.printStackTrace();
CodanCorePlugin.log(ce);
}
}

View file

@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
import org.eclipse.cdt.codan.internal.ui.CodanUIMessages;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
@ -338,9 +339,9 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
// and show it
showPreferencePage(pageId, page);
} catch (InstantiationException e) {
e.printStackTrace();
CodanUIActivator.log(e);
} catch (IllegalAccessException e) {
e.printStackTrace();
CodanUIActivator.log(e);
}
}

View file

@ -126,7 +126,6 @@ public abstract class AbstractCodanCMarkerResolution implements IMarkerResolutio
try {
editorPart = CodanEditorUtility.openInEditor(marker);
} catch (PartInitException e) {
e.printStackTrace();
CodanUIActivator.log(e);
return null;
}