diff --git a/nx01-x4o-driver/src/main/java/module-info.java b/nx01-x4o-driver/src/main/java/module-info.java index c49fa7c..ad5752a 100644 --- a/nx01-x4o-driver/src/main/java/module-info.java +++ b/nx01-x4o-driver/src/main/java/module-info.java @@ -31,7 +31,7 @@ /// @version ©Δ∞ 仙上主天 open module ᣕᕁᐤᣳ.ᕽᙾᐤ.ᒄᣗᑊᘁᓫᣗ { // TODO: remove open after qa module, as all test resources only work if open... - // thus local tests that remain, can only use inline xml if module is not open... + // thus local tests that remain, can only use inline xml if module is not open in test or move to META-INF... // TODO: move qa tests own project as we get duplicate resouces from "ONE" module filtered to last one which breaks testing @@ -42,7 +42,7 @@ open module ᣕᕁᐤᣳ.ᕽᙾᐤ.ᒄᣗᑊᘁᓫᣗ { // TEMP for tests only, until split to nx01-x4o-driver-qa module requires java.desktop; - // M2E is correct for now allowing two module-info per project, missing; + // M2E is correct for not allowing two module-info per project, missing; //test-requires java.desktop; //test-requires transitive org.junit.jupiter.engine; //test-requires transitive org.junit.jupiter.api; diff --git a/nx01-x4o-maisdoc/src/main/java/module-info.java b/nx01-x4o-maisdoc/src/main/java/module-info.java index cee3c35..2e4fd56 100644 --- a/nx01-x4o-maisdoc/src/main/java/module-info.java +++ b/nx01-x4o-maisdoc/src/main/java/module-info.java @@ -29,8 +29,7 @@ /// /// @author للَّٰهِilLצسُو /// @version ©Δ∞ 仙上主天 -open module ᣕᕁᐤᣳ.ᕽᙾᐤ.ᔿᣔᑊᔆᒄᐤᒼ { - //note: open for classloader resources(js/css) loading from this module +module ᣕᕁᐤᣳ.ᕽᙾᐤ.ᔿᣔᑊᔆᒄᐤᒼ { requires transitive ᣕᕁᐤᣳ.ᕽᙾᐤ.ᔆᣔᕽᕀᕀᕀ; requires transitive java.logging; diff --git a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/flake/MaisDocGenerator.java b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/flake/MaisDocGenerator.java index 2430048..7551aa6 100644 --- a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/flake/MaisDocGenerator.java +++ b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/flake/MaisDocGenerator.java @@ -566,7 +566,7 @@ public class MaisDocGenerator implements MaisDocContentPrinter { private void writeStyleSheet() throws IOException { try { - copyResourceToFile("org/x4o/maisdoc/theme/base/api-theme.js", basePath, "resources", "api-theme.js"); + copyResourceToFile("META-INF/maisdoc/theme/base/api-theme.js", basePath, "resources", "api-theme.js"); if (doc.getMetaStyleSheet() != null) { copyStreamToFile(new FileInputStream(doc.getMetaStyleSheet()), basePath, "resources", "stylesheet.css"); @@ -574,25 +574,25 @@ public class MaisDocGenerator implements MaisDocContentPrinter { } String thema = doc.getMetaStyleSheetThema(); List cssResources = new ArrayList(10); - cssResources.add("org/x4o/maisdoc/theme/base/api-theme.css"); - cssResources.add("org/x4o/maisdoc/theme/base/api-html.css"); - cssResources.add("org/x4o/maisdoc/theme/base/api-layout.css"); - cssResources.add("org/x4o/maisdoc/theme/base/api-inset.css"); - cssResources.add("org/x4o/maisdoc/theme/base/api-font.css"); - cssResources.add("org/x4o/maisdoc/theme/base/api-color.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-theme.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-html.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-layout.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-inset.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-font.css"); + cssResources.add("META-INF/maisdoc/theme/base/api-color.css"); if ("jdk6".equals(thema)) { - cssResources.add("org/x4o/maisdoc/theme/jdk6/stylesheet.css"); + cssResources.add("META-INF/maisdoc/theme/jdk6/stylesheet.css"); writeStyleSheetResources(cssResources); return; } if ("jdk7".equals(thema)) { - cssResources.add("org/x4o/maisdoc/theme/jdk7/stylesheet.css"); + cssResources.add("META-INF/maisdoc/theme/jdk7/stylesheet.css"); writeStyleSheetResources(cssResources); - copyResourceToFile("org/x4o/maisdoc/theme/jdk7/background.png", basePath, "resources", "background.png"); - copyResourceToFile("org/x4o/maisdoc/theme/jdk7/tab.png", basePath, "resources", "tab.png"); - copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar_end.png", basePath, "resources", "titlebar_end.png"); - copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar.png", basePath, "resources", "titlebar.png"); + copyResourceToFile("META-INF/maisdoc/theme/jdk7/background.png", basePath, "resources", "background.png"); + copyResourceToFile("META-INF/maisdoc/theme/jdk7/tab.png", basePath, "resources", "tab.png"); + copyResourceToFile("META-INF/maisdoc/theme/jdk7/titlebar_end.png", basePath, "resources", "titlebar_end.png"); + copyResourceToFile("META-INF/maisdoc/theme/jdk7/titlebar.png", basePath, "resources", "titlebar.png"); return; } } catch (SecurityException e) { @@ -812,8 +812,8 @@ public class MaisDocGenerator implements MaisDocContentPrinter { writer.printTagStart(Tag.div, MaisDocContentCss.indexContainer); writer.printTagStart(Tag.ul); - boolean printParent = new Boolean(true).equals(doc.getFrameNavPrintParent()); - boolean printParentParent = new Boolean(true).equals(doc.getFrameNavPrintParentParent()); + boolean printParent = Boolean.TRUE.equals(doc.getFrameNavPrintParent()); + boolean printParentParent = Boolean.TRUE.equals(doc.getFrameNavPrintParentParent()); for (MaisDocNode node : nodes) { List nodePath = new ArrayList(10); diff --git a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDoc.java b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDoc.java index a1de511..dbe5acb 100644 --- a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDoc.java +++ b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDoc.java @@ -24,6 +24,7 @@ package org.x4o.maisdoc.model; import java.io.File; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; @@ -150,13 +151,11 @@ public class MaisDoc { setNodeData(new MaisDocNodeData()); try { for (Class annoClass : getAnnotatedClasses()) { - Object bean = annoClass.newInstance(); + Object bean = annoClass.getConstructor().newInstance(); MaisDocNodeWriterBean.addAnnotatedNodeContentWriters(this, bean); MaisDocNodeDataConfiguratorBean.addAnnotatedNodeDataConfigurators(this, bean); } - } catch (InstantiationException e) { - throw new IllegalArgumentException(e); - } catch (IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) { throw new IllegalArgumentException(e); } for (MaisDocConcept concept : getConcepts()) { diff --git a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDocRemoteClass.java b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDocRemoteClass.java index e1db318..5681eb5 100644 --- a/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDocRemoteClass.java +++ b/nx01-x4o-maisdoc/src/main/java/org/x4o/maisdoc/model/MaisDocRemoteClass.java @@ -26,6 +26,9 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.nio.charset.Charset; @@ -124,11 +127,18 @@ public class MaisDocRemoteClass { packageList.clear(); String baseUrl = getDocUrlClean(); baseUrl += REMOTE_FILE; - URL url = new URL(baseUrl); + URL url; + try { + url = new URI(baseUrl).toURL(); + } catch (MalformedURLException | URISyntaxException e) { + throw new IOException(e); + } URLConnection conn = url.openConnection(); conn.setConnectTimeout(2000); conn.setReadTimeout(2000); - parseRemoteFile(conn.getInputStream(), conn.getContentEncoding()); + try (InputStream in = conn.getInputStream()) { + parseRemoteFile(in, conn.getContentEncoding()); + } } /** @@ -143,15 +153,11 @@ public class MaisDocRemoteClass { enc = "UTF-8"; } BufferedReader br = new BufferedReader(new InputStreamReader(in, Charset.forName(enc))); - try { - String line = null; - while ((line = br.readLine()) != null) { - String lineClean = line.trim(); - packageList.add(lineClean); - logger.finer("Adding remote package: '" + lineClean + "'"); - } - } finally { - br.close(); + String line = null; + while ((line = br.readLine()) != null) { + String lineClean = line.trim(); + packageList.add(lineClean); + logger.finer("Adding remote package: '" + lineClean + "'"); } } diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-color.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-color.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-color.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-color.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-font.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-font.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-font.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-font.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-html.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-html.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-html.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-html.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-inset.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-inset.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-inset.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-inset.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-layout.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-layout.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-layout.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-layout.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-theme.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-theme.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-theme.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-theme.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-theme.js b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-theme.js similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/base/api-theme.js rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/base/api-theme.js diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk6/stylesheet.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk6/stylesheet.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk6/stylesheet.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk6/stylesheet.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/background.png b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/background.png similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/background.png rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/background.png diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/stylesheet.css b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/stylesheet.css similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/stylesheet.css rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/stylesheet.css diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/tab.png b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/tab.png similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/tab.png rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/tab.png diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/titlebar.png b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/titlebar.png similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/titlebar.png rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/titlebar.png diff --git a/nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/titlebar_end.png b/nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/titlebar_end.png similarity index 100% rename from nx01-x4o-maisdoc/src/main/resources/org/x4o/maisdoc/theme/jdk7/titlebar_end.png rename to nx01-x4o-maisdoc/src/main/resources/META-INF/maisdoc/theme/jdk7/titlebar_end.png