cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cp-tools-discuss] gnu.bytecode


From: Per Bothner
Subject: Re: [Cp-tools-discuss] gnu.bytecode
Date: Sat, 15 Jan 2005 23:51:11 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Elliott Hughes wrote:
* gnu.bytecode.ClassTypeWriter has several package-access methods,
> and most of the methods that are public are final. it would have
> been nice to be able to provide my own ClassTypeWriter subclass.

I agree - most of these probably should't be final.
In general, I'm happy to consider patches/suggestions
whereever you think the design or code can be improved.

* the decoding of modifiers doesn't cover 1.5 class files,

Coincidentally, I just added those.

and is wrong because it doesn't properly distinguish class modifiers, method modifiers, and field modifiers.

Huh?  It does - that's what the "kind" parameter to
Access.toString(int flags, char kind) specifies.

One possible nit is that it will (say) happily write INTERFACE
for a method that erroneously has the 0x0200 bit set.  A solution
is to define three flags:
  static final int CLASS_MODIFIERS = PUBLIC|...|ENUM;
  static final int METHOD_MODIFIERS = ...;
  static final int FIELD_MODIFIERS = ...;
and use that in the toString method.

I'll probably do this.

> (that's why the attached class has its
own code to do the decoding.)

I suggest you change the code to use gnu.bytecode.Access.

It might make sense to include GjDump in gnu.bytecode.
To what extent this makes sense depends how may other classes
there are in gnu.classpath.tools that "extend" gnu.bytecode.
If there's only a modest number of such classes, it may more
sense to package them as part of gnu.bytecode.  However, it
that case it would have to have a license no more retrictive
than the gnu.bytecode (Kawa) license (which is GPL or ...
style "triple" license.)

More later.
--
        --Per Bothner
address@hidden   http://per.bothner.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]