Search in sources :

Example 6 with ClassDeclaration

use of sun.tools.java.ClassDeclaration in project jdk8u_jdk by JetBrains.

the class Main method compileAllClasses.

/*
     * Compile all classes that need to be compiled.
     */
public void compileAllClasses(BatchEnvironment env) throws ClassNotFound, IOException, InterruptedException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
    boolean done;
    do {
        done = true;
        for (Enumeration<?> e = env.getClasses(); e.hasMoreElements(); ) {
            ClassDeclaration c = (ClassDeclaration) e.nextElement();
            done = compileClass(c, buf, env);
        }
    } while (!done);
}
Also used : ClassDeclaration(sun.tools.java.ClassDeclaration) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Example 7 with ClassDeclaration

use of sun.tools.java.ClassDeclaration in project jdk8u_jdk by JetBrains.

the class CFCTest method exerciseClassDefinition.

/**
     * Failure is seen when getClassDefinition causes class read
     */
void exerciseClassDefinition() throws Exception {
    BatchEnvironment env = new BatchEnvironment(System.out, BatchEnvironment.createClassPath(testClassPath, null, null), null);
    try {
        ClassDeclaration decl = env.getClassDeclaration(Identifier.lookup(testClassName));
        decl.getClassDefinition(env);
    } finally {
        env.flushErrors();
        env.shutdown();
    }
}
Also used : ClassDeclaration(sun.tools.java.ClassDeclaration) BatchEnvironment(sun.rmi.rmic.BatchEnvironment)

Aggregations

ClassDeclaration (sun.tools.java.ClassDeclaration)7 ClassDefinition (sun.tools.java.ClassDefinition)3 Identifier (sun.tools.java.Identifier)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2 ClassNotFound (sun.tools.java.ClassNotFound)2 Type (sun.tools.java.Type)2 DataOutputStream (java.io.DataOutputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 PrintStream (java.io.PrintStream)1 DigestOutputStream (java.security.DigestOutputStream)1 MessageDigest (java.security.MessageDigest)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 Hashtable (java.util.Hashtable)1 MissingResourceException (java.util.MissingResourceException)1 Vector (java.util.Vector)1 BatchEnvironment (sun.rmi.rmic.BatchEnvironment)1 MemberDefinition (sun.tools.java.MemberDefinition)1