|
From: <Qa...@us...> - 2006-12-10 17:40:07
|
Revision: 2885
http://jnode.svn.sourceforge.net/jnode/?rev=2885&view=rev
Author: QaDeS
Date: 2006-12-10 09:40:01 -0800 (Sun, 10 Dec 2006)
Log Message:
-----------
Bug 911 quick fix
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/VmReflection.java
trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java
Modified: trunk/core/src/core/org/jnode/vm/VmReflection.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmReflection.java 2006-12-10 15:57:36 UTC (rev 2884)
+++ trunk/core/src/core/org/jnode/vm/VmReflection.java 2006-12-10 17:40:01 UTC (rev 2885)
@@ -318,6 +318,8 @@
}
if (!method.isStatic()) {
+ if( o == null )
+ throw new NullPointerException();
Unsafe.pushObject(o);
} else {
method.getDeclaringClass().initialize();
Modified: trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java 2006-12-10 15:57:36 UTC (rev 2884)
+++ trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java 2006-12-10 17:40:01 UTC (rev 2885)
@@ -33,6 +33,7 @@
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -287,8 +288,12 @@
// new
// thread?
try {
- AccessController.doPrivileged(new InvokeAction(method,
- null, args));
+ Object obj = null;
+ if(!Modifier.isStatic(method.getModifiers())) {
+ obj = cx.newInstance();
+ }
+ AccessController.doPrivileged(new InvokeAction(method,
+ obj, args));
} catch (PrivilegedActionException ex) {
throw ex.getException();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|