8034258: Don't use binary testing class files
authorpmuthuswamy
Mon, 20 Nov 2017 20:49:56 -0800
changeset 47869 b29191b9e727
parent 47868 5cc5b8270cad
child 47870 924591048898
8034258: Don't use binary testing class files Reviewed-by: jjg, ksrini
test/langtools/tools/javadoc/sourceOnly/Test.java
test/langtools/tools/javadoc/sourceOnly/p/NonSource.class
test/langtools/tools/javadoc/sourceOnly/p/NonSource.jasm
test/langtools/tools/javadoc/sourceOnly/p/SourceOnly.java
--- a/test/langtools/tools/javadoc/sourceOnly/Test.java	Mon Nov 20 20:33:51 2017 -0800
+++ b/test/langtools/tools/javadoc/sourceOnly/Test.java	Mon Nov 20 20:49:56 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
 
 /*
  * @test
- * @bug 4548768
+ * @bug 4548768 8034258
  * @summary Javadoc in JDK 1.4 uses classpath and not just source dir
  * @author gafter
  * @modules jdk.javadoc
- * @compile p/SourceOnly.java
+ * @compile p/SourceOnly.java p/NonSource.jasm
  * @run main p.SourceOnly
  */
 
Binary file test/langtools/tools/javadoc/sourceOnly/p/NonSource.class has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javadoc/sourceOnly/p/NonSource.jasm	Mon Nov 20 20:49:56 2017 -0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package  p;
+
+super public class NonSource
+        version 46:0
+{
+    public Method "<init>":"()V"
+        stack 1 locals 1
+    {
+                aload_0;
+                invokespecial   Method java/lang/Object."<init>":"()V";
+                return;
+    }
+}
--- a/test/langtools/tools/javadoc/sourceOnly/p/SourceOnly.java	Mon Nov 20 20:33:51 2017 -0800
+++ b/test/langtools/tools/javadoc/sourceOnly/p/SourceOnly.java	Mon Nov 20 20:49:56 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,9 @@
 /** Test that when running javadoc on a package, we only get
  *  documentation for those classes for which source was provided.
  */
-public class SourceOnly extends com.sun.javadoc.Doclet
-{
+public class SourceOnly extends com.sun.javadoc.Doclet {
+    NonSource dependency; // force a compilation error if not on classpath.
+
     public static void main(String[] args) {
         // run javadoc on package p
         int result = com.sun.tools.javadoc.Main.