prims.cc (_Jv_NewObjectArray): Undo placement change.
2000-11-25 Anthony Green <green@redhat.com> * prims.cc (_Jv_NewObjectArray): Undo placement change. (_Jv_NewPrimArray): Likewise. * gcj/array.h (__JArray): Undo const change. Removed constructor. (class JArray): Removed constructor. * java/lang/Thread.java (context_class_loader): New private data. (getContextClassLoader): New method. (setContextClassLoader): New method. (Thread): Initialize context_class_loader. * java/net/URLClassLoader.java: Import java.util.Enumeration. (getResource): Rename to findResource. (findResource): New method. Used to be getResource. (getResourceAsStream): Deleted. (jarFileize): Extracted logic from URLClassLoader constructor into this new private method. (addURL): New protected method. (URLClassLoader): Call jarFileize. Use addElement instead of insertElementAt. (findResources): New method. * java/lang/ClassLoader.java: Import java.util.Enumeration. (getResource): Implement correct logic. (findResource): New method. (getResources): New method. (findClass): Create a ClassNotFoundException with the name of the class rather than nothing at all. (defineClass) Only throw ClassFormatError. * java/lang/Class.java (forName): New method. * java/lang/Class.h (forName): New method. * java/lang/natClass.cc (forName): New method. From-SVN: r37751
This commit is contained in:
parent
1786009e06
commit
31280fb7c4
8 changed files with 206 additions and 113 deletions
|
@ -145,15 +145,23 @@ public class Thread implements Runnable
|
|||
daemon_flag = status;
|
||||
}
|
||||
|
||||
// TODO12:
|
||||
// public ClassLoader getContextClassLoader()
|
||||
// {
|
||||
// }
|
||||
public ClassLoader getContextClassLoader()
|
||||
{
|
||||
if (context_class_loader == null)
|
||||
{
|
||||
context_class_loader = ClassLoader.getSystemClassLoader ();
|
||||
return context_class_loader;
|
||||
}
|
||||
|
||||
// TODO12:
|
||||
// public void setContextClassLoader(ClassLoader cl)
|
||||
// {
|
||||
// }
|
||||
// FIXME: Add security manager stuff here.
|
||||
return context_class_loader;
|
||||
}
|
||||
|
||||
public void setContextClassLoader(ClassLoader cl)
|
||||
{
|
||||
// FIXME: Add security manager stuff here.
|
||||
context_class_loader = cl;
|
||||
}
|
||||
|
||||
public final void setName (String n)
|
||||
{
|
||||
|
@ -227,13 +235,14 @@ public class Thread implements Runnable
|
|||
interrupt_flag = false;
|
||||
alive_flag = false;
|
||||
startable_flag = true;
|
||||
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
daemon_flag = current.isDaemon();
|
||||
int gmax = group.getMaxPriority();
|
||||
int pri = current.getPriority();
|
||||
priority = (gmax < pri ? gmax : pri);
|
||||
context_class_loader = current.context_class_loader;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -277,7 +286,7 @@ public class Thread implements Runnable
|
|||
public String toString ()
|
||||
{
|
||||
return "Thread[" + name + "," + priority + "," +
|
||||
(group == null ? "" : group.getName()) + "]";
|
||||
(group == null ? "" : group.getName()) + "]";
|
||||
}
|
||||
|
||||
public static native void yield ();
|
||||
|
@ -291,6 +300,7 @@ public class Thread implements Runnable
|
|||
boolean interrupt_flag;
|
||||
private boolean alive_flag;
|
||||
private boolean startable_flag;
|
||||
private ClassLoader context_class_loader;
|
||||
|
||||
// Our native data.
|
||||
private Object data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue