7068595: html files in class-use dir do not get loaded correctly when Frames link is clicked
Reviewed-by: jjg
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Fri Oct 05 14:13:47 2012 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Fri Oct 05 14:16:32 2012 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -195,10 +195,7 @@
ClassUseWriter clsgen;
String path = DirectoryManager.getDirectoryPath(classdoc.
containingPackage());
- if (path.length() > 0) {
- path += File.separator;
- }
- path += "class-use";
+ path += "class-use" + DirectoryManager.URL_FILE_SEPARATOR;
String filename = classdoc.name() + ".html";
String pkgname = classdoc.containingPackage().name();
pkgname += (pkgname.length() > 0)? ".class-use": "class-use";
--- a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java Fri Oct 05 14:13:47 2012 -0700
+++ b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java Fri Oct 05 14:16:32 2012 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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,7 +23,7 @@
/*
* @test
- * @bug 4496290 4985072 7006178
+ * @bug 4496290 4985072 7006178 7068595
* @summary A simple test to determine if -use works.
* @author jamieh
* @library ../lib/
@@ -34,7 +34,7 @@
public class TestUseOption extends JavadocTester {
- private static final String BUG_ID = "4496290-4985072-7006178";
+ private static final String BUG_ID = "4496290-4985072-7006178-7068595";
//Input for string search tests.
private static final String[] TEST2 = {
@@ -64,6 +64,13 @@
}
};
+ private static final String[][] TEST4 = {
+ {BUG_ID + "-4" + FS + "pkg2" + FS + "class-use" + FS + "C3.html", "<a href=" +
+ "\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">" +
+ "Frames</a></li>"
+ }
+ };
+
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
};
@@ -76,6 +83,10 @@
"-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, "-use", SRC_DIR + FS + "C.java", SRC_DIR + FS + "UsedInC.java"
};
+ private static final String[] ARGS4 = new String[] {
+ "-d", BUG_ID + "-4", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+ };
+
/**
* The entry point of the test.
* @param args the array of command line arguments.
@@ -108,6 +119,7 @@
}
tester.printSummary();
run(tester, ARGS3, TEST3, NO_TEST);
+ run(tester, ARGS4, TEST4, NO_TEST);
tester.printSummary();
}