Skip to content

Commit 57658d2

Browse files
authored
Merge pull request #26 from MDSD-Tools/improved_osgi
Improved OSGi Support
2 parents 604d7b7 + 05060d5 commit 57658d2

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

jamopp.model/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
</goals>
6767
<configuration>
6868
<instructions>
69+
<Export-Package>tools.mdsd.*</Export-Package>
6970
<Bundle-SymbolicName>${project.groupId}.${project.artifactId};singleton:=true</Bundle-SymbolicName>
7071
</instructions>
7172
</configuration>

jamopp.parser.jdt.singlefile/src/main/java/tools/mdsd/jamopp/parser/jdt/singlefile/JaMoPPJDTSingleFileParser.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import java.util.List;
2828
import java.util.Map;
2929

30-
import org.apache.logging.log4j.Logger;
31-
import org.apache.logging.log4j.LogManager;
30+
//import org.apache.logging.log4j.Logger;
31+
//import org.apache.logging.log4j.LogManager;
3232
import org.eclipse.emf.common.util.URI;
3333
import org.eclipse.emf.ecore.resource.Resource;
3434
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -52,8 +52,8 @@
5252
import tools.mdsd.jamopp.resolution.resolver.CentralReferenceResolver;
5353

5454
public class JaMoPPJDTSingleFileParser implements JaMoPPParserAPI {
55-
private static final Logger logger = LogManager.getLogger("jamopp."
56-
+ JaMoPPJDTSingleFileParser.class.getSimpleName());
55+
// private static final Logger logger = LogManager.getLogger("jamopp."
56+
// + JaMoPPJDTSingleFileParser.class.getSimpleName());
5757
private final String DEFAULT_ENCODING = StandardCharsets.UTF_8.toString();
5858
private ResourceSet resourceSet;
5959
private ArrayList<String> exclusionPatterns = new ArrayList<>();
@@ -113,19 +113,19 @@ public ResourceSet parseDirectory(Path dir) {
113113
encodings[index] = DEFAULT_ENCODING;
114114
}
115115
String[] classpathEntries = findClasspathEntries(dir);
116-
logger.debug("Parsing the directory " + dir.toString() + " with "
117-
+ sources.length + " source files and " + classpathEntries.length
118-
+ " classpath entries.");
116+
// logger.debug("Parsing the directory " + dir.toString() + " with "
117+
// + sources.length + " source files and " + classpathEntries.length
118+
// + " classpath entries.");
119119
this.parseFilesWithJDT(classpathEntries, sources, encodings);
120-
logger.debug("Resolving the parsed files.");
120+
// logger.debug("Resolving the parsed files.");
121121
resolveBindings();
122122
resolveEverything();
123-
logger.debug("Resolved the parsed files.");
123+
// logger.debug("Resolved the parsed files.");
124124
} catch (IOException e) {
125125
}
126126
ResourceSet result = this.resourceSet;
127127
this.resourceSet = null;
128-
logger.debug("Parsed the directory.");
128+
// logger.debug("Parsed the directory.");
129129
return result;
130130
}
131131

@@ -254,7 +254,7 @@ public void resolveBindings() {
254254

255255
private void resolveEverything() {
256256
if (ParserOptions.RESOLVE_EVERYTHING.isTrue()) {
257-
logger.debug("Resolving everything.");
257+
// logger.debug("Resolving everything.");
258258
int oldSize;
259259
do {
260260
oldSize = resourceSet.getResources().size();

jamopp.resource/src/main/java/tools/mdsd/jamopp/resource/JavaResource2.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23-
import org.apache.logging.log4j.Logger;
24-
import org.apache.logging.log4j.LogManager;
23+
//import org.apache.logging.log4j.Logger;
24+
//import org.apache.logging.log4j.LogManager;
2525
import org.eclipse.emf.common.util.URI;
2626
import org.eclipse.emf.ecore.EObject;
2727
import org.eclipse.emf.ecore.EReference;
@@ -49,7 +49,7 @@
4949

5050
public class JavaResource2 extends XMIResourceImpl {
5151
public static final String JAVAXMI_FILE_EXTENSION = LogicalJavaURIGenerator.JAVAXMI_FILE_EXTENSION_NAME;
52-
private static final Logger LOGGER = LogManager.getLogger("jamopp." + JavaResource2.class.getSimpleName());
52+
// private static final Logger LOGGER = LogManager.getLogger("jamopp." + JavaResource2.class.getSimpleName());
5353
private Map<String, IJavaContextDependentURIFragment> internalURIFragmentMap =
5454
IJavaContextDependentURIFragmentCollector.GLOBAL_INSTANCE
5555
.getContextDependentURIFragmentMap();
@@ -77,10 +77,10 @@ public void doLoad(InputStream input, Map<?, ?> options) throws IOException {
7777
physicalURI = JavaClasspath.get(this).getURIMap().get(this.getURI());
7878
}
7979
if (physicalURI == null) {
80-
LOGGER.error(this.getURI() + " has no physical URI.");
80+
// LOGGER.error(this.getURI() + " has no physical URI.");
8181
throw new IllegalStateException("There has to be a physical URI.");
8282
}
83-
LOGGER.debug("Loading " + physicalURI);
83+
// LOGGER.debug("Loading " + physicalURI);
8484
String extension = physicalURI.fileExtension();
8585
if (extension.equals("class")) {
8686
try {

0 commit comments

Comments
 (0)