Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristof Marti2004-11-26 06:21:09 -0500
committerChristof Marti2004-11-26 06:21:09 -0500
commitc50820edf51c2cb40e22016d641cc89cd4755c32 (patch)
tree3ceb974a70fe0ea94bb7bebf93819c435e7a3db8
parentf5f86340eb227e9bfa059423be0b3b2fa64fdca9 (diff)
downloadeclipse.platform.text-perf_301.tar.gz
eclipse.platform.text-perf_301.tar.xz
eclipse.platform.text-perf_301.zip
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java2
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java31
2 files changed, 28 insertions, 5 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
index 1b76b5833..8ea666406 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
@@ -73,7 +73,7 @@ public class ResourceHelper {
i= MAX_RETRY;
} catch (CoreException x) {
if (i == MAX_RETRY - 1) {
- FileBuffersTestPlugin.getDefault().getLog().log(x.getStatus());
+ FilebuffersTestPlugin.getDefault().getLog().log(x.getStatus());
// throw x;
}
try {
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java
index 3ed77877a..784b8c209 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java
@@ -47,16 +47,39 @@ public class Accessor extends Assert {
}
/**
+ * Creates an accessor for the given <code>instance</code> and
+ * <code>class</code>. Only non-inherited members that particular
+ * <code>class</code> can be accessed.
+ *
+ * @param instance the instance
+ * @param className the name of the class
+ * @param classLoader the class loader to use i.e. <code>getClass().getClassLoader()</code>
+ */
+ public Accessor(Object instance, String className, ClassLoader classLoader) {
+ assertNotNull(instance);
+ assertNotNull(className);
+ assertNotNull(classLoader);
+ fInstance= instance;
+ try {
+ fClass= Class.forName(className, true, classLoader);
+ } catch (ClassNotFoundException e) {
+ fail();
+ } catch (ExceptionInInitializerError e) {
+ fail();
+ }
+ }
+
+ /**
* Creates an accessor for the given class.
* <p>
* In order to get the type information from the given
- * arguments they must all be instanceof Object. Use
+ * arguments they must all be instanc eof Object. Use
* {@link #Accessor(String, ClassLoader, Class[], Object[])} if this
* is not the case.</p>
*
* @param className the name of the class
* @param classLoader the class loader to use i.e. <code>getClass().getClassLoader()</code>
- * @param constructorArgs the constructor arguments which must all be instanceof Object
+ * @param constructorArgs the constructor arguments which must all be instance of Object
*/
public Accessor(String className, ClassLoader classLoader, Object[] constructorArgs) {
this(className, classLoader, getTypes(constructorArgs), constructorArgs);
@@ -105,12 +128,12 @@ public class Accessor extends Assert {
* Invokes the method with the given method name and arguments.
* <p>
* In order to get the type information from the given
- * arguments all those arguments must be instanceof Object. Use
+ * arguments all those arguments must be instance of Object. Use
* {@link #invoke(String, Class[], Object[])} if this
* is not the case.</p>
*
* @param methodName the method name
- * @param arguments the method arguments which must all be instanceof Object
+ * @param arguments the method arguments which must all be instance of Object
* @return the method return value
*/
public Object invoke(String methodName, Object[] arguments) {

Back to the top