From 7c94d2129068a54ff1bb78acc6e6295bc4b8152f Mon Sep 17 00:00:00 2001 From: Martin Armbruster Date: Sat, 12 Aug 2023 21:20:14 +0200 Subject: [PATCH 1/2] All packages of the model are exported. --- jamopp.model/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/jamopp.model/pom.xml b/jamopp.model/pom.xml index 0544efd8..be426b54 100644 --- a/jamopp.model/pom.xml +++ b/jamopp.model/pom.xml @@ -66,6 +66,7 @@ + tools.mdsd.* ${project.groupId}.${project.artifactId};singleton:=true From 05060d595ff610e471f6ea2110b1f54284f376f3 Mon Sep 17 00:00:00 2001 From: Martin Armbruster Date: Fri, 1 Sep 2023 15:36:13 +0200 Subject: [PATCH 2/2] Temporarily deactivated the logging (except the tests). --- .../singlefile/JaMoPPJDTSingleFileParser.java | 22 +++++++++---------- .../mdsd/jamopp/resource/JavaResource2.java | 10 ++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/jamopp.parser.jdt.singlefile/src/main/java/tools/mdsd/jamopp/parser/jdt/singlefile/JaMoPPJDTSingleFileParser.java b/jamopp.parser.jdt.singlefile/src/main/java/tools/mdsd/jamopp/parser/jdt/singlefile/JaMoPPJDTSingleFileParser.java index c9f890d1..9303f548 100644 --- a/jamopp.parser.jdt.singlefile/src/main/java/tools/mdsd/jamopp/parser/jdt/singlefile/JaMoPPJDTSingleFileParser.java +++ b/jamopp.parser.jdt.singlefile/src/main/java/tools/mdsd/jamopp/parser/jdt/singlefile/JaMoPPJDTSingleFileParser.java @@ -27,8 +27,8 @@ import java.util.List; import java.util.Map; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; +//import org.apache.logging.log4j.Logger; +//import org.apache.logging.log4j.LogManager; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; @@ -52,8 +52,8 @@ import tools.mdsd.jamopp.resolution.resolver.CentralReferenceResolver; public class JaMoPPJDTSingleFileParser implements JaMoPPParserAPI { - private static final Logger logger = LogManager.getLogger("jamopp." - + JaMoPPJDTSingleFileParser.class.getSimpleName()); +// private static final Logger logger = LogManager.getLogger("jamopp." +// + JaMoPPJDTSingleFileParser.class.getSimpleName()); private final String DEFAULT_ENCODING = StandardCharsets.UTF_8.toString(); private ResourceSet resourceSet; private ArrayList exclusionPatterns = new ArrayList<>(); @@ -113,19 +113,19 @@ public ResourceSet parseDirectory(Path dir) { encodings[index] = DEFAULT_ENCODING; } String[] classpathEntries = findClasspathEntries(dir); - logger.debug("Parsing the directory " + dir.toString() + " with " - + sources.length + " source files and " + classpathEntries.length - + " classpath entries."); +// logger.debug("Parsing the directory " + dir.toString() + " with " +// + sources.length + " source files and " + classpathEntries.length +// + " classpath entries."); this.parseFilesWithJDT(classpathEntries, sources, encodings); - logger.debug("Resolving the parsed files."); +// logger.debug("Resolving the parsed files."); resolveBindings(); resolveEverything(); - logger.debug("Resolved the parsed files."); +// logger.debug("Resolved the parsed files."); } catch (IOException e) { } ResourceSet result = this.resourceSet; this.resourceSet = null; - logger.debug("Parsed the directory."); +// logger.debug("Parsed the directory."); return result; } @@ -254,7 +254,7 @@ public void resolveBindings() { private void resolveEverything() { if (ParserOptions.RESOLVE_EVERYTHING.isTrue()) { - logger.debug("Resolving everything."); +// logger.debug("Resolving everything."); int oldSize; do { oldSize = resourceSet.getResources().size(); diff --git a/jamopp.resource/src/main/java/tools/mdsd/jamopp/resource/JavaResource2.java b/jamopp.resource/src/main/java/tools/mdsd/jamopp/resource/JavaResource2.java index 3915aba7..41bd8ecb 100644 --- a/jamopp.resource/src/main/java/tools/mdsd/jamopp/resource/JavaResource2.java +++ b/jamopp.resource/src/main/java/tools/mdsd/jamopp/resource/JavaResource2.java @@ -20,8 +20,8 @@ import java.util.List; import java.util.Map; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; +//import org.apache.logging.log4j.Logger; +//import org.apache.logging.log4j.LogManager; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; @@ -49,7 +49,7 @@ public class JavaResource2 extends XMIResourceImpl { public static final String JAVAXMI_FILE_EXTENSION = LogicalJavaURIGenerator.JAVAXMI_FILE_EXTENSION_NAME; - private static final Logger LOGGER = LogManager.getLogger("jamopp." + JavaResource2.class.getSimpleName()); +// private static final Logger LOGGER = LogManager.getLogger("jamopp." + JavaResource2.class.getSimpleName()); private Map internalURIFragmentMap = IJavaContextDependentURIFragmentCollector.GLOBAL_INSTANCE .getContextDependentURIFragmentMap(); @@ -77,10 +77,10 @@ public void doLoad(InputStream input, Map options) throws IOException { physicalURI = JavaClasspath.get(this).getURIMap().get(this.getURI()); } if (physicalURI == null) { - LOGGER.error(this.getURI() + " has no physical URI."); +// LOGGER.error(this.getURI() + " has no physical URI."); throw new IllegalStateException("There has to be a physical URI."); } - LOGGER.debug("Loading " + physicalURI); +// LOGGER.debug("Loading " + physicalURI); String extension = physicalURI.fileExtension(); if (extension.equals("class")) { try {