#41 Decompiler does not put in needed parenthesis

open
nobody
None
5
2003-07-17
2003-07-17
No

Take the following simple example:

import java.io.PrintStream;
public class Test1{
public static void main(String[] stringArr)
{
byte i = 6;
if ((i & 2) != 0)
System.out.println("Hi there");
return;
}
}

Compile it with Sun's javac (I used JDK 1.4) and then
decompile with jrevpro

The decompiled code is OK except that it gives the line

if (i & 2 != 0)

which cannot be again compiled.

jrevpro should examine the order-of-precedence of the
operators and anticipate when paranthesis are needed
by the language and provide them.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks