getClassLoader()

Archie Cobbs kaffe@rufus.w3.org
Tue, 28 Jul 1998 08:24:26 -0700 (PDT)


Alexandre Oliva writes:
> > The method Class.getClassLoader() is returning null, which is
> > causing stuff to bomb out with NullPointerException.
> 
> getClassLoader() is supposed to return null for classes loaded by the
> default class-loader.  If things are bombing because it is returning
> null, the problem must be elsewhere

Yes, you're right.. here's the problem I'm having:

  java.lang.NullPointerException
	  at java/lang/Class.getResourceAsStream(158)
	  at ca/mcgill/sable/sablecc/GenTokens.<init>(91)
	  at ca/mcgill/sable/sablecc/SableCC.main(163)
	  at SableCC.main(73)

Because in java/lang/Class.java:

  public InputStream getResourceAsStream(String name) {
	  return (getClassLoader().getResourceAsStream(fullResourceName(name)));
  }

So I guess getResourceAsStream() needs to be fixed.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com