Skip to content

Commit

Permalink
[3666] Enable EMF's entrinsicIDToEObjectMap for JSON resources
Browse files Browse the repository at this point in the history
Bug: #3666
Signed-off-by: Pierre-Charles David <[email protected]>
  • Loading branch information
pcdavid committed Jun 26, 2024
1 parent 449ad0a commit d4bc46e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 d4bc46e

Please sign in to comment.