# HG changeset patch # User andrew # Date 1344021800 -3600 # Node ID 45a1817f956b016d5045d10a63572ec4092c9eee # Parent 7450073e2e6f6d77e34bdb38c83fe637ea9f85f1# Parent c4cd4cab2220817c88c8c139c9bfc91c36b48826 Merge jdk8-b50 diff -r 7450073e2e6f -r 45a1817f956b .hgtags --- a/.hgtags Thu Aug 02 17:00:14 2012 +0100 +++ b/.hgtags Fri Aug 03 20:23:20 2012 +0100 @@ -169,3 +169,9 @@ 02c5a3575539e737a1855b31287654e843edd6da jdk8-b42 f8c64d835b2806293b8e924b44f0e32b20657ed3 jdk8-b43 59cbead12ff46dbb397120bd26635bcd7d41ff21 jdk8-b44 +e111e4587ccada8eb93f72e834e378c76256f4b7 jdk8-b45 +4ca5994971724731233735f055f33d4936fd11d3 jdk8-b46 +7e6be2f239c9a4ac6dec280bd18ec296dd78e464 jdk8-b47 +afb0a523155727d42b1c773f783ff3a7cfab8e86 jdk8-b48 +c72c164ced676d3c360d99b1c52cc80940fc3122 jdk8-b49 +b2d8a270f5f2144e14a1fe97fbda9e4391a5332e jdk8-b50 diff -r 7450073e2e6f -r 45a1817f956b make/tools/genstubs/GenStubs.java --- a/make/tools/genstubs/GenStubs.java Thu Aug 02 17:00:14 2012 +0100 +++ b/make/tools/genstubs/GenStubs.java Fri Aug 03 20:23:20 2012 +0100 @@ -201,7 +201,7 @@ */ public void visitTopLevel(JCCompilationUnit tree) { super.visitTopLevel(tree); - tree.docComments = Collections.emptyMap(); + tree.docComments = null; } /** diff -r 7450073e2e6f -r 45a1817f956b src/share/classes/com/sun/tools/javac/comp/Flow.java --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java Thu Aug 02 17:00:14 2012 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri Aug 03 20:23:20 2012 +0100 @@ -746,6 +746,7 @@ pendingExits = prevPendingExits; alive = true; scanStat(tree.finalizer); + tree.finallyCanCompleteNormally = alive; if (!alive) { // discard exits and exceptions from try and finally thrown = chk.union(thrown, thrownPrev); @@ -764,7 +765,6 @@ } alive = aliveEnd; } - tree.finallyCanCompleteNormally = alive; } else { thrown = chk.union(thrown, chk.diff(thrownInTry, caughtInTry)); alive = aliveEnd; diff -r 7450073e2e6f -r 45a1817f956b test/tools/javac/DefiniteAssignment/T7181578.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/DefiniteAssignment/T7181578.java Fri Aug 03 20:23:20 2012 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7181578 + * @summary javac reports uninitialized variable with nested try...finally blocks + * + * @compile T7181578.java + */ +class T7181578 { + String test(boolean cond) { + final String s; + try { + if (cond) { + try { + s = ""; + return s; + } finally { } + } else { + s = ""; + } + return s; // bug occurs here: mapping is always initialized + } finally { } + } +}