Community
Participate
Working Groups
U am using eclipse 2.0 build 20011219 on debian linux. I have enabled the warning about unused variables, and there are some instances when eclipse flags some variables as unused in inappropriate cases. Some examples: public static void test () { int i = 17; final int j = 15; switch (i) { case j: i++; } } eclipse flags j as unused variable public static void main(String[] args) { AgathaUI agathaUI = new AgathaUI(); } Here agathaUI is marked as unused. public void ComputeExcitation() { ranking.setAlgorithm(Ranking.ALGORITHM_EXCITATION); double authority; Node best; ranking.compute(dot); ranking.printAuthorities(); best = ranking.getAuthority(0); assertEquals(dot_node, best); ranking.compute(arc); ranking.printAuthorities(); best = ranking.getAuthority(0); assertEquals(arc_node1, best); authority = NodeUtils.getValue(ranking.getAuthority(0), Ranking.AUTHORITY_ATTR); ranking.compute(path); ranking.printAuthorities(); best = ranking.getAuthority(0); assertEquals(path_node2, best); } Here authority is marked as unused.
The first scenario is indeed a bug, the last 2 ones are the same pattern: a variable is assigned but never read from.
Fixed only the first scenario as per previous note.