像保羅一樣博丁頓在註釋中說的選項,這是實際上JetBrains忘了在他們的算法中實現的東西,那一直是fixed a few days ago。
前:
if (opSign == LT && comparedWith <= rangeMin) return alwaysFalse(instruction, runner, memState);
if (opSign == LT && comparedWith > rangeMax) return alwaysTrue(instruction, runner, memState);
if (opSign == LE && comparedWith >= rangeMax) return alwaysTrue(instruction, runner, memState);
if (opSign == GT && comparedWith >= rangeMax) return alwaysFalse(instruction, runner, memState);
if (opSign == GT && comparedWith < rangeMin) return alwaysTrue(instruction, runner, memState);
if (opSign == GE && comparedWith <= rangeMin) return alwaysTrue(instruction, runner, memState);
後:
if (opSign == LT && comparedWith <= rangeMin) return alwaysFalse(instruction, runner, memState);
if (opSign == LT && comparedWith > rangeMax) return alwaysTrue(instruction, runner, memState);
if (opSign == LE && comparedWith >= rangeMax) return alwaysTrue(instruction, runner, memState);
if (opSign == LE && comparedWith < rangeMin) return alwaysFalse(instruction, runner, memState);
if (opSign == GT && comparedWith >= rangeMax) return alwaysFalse(instruction, runner, memState);
if (opSign == GT && comparedWith < rangeMin) return alwaysTrue(instruction, runner, memState);
if (opSign == GE && comparedWith <= rangeMin) return alwaysTrue(instruction, runner, memState);
if (opSign == GE && comparedWith > rangeMax) return alwaysFalse(instruction, runner, memState);
通訊問題:https://youtrack.jetbrains.com/issue/IDEA-146950
好像在的IntelliJ不是Java問題執行情況的故障。我會建議報告給JetBrains。 –
我不認爲有什麼深層原因。它只是一個錯誤,但這是一個很奇怪的錯誤。如果我做'int i = 5;如果(我<= 2)'我沒有收到警告。 –
也許https://youtrack.jetbrains.com/issue/IDEA-146950 – 2015-11-04 16:48:03