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.util.*;
26 import javax.tools.*;
27 import com.sun.tools.javap.*;
28
29 /*
30 * @test
31 * @bug 4777949
32 * @summary Warn javap usage on package with simple name
33 * @modules jdk.compiler
34 */
35 public class T4777949 {
36 public static void main(String... args) throws Exception {
37 new T4777949().run();
38 }
39
40 void run() throws Exception {
41 File javaFile = writeTestFile();
42 File classFile = compileTestFile(javaFile);
43
44 test(".", "p.q.r.Test", false);
45 test("p", "q.r.Test", true);
46 test("p/q", "r.Test", true);
47 test("p/q/r", "Test", true);
48 test(".", "p.q.r.Test.Inner", false);
49 test(".", "p.q.r.Test$Inner", false);
50 test("p", "q.r.Test.Inner", true);
51 test("p", "q.r.Test$Inner", true);
52
53 if (errors > 0)
|
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.util.*;
26 import javax.tools.*;
27 import com.sun.tools.javap.*;
28
29 /*
30 * @test
31 * @bug 4777949
32 * @summary Warn javap usage on package with simple name
33 * @modules jdk.jdeps
34 */
35 public class T4777949 {
36 public static void main(String... args) throws Exception {
37 new T4777949().run();
38 }
39
40 void run() throws Exception {
41 File javaFile = writeTestFile();
42 File classFile = compileTestFile(javaFile);
43
44 test(".", "p.q.r.Test", false);
45 test("p", "q.r.Test", true);
46 test("p/q", "r.Test", true);
47 test("p/q/r", "Test", true);
48 test(".", "p.q.r.Test.Inner", false);
49 test(".", "p.q.r.Test$Inner", false);
50 test("p", "q.r.Test.Inner", true);
51 test("p", "q.r.Test$Inner", true);
52
53 if (errors > 0)
|