< prev index next >

langtools/test/tools/javap/typeAnnotations/Presence.java

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.*;
  25 import java.lang.annotation.ElementType;
  26 
  27 import com.sun.tools.classfile.*;
  28 
  29 /*
  30  * @test Presence
  31  * @bug 6843077
  32  * @summary test that all type annotations are present in the classfile
  33  * @modules jdk.compiler/com.sun.tools.classfile
  34  */
  35 
  36 public class Presence {
  37     public static void main(String[] args) throws Exception {
  38         new Presence().run();
  39     }
  40 
  41     public void run() throws Exception {
  42         File javaFile = writeTestFile();
  43         File classFile = compileTestFile(javaFile);
  44 
  45         ClassFile cf = ClassFile.read(classFile);
  46         test(cf);
  47         for (Field f : cf.fields) {
  48             test(cf, f);
  49         }
  50         for (Method m: cf.methods) {
  51             test(cf, m);
  52         }
  53 




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.*;
  25 import java.lang.annotation.ElementType;
  26 
  27 import com.sun.tools.classfile.*;
  28 
  29 /*
  30  * @test Presence
  31  * @bug 6843077
  32  * @summary test that all type annotations are present in the classfile
  33  * @modules jdk.jdeps/com.sun.tools.classfile
  34  */
  35 
  36 public class Presence {
  37     public static void main(String[] args) throws Exception {
  38         new Presence().run();
  39     }
  40 
  41     public void run() throws Exception {
  42         File javaFile = writeTestFile();
  43         File classFile = compileTestFile(javaFile);
  44 
  45         ClassFile cf = ClassFile.read(classFile);
  46         test(cf);
  47         for (Field f : cf.fields) {
  48             test(cf, f);
  49         }
  50         for (Method m: cf.methods) {
  51             test(cf, m);
  52         }
  53 


< prev index next >