java-decompiler / jd-gui

A standalone Java Decompiler GUI
GNU General Public License v3.0
14.09k stars 2.4k forks source link

Parentheses Missing #400

Open Somdy opened 2 years ago

Somdy commented 2 years ago

This may happen occasionally that decompiled codes are missing some parentheses. Not the parentheses that are parts of methods or constructors, but the ones in some calculation statements. An example are as following.

This is decompiled by jd. 图片

This is decompiled by IDEA. 图片

It is notable that a local var handSizeAndDraw is assigned by a statement 10 - this.amount + hand.size() while the statement is 10 - (this.amount + hand.size()) in IDEA. The latter is correct after debugging it.

Boat2017 commented 2 years ago

现在是假期。已经收到您的来信,我会尽快回复。

StevenJack666 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

rautamiekka commented 2 years ago

10 - this.amount + hand.size() 10 - (this.amount + hand.size())

100% pointless in this case.

Somdy commented 2 years ago

10 - this.amount + hand.size() 10 - (this.amount + hand.size())

100% pointless in this case.

@rautamiekka are u sure? i don't know what the case is you are saying and in my example 10-1+2=11 but 10-(1+2)=7

L-ios commented 2 years ago

can you show your class file

Somdy commented 2 years ago

can you show your class file

@L-ios no. it's the code of a game on Steam called Slay the Spire and i think it's copyrighted so i won't put the class file here. but i am sure the game would run in a completely wrong logic if the parentheses were missing.

Somdy commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

rautamiekka commented 2 years ago

10 - this.amount + hand.size() 10 - (this.amount + hand.size()) 100% pointless in this case.

@rautamiekka are u sure? i don't know what the case is you are saying and in my example 10-1+2=11 but 10-(1+2)=7

Sigh ... I hate math ...