Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Commit

Permalink
Returning empty list of packages if uri is relative and resourse is null
Browse files Browse the repository at this point in the history
  • Loading branch information
pvlasov committed May 7, 2017
1 parent 9ef065f commit 94ce113
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -4,6 +4,7 @@

import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.Plugin;
import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
import org.eclipse.emf.common.util.ECollections;
Expand Down Expand Up @@ -110,7 +111,12 @@ public EList<EPackage> getEPackages(ResourceSet resourceSet) {
}
} else {
URI uri = URI.createURI(getLocation());
if (eResource() != null) {
if (uri.isRelative()) {
if (eResource() == null) {
System.err.println("Resource is null"); // TODO - proper logging.
return ret;
}

URI base = eResource().getURI();
if (base != null && base.isHierarchical()) {
uri = uri.resolve(base);
Expand Down

0 comments on commit 94ce113

Please sign in to comment.