Source:
<code>public static void registerEcore(String ecorePath) throws IOException { if (ecorePath == null) { return; } Integer previousValue = ECOREPATH_TO_REGISTEREDCOUNT.get(ecorePath); if (previousValue == null || previousValue < 0) { previousValue = 0; } ECOREPATH_TO_REGISTEREDCOUNT.put(ecorePath, ++previousValue); determineWorkspaceDepedencies(ecorePath); final ResourceSet physicalResourceSet = new ResourceSetImpl(); initResourceSet(physicalResourceSet, true); final URI uri = URI.createPlatformResourceURI(ecorePath, false); final Resource r = physicalResourceSet.createResource(uri); r.load(null); int rsSize = physicalResourceSet.getResources().size(); EcoreUtil.resolveAll(physicalResourceSet); while (rsSize != physicalResourceSet.getResources().size()) { EcoreUtil.resolveAll(physicalResourceSet); rsSize = physicalResourceSet.getResources().size(); } final ResourceSetImpl virtualResourceSet = new ResourceSetImpl(); for (final Resource physicalResource : physicalResourceSet.getResources()) { if (physicalResource.getContents().size() == 0) { continue; } final EObject eObject = physicalResource.getContents().get(0); final EPackage ePackage = EPackage.class.cast(eObject); if (isContainedInPackageRegistry(ePackage.getNsURI())) { final EPackage registeredPackage = EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI()); <START> if (!ePackage.equals(registeredPackage)) { <END> EPackage.Registry.INSTANCE.put(ePackage.getNsURI(), ePackage); updateRegistryAndLocalCache(ePackage, physicalResource, virtualResourceSet); } continue; } updateRegistryAndLocalCache(ePackage, physicalResource, virtualResourceSet); } }</code><technical_language>is check sufficient? package ref if package change</technical_language>

Target:
public static void registerEcore(String ecorePath) throws IOException { if (ecorePath == null) { return; } Integer previousValue = ECOREPATH_TO_REGISTEREDCOUNT.get(ecorePath); if (previousValue == null || previousValue < 0) { previousValue = 0; } ECOREPATH_TO_REGISTEREDCOUNT.put(ecorePath, ++previousValue); determineWorkspaceDepedencies(ecorePath); final ResourceSet physicalResourceSet = new ResourceSetImpl(); initResourceSet(physicalResourceSet, true); final URI uri = URI.createPlatformResourceURI(ecorePath, false); final Resource r = physicalResourceSet.createResource(uri); r.load(null); int rsSize = physicalResourceSet.getResources().size(); EcoreUtil.resolveAll(physicalResourceSet); while (rsSize != physicalResourceSet.getResources().size()) { EcoreUtil.resolveAll(physicalResourceSet); rsSize = physicalResourceSet.getResources().size(); } final ResourceSetImpl virtualResourceSet = new ResourceSetImpl(); for (final Resource physicalResource : physicalResourceSet.getResources()) { if (physicalResource.getContents().size() == 0) { continue; } final EObject eObject = physicalResource.getContents().get(0); final EPackage ePackage = EPackage.class.cast(eObject); if (isContainedInPackageRegistry(ePackage.getNsURI())) { final EPackage registeredPackage = EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI()); if (!ePackage.equals(registeredPackage)) { updateRegistryAndLocalCache(ePackage, physicalResource, virtualResourceSet); } continue; } updateRegistryAndLocalCache(ePackage, physicalResource, virtualResourceSet); } }