Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions bundles/tools.vitruv.domains.java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.xtend.lib,
edu.kit.ipd.sdq.activextendannotations,
tools.vitruv.framework.domains;visibility:=reexport,
org.emftext.language.java;visibility:=reexport,
org.emftext.language.java.resource,
org.emftext.language.java.resource.java,
org.apache.log4j,
org.eclipse.emf.ecore.xmi,
org.eclipse.core.runtime
org.eclipse.core.runtime,
org.emftext.language.java;bundle-version="5.1.0",
jamopp.resource;bundle-version="5.1.0"
Export-Package: tools.vitruv.domains.java,
tools.vitruv.domains.java.tuid;x-internal:=true,
tools.vitruv.domains.java.util,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package tools.vitruv.domains.java

import static tools.vitruv.domains.java.JavaNamespace.*
import org.eclipse.emf.ecore.resource.Resource
import org.emftext.language.java.resource.JavaSourceOrClassFileResourceFactoryImpl
import java.util.Map
import org.emftext.language.java.resource.java.IJavaOptions
import jamopp.resource.JavaResource2Factory
import java.util.List
import tools.vitruv.framework.domains.AbstractVitruvDomain
import org.emftext.language.java.JavaClasspath
import jamopp.resource.JavaResource2

class JavaDomain extends AbstractVitruvDomain {
static final String METAMODEL_NAME = "Java"
Expand All @@ -17,12 +17,14 @@ class JavaDomain extends AbstractVitruvDomain {
}

protected new(String name) {
super(name, ROOT_PACKAGE, List.of(FILE_EXTENSION))
super(name, ROOT_PACKAGE, List.of(FILE_EXTENSION, JavaResource2.JAVAXMI_FILE_EXTENSION))
// Register factory for class and Java files in case of not running as plugin
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("java", new JavaSourceOrClassFileResourceFactoryImpl())
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("class", new JavaSourceOrClassFileResourceFactoryImpl())
// This is necessary to resolve classes from standard library (e.g. Object, List etc.)
JamoppLibraryHelper.registerStdLib
val factory = new JavaResource2Factory
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(FILE_EXTENSION, factory)
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("class", factory)
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
JavaResource2.JAVAXMI_FILE_EXTENSION, factory)
JavaClasspath.get.registerStdLib
}

