aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-04-15 09:07:57 (EDT)
committersefftinge2009-04-15 09:07:57 (EDT)
commit66ceb89ffa3d963ee40e840c3c80e3558cc75c86 (patch)
tree7794fdecd307c13590bd6e86b95523c0c6fd8173
parent9885fab4777b4aa82e9693846fc48a54d1c45ba5 (diff)
downloadorg.eclipse.xtext-66ceb89ffa3d963ee40e840c3c80e3558cc75c86.zip
org.eclipse.xtext-66ceb89ffa3d963ee40e840c3c80e3558cc75c86.tar.gz
org.eclipse.xtext-66ceb89ffa3d963ee40e840c3c80e3558cc75c86.tar.bz2
Code cleanup to remove warnings
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/hyperlinking/DefaultHyperlinkDetector.java1
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractDeclarativeSemanticModelTransformer.java5
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractSemanticModelTransformer.java17
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/UIPluginModule.java5
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextResourceChecker.java7
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/internal/Activator.java2
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/wizard/XtextNewProjectWizard.java1
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java1
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/tests/Activator.java2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/validation/CheckValidatorTest.java1
10 files changed, 19 insertions, 23 deletions
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/hyperlinking/DefaultHyperlinkDetector.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/hyperlinking/DefaultHyperlinkDetector.java
index acb94b8..ec7a3b9 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/hyperlinking/DefaultHyperlinkDetector.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/hyperlinking/DefaultHyperlinkDetector.java
@@ -17,7 +17,6 @@ import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.xtext.CrossReference;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.ui.core.editor.XtextEditor;
import org.eclipse.xtext.ui.core.editor.model.IXtextDocument;
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractDeclarativeSemanticModelTransformer.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractDeclarativeSemanticModelTransformer.java
index b38831d..0abea0b 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractDeclarativeSemanticModelTransformer.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractDeclarativeSemanticModelTransformer.java
@@ -28,14 +28,14 @@ import com.google.inject.Inject;
*/
public class AbstractDeclarativeSemanticModelTransformer extends DefaultSemanticModelTransformer {
- private PolymorphicDispatcher<ContentOutlineNode> createNode = new PolymorphicDispatcher<ContentOutlineNode>(Lists
+ private final PolymorphicDispatcher<ContentOutlineNode> createNode = new PolymorphicDispatcher<ContentOutlineNode>(Lists
.newArrayList(this), new Predicate<Method>() {
public boolean apply(Method param) {
return ((param.getName().equals("createNode")) || (param.getAnnotation(CreateNode.class) != null));
}
});
- private PolymorphicDispatcher<List<EObject>> getChildren = new PolymorphicDispatcher<List<EObject>>(Lists
+ private final PolymorphicDispatcher<List<EObject>> getChildren = new PolymorphicDispatcher<List<EObject>>(Lists
.newArrayList(this), new Predicate<Method>() {
public boolean apply(Method param) {
return ((param.getName().equals("getChildren")) || (param.getAnnotation(GetChildren.class) != null));
@@ -62,6 +62,7 @@ public class AbstractDeclarativeSemanticModelTransformer extends DefaultSemantic
return getChildren.invoke(semanticNode);
}
+ @Override
protected List<EObject> getChildren(EObject semanticNode) {
return semanticNode.eContents();
}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractSemanticModelTransformer.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractSemanticModelTransformer.java
index 88e00e2..fb2d0b8 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractSemanticModelTransformer.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/outline/impl/AbstractSemanticModelTransformer.java
@@ -31,13 +31,14 @@ public abstract class AbstractSemanticModelTransformer implements ISemanticModel
public static final String INVISIBLE_ROOT_NODE = "Invisible Root Node";
public static final List<EObject> NO_CHILDREN = new ArrayList<EObject>();
public static final ContentOutlineNode HIDDEN_NODE = new ContentOutlineNode() {
+ @Override
public String getLabel() {
return "hidden node";
- };
+ }
};
private boolean sorted = false;
- private HashMap<Class, IOutlineFilter> filters;
+ private HashMap<Class<?>, IOutlineFilter> filters;
public ContentOutlineNode transformSemanticModel(EObject semanticModel) {
ContentOutlineNode outlineModel = new ContentOutlineNode();
@@ -100,7 +101,7 @@ public abstract class AbstractSemanticModelTransformer implements ISemanticModel
public void enableFilter(IOutlineFilter filterSpec) {
if (filters == null) {
- filters = new HashMap<Class, IOutlineFilter>();
+ filters = new HashMap<Class<?>, IOutlineFilter>();
}
filters.put(filterSpec.getClass(), filterSpec);
}
@@ -115,18 +116,14 @@ public abstract class AbstractSemanticModelTransformer implements ISemanticModel
if (filters != null) {
return filters.containsKey(filterSpec.getClass());
}
- else {
- return false;
- }
+ return false;
}
- public boolean isFilterActive(Class clazz) {
+ public boolean isFilterActive(Class<?> clazz) {
if (filters != null) {
return filters.containsKey(clazz);
}
- else {
- return false;
- }
+ return false;
}
protected abstract boolean doSortChildren(EObject semanticNode);
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/UIPluginModule.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/UIPluginModule.java
index 1fe2d1a..c42462f 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/UIPluginModule.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/UIPluginModule.java
@@ -19,18 +19,19 @@ import com.google.inject.Binder;
*/
public class UIPluginModule extends AbstractGenericModule {
- private AbstractUIPlugin plugin;
+ private final AbstractUIPlugin plugin;
public UIPluginModule(AbstractUIPlugin plugin) {
this.plugin = plugin;
}
+ @Override
public void configure(Binder binder) {
super.configure(binder);
binder.bind(AbstractUIPlugin.class).toInstance(plugin);
}
public Class<? extends IImageHelper> bindIImageHelper() {
- return PluginImageHelper.class;
+ return PluginImageHelper.class;
}
}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextResourceChecker.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextResourceChecker.java
index 1ebb623..4634577 100644
--- a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextResourceChecker.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextResourceChecker.java
@@ -33,11 +33,9 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.xtext.parsetree.AbstractNode;
import org.eclipse.xtext.parsetree.NodeAdapter;
import org.eclipse.xtext.parsetree.NodeUtil;
-import org.eclipse.xtext.resource.XtextResource;
/**
* @author Dennis Hübner - Initial contribution and API
- *
*/
public class XtextResourceChecker {
@@ -49,7 +47,6 @@ public class XtextResourceChecker {
/**
* @author Sven Efftinge - Initial contribution and API
- *
*/
public static final class AddMarkersOperation extends WorkspaceModifyOperation {
/**
@@ -60,10 +57,6 @@ public class XtextResourceChecker {
private final String markerId;
private final boolean deleteMarkers;
- /**
- * @param rule
- * @param issues
- */
public AddMarkersOperation(ISchedulingRule rule, List<Map<String, Object>> issues, IFile file, String markerId,
boolean deleteMarkers) {
super(rule);
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/internal/Activator.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/internal/Activator.java
index 777c8d9..a3159c6 100644
--- a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/internal/Activator.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/internal/Activator.java
@@ -51,6 +51,7 @@ public class Activator extends AbstractUIPlugin {
public Activator() {
}
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
setDefault(this);
@@ -65,6 +66,7 @@ public class Activator extends AbstractUIPlugin {
plugin = activator;
}
+ @Override
public void stop(BundleContext context) throws Exception {
if (log.isDebugEnabled())
log.debug("Stopping Xtext UI bundle.");
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/wizard/XtextNewProjectWizard.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/wizard/XtextNewProjectWizard.java
index a99cda5..b05d047 100644
--- a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/wizard/XtextNewProjectWizard.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/wizard/XtextNewProjectWizard.java
@@ -47,6 +47,7 @@ public abstract class XtextNewProjectWizard extends Wizard implements INewWizard
protected abstract IProjectInfo getProjectInfo();
+ @Override
public boolean performFinish() {
final IProjectInfo projectInfo = getProjectInfo();
IRunnableWithProgress op = new IRunnableWithProgress() {
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java
index fa01203..73fc713 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java
@@ -45,6 +45,7 @@ public class DynamicDispatchTest extends TestCase{
return OBJECT;
}
+ @SuppressWarnings("unused")
protected List<ICompletionProposal> foo(String s) {
return STRING;
}
diff --git a/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/tests/Activator.java b/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/tests/Activator.java
index f5ced20..5bb8e6f 100644
--- a/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/tests/Activator.java
+++ b/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/tests/Activator.java
@@ -24,6 +24,7 @@ public class Activator extends AbstractUIPlugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -33,6 +34,7 @@ public class Activator extends AbstractUIPlugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/validation/CheckValidatorTest.java b/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/validation/CheckValidatorTest.java
index d5dce33..ba3ba9d 100644
--- a/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/validation/CheckValidatorTest.java
+++ b/tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/validation/CheckValidatorTest.java
@@ -16,7 +16,6 @@ import org.eclipse.xtext.testlanguages.TreeTestLanguageStandaloneSetup;
/**
* @author Sven Efftinge - Initial contribution and API
- *
*/
public class CheckValidatorTest extends AbstractXtextTests {