Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d05f71d
Deprecate clunky order-based approach to load metamodel files for mod…
tsaglam Mar 1, 2026
354c7c0
Remove submission sorting for languages that expect submission order.
tsaglam Mar 1, 2026
af07ee7
Implement language-specific option for specifying the metamodel requi…
tsaglam Mar 1, 2026
cf98914
Remove metamodel parsing from the dynamic model parser. If a submissi…
tsaglam Mar 1, 2026
f5cd8d6
Clean up minor issues.
tsaglam Mar 1, 2026
5719029
Improve emf-model language interface and metamodel path option.
tsaglam Mar 2, 2026
7dde785
Fix deprecation annotation in the language interface.
tsaglam Mar 2, 2026
7ffea64
Throw parsing exception when model instances are parsed without provi…
tsaglam Mar 2, 2026
4e5ea21
Add unit tests for the EMF language-specific option.
tsaglam Mar 23, 2026
03ab7f9
Separate EMF model language classes from the dynamic EMF language mod…
tsaglam Apr 12, 2026
a0b7e35
Deprecate dynamic EMF language module but keep maven module stub.
tsaglam Apr 12, 2026
50dad7c
Update the readme of the EMF model language module.
tsaglam Apr 12, 2026
5684411
Add deprecation message to the dynamic EMF module stub pom file.
tsaglam Apr 12, 2026
25f2b6c
Remove EMF dynamic maven dependencies from the internal project struc…
tsaglam Apr 12, 2026
88384ec
Fix view file clean-up in the the EMF model test.
tsaglam Apr 12, 2026
9f87e71
Re-add minimal dependencies to allow CI checks to pass.
tsaglam Apr 12, 2026
d8e99fa
Spotless/checkstyle style fixes and minor improvements.
tsaglam Apr 12, 2026
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
8 changes: 1 addition & 7 deletions core/src/main/java/de/jplag/SubmissionSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,7 @@ private void parseSubmissions(List<Submission> submissions) throws ExitException

ProgressBar progressBar = ProgressBarLogger.createProgressBar(ProgressBarType.PARSING, submissions.size());

if (options.language().expectsSubmissionOrder()) {
for (Submission submission : submissions) {
parseSingleSubmission(progressBar, submission);
}
} else {
parseSubmissionsInParallel(submissions, progressBar);
}
parseSubmissionsInParallel(submissions, progressBar);

progressBar.dispose();

Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/de/jplag/SubmissionSetBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ public SubmissionSet buildSubmissionSet() throws ExitException {
// Merge everything in a submission set.
List<Submission> submissions = new ArrayList<>(foundSubmissions.values());

// Some languages expect a certain order, which is ensured here:
if (options.language().expectsSubmissionOrder()) {
List<File> rootFiles = foundSubmissions.values().stream().map(Submission::getRoot).toList();
rootFiles = options.language().customizeSubmissionOrder(rootFiles);
submissions = new ArrayList<>(rootFiles.stream().map(foundSubmissions::get).toList());
}
return new SubmissionSet(submissions, baseCodeSubmission.orElse(null), options);
}

Expand Down
1 change: 1 addition & 0 deletions coverage-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<artifactId>emf-metamodel</artifactId>
</dependency>
<dependency>
<!-- deprecated dependency (only included to not break CI checks) -->
<groupId>de.jplag</groupId>
<artifactId>emf-metamodel-dynamic</artifactId>
</dependency>
Expand Down
4 changes: 4 additions & 0 deletions language-api/src/main/java/de/jplag/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@
/**
* Specifies if the submission order is relevant for this language.
* @return defaults to false.
* @deprecated No longer used (replaced by language option) and will be removed.
*/
@Deprecated(since = "7.0.0", forRemoval = true)
default boolean expectsSubmissionOrder() {

Check warning on line 123 in language-api/src/main/java/de/jplag/Language.java

View check run for this annotation

SonarQubeCloud / [JPlag Plagiarism Detector] SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=jplag_JPlag&issues=AZ2B3F4SB1HMB1XNp98U&open=AZ2B3F4SB1HMB1XNp98U&pullRequest=2845
return false;
}

