test/tools/javac/jvm/T8020689.java

Thu, 19 Dec 2013 11:38:45 -0500

author
emc
date
Thu, 19 Dec 2013 11:38:45 -0500
changeset 2414
17ce329d7bd0
parent 0
959103a6100f
permissions
-rw-r--r--

8030726: tools/javac/NoStringToLower.java fails due to enforcement no use of String.toLowerCase on non-langtools classes
Summary: Fix NoStringToLower test to only enforce ban on String.toLowerCase on langtools classes
Reviewed-by: vromero, jfranck
Contributed-by: paul.govereau@oracle.com

     1 /*
     2  * @test  /nodynamiccopyright/
     3  * @bug 8020689
     4  * @summary Making sure the LineNumberTable entry is correctly generated for the leading method invocation in the else section
     5  * @compile T8020689.java
     6  * @run main T8020689
     7  */
     9 public class T8020689 {
    11     public static void main(String... args) {
    12         if (args.length > 0) {
    13             a();
    14         } else {
    15             b();
    16         }
    17     }
    19     static void a() {
    20     }
    22     static void b() {
    23         assertLine(15);
    24     }
    26     public static void assertLine(int expectedline) {
    27         Exception e = new Exception("expected line#: " + expectedline);
    28         int myline = e.getStackTrace()[2].getLineNumber();
    29         if( myline != expectedline) {
    30             throw new RuntimeException("Incorrect line number " +
    31                     "expected: " + expectedline +
    32                     ", got: " + myline, e);
    33         }
    34         System.out.format("Got expected line number %d correct %n", myline);
    35     }
    36 }

mercurial