[286937] ExceptionInInitializerError from TaglibHelper.isIterationTag in log [286969] Java string constants containing entity references get decoded
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java index f0115c8..a9b5be3 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPIncludeRegionHelper.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,7 +17,7 @@ /** - * Extension of XMLJSPRegionHelper inteded to parse entire included JSP files. + * Extension of XMLJSPRegionHelper intended to parse entire included JSP files. * Basically it expands the rules for what tags are parsed as JSP. * * @author pavery @@ -91,4 +91,8 @@ processIncludeDirective(sdRegion); processPageDirective(sdRegion); } + + protected void prepareText(IStructuredDocumentRegion sdRegion) { + fStrippedText = fTextBefore = fTextToParse.substring(sdRegion.getStartOffset(), sdRegion.getEndOffset()); + } }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java index 063c796..f8b9043 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java
@@ -103,27 +103,36 @@ } private boolean isIterationTag(TLDElementDeclaration elementDecl, IStructuredDocument document, ITextRegionCollection customTag, List problems) { + String className = elementDecl.getTagclass(); + if (className == null || className.length() == 0 || fJavaProject == null) + return false; + Class tagClass; try { - tagClass = Class.forName(elementDecl.getTagclass(), true, getClassloader()); + tagClass = Class.forName(className, true, getClassloader()); if (tagClass != null) { return IterationTag.class.isInstance(tagClass.newInstance()); } } catch (ClassNotFoundException e) { - Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TagClassNotFound, JSPCoreMessages.TaglibHelper_3, elementDecl.getTagclass(), true); + Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TagClassNotFound, JSPCoreMessages.TaglibHelper_3, className, true); if (createdProblem != null) problems.add(createdProblem); if (DEBUG) - Logger.logException(elementDecl.getTagclass(), e); + Logger.logException(className, e); } catch (IllegalAccessException e) { if (DEBUG) - Logger.logException(elementDecl.getTagclass(), e); + Logger.logException(className, e); } catch (InstantiationException e) { if (DEBUG) - Logger.logException(elementDecl.getTagclass(), e); - } catch (NoClassDefFoundError e) { + Logger.logException(className, e); + } catch (Exception e) { + // this is 3rd party code, need to catch all exceptions if (DEBUG) - Logger.logException(elementDecl.getTagclass(), e); + Logger.logException(className, e); + } catch (Error e) { + // this is 3rd party code, need to catch all errors + if (DEBUG) + Logger.logException(className, e); } return false; }