Author: scabanovich
Date: 2012-05-02 15:28:15 -0400 (Wed, 02 May 2012)
New Revision: 40721
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-11724
https://issues.jboss.org/browse/JBIDE-11724
File can be null, e.g. when hover requests element info for a document open from jar.
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 2012-05-02
19:12:19 UTC (rev 40720)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-05-02
19:28:15 UTC (rev 40721)
@@ -350,7 +350,8 @@
// long ctm = 0;
/**
- * Creates a page context for the specified context type
+ * Creates a page context for the specified context type.
+ * Either file or document can be null. File is always null for documents from jar
files.
*
* @param file
* @param contentType
@@ -371,7 +372,7 @@
context = createJavaContext(file);
} else if(JAVA_PROPERTIES_CONTENT_TYPE.equalsIgnoreCase(typeId)) {
context = createPropertiesContext(file);
- } else if(isXMLWithoutEL(file)) {
+ } else if(file != null && isXMLWithoutEL(file)) {
IProject project = file != null ? file.getProject() : getActiveProject();
context = new SimpleELContext();
context.setResource(file);