Community
Participate
Working Groups
I extracted a long method from a long code sequence in a finally block. The extracted seems to be correct and will be called at its original place, but after the method call a return statement was inserted. In my case the return statement did not cause a logical error, but it is superflous and I do not want to have it. best regards Thorsten van Ellen
Do you have a code example where this is reproducable?
Thorsten, do you have some test cases for this ?
Sorry for my idleness. Here is some reduced code: public class TestReducedEclipseBug { public static void main(String[] args) { try { System.out.println("bla1"); } finally { System.out.println("bla2"); return; } } } I know the return is already superfluous, but without it there is no problem! The problem is not too serious as far as I can see. If I extract a method from the contents of the finally block, i get this: public class TestReducedEclipseBug { public static void main(String[] args) { try { System.out.println("bla1"); } finally { x(); return; } } private static void x() { System.out.println("bla2"); return; } } Know I got two superfluous return statements. best regards Thorsten van Ellen
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.
Still a problem in 4.12 M1. It should not add a return in the finally block.
New Gerrit change created: https://git.eclipse.org/r/147464
Gerrit change https://git.eclipse.org/r/147464 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=c454e6f6fee57584c2dbb456a959b73c7f965bac
Verified for 4.14 M1 using I20191009-0600 build.