< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java

Print this page

        

@@ -72,16 +72,22 @@
         this.configuration = configuration;
         this.element = element;
 
         switch (element.getKind()) {
             case MODULE:
-                location = configuration.utils.getLocationForModule((ModuleElement)element);
+                ModuleElement mdle = (ModuleElement)element;
+                location = configuration.utils.getLocationForModule(mdle);
                 source = DocPaths.DOC_FILES;
                 break;
             case PACKAGE:
-                location = configuration.utils.getLocationForPackage((PackageElement)element);
-                source = DocPath.forPackage((PackageElement)element).resolve(DocPaths.DOC_FILES);
+                PackageElement pkg = (PackageElement)element;
+                location = configuration.utils.getLocationForPackage(pkg);
+                // Note, given that we have a module-specific location,
+                // we want a module-relative path for the source, and not the
+                // standard path that may include the module directory
+                source = DocPath.create(pkg.getQualifiedName().toString().replace('.', '/'))
+                        .resolve(DocPaths.DOC_FILES);
                 break;
             default:
                 throw new AssertionError("unsupported element " + element);
         }
     }

@@ -101,14 +107,14 @@
                 continue;
             }
             DocPath path = null;
             switch (this.element.getKind()) {
                 case MODULE:
-                    path = DocPath.forModule((ModuleElement)this.element);
+                    path = DocPaths.forModule((ModuleElement)this.element);
                     break;
                 case PACKAGE:
-                    path = DocPath.forPackage((PackageElement)this.element);
+                    path = configuration.docPaths.forPackage((PackageElement)this.element);
                     break;
                 default:
                     throw new AssertionError("unknown kind:" + this.element.getKind());
             }
             copyDirectory(srcdir, path.resolve(DocPaths.DOC_FILES), first);
< prev index next >