svn commit: r18626 - trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2010-08-04 13:23:45-0700
New Revision: 18626

Modified:
   trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java

Log:
Make it impossible to instanciate singleton notationproviders.

Modified: trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java?view=diff&pathrev=18626&r1=18625&r2=18626
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/notation/NotationProviderFactory2.java	2010-08-04 13:23:45-0700
@@ -41,7 +41,6 @@
 import java.beans.PropertyChangeListener;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -225,18 +224,12 @@
         Class clazz = getNotationProviderClass(type, name);
         if (clazz != null) {
             try {
-                try {
-                    Class[] mp = {};
-                    Method m = clazz.getMethod("getInstance", mp);
-                    return (NotationProvider) m.invoke(null, (Object[]) mp);
-                } catch (Exception e) {
-                    Class[] cp = {Object.class};
-                    Constructor constructor = clazz.getConstructor(cp);
-                    Object[] params = {
-                        object,
-                    };
-                    return (NotationProvider) constructor.newInstance(params);
-                }
+                Class[] cp = {Object.class};
+                Constructor constructor = clazz.getConstructor(cp);
+                Object[] params = {
+                    object,
+                };
+                return (NotationProvider) constructor.newInstance(params);
             } catch (SecurityException e) {
                 // TODO: Why aren't we throwing an exception here?
             	// Returning null results in NPE and no explanation why.

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2642901

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.