Merged gcj-eclipse branch to trunk.

From-SVN: r120621
This commit is contained in:
Tom Tromey 2007-01-09 19:58:05 +00:00
parent c648dedbde
commit 97b8365caf
17478 changed files with 606493 additions and 100744 deletions

View file

@ -40,10 +40,7 @@ exception statement from your version. */
package java.io;
import gnu.classpath.Configuration;
import gnu.classpath.VMStackWalker;
import java.lang.reflect.Constructor;
import java.security.AccessController;
import java.security.PrivilegedAction;
final class VMObjectInputStream
{
@ -55,42 +52,6 @@ final class VMObjectInputStream
}
}
/**
* PrivilegedAction needed for Class.getClassLoader()
*/
private static PrivilegedAction loaderAction = new PrivilegedAction()
{
/**
* Returns the first user defined class loader on the call stack, or the
* context class loader of the current thread, when no non-null class loader
* was found.
*/
public Object run()
{
Class[] ctx = VMStackWalker.getClassContext();
for (int i = 0; i < ctx.length; i++)
{
ClassLoader cl = ctx[i].getClassLoader();
if (cl != null)
return cl;
}
return Thread.currentThread().getContextClassLoader();
}
};
/**
* Returns the first user defined class loader on the call stack, or the
* context class loader of the current thread, when no non-null class loader
* was found.
*
* @return the class loader
*/
static ClassLoader currentClassLoader()
{
return (ClassLoader) AccessController.doPrivileged(loaderAction);
}
/**
* Allocates a new Object of type clazz but without running the
* default constructor on it. It then calls the given constructor on