Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-07-23 07:52:11 -0400
committerCamille Letavernier2015-07-23 07:54:17 -0400
commit661523df5a820d655eeff23999bd233b5e4746bd (patch)
tree51ab2535154aeddeb35c37a8651435adb3d7671a /plugins/views/properties
parentc29c02216ec79ce90b02cc96e20de4d74db55380 (diff)
downloadorg.eclipse.papyrus-661523df5a820d655eeff23999bd233b5e4746bd.tar.gz
org.eclipse.papyrus-661523df5a820d655eeff23999bd233b5e4746bd.tar.xz
org.eclipse.papyrus-661523df5a820d655eeff23999bd233b5e4746bd.zip
443799: [Code Quality] Cleanup code according to FindBugs results
https://bugs.eclipse.org/bugs/show_bug.cgi?id=443799 - Fix issues in various bundles
Diffstat (limited to 'plugins/views/properties')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java7
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java2
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/EnumCombo.java14
3 files changed, 5 insertions, 18 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java
index 730c42263b6..78fb0a1245d 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java
@@ -179,6 +179,7 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory {
EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsUri);
if (ePackage == null) {
Activator.log.warn("Cannot find the EPackage corresponding to URI " + nsUri); //$NON-NLS-1$
+ return;
}
eClass = (EClass) ePackage.getEClassifier(className);
if (eClass == null) {
@@ -314,7 +315,7 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory {
* The control used to open a selection list (if more than one EClass
* can be instantiated)
* @return
- * The EClass to instantiate
+ * The EClass to instantiate
*/
protected EClass chooseEClass(Control widget) {
if (eClass != null) {
@@ -377,7 +378,7 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory {
/**
* @return
- * The list of {@link EClass} that can be instantiated.
+ * The list of {@link EClass} that can be instantiated.
* This is the list of all concrete subclasses of {@link #type}
*/
protected List<EClass> getAvailableEClasses() {
@@ -426,7 +427,7 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory {
/**
* @return
- * The EClass that will be instantiated, or null if this hasn't been forced
+ * The EClass that will be instantiated, or null if this hasn't been forced
*/
public EClass getEClass() {
return eClass;
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
index 6f86e0cf51b..0d5e148ecc3 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
@@ -40,7 +40,7 @@ public class DataSourceFactory {
/**
* Singleton instance for DataSourceFactory
*/
- public static DataSourceFactory instance = new DataSourceFactory();
+ public static final DataSourceFactory instance = new DataSourceFactory();
/**
* Creates a new DataSource from a selection and a view.
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/EnumCombo.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/EnumCombo.java
index f2e2d453006..e87d7c97ba9 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/EnumCombo.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/EnumCombo.java
@@ -11,11 +11,6 @@
*****************************************************************************/
package org.eclipse.papyrus.views.properties.widgets;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.HierarchicToFlatContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.TreeToFlatContentProvider;
import org.eclipse.swt.widgets.Composite;
/**
@@ -54,15 +49,6 @@ public class EnumCombo extends AbstractPropertyEditor {
*/
@Override
protected void doBinding() {
-
- IStaticContentProvider provider = input.getContentProvider(propertyPath);
-
- if (provider instanceof IHierarchicContentProvider) {
- provider = new HierarchicToFlatContentProvider((IHierarchicContentProvider) provider);
- } else if (provider instanceof ITreeContentProvider) {
- provider = new TreeToFlatContentProvider((ITreeContentProvider) provider);
- }
-
enumCombo.setProviders(input.getContentProvider(propertyPath), input.getLabelProvider(propertyPath));
enumCombo.setUnsettable(!input.isMandatory(propertyPath));

Back to the top