Community
Participate
Working Groups
BETA_JAVA7 List<Integer> m() { HashMap<String, ArrayList<Integer>> field= new HashMap<>(); field.put("hi", new ArrayList<Integer>()); return (ArrayList<Integer>)field.get(0); } ctrl+ 1 on field -> Inline Local Variable shown on field declaration, which is wrong and gives a wrong result. Also in this case: List<Integer> m() { HashMap<String, ArrayList<Integer>> field= new HashMap<>(); return null; } If the local variable is marked unused, ILV is offered as a quick fix and the declaration is removed. Doing this in the refactoring is ok if explicitly invoked, but should not be offered as a quick fix here. Also seen earlier to 1.5, List m() { List list= new ArrayList(); list.add(0); return list; } We should check code at: org.eclipse.jdt.internal.corext.refactoring.code.InlineTempRefactoring.checkAssignments(VariableDeclaration)
This is similar to bug 257714.
*** Bug 402605 has been marked as a duplicate of this bug. ***
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.