< prev index next >

langtools/test/tools/sjavac/IncCompInheritance.java

Print this page




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 /*
  25  * @test
  26  * @bug 8056258
  27  * @summary Analysis of public API does not take super classes into account
  28  * @library /tools/lib
  29  * @modules jdk.compiler/com.sun.tools.javac.api
  30  *          jdk.compiler/com.sun.tools.javac.main
  31  *          jdk.jdeps/com.sun.tools.javap
  32  * @build Wrapper toolbox.ToolBox
  33  * @run main Wrapper IncCompInheritance
  34  */
  35 
  36 import java.nio.file.Path;
  37 import java.nio.file.Paths;
  38 
  39 public class IncCompInheritance extends SjavacBase {
  40     public static void main(String... args) throws Exception {
  41 
  42         Path root = Paths.get(IncCompInheritance.class.getSimpleName() + "Test");
  43         Path src = root.resolve("src");
  44         Path classes = root.resolve("classes");
  45 
  46         // Prep source files: A <- B <- C
  47         String a = "package pkga; public class A { public void m() {} }";
  48         String b = "package pkgb; public class B extends pkga.A {}";
  49         String c = "package pkgc; public class C extends pkgb.B {{ new pkgb.B().m(); }}";
  50         toolbox.writeFile(src.resolve("pkga/A.java"), a);
  51         toolbox.writeFile(src.resolve("pkgb/B.java"), b);


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 /*
  25  * @test
  26  * @bug 8056258
  27  * @summary Analysis of public API does not take super classes into account
  28  * @library /tools/lib
  29  * @modules jdk.compiler/com.sun.tools.javac.api
  30  *          jdk.compiler/com.sun.tools.javac.main
  31  *          jdk.compiler/com.sun.tools.sjavac
  32  * @build Wrapper toolbox.ToolBox
  33  * @run main Wrapper IncCompInheritance
  34  */
  35 
  36 import java.nio.file.Path;
  37 import java.nio.file.Paths;
  38 
  39 public class IncCompInheritance extends SjavacBase {
  40     public static void main(String... args) throws Exception {
  41 
  42         Path root = Paths.get(IncCompInheritance.class.getSimpleName() + "Test");
  43         Path src = root.resolve("src");
  44         Path classes = root.resolve("classes");
  45 
  46         // Prep source files: A <- B <- C
  47         String a = "package pkga; public class A { public void m() {} }";
  48         String b = "package pkgb; public class B extends pkga.A {}";
  49         String c = "package pkgc; public class C extends pkgb.B {{ new pkgb.B().m(); }}";
  50         toolbox.writeFile(src.resolve("pkga/A.java"), a);
  51         toolbox.writeFile(src.resolve("pkgb/B.java"), b);
< prev index next >