Re: problems with the Repository

"Dave Brosius" <[email protected]> Sun, 26 Feb 2006 02:18:22 -0500
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <000a01c63aa4$d3a60c00$6401a8c0@MeBigFatGuy>
don't use backslashes to specify class package names.

you should be able to use package syntax

prova.Prova

or

internal format syntax

prova/Prova


----- Original Message ----- 
From: <[email protected]>
To: "BCEL Users List" <[email protected]>
Sent: Thursday, February 23, 2006 12:53 PM
Subject: problems with the Repository


> Hello.
> I have same problems with the Repository of bcel.
> I would like to load a class received by command line
> to change its bytecode.
> Actually my project load correctly the class files if
> they are in the same directory of my program, but I
> got a NullPointerException if I try to load a class in
> another directory.
> 
> My source code is the following:
> ...
> if(!new File(classFileName+".class").isFile())   
>  System.out.println("The file doesn't exists");
> else {
>  JavaClass clazz =
> Repository.lookupClass(classFileName);
>  Method[] methods = clazz.getMethods();
> ...
> 
> If, for example, classFileName == prova\Prova, I'm
> sure that the file exists for the if clause, but the
> command lookupClass fail the load and return null.
> 
> Someone can help me?
> 
> Thanks.
> 
> 
> ---------------------------------
> Debendetti Emanuele
> sanremo.too.it
> 
> 
> 
> 
> 
> 
> ___________________________________ 
> Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
> http://mail.yahoo.it
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
>