Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 361382 | Differences between
and this patch

Collapse All | Expand All

(-)a/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/ProfilingExtensions.java (-4 / +4 lines)
Lines 52-58 public class ProfilingExtensions { Link Here
52
			setMetaModelPackage(UMLPackage.class.getName());
52
			setMetaModelPackage(UMLPackage.class.getName());
53
		}
53
		}
54
54
55
		public Element load (String file) {
55
		public Element load (Element element, String file) {
56
			setModelFile(file);
56
			setModelFile(file);
57
			Issues issues = new IssuesImpl();
57
			Issues issues = new IssuesImpl();
58
	        final File f = loadFile(issues);
58
	        final File f = loadFile(issues);
Lines 61-67 public class ProfilingExtensions { Link Here
61
	        }
61
	        }
62
	        final URI fileURI = URI.createFileURI(f.getAbsolutePath());
62
	        final URI fileURI = URI.createFileURI(f.getAbsolutePath());
63
63
64
	        final Resource r = new ResourceSetImpl().createResource(fileURI);
64
	        final Resource r = element.eResource().getResourceSet().createResource(fileURI);
65
	        try {
65
	        try {
66
	            r.load(null);
66
	            r.load(null);
67
	        } catch (final IOException e) {
67
	        } catch (final IOException e) {
Lines 72-77 public class ProfilingExtensions { Link Here
72
	        }
72
	        }
73
	        return (Element) r.getContents().get(0);
73
	        return (Element) r.getContents().get(0);
74
		}
74
		}
75
75
	}
76
	}
76
	
77
	
77
	/**
78
	/**
Lines 85-91 public class ProfilingExtensions { Link Here
85
		if (!uri.endsWith(".profile.uml2") && !uri.endsWith(".profile.uml")) {
86
		if (!uri.endsWith(".profile.uml2") && !uri.endsWith(".profile.uml")) {
86
			uri += ".profile.uml";
87
			uri += ".profile.uml";
87
		}
88
		}
88
		Profile profile = (Profile) new XmiReader().load(uri);
89
		Profile profile = (Profile) new XmiReader().load(model, uri);
89
		if (profile==null) {
90
		if (profile==null) {
90
			throw new NullPointerException("Profile '"+uri+"' not loaded.");
91
			throw new NullPointerException("Profile '"+uri+"' not loaded.");
91
		}
92
		}
92
- 

Return to bug 361382