Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2012-12-12 06:12:14 -0500
committerSopot Cela2012-12-12 06:12:14 -0500
commite7cb002985859e26550d043db1e540d32b3a27fa (patch)
tree98368f87699ac185aa3519835e8a98c250d71d96
parentccc4aa3ef044b1ad210276b019411786bb7c9ff7 (diff)
downloadorg.eclipse.e4.tools-e7cb002985859e26550d043db1e540d32b3a27fa.tar.gz
org.eclipse.e4.tools-e7cb002985859e26550d043db1e540d32b3a27fa.tar.xz
org.eclipse.e4.tools-e7cb002985859e26550d043db1e540d32b3a27fa.zip
Bug 396388 - Increase rules compliance on e4 code
-rw-r--r--bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/syntaxcoloring/CSSSemanticHighlightCalculator.java4
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java8
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/TargetElementProviders.java5
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/emf/EditUIUtil.java8
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java4
5 files changed, 8 insertions, 21 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/syntaxcoloring/CSSSemanticHighlightCalculator.java b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/syntaxcoloring/CSSSemanticHighlightCalculator.java
index 07c6c438..369e43b4 100644
--- a/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/syntaxcoloring/CSSSemanticHighlightCalculator.java
+++ b/bundles/org.eclipse.e4.tools.css.editor.ui/src/org/eclipse/e4/ui/syntaxcoloring/CSSSemanticHighlightCalculator.java
@@ -36,10 +36,6 @@ public class CSSSemanticHighlightCalculator implements
} else if (((RuleCallImpl) eoj).getRule().getName().equals("css_hash_class")) {
// node.getGrammarElement()
acceptor.addPosition(node.getOffset(), node.getLength(), CSSHighlightingConfiguration.CSS_ClassID);
- } else if (((RuleCallImpl) eoj).getRule().getName().equals("ident")) {
-// node.getGrammarElement()
-// acceptor.addPosition(node.getOffset(), node.getLength(), CSSHighlightingConfiguration.CSS_Declaration);
- }
}
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
index f986d15f..f22e3808 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
@@ -281,7 +281,7 @@ public class CssSpyDialog extends Dialog {
if (decl != null) {
sb.append(decl.getCssText());
}
- } catch (Throwable e) {
+ } catch (Exception e) {
sb.append(e);
}
}
@@ -358,10 +358,6 @@ public class CssSpyDialog extends Dialog {
}
// emulate a transparent background as per SWT Snippet180
Shell selectedShell = getShell(selected);
- if (selectedShell != null) {
- // bounds = slectedShell.getDisplay().map(null, selectedShell,
- // bounds);
- }
// create the highlight; want it to appear on top
Shell highlight = new Shell(selectedShell, SWT.NO_TRIM | SWT.MODELESS
| SWT.NO_FOCUS | SWT.ON_TOP);
@@ -621,7 +617,7 @@ public class CssSpyDialog extends Dialog {
}
CSSPropertyProvider provider = (CSSPropertyProvider) element;
provider.setValue((String) value);
- } catch (Throwable e) {
+ } catch (Exception e) {
MessageDialog.openError(getShell(), "Error",
"Unable to set property:\n\n"
+ e.getMessage());
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/TargetElementProviders.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/TargetElementProviders.java
index 66645ee7..39356e09 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/TargetElementProviders.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/TargetElementProviders.java
@@ -104,10 +104,7 @@ public class TargetElementProviders implements IModelElementProvider {
true);
while (it.hasNext()) {
EObject o = it.next();
- if (o.eContainingFeature() == FragmentPackageImpl.Literals.MODEL_FRAGMENTS__IMPORTS) {
-// System.err
-// .println("Skipped because it is an import");
- } else {
+ if (o.eContainingFeature() != FragmentPackageImpl.Literals.MODEL_FRAGMENTS__IMPORTS) {
if (o.eClass().equals(filter.eClass)) {
// System.err.println("Found: " + o);
handler.result(o);
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/emf/EditUIUtil.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/emf/EditUIUtil.java
index 39074b03..4052b79b 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/emf/EditUIUtil.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/emf/EditUIUtil.java
@@ -15,7 +15,7 @@ public class EditUIUtil {
Class<?> fileClass = null;
try {
fileClass = IFile.class;
- } catch (Throwable exception) {
+ } catch (Exception exception) {
// Ignore any exceptions and assume the class isn't available.
}
FILE_CLASS = fileClass;
@@ -34,7 +34,7 @@ public class EditUIUtil {
.loadClass("org.eclipse.team.core.history.IFileRevision");
fileRevisionGetURIMethod = fileRevisionClass
.getMethod("getURI");
- } catch (Throwable exeption) {
+ } catch (Exception exeption) {
// Ignore any exceptions and assume the class isn't available.
}
}
@@ -47,7 +47,7 @@ public class EditUIUtil {
Class<?> uriEditorInputClass = null;
try {
uriEditorInputClass = IURIEditorInput.class;
- } catch (Throwable exception) {
+ } catch (Exception exception) {
// The class is not available.
}
URI_EDITOR_INPUT_CLASS = uriEditorInputClass;
@@ -69,7 +69,7 @@ public class EditUIUtil {
return URI
.createURI(((java.net.URI) FILE_REVISION_GET_URI_METHOD
.invoke(fileRevision)).toString());
- } catch (Throwable exception) {
+ } catch (Exception exception) {
// TODO Log error
}
}
diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java
index 5a3ec0ab..b11d553c 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java
@@ -137,9 +137,7 @@ public final class BufferedDocumentScanner implements ICharacterScanner {
public final void unread() {
if (fOffset == 0) {
- if (fBufferOffset == fRangeOffset) {
- // error: BOF
- } else {
+ if (fBufferOffset != fRangeOffset) {
updateBuffer(fBufferOffset - fBuffer.length);
fOffset= fBuffer.length - 1;
}

Back to the top