test/hotspot/jtreg/serviceability/sa/LingeredAppWithInvokeDynamic.java
author jgeorge
Fri, 01 Dec 2017 18:19:39 +0530
changeset 48181 61a14b5cb1c6
parent 47216 71c04702a3d5
permissions -rw-r--r--
8191538: SA: tests for clhsdb commands: vmstructsdump, field, symboltable and symbol Summary: Create tests for the clhsdb commands: vmstructsdump, field, symboltable and symbol Reviewed-by: sspitsyn, sballal
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42087
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     1
/*
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     4
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     7
 * published by the Free Software Foundation.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     8
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    13
 * accompanied this code).
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    14
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    18
 *
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    21
 * questions.
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    22
 */
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    23
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    24
import jdk.test.lib.apps.LingeredApp;
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    25
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    26
interface TestComparator {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    27
    public boolean compare(int a1, int a2);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    28
}
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    29
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    30
public class LingeredAppWithInvokeDynamic extends LingeredApp {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    31
    public static void main(String args[]) {
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    32
        Runnable r1 = () -> System.out.println("Hello");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    33
        Runnable r2 = () -> System.out.println("Hello Hello");
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    34
        r1.run();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    35
        r2.run();
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    36
        TestComparator testComparator = (int a1, int a2) -> {return (a1 > a2);};
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    37
        boolean result = testComparator.compare(2, 5);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    38
        System.out.println(result);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    39
        LingeredApp.main(args);
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    40
    }
afd6ae4fec81 8164783: SA: jhsdb clhsdb 'printall' often throws "Corrupted constant pool" assertion failure
vtewari
parents:
diff changeset
    41
 }