Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[50] Fix potential NPE in GsonEObjectDeserializer#resolveType #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AxelRICHARD
Copy link

Bug: #50

@AxelRICHARD AxelRICHARD linked an issue Sep 26, 2024 that may be closed by this pull request
@@ -253,7 +253,7 @@ public List<EObject> deserialize(JsonElement jsonElement, Type type, JsonDeseria

EPackage ePackage = this.getEPackage(uri);
if (ePackage != null) {
this.resourceSet.getPackageRegistry().put(ePackage.getNsURI(), ePackage);
this.packageRegistry.put(ePackage.getNsURI(), ePackage);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the resourceSet is null, this.packageRegistry refers to the global package registry. In that case, I don't know the consequence adding an EPackage to the global registry

@@ -864,7 +864,7 @@ private void deserializeMultipleContainmentEReference(EReference eReference, Jso
JsonObject properties = jsonObject.getAsJsonObject(IGsonConstants.DATA);
eReferenceValue = this.loadReferences(EcorePackage.Literals.EPACKAGE, properties);
EPackage ePackage = (EPackage) eReferenceValue;
this.resourceSet.getPackageRegistry().put(ePackage.getNsURI(), ePackage);
this.packageRegistry.put(ePackage.getNsURI(), ePackage);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same wondering here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential NPE in GsonEObjectDeserializer#resolveType
2 participants