Field modifiers

Shrinivas Joshi <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Hi All,
   I need to change access modifiers of all fields of a particular class
to public access.
When I use setModifiers(Constants.ACC_PUBLIC) the other attributes such as
static, final etc are not retained. The field modifier is then set to just
public. I tried using bitwise OR of Constants.ACC_PUBLIC with existing
modifiers and noticed that it retains the other access attributes and also
changes the field modifier to public. But doesnt works for protected
fields as bitwise OR results in 0x5 value which is not valid value.
Please let me know if I am doing it right or missing something over here.

Thanks and Regards
Shrinivas Joshi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.