diff options
author | vlorenzo | 2012-04-19 12:07:17 +0000 |
---|---|---|
committer | vlorenzo | 2012-04-19 12:07:17 +0000 |
commit | 270d61433e57c83622275699fb3af8a6b444a116 (patch) | |
tree | 64b3aa8ade214f8bc1e5ccf66a165ae603235369 /plugins | |
parent | a02e3520cdcc4a207f39d241052a13c2be65075a (diff) | |
download | org.eclipse.papyrus-270d61433e57c83622275699fb3af8a6b444a116.tar.gz org.eclipse.papyrus-270d61433e57c83622275699fb3af8a6b444a116.tar.xz org.eclipse.papyrus-270d61433e57c83622275699fb3af8a6b444a116.zip |
377154: [Nested UML Compare] Comparison between 2 elements which don't have the same parent is not done properly
https://bugs.eclipse.org/bugs/show_bug.cgi?id=377154
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java new file mode 100644 index 00000000000..a8c706ef087 --- /dev/null +++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java @@ -0,0 +1,44 @@ +package org.eclipse.papyrus.infra.tools.util;
+
+import java.lang.reflect.Method;
+
+/**
+ *
+ * This helper provides methods to get methods reflectively
+ * It is not the better way to access to method, but sometimes it can be interested to avoid to duplicate
+ * lot of code
+ *
+ */
+public class ReflectHelper {
+
+ /**
+ *
+ * Should not be instantiated
+ *
+ */
+ private ReflectHelper() {
+ // prevents instantiation
+ }
+
+ /**
+ * Warning : each call of this method should be tested with a JUnit test, in order to know
+ * when the API has changed
+ *
+ * @param aClass
+ * a class
+ * @param methodName
+ * the name of the method to find
+ * @param parameterTypes
+ * an array owning the type of the parameters of the called method
+ * @return
+ * the wanted method
+ * @throws NoSuchMethodException
+ * @throws SecurityException
+ */
+ public static Method getMethod(final Class<?> aClass, final String methodName, Class<?>[] parameterTypes) throws SecurityException, NoSuchMethodException {
+ Method m = null;
+ m = aClass.getDeclaredMethod(methodName, parameterTypes);
+ m.setAccessible(true);
+ return m;
+ }
+}
|