Author: scabanovich
Date: 2012-01-06 20:44:41 -0500 (Fri, 06 Jan 2012)
New Revision: 37707
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java
Log:
JBIDE-10601
https://issues.joss.org/browse/JBIDE-10601
When computing hover, use safe methods, that do not require current file to be in the
class path.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java 2012-01-07
01:39:07 UTC (rev 37706)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/JavaStringELInfoHover.java 2012-01-07
01:44:41 UTC (rev 37707)
@@ -160,6 +160,10 @@
// Ignore. It is probably because of Java element's resource is not found
}
+ if(file == null) {
+ return null;
+ }
+
ELContext context = PageContextFactory.createPageContext(file,
JavaCore.JAVA_SOURCE_CONTENT_TYPE);
TextProposal[] proposals = PageProcessor.getInstance().getProposals(kbQuery, context);
@@ -238,15 +242,11 @@
if (input == null)
return null;
- IFile file = null;
-
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- // Ignore. It is probably because of Java element's resource is not found
+ IResource r = input.getResource();
+ if(!(r instanceof IFile) || !r.exists() || r.getName().endsWith(".jar")) {
//$NON-NLS-1$
+ return null;
}
+ IFile file = (IFile)r;
ELContext context = PageContextFactory.createPageContext(file,
JavaCore.JAVA_SOURCE_CONTENT_TYPE);