8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8034091
27 * @summary Add LineNumberTable attributes for conditional operator (?:) split across several lines.
28 * @modules jdk.compiler/com.sun.tools.classfile
29 */
30
31 import com.sun.tools.classfile.ClassFile;
32 import com.sun.tools.classfile.ConstantPoolException;
33 import com.sun.tools.classfile.Method;
34 import com.sun.tools.classfile.Attribute;
35 import com.sun.tools.classfile.Code_attribute;
36 import com.sun.tools.classfile.LineNumberTable_attribute;
37 import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
38
39 import java.io.File;
40 import java.io.IOException;
41
42 public class ConditionalLineNumberTest {
43 public static void main(String[] args) throws Exception {
44 // check that we have 5 consecutive entries for method()
45 Entry[] lines = findEntries();
46 if (lines == null || lines.length != 5)
47 throw new Exception("conditional line number table incorrect");
48
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8034091
27 * @summary Add LineNumberTable attributes for conditional operator (?:) split across several lines.
28 * @modules jdk.jdeps/com.sun.tools.classfile
29 */
30
31 import com.sun.tools.classfile.ClassFile;
32 import com.sun.tools.classfile.ConstantPoolException;
33 import com.sun.tools.classfile.Method;
34 import com.sun.tools.classfile.Attribute;
35 import com.sun.tools.classfile.Code_attribute;
36 import com.sun.tools.classfile.LineNumberTable_attribute;
37 import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
38
39 import java.io.File;
40 import java.io.IOException;
41
42 public class ConditionalLineNumberTest {
43 public static void main(String[] args) throws Exception {
44 // check that we have 5 consecutive entries for method()
45 Entry[] lines = findEntries();
46 if (lines == null || lines.length != 5)
47 throw new Exception("conditional line number table incorrect");
48
|