/[classpath]/classpath/vm/reference/java/lang/VMClassLoader.java
ViewVC logotype

Diff of /classpath/vm/reference/java/lang/VMClassLoader.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by mark, Sat Oct 26 18:41:59 2002 UTC revision 1.14 by jewel, Wed Dec 18 10:28:29 2002 UTC
# Line 44  import java.io.IOException; Line 44  import java.io.IOException;
44  import java.util.Enumeration;  import java.util.Enumeration;
45  import java.util.Map;  import java.util.Map;
46  import java.util.HashMap;  import java.util.HashMap;
47    import java.lang.reflect.Constructor;
48    import gnu.java.lang.SystemClassLoader;
49    
50  import gnu.java.util.EmptyEnumeration;  import gnu.java.util.EmptyEnumeration;
51    
# Line 295  final class VMClassLoader Line 297  final class VMClassLoader
297    {    {
298      return new HashMap();      return new HashMap();
299    }    }
300    
301      static ClassLoader getSystemClassLoader()
302      {
303        // This method is called as the initialization of systemClassLoader,
304        // so if there is a null value, this is the first call and we must check
305        // for java.system.class.loader.
306          String loader = System.getProperty("java.system.class.loader",
307                                               "gnu.java.lang.SystemClassLoader");
308          try
309              {
310                  // Give the new system class loader a null parent.
311                  Constructor c = Class.forName(loader).getConstructor
312                      ( new Class[] { ClassLoader.class } );
313                  return (ClassLoader) c.newInstance(new Object[1]);
314              }
315          catch (Exception e)
316              {
317                  try
318                      {
319                          System.err.println("Requested system classloader "
320                                             + loader + " failed, trying "
321                                             + "gnu.java.lang.SystemClassLoader");
322                          e.printStackTrace();
323                          // Fallback to gnu.java.lang.SystemClassLoader.
324                          return new SystemClassLoader(null);
325                      }
326                  catch (Exception e1)
327                      {
328                          throw (Error) new InternalError
329                              ("System class loader could not be found: " + e1)
330                              .initCause(e1);
331                      }
332              }
333    
334      }
335  }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26