]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java
Compiler warning elimination
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / property / AnnotatedPropertyTabContributorFactory.java
index 7198ead22ba6ccd9ad96cc30303158f9a9b9f317..7e3f85333bb88022ce5038e43670bdf0ab792346 100644 (file)
@@ -216,6 +216,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
        private static Map<PropertyItem, PropertyManipulator> createManipulators(CompoundPropertyItem item, Object obj) {
                try {
                        
+                       @SuppressWarnings("unchecked")
                        Map<String,Object> map = (Map<String, Object>)item.getter.invoke(obj);
                        Map<PropertyItem, PropertyManipulator> result = new HashMap<AnnotatedPropertyTabContributorFactory.PropertyItem, PropertyManipulator>();
                        for (String key : map.keySet()) {
@@ -232,7 +233,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                        return result;
                } catch (Exception e) {
                        e.printStackTrace();
-                       return Collections.EMPTY_MAP;
+                       return Collections.emptyMap();
                } 
                
        }
@@ -980,9 +981,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                        if (focusCellManager != null) {
                                try {
                                        Method m = focusCellManager.getClass().getSuperclass()
-                                                       .getDeclaredMethod("init", null);
+                                                       .getDeclaredMethod("init");
                                        m.setAccessible(true);
-                                       m.invoke(focusCellManager, null);
+                                       m.invoke(focusCellManager);
                                } catch (SecurityException e) {
                                        e.printStackTrace();
                                } catch (IllegalArgumentException e) {
@@ -1050,9 +1051,10 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                                if (DEBUG)System.err.println("FOCUS CELL: " + focusCell);
                                                
                                                Method m = AbstractTableViewer.class.getDeclaredMethod(
-                                                               "getSelectionFromWidget", null);
+                                                               "getSelectionFromWidget");
                                                m.setAccessible(true);
-                                               List l = (List) m.invoke(getViewer(), null);
+                                               @SuppressWarnings("rawtypes")
+                                               List l = (List) m.invoke(getViewer());
                                                if (focusCellManager != null) {
                                                        m = focusCellManager
                                                                        .getClass()
@@ -1152,9 +1154,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                        ViewerColumn column = (ViewerColumn) m.invoke(viewer,
                                                        new Object[] { new Integer(columnIndex) });
                                        m = ViewerColumn.class.getDeclaredMethod(
-                                                       "getEditingSupport", null);
+                                                       "getEditingSupport");
                                        m.setAccessible(true);
-                                       EditingSupport es = (EditingSupport) m.invoke(column, null);
+                                       EditingSupport es = (EditingSupport) m.invoke(column);
                                        if (column != null && es != null) {
                                                m = EditingSupport.class.getDeclaredMethod("canEdit",
                                                                new Class[] { Object.class });
@@ -1258,10 +1260,9 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                m.setAccessible(true);
                                ViewerColumn column = (ViewerColumn) m.invoke(viewer,
                                                new Object[] { new Integer(cell.getColumnIndex()) });
-                               m = ViewerColumn.class.getDeclaredMethod("getEditingSupport",
-                                               null);
+                               m = ViewerColumn.class.getDeclaredMethod("getEditingSupport");
                                m.setAccessible(true);
-                               EditingSupport es = (EditingSupport) m.invoke(column, null);
+                               EditingSupport es = (EditingSupport) m.invoke(column);
                                if (column != null && es != null) {
                                        m = EditingSupport.class.getDeclaredMethod("canEdit",
                                                        new Class[] { Object.class });