JAVA:まず巻きブラケット、関係の継続
-
20-09-2019 - |
質問
私は、以下のjavaコードフラグメント
while (condition1){
switch (someinteger){
case 1:
if(condition2) continue;
// other stuff here
break;
// other cases here
}
}
すべてに影響はありません。私が生成するクラスファイルを逆コンパイルされている内容が消えてしまう無料ツール(JD-gui)を取得し、以下のコードです。
while (condition1){
switch (someinteger){
case 1:
if(!condition2);
// other stuff here
break;
// other cases here
}
}
その変化 if(condition2) continue;
へ if(!condition2);
を見つけられなかった他の情報その他の場合は書きなブレース).誰でもできるので説明する理論。よろしくお願いします。
編集:った試験のdecompiler動作が正しくないのを修正した。
こちらのコードの前に:
public void strip(InputStreamReader f1, OutputStreamWriter f2) throws IOException{
int commentON=0, quoteON=0;
int b1;
while ((b1 = f1.read()) != -1){
switch ((char) b1){
case '\\':
if (commentON==0){
quoteON = 1;
break;
}
continue;
case '\n':
if (commentON>0){ commentON=0; continue; }
break;
case '%':
if (commentON>0) continue;
if (quoteON>0) { quoteON=0; break; }
commentON=2;
continue;
default:
if (commentON>0) continue;
if (quoteON>0) quoteON=0;
break;
}
f2.write(b1);
}
}
こちらはdecompiledコード
public void strip(InputStreamReader f1, OutputStreamWriter f2) throws IOException
{
int commentON = 0; int quoteON = 0;
while ((b1 = f1.read()) != -1)
{
int b1;
switch ((char)b1)
{
case '\\':
if (commentON == 0);
quoteON = 1;
break;
case '\n':
if (commentON <= 0) break label109; commentON = 0; break;
case '%':
if (commentON <= 0);
if (quoteON > 0) { quoteON = 0; break label109: }
commentON = 2;
break;
}
if (commentON <= 0);
if (quoteON > 0) quoteON = 0;
label109: f2.write(b1);
}
}
ご迷惑をかけるのです。P 私削除するこの質問があります。
解決
近くできdecompilers再構成しオリジナルの書式として彼のコンパイラの解釈のコードです。
書いてますjavaコードを取得しめるバイトコードは、javaコンパイラです。
a decompilerしを作成しようとしjavaコードからのバイトコードです。
以降のコード断片を論理的に同じdecompilerできます。
編集したコメント):
合わせなければならないという、も可能です(こには共通のdecompilerはエラーとなります。
の声明 if(!condition2);
基本的には一切提供condition2はそのbooleanとな擬似コードとします。
このため最初の //other stuff here
うに加工することに関わらず condition2
のdecompiledバージョン。
をしていますのdecompiledコードの動作を確認してください。◆
他のヒント
アンない本体とif文は、(「中括弧無し」)は、単に何のコードを実行しない場合は、空のステートメントである。
これは、同じロジックの別の/正規表現です。逆コンパイラは、コードを保存しません。