Skip to content

Commit

Permalink
[3666] Enable EMF's entrinsicIDToEObjectMap for JSON resources
Browse files Browse the repository at this point in the history
This requires moving to EMF JSON 2.3.12 to actually use this new map
as a fall back when looking for an object by id.

Bug: #3666
Signed-off-by: Pierre-Charles David <[email protected]>
  • Loading branch information
pcdavid committed Jun 26, 2024
1 parent 449ad0a commit 9211869
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ More existing APIs will be migrated to this new common pattern.
- [releng] Switch to `maven-checkstyle-plugin` 3.3.1
- [releng] Remove the dependency to `reflect-metadata`
- [releng] Switch to `subscriptions-transport-ws` 0.11.0
- [releng] Switch to EMF Json 2.3.11
- [releng] Switch to EMF Json 2.3.12
- https://github.com/eclipse-sirius/sirius-web/issues/3523[#3523] [gantt] Move to @ObeoNetwork/gantt-task-react 0.4.19 to benefit for enhancements

=== Bug fixes
Expand All @@ -67,6 +67,7 @@ More existing APIs will be migrated to this new common pattern.
- https://github.com/eclipse-sirius/sirius-web/issues/3650[#3650] [diagram] Fix potential NPE in DiagramNavigator and Node toString method
- https://github.com/eclipse-sirius/sirius-web/issues/3649[#3649] [sirius-web] Restore support for Related elements view icons
- https://github.com/eclipse-sirius/sirius-web/issues/3630[#3630] [sirius-web] Restore support for the deletion of dangling representations
- https://github.com/eclipse-sirius/sirius-web/issues/3666[#3666] [core] Enable EMF's entrinsicIDToEObjectMap for JSON resources to support languages which use modeled identifiers (e.g. SysMLv2).

=== New Features

Expand Down
4 changes: 2 additions & 2 deletions packages/emf/backend/sirius-components-emf/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2023 Obeo.
Copyright (c) 2019, 2024 Obeo.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
Expand Down Expand Up @@ -102,7 +102,7 @@
<dependency>
<groupId>org.eclipse.sirius.emfjson</groupId>
<artifactId>org.eclipse.sirius.emfjson</artifactId>
<version>2.3.11-SNAPSHOT</version>
<version>2.3.12-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ public class JSONResourceFactory extends ResourceFactoryImpl {

@Override
public JsonResource createResource(URI uri) {
// @formatter:off
Optional.ofNullable(uri)
.map(URI::scheme)
.filter(Objects::nonNull)
.filter(Predicate.not(String::isEmpty))
.orElseThrow(() -> new IllegalArgumentException(String.format("Missing scheme for URI %s", uri)));
// @formatter:on

Map<String, Object> options = new HashMap<>();

options.put(JsonResource.OPTION_ID_MANAGER, new EObjectIDManager());
options.put(JsonResource.OPTION_DISPLAY_DYNAMIC_INSTANCES, true);

return new JsonResourceImpl(uri, options);
var resource = new JsonResourceImpl(uri, options);
resource.setIntrinsicIDToEObjectMap(new HashMap<>());
return resource;
}

/**
Expand Down

0 comments on commit 9211869

Please sign in to comment.