Author: vrubezhny
Date: 2009-11-27 11:10:53 -0500 (Fri, 27 Nov 2009)
New Revision: 18885
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-5273: NPE in junit tests for jsp components
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2009-11-27 15:59:05 UTC (rev
18884)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2009-11-27 16:10:53 UTC (rev
18885)
@@ -83,6 +83,8 @@
<contexttype id="JSP_PAGE_CONTEXT_TYPE">
<contenttype id="org.eclipse.jst.jsp.core.jspsource" />
+ <contenttype id="org.eclipse.jst.jsp.core.jspfragmentsource"/>
+ <contenttype id="org.eclipse.jst.jsp.core.tagsource"/>
</contexttype>
<contexttype id="FACELETS_PAGE_CONTEXT_TYPE">
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2009-11-27
15:59:05 UTC (rev 18884)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2009-11-27
16:10:53 UTC (rev 18885)
@@ -28,4 +28,5 @@
public static String KBBUILDER_NOT_FOUND;
public static String KBPROBLEM;
public static String ENABLE_KB;
+ public static String ILLEGAL_CONTENTTYPE;
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties 2009-11-27
15:59:05 UTC (rev 18884)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties 2009-11-27
16:10:53 UTC (rev 18885)
@@ -4,4 +4,6 @@
KBNATURE_NOT_FOUND=KB Nature is not installed.
KBBUILDER_NOT_FOUND=KB Builder is not installed.
KBPROBLEM=KB Problem: {0} {1} Use Quick Fix to allow JSF Content Assistant and
Validation.
-ENABLE_KB=Enable JSF CA and validation on this project
\ No newline at end of file
+ENABLE_KB=Enable JSF CA and validation on this project
+
+ILLEGAL_CONTENTTYPE=Unknown contentType argument value: {0}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27
15:59:05 UTC (rev 18884)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27
16:10:53 UTC (rev 18885)
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.internal.corext.util.Messages;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
@@ -67,6 +68,7 @@
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.text.ext.util.Utils;
@@ -308,8 +310,10 @@
return new JspContextImpl();
} else if (FACELETS_PAGE_CONTEXT_TYPE.equals(contextType)) {
return new FaceletPageContextImpl();
+ } else {
+ WebKbPlugin.getDefault().logError(Messages.format(KbMessages.ILLEGAL_CONTENTTYPE,
contentType));
}
- return null;
+ return new SimpleELContext();
}
/**
Show replies by date