Community
Participate
Working Groups
This program incorrectly flags the second clause in "doit1" as dead. Run the program to see that it is not. "doit2" is a slightly rewritten version of the same function which is not flagged. package test; public class ReadStock { int actualVotes; public ReadStock(int w) { actualVotes = w; } static public void doit1(ReadStock players[]) { ReadStock winner = null; ReadStock tie = null; for(ReadStock p : players) { if((winner==null)||(p.actualVotes>=winner.actualVotes)) { tie = winner; winner = p; } } if((tie!=null) && (winner!=null) && (tie.actualVotes==winner.actualVotes)) { //incorrectly flagged as dead System.out.println("It's a tie 1"); } } static public void doit2(ReadStock players[]) { ReadStock winner = null; ReadStock tie = null; for(ReadStock p : players) { { if(winner==null) { winner = p; } else if(p.actualVotes>=winner.actualVotes) { tie = winner; winner = p; } } } if((tie!=null) && (winner!=null) && (tie.actualVotes==winner.actualVotes)) { System.out.println("Its a tie 2"); } } public static void main(String args[]) { ReadStock players[] = { new ReadStock(1),new ReadStock(1)}; doit1(players); doit2(players); } }
This example is accepted by ecj <= 3.6.2 and rejected above.
I'll check for RC2 if there's a safe fix, but will more likely move over to 4.6 ... ... even though at 3.7 it was a regression ...
Moving to 4.6.
Too much on my plate for 4.6. Bulk deferral to 4.7
bulk move out of 4.8
Bulk move out of 4.9
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.