commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Li <fancye...@gmail.com>
Subject Re: is BCEL the tool for me?
Date Wed, 24 Jun 2015 09:44:53 GMT
I have to use another package name other than the original one because
the original package is loaded and not controlled by my code.


On Wed, Jun 24, 2015 at 5:37 PM, Benedikt Ritter <britter@apache.org> wrote:
> Hello Li Li
>
> 2015-06-24 11:21 GMT+02:00 Li Li <fancyerii@gmail.com>:
>
>> Hi all,
>>      I have a jar file and without the source code, I want to replace
>> a package and all classes of this package with my own.
>>      e.g.  There is a package
>>       com.abc.tool
>>       com.abc.tool.A.class
>>       com.abc.tool.B.class
>>     The com.abc.tool.A.class and com.abc.tool.B.class are used in many
>> other classes.
>>     I want to use my own implementation, So I can create my
>> package(com.def.tool) and my A.java B.java which has exactly the same
>> method as  com.abc.tool.A.class and  com.abc.tool.B.class
>>        com.def.tool
>>        com.def.tool.A.class
>>        com.def.tool.B.class
>>     But other classes in this jar still use com.abc.tool.A.class and
>> com.abc.tool.B.class. I want to use a byte code library to modify the
>> jar so it can run and use my implementation.
>>     Is BCEL suitable for this? Thank you
>>
>
> This sounds like a pretty complicated solution to your problem. Why don't
> you just replace the class files in the jar at build time?
>
> Regards,
> Benedikt
>
>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message