Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2010-10-25 16:38:07 -0400
committergkessler2010-10-25 16:38:07 -0400
commitdb7defd070b0b9fd25e26ed1075a33099533b70d (patch)
tree59d5e767dd6d58fa35fc242c9655ab8dbf455fff
parentd28c96dabdb4237a37ad413b4bebb7ebd34576ec (diff)
downloadwebtools.jsf-db7defd070b0b9fd25e26ed1075a33099533b70d.tar.gz
webtools.jsf-db7defd070b0b9fd25e26ed1075a33099533b70d.tar.xz
webtools.jsf-db7defd070b0b9fd25e26ed1075a33099533b70d.zip
[328513] DomainLoadingStrategy may return null even when model context contains project
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContext.java15
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java2
2 files changed, 12 insertions, 5 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContext.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContext.java
index e90bd2692..ba3fb68af 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContext.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContext.java
@@ -44,12 +44,17 @@ public final class MetaDataModelContext implements IMetaDataModelContext {
public Object getAdapter(Class adapter) {
if (adapter == ModelKeyDescriptor.class)
return new ModelKeyDescriptor(_project, _domainId, _modelId);
+ if (adapter == IProject.class)
+ return _project;
return null;
}
- public IProject getProject() {
- return _project;
- }
+// /**
+// * @return project
+// */
+// public IProject getProject() {
+// return _project;
+// }
public String getDomainId() {
return _domainId;
@@ -62,8 +67,8 @@ public final class MetaDataModelContext implements IMetaDataModelContext {
@Override
public String toString() {
final StringBuffer buf = new StringBuffer();
- if (getProject() != null) {
- buf.append(getProject().getName()).append(":"); //$NON-NLS-1$
+ if (_project != null) {
+ buf.append(_project.getName()).append(":"); //$NON-NLS-1$
}
buf.append(getDomainId()).append(":"); //$NON-NLS-1$
buf.append(getModelIdentifier()).append(":"); //$NON-NLS-1$
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java
index 26a678a64..4f8f4ad99 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java
@@ -52,6 +52,8 @@ public class TaglibDomainMetaDataModelContextImpl extends MetaDataModelContextIm
public Object getAdapter(Class adapter) {
if (adapter.equals(ITaglibDomainMetaDataModelContext.class))
return this;
+ if (adapter.equals(IProject.class))
+ return _project;
return super.getAdapter(adapter);
}

Back to the top