override shouldTransitivelyPropagateChanges() {
Expand All @@ -36,20 +38,4 @@ class JavaDomain extends AbstractVitruvDomain {
def enableTransitiveChangePropagation() {
shouldTransitivelyPropagateChanges = true
}

override getDefaultLoadOptions() {
Map.of(
/**
* FIXME Layout information currently breaks Vitruv: Because it is created dynamically
* when a resource is loaded into a view, there are no create changes for layout information.
* Hence, layout information has not UUIDs, and even if it had, it could not be resolved
* correctly in the VSUM. Eventually, layout information should be recorded by Vitruv
* just like all other model elements. To get there, we should have a mechanism that
* creates the correct changes for layout information as well, preferably directly
* when the corresponding model objects are created. For the time being, we disable
* layout information
*/
IJavaOptions.DISABLE_LAYOUT_INFORMATION_RECORDING, true
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class JamoppStringOperations {

static def dispatch String getStringRepresentation(Method javaMethod) {
val javaIdentifier = new StringBuilder();
javaIdentifier.append(javaMethod.typeReference.getStringRepresentation(javaMethod.arrayDimension))
javaIdentifier.append(javaMethod.typeReference.getStringRepresentation(javaMethod.typeReference.arrayDimension))
javaIdentifier.append(javaMethod.name)
javaMethod.parameters.forEach[
javaIdentifier.append(typeReference.getStringRepresentation(arrayDimension))]
javaIdentifier.append(typeReference.getStringRepresentation(typeReference.arrayDimension))]
return javaIdentifier.toString
}

Expand All @@ -71,11 +71,11 @@ class JamoppStringOperations {
}

static def dispatch String getStringRepresentation(OrdinaryParameter param) {
return param.typeReference.target.getStringRepresentation(param.arrayDimension)
return param.typeReference.target.getStringRepresentation(param.typeReference.arrayDimension)
}

static def dispatch String getStringRepresentation(VariableLengthParameter param) {
return param.typeReference.target.getStringRepresentation(param.arrayDimension) + "..."
return param.typeReference.target.getStringRepresentation(param.typeReference.arrayDimension) + "..."
}

static def String getNamespaceAsString(Iterable<String> namespaces) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class JavaModificationUtil {
def static ConcreteClassifier getClassifier(String qualifiedName) {
// To resolve classifiers from the Java standard library, this requires the Java standard library to be
// registered (JavaClasspath.get().registerStdLib). Should be done by the domain by default.
JavaClasspath.get().getClassifier(qualifiedName) as ConcreteClassifier
JavaClasspath.get().getConcreteClassifier(qualifiedName)
}

def static addAnnotationToAnnotableAndModifiable(AnnotableAndModifiable annotableAndModifiable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.emftext.language.java.JavaPackage;
import org.emftext.language.java.resource.JavaSourceOrClassFileResourceFactoryImpl;
import org.emftext.language.java.resource.java.IJavaOptions;

import jamopp.resource.JavaResource2Factory;

/**
* Registers the {@link JavaSourceOrClassFileResourceFactoryImpl} to load JaMoPP resources from
* Registers the {@link JavaResource2Factory} to load JaMoPP resources from
* .java files or java content-type InputStreams.
*/
public class Jamopp {
Expand All @@ -47,12 +47,11 @@ public ResourceSet getResourceSet() {
}

protected void setUp() {
this.rs.getLoadOptions().put(IJavaOptions.DISABLE_LOCATION_MAP, Boolean.TRUE);
EPackage.Registry.INSTANCE.put("http://www.emftext.org/java", JavaPackage.eINSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("java",
new JavaSourceOrClassFileResourceFactoryImpl());
new JavaResource2Factory());
Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap().put("java",
new JavaSourceOrClassFileResourceFactoryImpl());
new JavaResource2Factory());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
}
Expand Down
2 changes: 0 additions & 2 deletions features/tools.vitruv.domains.java.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<import plugin="edu.kit.ipd.sdq.activextendannotations"/>
<import plugin="tools.vitruv.framework.domains"/>
<import plugin="org.emftext.language.java"/>
<import plugin="org.emftext.language.java.resource"/>
<import plugin="org.emftext.language.java.resource.java"/>
<import plugin="org.apache.log4j"/>
<import plugin="org.eclipse.emf.ecore.xmi"/>
<import plugin="org.eclipse.core.runtime"/>
Expand Down
4 changes: 2 additions & 2 deletions releng/tools.vitruv.domains.cbs.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<url>http://update.emftext.org/release</url>
</repository>-->
<repository>
<id>EMFText and JaMoPP (P2 Wrapper)</id>
<id> Palladio Supporting Eclipse Java Development Tools Core</id>
<layout>p2</layout>
<url>https://kit-sdq.github.io/updatesite/release/p2-wrapper/</url>
<url>https://updatesite.palladio-simulator.com/palladio-supporting-eclipsejavadevelopmenttools/nightly/</url>
</repository>
<repository>
<id>Palladiosimulator</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
<features name="de.uka.ipd.sdq.identifier.feature.feature.group" versionRange="2.1.0"/>
<features name="org.palladiosimulator.pcm.feature.feature.group" versionRange="4.3.0"/>
</repositories>
<repositories location="https://kit-sdq.github.io/updatesite/release/p2-wrapper" mirrorArtifacts="false">
<features name="org.emftext.language.java.feature.group" versionRange="1.4.1"/>
<features name="org.emftext.language.java.jdt.feature.group" versionRange="1.4.1"/>
<features name="org.emftext.language.java.ui.feature.group" versionRange="1.4.1"/>
<features name="org.emftext.commons.antlr3_4_0.feature.group" versionRange="3.4.0"/>
<features name="org.emftext.commons.jdt.feature.group" versionRange="1.4.1"/>
<features name="org.emftext.commons.layout.feature.group" versionRange="1.4.1"/>
</repositories>
<repositories location="https://updatesite.palladio-simulator.com/palladio-supporting-eclipsejavadevelopmenttools/nightly/" mirrorArtifacts="false">
<features name="org.emftext.language.java.feature.feature.group" versionRange="5.1.0"/>
<features name="org.emftext.language.java" versionRange="5.1.0"/>
</repositories>
<repositories location="https://kit-sdq.github.io/updatesite/release/commons/2.0.0" mirrorArtifacts="false">
<features name="edu.kit.ipd.sdq.commons.util.pcm.feature.feature.group"/>
</repositories>
Expand Down