The jst.jsp.core change is
[279038] JSP opens dirty if content type header misspells "charset"
[272389] tokenizers stuck in loop when input not matched
the wst.sse.core change is
[272389] tokenizers stuck in loop when input not matched
the jsdt change is
[277000] Provide a way to disable JS semantic analyzer/validator
diff --git a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
index fa413f9..516c273 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.jsp.core; singleton:=true
-Bundle-Version: 1.2.122.qualifier
+Bundle-Version: 1.2.123.qualifier
Bundle-Activator: org.eclipse.jst.jsp.core.internal.JSPCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
index f3f3e9c..8a6e5c6 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 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
@@ -28,9 +28,12 @@
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
+import org.eclipse.wst.sse.core.utils.StringUtils;
import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
+import com.ibm.icu.util.StringTokenizer;
+
public class JSPResourceEncodingDetector implements IResourceCharsetDetector {
private String fCharset;
@@ -341,33 +344,49 @@
* @param contentType
*/
private void parseContentTypeValue(String contentType) {
- Pattern pattern = Pattern.compile(";\\s*charset\\s*=\\s*"); //$NON-NLS-1$
- String[] parts = pattern.split(contentType);
- if (parts.length > 0) {
- // if only one item, it can still be charset instead of
- // contentType
- if (parts.length == 1) {
- if (parts[0].length() > 6) {
- String checkForCharset = parts[0].substring(0, 7);
- if (checkForCharset.equalsIgnoreCase("charset")) { //$NON-NLS-1$
- int eqpos = parts[0].indexOf('=');
- eqpos = eqpos + 1;
- if (eqpos < parts[0].length()) {
- fCharset = parts[0].substring(eqpos);
- fCharset = fCharset.trim();
- }
- }
- else {
- fContentType = parts[0];
- }
- }
- }
- else {
- fContentType = parts[0];
- }
+ /*
+ * Based partially on
+ * org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterImpl
+ * .getMimeTypeFromContentTypeValue(String) , divides the full value
+ * into segments according to ';', assumes the first specifies the
+ * content type itself if it has no '=', and that the remainder are
+ * parameters which may specify a charset
+ */
+
+ String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentType);
+ /* Break the mime header into the main value and its parameters, separated by ';' */
+ StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";"); //$NON-NLS-1$
+ int tLen = tokenizer.countTokens();
+ if (tLen == 0)
+ return;
+ String[] tokens = new String[tLen];
+ int j = 0;
+ while (tokenizer.hasMoreTokens()) {
+ tokens[j] = tokenizer.nextToken();
+ j++;
}
- if (parts.length > 1) {
- fCharset = parts[1];
+
+ int firstParameter = 0;
+ if (tokens[0].indexOf('=') == -1) {
+ /*
+ * no equal sign in the first segment, so assume it indicates a
+ * content type properly
+ */
+ fContentType = tokens[0].trim();
+ firstParameter = 1;
+ }
+ /*
+ * now handle parameters as name=value pairs, looking for "charset"
+ * specifically
+ */
+ Pattern equalPattern = Pattern.compile("\\s*=\\s*"); //$NON-NLS-1$
+ for (int i = firstParameter; i < tokens.length; i++) {
+ String[] pair = equalPattern.split(tokens[i]);
+ if (pair.length < 2)
+ continue;
+ if (pair[0].trim().equals("charset")) { //$NON-NLS-1$
+ fCharset = pair[1].trim();
+ }
}
}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
index 2179658..1e70a35 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.2.2 on 5/6/09 2:12 PM */
+/* The following code was generated by JFlex 1.2.2 on 6/3/09 11:14 PM */
/*******************************************************************************
* Copyright (c) 2004, 2009 IBM Corporation and others.
@@ -20,8 +20,8 @@
import java.util.Iterator;
import java.util.List;
-import org.eclipse.jst.jsp.core.internal.Logger;
import org.eclipse.jst.jsp.core.internal.contenttype.BooleanStack;
+import org.eclipse.jst.jsp.core.internal.Logger;
import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTokenizer;
@@ -37,8 +37,8 @@
/**
* This class is a scanner generated by
* <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 5/6/09 2:12 PM from the specification file
- * <tt>file:/E:/wtp-3.0/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
+ * on 6/3/09 11:14 PM from the specification file
+ * <tt>file:/E:/wtp-3.0/releng.workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
*/
public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
@@ -1144,7 +1144,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
yybegin(ST_ABORT_EMBEDDED);
longscan = false;
@@ -1169,7 +1169,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
yybegin(ST_ABORT_EMBEDDED);
}
@@ -1375,7 +1375,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -1402,7 +1402,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -1429,7 +1429,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -1469,8 +1469,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return UNDEFINED;
}
if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
@@ -1564,8 +1566,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
}
return UNDEFINED;
}
@@ -1584,8 +1588,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
}
return UNDEFINED;
}
@@ -1632,8 +1638,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return fRegionFactory.createToken(UNDEFINED, start, textLength, length, null, null);
}
if (context == PROXY_CONTEXT) {
@@ -1661,8 +1669,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return fRegionFactory.createToken(UNDEFINED, start, textLength, length, null, null);
}
if (f_context == PROXY_CONTEXT) {
@@ -1847,6 +1857,23 @@
private boolean isJspTag() {
return fJspTagStack.empty() ? false : fJspTagStack.peek();
}
+ /* user method */
+ private void recoverInternals() {
+ fShouldLoadBuffered = false;
+ fBufferedContext = null;
+ fBufferedStart = 1;
+ fBufferedLength = 0;
+ fStateStack = new IntStack();
+ fJspTagStack.clear();
+
+ fLastInternalBlockStart = -1;
+
+ context = null;
+ fEmbeddedContainer = null;
+
+ fELlevel = 0;
+ }
+
/**
@@ -2007,19 +2034,34 @@
*/
private void yy_ScanError(int errorCode) {
if (fErroredInputstamp != fInputStamp) {
- IllegalStateException e = new IllegalStateException("Instance:" + System.identityHashCode(this) + " Input:" + fInputStamp + " offset:" + (fOffset + yychar) + " state:" + yystate());
- try {
- Logger.logException(YY_ERROR_MSG[errorCode], e);
- throw(e);
+ // must update count before throwing the exception
+ fErroredInputstamp = fInputStamp;
+ // attempt to capture and report the next 20 characters
+ StringBuffer next = new StringBuffer();
+ if(errorCode == YY_NO_MATCH) {
+ for (int i = 0; i < 20; i++) {
+ try {
+ int c = yy_advance();
+ if (c != YYEOF)
+ next.append((char) c);
+ }
+ catch (IOException e1) {
+ }
+ }
+ yypushback(next.length());
+ }
+ IllegalStateException e = new IllegalStateException("Instance:" + System.identityHashCode(this) + " Input:" + fInputStamp + " offset:" + (fOffset + yychar) + " state:" + yystate() + " stack:" + fStateStack + " next:" + next);
+ try {
+ Logger.logException(YY_ERROR_MSG[errorCode], e);
+ throw (e);
+ }
+ catch (ArrayIndexOutOfBoundsException e2) {
+ Logger.logException(YY_ERROR_MSG[YY_UNKNOWN_ERROR], e2);
+ }
}
- catch (ArrayIndexOutOfBoundsException e2) {
- Logger.logException(YY_ERROR_MSG[YY_UNKNOWN_ERROR], e2);
- }
- fErroredInputstamp = fInputStamp;
- }
-
- // DO NOT EXIT the VM on an error
- // System.exit(1);
+
+ // DO NOT EXIT the VM on an error
+ // System.exit(1);
}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
index 4a5e121..05dbb88 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
@@ -247,7 +247,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
yybegin(ST_ABORT_EMBEDDED);
longscan = false;
@@ -272,7 +272,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
yybegin(ST_ABORT_EMBEDDED);
}
@@ -478,7 +478,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -505,7 +505,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -532,7 +532,7 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
}
yybegin(resumeState);
@@ -572,8 +572,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return UNDEFINED;
}
if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {
@@ -667,8 +669,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
}
return UNDEFINED;
}
@@ -687,8 +691,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
}
return UNDEFINED;
}
@@ -735,8 +741,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return fRegionFactory.createToken(UNDEFINED, start, textLength, length, null, null);
}
if (context == PROXY_CONTEXT) {
@@ -764,8 +772,10 @@
}
catch(IllegalStateException e) {
start = yychar;
- while(yy_advance() != YYEOF);
+ while(yy_advance() != YYEOF){}
textLength = length = yylength();
+ recoverInternals();
+ yybegin(YYINITIAL);
return fRegionFactory.createToken(UNDEFINED, start, textLength, length, null, null);
}
if (f_context == PROXY_CONTEXT) {
@@ -950,6 +960,23 @@
private boolean isJspTag() {
return fJspTagStack.empty() ? false : fJspTagStack.peek();
}
+ /* user method */
+ private void recoverInternals() {
+ fShouldLoadBuffered = false;
+ fBufferedContext = null;
+ fBufferedStart = 1;
+ fBufferedLength = 0;
+ fStateStack = new IntStack();
+ fJspTagStack.clear();
+
+ fLastInternalBlockStart = -1;
+
+ context = null;
+ fEmbeddedContainer = null;
+
+ fELlevel = 0;
+ }
+
%}
%eof{
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
index 05e4245..ef6805c 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
@@ -185,19 +185,34 @@
*/
private void yy_ScanError(int errorCode) {
if (fErroredInputstamp != fInputStamp) {
- IllegalStateException e = new IllegalStateException("Instance:" + System.identityHashCode(this) + " Input:" + fInputStamp + " offset:" + (fOffset + yychar) + " state:" + yystate());
- try {
- Logger.logException(YY_ERROR_MSG[errorCode], e);
- throw(e);
+ // must update count before throwing the exception
+ fErroredInputstamp = fInputStamp;
+ // attempt to capture and report the next 20 characters
+ StringBuffer next = new StringBuffer();
+ if(errorCode == YY_NO_MATCH) {
+ for (int i = 0; i < 20; i++) {
+ try {
+ int c = yy_advance();
+ if (c != YYEOF)
+ next.append((char) c);
+ }
+ catch (IOException e1) {
+ }
+ }
+ yypushback(next.length());
+ }
+ IllegalStateException e = new IllegalStateException("Instance:" + System.identityHashCode(this) + " Input:" + fInputStamp + " offset:" + (fOffset + yychar) + " state:" + yystate() + " stack:" + fStateStack + " next:" + next);
+ try {
+ Logger.logException(YY_ERROR_MSG[errorCode], e);
+ throw (e);
+ }
+ catch (ArrayIndexOutOfBoundsException e2) {
+ Logger.logException(YY_ERROR_MSG[YY_UNKNOWN_ERROR], e2);
+ }
}
- catch (ArrayIndexOutOfBoundsException e2) {
- Logger.logException(YY_ERROR_MSG[YY_UNKNOWN_ERROR], e2);
- }
- fErroredInputstamp = fInputStamp;
- }
-
- // DO NOT EXIT the VM on an error
- // System.exit(1);
+
+ // DO NOT EXIT the VM on an error
+ // System.exit(1);
}
diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index 44bb35a..73d16f7 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.304.qualifier
+Bundle-Version: 1.1.305.qualifier
Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
index 82c713b..455f99f 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
+++ b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
@@ -7,12 +7,8 @@
<body>
-<h1>WTP 3.0.1 Patches</h1>
+<h1>WTP 3.0.5 Patches</h1>
-<p>Bug <a href="https://bugs.eclipse.org/243747">243747</a>. "Cannot
-find the tag library descriptor" after removing a taglib file with
-duplicate URI.</p>
-<p>Bug <a href="https://bugs.eclipse.org/246294">246294</a>. NPE in
-EMF2DOMSSEAdapter.primGetExistingAdapter()</p>
+<p>Bug <a href='https://bugs.eclipse.org/272389'>272389</a>. tokenizers stuck in loop when input not matched</p>
</body>
</head>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
index 2874cbc..8a43b53 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
@@ -27,8 +27,7 @@
description=\
The bugs and fixes are described in the following bugzilla entries:\n\
\n\
-Bug https://bugs.eclipse.org/243747 Cannot find the tag library descriptor" after removing a taglib file with duplicate URI.\n\
-Bug https://bugs.eclipse.org/246294 NPE in EMF2DOMSSEAdapter.primGetExistingAdapter()\n\
+Bug https://bugs.eclipse.org/272389 tokenizers stuck in loop when input not matched\n\
\n\
# "copyright" property - text of the "Feature Update Copyright"
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/feature.xml b/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
index fd3dd7f..fb68732 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
+++ b/features/org.eclipse.wst.xml_core.feature.patch/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.wst.xml_core.feature.patch"
label="%featureName"
- version="3.0.1.qualifier"
+ version="3.0.5.qualifier"
provider-name="%providerName">
<description>
@@ -22,7 +22,7 @@
</url>
<requires>
- <import feature="org.eclipse.wst.xml_core.feature" version="3.0.1.v200807220139-7A7NEGuE7QYGHNH_NuKhUl" patch="true"/>
+ <import feature="org.eclipse.wst.xml_core.feature" version="3.0.5.v200903310029-7A7NEH6E7QYGHRHvLuKlbZ" patch="true"/>
</requires>
<plugin
@@ -31,12 +31,5 @@
install-size="0"
version="0.0.0"
unpack="false"/>
-
- <plugin
- id="org.eclipse.wst.xml.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+
+ </feature>