You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Laurent Therond <lt...@Concentual.com> on 2002/11/06 04:59:07 UTC

Question about BCEL and class closure

Hi,

I was wondering if anyone tried to compute a full class closure using BCEL.

I mean: Given a class file, produce a list of all classes used by the corresponding class, including classes used in declarations of local variables (within methods) and classes used in declarations of local variables (within methods) of any parent class or any class associated by composition.

I have seen a lot of code that computes partial class closures, but nothing as complete as a real class closure.

Does anyone know if that would be possible?
Does anyone have source code showing how this could be done using BCEL?

Regards,

Laurent

Re: Question about BCEL and class closure

Posted by Laurent Therond <lt...@Concentual.com>.
OK, let's assume the reflection API is not used.
In this case, are you saying BCEL can be used to do the job?

My ultimate goal is code mobility: Being able to package on-the-fly a class
and all of its dependencies in order to be able to load it, link it and
initialize it somewhere else on the network, without having to worry about
whether or not it references classes or resources that do not necessarily
exist in the "natural" Java runtime.

Regards,

L.

----- Original Message -----
From: "Toby Reyelts" <to...@reyelts.com>
To: "BCEL Users List" <bc...@jakarta.apache.org>; "Laurent Therond"
<lt...@Concentual.com>
Sent: Tuesday, November 05, 2002 8:29 PM
Subject: Re: Question about BCEL and class closure


>
> I'm sure lots of people have looked at this. Think of, for example, all of
> the static compilers for Java. Of course, you can't absolutely know the
full
> set of classes that will be used, because the class could dynamically load
> other classes using the reflection api.
>
> God bless,
> -Toby Reyelts
>
>
> ----- Original Message -----
> From: "Laurent Therond" <lt...@Concentual.com>
> To: <bc...@jakarta.apache.org>; <bc...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 10:59 PM
> Subject: Question about BCEL and class closure
>
>
> Hi,
>
> I was wondering if anyone tried to compute a full class closure using
BCEL.
>
> I mean: Given a class file, produce a list of all classes used by the
> corresponding class, including classes used in declarations of local
> variables (within methods) and classes used in declarations of local
> variables (within methods) of any parent class or any class associated by
> composition.
>
> I have seen a lot of code that computes partial class closures, but
nothing
> as complete as a real class closure.
>
> Does anyone know if that would be possible?
> Does anyone have source code showing how this could be done using BCEL?
>
> Regards,
>
> Laurent


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about BCEL and class closure

Posted by Toby Reyelts <to...@reyelts.com>.
I'm sure lots of people have looked at this. Think of, for example, all of
the static compilers for Java. Of course, you can't absolutely know the full
set of classes that will be used, because the class could dynamically load
other classes using the reflection api.

God bless,
-Toby Reyelts


----- Original Message -----
From: "Laurent Therond" <lt...@Concentual.com>
To: <bc...@jakarta.apache.org>; <bc...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 10:59 PM
Subject: Question about BCEL and class closure


Hi,

I was wondering if anyone tried to compute a full class closure using BCEL.

I mean: Given a class file, produce a list of all classes used by the
corresponding class, including classes used in declarations of local
variables (within methods) and classes used in declarations of local
variables (within methods) of any parent class or any class associated by
composition.

I have seen a lot of code that computes partial class closures, but nothing
as complete as a real class closure.

Does anyone know if that would be possible?
Does anyone have source code showing how this could be done using BCEL?

Regards,

Laurent


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>