diff options
author | crogers | 2010-05-17 15:54:38 +0000 |
---|---|---|
committer | crogers | 2010-05-17 15:54:38 +0000 |
commit | 87f32b8aa0f31ecfe927502a5a4ec504a7d79789 (patch) | |
tree | 6c0879564047779a4cb5c6241be04bd123641656 | |
parent | fdf4071acd0212ff3ee2af44a0a08873430461b7 (diff) | |
download | webtools.jsf-87f32b8aa0f31ecfe927502a5a4ec504a7d79789.tar.gz webtools.jsf-87f32b8aa0f31ecfe927502a5a4ec504a7d79789.tar.xz webtools.jsf-87f32b8aa0f31ecfe927502a5a4ec504a7d79789.zip |
[Bug 312826] JEM IDE remote VM fails to find a dependent class for the TagAnalyzer
2 files changed, 16 insertions, 43 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java index 4e2b79b4a..ac189b31d 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java +++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java @@ -354,11 +354,15 @@ public final class BeanProxyUtil PARENT_LOOP: while (curType != null) { final IMethodProxy[] declaredMethods = curType.getDeclaredMethods(); - final IMethodProxy foundMethod = findMethodInList(methodName, argTypes, declaredMethods); - if (foundMethod != null) + if (declaredMethods != null) { - return foundMethod; + final IMethodProxy foundMethod = findMethodInList(methodName, argTypes, declaredMethods); + if (foundMethod != null) + { + return foundMethod; + } } + // avoid infinite loop: if the parent of curType can't // be resolved, JEM returns the same type, so curType // never becomes null diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java index efe340da3..45d8d9212 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java +++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java @@ -17,10 +17,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Platform; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jem.internal.proxy.core.ConfigurationContributorAdapter; import org.eclipse.jem.internal.proxy.core.IConfigurationContributionController; import org.eclipse.jst.jsf.core.JSFVersion; @@ -29,18 +25,15 @@ import org.osgi.framework.Bundle; class ServletBeanProxyContributor extends ConfigurationContributorAdapter { - private final IProject _project; private final JSFVersion _jsfVersion; public ServletBeanProxyContributor(final IProject project) { - _project = project; _jsfVersion = getProjectVersion(project); if (_jsfVersion == null) { throw new IllegalArgumentException("jsfVersion must not be null"); //$NON-NLS-1$ } - } @Override @@ -48,7 +41,7 @@ class ServletBeanProxyContributor extends ConfigurationContributorAdapter final IConfigurationContributionController controller) throws CoreException { - if (_jsfVersion != JSFVersion.V1_2) + if (_jsfVersion != null && _jsfVersion.compareTo(JSFVersion.V1_2) < 0) { final Bundle servletBundle = Platform.getBundle("javax.servlet"); //$NON-NLS-1$ controller.contributeClasspath(servletBundle, (IPath) null, @@ -63,38 +56,14 @@ class ServletBeanProxyContributor extends ConfigurationContributorAdapter else { final Bundle coreBundle = JSFCorePlugin.getDefault().getBundle(); - final IJavaProject javaProject = JavaCore.create(_project); - maybeAddJar(controller, "javax.servlet.jsp.tagext.JspIdConsumer", //$NON-NLS-1$ - javaProject, coreBundle, "/jars/fake_jsp_21.jar"); //$NON-NLS-1$ - maybeAddJar(controller, "javax.el.ELException", javaProject, //$NON-NLS-1$ - coreBundle, "/jars/fake_el.jar"); //$NON-NLS-1$ - } - } - - private void maybeAddJar( - final IConfigurationContributionController controller, - final String addIfTypeNameNotFound, final IJavaProject javaProject, - final Bundle bundle, final String path) - { - try - { - final IType type = javaProject.findType(addIfTypeNameNotFound); - // if we can't find the type name on the classpath,then inject - // our fake jar to aid linkage while introspecting facelet libs - if (type == null) - { - - controller - .contributeClasspath( - bundle, - path, - IConfigurationContributionController.APPEND_USER_CLASSPATH, - false); - } - } - catch (final JavaModelException jme) - { - // suppress + controller.contributeClasspath(coreBundle, + "/jars/fake_jsp_21.jar", //$NON-NLS-1$ + IConfigurationContributionController.APPEND_USER_CLASSPATH, + false); + controller.contributeClasspath(coreBundle, + "/jars/fake_el.jar", //$NON-NLS-1$ + IConfigurationContributionController.APPEND_USER_CLASSPATH, + false); } } |