jdk/test/vm/verifier/TestStaticIF.java
author duke
Wed, 05 Jul 2017 23:26:05 +0200
changeset 45078 8344afa5ea9e
parent 16718 f53963145c0a
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15998
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     1
/*
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     4
 *
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     7
 * published by the Free Software Foundation.
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     8
 *
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    13
 * accompanied this code).
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    14
 *
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    18
 *
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    21
 * questions.
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    22
 *
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    23
 */
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    24
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    25
/*
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    26
 * @test
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    27
 * @bug 8007736
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    28
 * @summary Test static interface method.
16718
f53963145c0a 8010846: Update the corresponding test in test/vm/verifier/TestStaticIF.java
acorn
parents: 15998
diff changeset
    29
 * @run main/othervm -Xverify:all TestStaticIF
15998
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    30
 */
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    31
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    32
public class TestStaticIF implements StaticMethodInInterface {
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    33
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    34
    public static void main(String[] args) {
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    35
        System.out.printf("main: %s%n", StaticMethodInInterface.get());
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    36
    }
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    37
}
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    38
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    39
interface StaticMethodInInterface {
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    40
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    41
    public static String get() {
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    42
        return "Hello from StaticMethodInInterface.get()";
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    43
    }
07d54dcb3a56 8007736: VerifyError for use of static method in interface
bharadwaj
parents:
diff changeset
    44
}