Expand All @@ -126,8 +128,10 @@
* Reorders the provided submission according the requirements of the language.
* @param submissions is the list of submissions.
* @return the reordered list.
* @deprecated No longer used (replaced by language option) and will be removed.
*/
@Deprecated(since = "7.0.0", forRemoval = true)
default List<File> customizeSubmissionOrder(List<File> submissions) {

Check warning on line 134 in language-api/src/main/java/de/jplag/Language.java

View check run for this annotation

SonarQubeCloud / [JPlag Plagiarism Detector] SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=jplag_JPlag&issues=AZ2B3F4SB1HMB1XNp98V&open=AZ2B3F4SB1HMB1XNp98V&pullRequest=2845
return submissions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ protected <T> LanguageOption<T> createOption(OptionType<T> type, String name) {
return createOption(type, name, "");
}

/**
* Adds an option to the list of language options.
* @param option is the language option to add.
*/
protected void addOption(LanguageOption<?> option) {
options.add(option);
}

/**
* @return The list of all options.
*/
Expand Down
22 changes: 0 additions & 22 deletions languages/emf-metamodel-dynamic/README.md

This file was deleted.

1 change: 1 addition & 0 deletions languages/emf-metamodel-dynamic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</parent>
<artifactId>emf-metamodel-dynamic</artifactId>
<name>JPlag: EMF Metamodel (Dynamic) Language Module</name>
<description>DEPRECATED: This module has been removed as of v7.0.0.</description>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
import de.jplag.ParsingException;
import de.jplag.Token;
import de.jplag.emf.EmfLanguage;
import de.jplag.emf.dynamic.parser.DynamicEcoreParser;

/**
* Language for EMF metamodels from the Eclipse Modeling Framework (EMF). This language is based on a dynamically
* created token set instead of a hand-picked one.
* @author Timur Saglam
* @deprecated this language module was never available in JPlag as it was prototypical. It is now deprecated and should
* not be used, as it is non-functional and only serves as deprecation placeholder.
*/
@Deprecated(since = "7.0.0", forRemoval = true)
public class DynamicEmfLanguage extends EmfLanguage { // currently not included in the CLI

Check warning on line 19 in languages/emf-metamodel-dynamic/src/main/java/de/jplag/emf/dynamic/DynamicEmfLanguage.java

View check run for this annotation

SonarQubeCloud / [JPlag Plagiarism Detector] SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=jplag_JPlag&issues=AZ2B3F05B1HMB1XNp98T&open=AZ2B3F05B1HMB1XNp98T&pullRequest=2845

@Override
public String getName() {
Expand All @@ -26,13 +28,8 @@
return "emf-dynamic";
}

@Override
public int minimumTokenMatch() {
return 10;
}

@Override
public List<Token> parse(Set<File> files, boolean normalize) throws ParsingException {
return new DynamicEcoreParser().parse(files, normalize);
throw new UnsupportedOperationException("Language module is deprecated and no longer supported!");
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ModelingElementIdentifierManager() {
* @return the identifier, that is unique for all elements of the same EClass.
*/
public int getIdentifier(EObject element) {
Set<EObject> elements = elementToIdentifer.computeIfAbsent(element.eClass(), key -> new LinkedHashSet<>());
Set<EObject> elements = elementToIdentifer.computeIfAbsent(element.eClass(), _ -> new LinkedHashSet<>());
int index = 0;
for (EObject containedElement : elements) {
if (containedElement.equals(element)) {
Expand Down
11 changes: 8 additions & 3 deletions languages/emf-model/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dynamic EMF model language module
The dynamic EMF model language module allows the use of JPlag with model submissions.
The EMF model language module allows the use of JPlag with EMF based modeling file submissions.
It is based on the EMF API.

### EMF specification compatibility
Expand All @@ -10,8 +10,13 @@ For the token extraction, we visit the containment tree of the model and extract

### Usage
The input for this is an EMF metamodel and a set of corresponding instances.
To ensure only the intended files are parsed, you can use `-p` to specify allowed file types: `-p ecore,xmi,mysuffix`.
To use this module, add the `-l emf-model` flag in the CLI, or use a `JPlagOption` object with `new DynamicEmfLanguage()` as `language` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).
To use this module, add the `emf-model` subcommand in the CLI, or use a `JPlagOption` object with `new EmfModelLanguage()` as `language` in the Java API as described in the usage information in the [readme of the main project](https://github.com/jplag/JPlag#usage) and [in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag).

In order to correctly parse model instances, the required metamodel files need to be specified. This can be done via the language options of the `emf-model` language (see the language options via `jplag.jar emf-model -h`). Specify one or more metamodel files like this (multiple paths are comma-separated):

`java -jar jplag.jar path/to/model/instances emf-model --metamodel path/to/metamodel/file.ecore`

To ensure only the intended model files are parsed in the submissions, you can use `-p` to specify allowed file types, for example: `-p ecore,xmi,mysuffix`. Note: Normal JPlag parameters need to be specified before the `emf-model` language identifier.

### Report Viewer
In the report viewer, a simple textual syntax is used to generate a tree-based model view.
Expand Down
2 changes: 1 addition & 1 deletion languages/emf-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>emf-metamodel-dynamic</artifactId>
<artifactId>emf-metamodel</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
Expand Down
Loading
Loading