diff options
author | John Collier | 2017-11-16 23:17:33 +0000 |
---|---|---|
committer | John Collier | 2017-11-16 23:17:33 +0000 |
commit | 340aec38099115145bb2e9140bd378a79922a66d (patch) | |
tree | 9725ea9a6ef3c7c34ec408eb5114be64f0876e66 /plugins | |
parent | 9801bd606577b3e3f5a7d5bef334402476697b71 (diff) | |
download | webtools.javaee-340aec38099115145bb2e9140bd378a79922a66d.tar.gz webtools.javaee-340aec38099115145bb2e9140bd378a79922a66d.tar.xz webtools.javaee-340aec38099115145bb2e9140bd378a79922a66d.zip |
[510682] Adds check for Dynamic Web facet before version check
In the WebAnnotationReader.analyzeCompilationUnit function, there is a
check to see what version of the Dynamic Web facet is installed in a
project without checking to see if the facet is even installed. A simple
solution is to add a check to see if the facet is installed, before
checking the version, like what was done in
Web25MergedModelProvider.createWebMerger.
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationReader.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationReader.java b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationReader.java index 75908adad..204df132a 100644 --- a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationReader.java +++ b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationReader.java @@ -141,9 +141,13 @@ public class WebAnnotationReader extends AbstractAnnotationModelProvider<WebApp> return annotationFactory.createFilter(rootType, filter.getFilterName()); } } - if(Float.parseFloat(facetedProject.getProjectFacetVersion(WebFacetUtils.WEB_FACET).getVersionString()) > 2.5){ - return createJavaeeObject(rootType); + + if (facetedProject.hasProjectFacet(WebFacetUtils.WEB_FACET)) { + if (Float.parseFloat(facetedProject.getProjectFacetVersion(WebFacetUtils.WEB_FACET).getVersionString()) > 2.5){ + return createJavaeeObject(rootType); + } } + return null; } |