Skip to content

Commit

Permalink
[cleanup] Fix various styling errors
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Bégaudeau <[email protected]>
  • Loading branch information
sbegaudeau committed Jan 11, 2024
1 parent dbbc20c commit 8dc7300
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion bundles/org.eclipse.sirius.emfjson/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ Import-Package: com.google.gson;version="2.2.4",
org.eclipse.emf.ecore.resource.impl;version="0.0.0",
org.eclipse.emf.ecore.util;version="0.0.0"
Automatic-Module-Name: org.eclipse.sirius.emfjson
Require-Bundle: javax.xml.bind;bundle-version="2.2.0"
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,12 @@ private JsonElement createSchemaLocationHeader() {
xsiNoNamespaceSchemaLocation = this.getNoNamespaceSchemaLocation(ePackage);
}
} else {
Resource resource = ePackage.eResource();
if (resource != null) {
JsonObjectProperty jsonObjectProperty = this.getJsonObjectFromResource(ePackage, handleBySchemaLocationMap, resource);
if (jsonObjectProperty != null) {
if (jsonObject == null) {
jsonObject = new JsonObject();
}
jsonObject.add(jsonObjectProperty.getKey(), jsonObjectProperty.getElement());
JsonObjectProperty jsonObjectProperty = this.getJsonObjectProperty(ePackage, handleBySchemaLocationMap);
if (jsonObjectProperty != null) {
if (jsonObject == null) {
jsonObject = new JsonObject();
}
jsonObject.add(jsonObjectProperty.getKey(), jsonObjectProperty.getElement());
}
}
}
Expand All @@ -713,6 +710,14 @@ private JsonElement createSchemaLocationHeader() {
return jsonObject;
}

private JsonObjectProperty getJsonObjectProperty(EPackage ePackage, Map<String, String> handleBySchemaLocationMap) {
Resource resource = ePackage.eResource();
if (resource != null) {
return this.getJsonObjectFromResource(ePackage, handleBySchemaLocationMap, resource);
}
return null;
}

/**
* Return JsonObject representation of schemLocation xml Attribute from given elements.
*
Expand Down

0 comments on commit 8dc7300

Please sign in to comment.