jdk/test/com/sun/jdi/RefTypes.java
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 2 90ce3da70b43
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono

/* /nodynamiccopyright/ hard coded linenumbers in other tests - DO NOT CHANGE
 * Debuggee which exercises various reference types
 */

abstract class AllAbstract {
    abstract void a();
    abstract void b();
    abstract void c();
}

class AllNative {
    native void a();
    native void b();
    native void c();
}

abstract class Abstract {
    abstract void a();
    void b() {
        int x = 1;
        int y = 2;
        System.out.println("x + y = " + x + y);
        return;
    }
}

class Native {
    native void a();
    void b() {
        int x = 1;
        int y = 2;
        System.out.println("x + y = " + x + y);
        return;
    }
}

abstract class AbstractAndNative {
    abstract void a();
    native void b();
    void c() {
        int x = 1;
        int y = 2;
        System.out.println("x + y = " + x + y);
        return;
    }
}

interface Interface {
    void a();
    void b();
    void c();
}

interface InterfaceWithCode {
    String foo = new String("foo");
}

public class RefTypes {
    static void loadClasses() throws ClassNotFoundException {
        Class.forName("AllAbstract");
        Class.forName("AllNative");
        Class.forName("Abstract");
        Class.forName("Native");
        Class.forName("AbstractAndNative");
        Class.forName("Interface");
        Class.forName("InterfaceWithCode");
    }

    public static void main(String args[]) throws Exception {
        loadClasses();
    }
}