Re: loop limiter in BCELifier.printFlags

"Torsten Curdt" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Yudhi,

Well spotted! ..but I think your fix is not correct.
I think it should just be

  for (int i = 0, pow = 1; pow <= Constants.MAX_ACC_FLAG; i++) {
    ...
    pow <<= 1;
  }

cheers
--
Torsten

On 4/12/06, Yudhi Widyatama <[email protected]> wrote:
> Hi,
> I'm wondering about the line 195 in
> org/apache/bcel/util/BCELifier.java (trunk code in
> SVN):
>          for (int i = 0, pow = 1; i <=
> Constants.MAX_ACC_FLAG; i++) {
> ...
>             pow <<= 1;
>         }
> If I understand this correctly, there is no need to do
> the loop 0x4000 times (which is the value of
> Constants.MAX_ACC_FLAG).
> I thought it would be better
> like this:
>         for (int i = 0, pow = 1; i <
> Constants.ACCESS_NAMES.length; i++) {
> Pardon me if I'm wrong.
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.