langtools/test/tools/javac/T6358168.java
changeset 23810 b92eb80925f0
parent 10193 3e1ef5e9f4fd
child 24897 655b72d7b96e
equal deleted inserted replaced
23809:9405883da95f 23810:b92eb80925f0
     1 /*
     1 /*
     2  * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    97                                      "-processorpath", testClasses,
    97                                      "-processorpath", testClasses,
    98                                      "-processor", self,
    98                                      "-processor", self,
    99                                      "-d", "."});
    99                                      "-d", "."});
   100 
   100 
   101         JavaCompiler compiler = JavaCompiler.instance(context);
   101         JavaCompiler compiler = JavaCompiler.instance(context);
   102         compiler.initProcessAnnotations(null);
   102         compiler.compile(List.of(f));
   103         JavaCompiler compiler2 = compiler.processAnnotations(compiler.enterTrees(compiler.parseFiles(List.of(f))));
       
   104         try {
   103         try {
   105             compiler2.compile(List.of(f));
   104             compiler.compile(List.of(f));
   106             throw new Error("Error: AssertionError not thrown after second call of compile");
   105             throw new Error("Error: AssertionError not thrown after second call of compile");
   107         } catch (AssertionError e) {
   106         } catch (AssertionError e) {
   108             System.err.println("Exception from compiler (expected): " + e);
   107             System.err.println("Exception from compiler (expected): " + e);
   109         }
   108         }
   110     }
   109     }