Skip to content

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

Open
AxelRICHARD wants to merge 1 commit intomasterfrom
ari/fix/resourceSet
Open

[50] Fix potential NPE in GsonEObjectDeserializer#resolveType#51
AxelRICHARD wants to merge 1 commit intomasterfrom
ari/fix/resourceSet

Conversation

@AxelRICHARD
Copy link
Contributor

Bug: #50

Bug: #50
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
@AxelRICHARD AxelRICHARD linked an issue Sep 26, 2024 that may be closed by this pull request
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

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