equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
26 * @bug 7008643 |
26 * @bug 7008643 |
27 * @summary inlined finally clauses confuse debuggers |
27 * @summary inlined finally clauses confuse debuggers |
28 * @library /tools/lib |
28 * @library /tools/lib |
29 * @modules jdk.jdeps/com.sun.tools.classfile |
29 * @modules jdk.jdeps/com.sun.tools.classfile |
30 * jdk.compiler/com.sun.tools.javac.api |
30 * jdk.compiler/com.sun.tools.javac.api |
31 * jdk.compiler/com.sun.tools.javac.file |
|
32 * jdk.compiler/com.sun.tools.javac.main |
31 * jdk.compiler/com.sun.tools.javac.main |
33 * jdk.compiler/com.sun.tools.javac.util |
32 * jdk.compiler/com.sun.tools.javac.util |
34 * jdk.jdeps/com.sun.tools.javap |
33 * jdk.jdeps/com.sun.tools.javap |
35 * @build ToolBox |
34 * @build toolbox.ToolBox toolbox.JavacTask |
36 * @run main InlinedFinallyConfuseDebuggersTest |
35 * @run main InlinedFinallyConfuseDebuggersTest |
37 */ |
36 */ |
38 |
37 |
39 import java.io.File; |
38 import java.io.File; |
40 import java.nio.file.Paths; |
39 import java.nio.file.Paths; |
42 import com.sun.tools.classfile.ClassFile; |
41 import com.sun.tools.classfile.ClassFile; |
43 import com.sun.tools.classfile.Code_attribute; |
42 import com.sun.tools.classfile.Code_attribute; |
44 import com.sun.tools.classfile.LineNumberTable_attribute; |
43 import com.sun.tools.classfile.LineNumberTable_attribute; |
45 import com.sun.tools.classfile.Method; |
44 import com.sun.tools.classfile.Method; |
46 import com.sun.tools.javac.util.Assert; |
45 import com.sun.tools.javac.util.Assert; |
|
46 |
|
47 import toolbox.JavacTask; |
|
48 import toolbox.ToolBox; |
47 |
49 |
48 public class InlinedFinallyConfuseDebuggersTest { |
50 public class InlinedFinallyConfuseDebuggersTest { |
49 |
51 |
50 static final String testSource = |
52 static final String testSource = |
51 /* 01 */ "public class InlinedFinallyTest {\n" + |
53 /* 01 */ "public class InlinedFinallyTest {\n" + |
86 checkClassFile(new File(Paths.get(System.getProperty("user.dir"), |
88 checkClassFile(new File(Paths.get(System.getProperty("user.dir"), |
87 "InlinedFinallyTest.class").toUri()), methodToLookFor); |
89 "InlinedFinallyTest.class").toUri()), methodToLookFor); |
88 } |
90 } |
89 |
91 |
90 void compileTestClass() throws Exception { |
92 void compileTestClass() throws Exception { |
91 tb.new JavacTask() |
93 new JavacTask(tb) |
92 .sources(testSource) |
94 .sources(testSource) |
93 .run(); |
95 .run(); |
94 } |
96 } |
95 |
97 |
96 void checkClassFile(final File cfile, String methodToFind) throws Exception { |
98 void checkClassFile(final File cfile, String methodToFind) throws Exception { |