[100152] JSP/HTML editor doesn't recognize lowercase tags in Turkish locale
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
index 21ce1b2..91f34f2 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
@@ -14,16 +14,17 @@
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Locale;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
/**
- * An implementation of the CMNamedNodeMap interface.
- * This class is intented to be used as a container of attribute declarations.
- * If someone wants to use this class for other purpose, he must pay attention
- * to the fact that this class is tolerant of the key name case. That is, this
- * class does not distinguish "name", "NAME", and "Name" as a key name.
+ * An implementation of the CMNamedNodeMap interface. This class is intented
+ * to be used as a container of attribute declarations. If someone wants to
+ * use this class for other purpose, he must pay attention to the fact that
+ * this class is tolerant of the key name case. That is, this class does not
+ * distinguish "name", "NAME", and "Name" as a key name.
*/
class CMNamedNodeMapImpl implements CMNamedNodeMap {
@@ -38,6 +39,7 @@
/**
* getLength method
+ *
* @return int
*/
public int getLength() {
@@ -46,8 +48,10 @@
/**
* getNamedItem method
+ *
* @return CMNode <code>null</code> for unknown keys.
- * @param name java.lang.String
+ * @param name
+ * java.lang.String
*/
public CMNode getNamedItem(String name) {
String cookedName = makeCanonicalForm(name);
@@ -58,8 +62,10 @@
/**
* item method
+ *
* @return CMNode
- * @param index int
+ * @param index
+ * int
*/
public CMNode item(int index) {
Iterator iter = iterator();
@@ -80,15 +86,24 @@
/**
* @return java.lang.String
- * @param rawForm java.lang.String
+ * @param rawForm
+ * java.lang.String
*/
- private String makeCanonicalForm(String rawForm) {
- return rawForm.toUpperCase();
+ private String makeCanonicalForm(String raw) {
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
+ // we are able to "cheat" here a little and use US Locale
+ // to get a good cononical form, since we are using this only
+ // for HTML and JSP standard tags.
+ // Long term, for similar needs with XML 1.1 (for example)
+ // we should use a class such as com.ibm.icu.text.Normalizer
+ return raw.toUpperCase(Locale.US);
}
/**
- * @param key java.lang.String
- * @param item java.lang.String
+ * @param key
+ * java.lang.String
+ * @param item
+ * java.lang.String
*/
void putNamedItem(String name, CMNode item) {
String cookedName = makeCanonicalForm(name);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
index a32cdfd..098f91a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
@@ -13,15 +13,16 @@
import java.util.Iterator;
+import java.util.Locale;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
/**
- * An implementation of the CMNamedNodeMap interface.
- * This class is intented to be used as a container of attribute declarations.
- * If someone wants to use this class for other purpose, he must pay attention
- * to the fact that this class is tolerant of the key name case. That is, this
- * class does not distinguish "name", "NAME", and "Name" as a key name.
+ * An implementation of the CMNamedNodeMap interface. This class is intented
+ * to be used as a container of attribute declarations. If someone wants to
+ * use this class for other purpose, he must pay attention to the fact that
+ * this class is tolerant of the key name case. That is, this class does not
+ * distinguish "name", "NAME", and "Name" as a key name.
*/
class CMNamedNodeMapImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap {
@@ -36,6 +37,7 @@
/**
* getLength method
+ *
* @return int
*/
public int getLength() {
@@ -44,8 +46,10 @@
/**
* getNamedItem method
+ *
* @return CMNode <code>null</code> for unknown keys.
- * @param name java.lang.String
+ * @param name
+ * java.lang.String
*/
public CMNode getNamedItem(String name) {
String cookedName = makeCanonicalForm(name);
@@ -56,8 +60,10 @@
/**
* item method
+ *
* @return CMNode
- * @param index int
+ * @param index
+ * int
*/
public CMNode item(int index) {
Iterator iter = iterator();
@@ -78,15 +84,24 @@
/**
* @return java.lang.String
- * @param rawForm java.lang.String
+ * @param rawForm
+ * java.lang.String
*/
- private String makeCanonicalForm(String rawForm) {
- return rawForm.toUpperCase();
+ private String makeCanonicalForm(String raw) {
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
+ // we are able to "cheat" here a little and use US Locale
+ // to get a good cononical form, since we are using this only
+ // for HTML and JSP standard tags.
+ // Long term, for similar needs with XML 1.1 (for example)
+ // we should use a class such as com.ibm.icu.text.Normalizer
+ return raw.toUpperCase(Locale.US);
}
/**
- * @param key java.lang.String
- * @param item java.lang.String
+ * @param key
+ * java.lang.String
+ * @param item
+ * java.lang.String
*/
void putNamedItem(String name, CMNode item) {
String cookedName = makeCanonicalForm(name);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
index 2b56527..22558cf 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
@@ -14,6 +14,7 @@
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Locale;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
@@ -90,7 +91,13 @@
}
private String makeCanonicalForm(String raw) {
- return raw.toUpperCase();
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
+ // we are able to "cheat" here a little and use US Locale
+ // to get a good cononical form, since we are using this only
+ // for HTML and JSP standard tags.
+ // Long term, for similar needs with XML 1.1 (for example)
+ // we should use a class such as com.ibm.icu.text.Normalizer
+ return raw.toUpperCase(Locale.US);
}
}
@@ -137,7 +144,8 @@
/**
* @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param id int
+ * @param id
+ * int
*/
protected abstract CMNode create(String name);
@@ -166,8 +174,10 @@
/**
* Map name to id.
+ *
* @return int
- * @param name java.lang.String
+ * @param name
+ * java.lang.String
*/
protected int getID(String name) {
return fMap.getKey(name);
@@ -175,6 +185,7 @@
/**
* getLength method
+ *
* @return int
*/
public int getLength() {
@@ -183,7 +194,8 @@
/**
* @return java.lang.String
- * @param id int
+ * @param id
+ * int
*/
protected String getName(int id) {
return (String) fMap.getValue(id);
@@ -191,8 +203,10 @@
/**
* getNamedItem method
+ *
* @return CMNode
- * @param name java.lang.String
+ * @param name
+ * java.lang.String
*/
public CMNode getNamedItem(String name) {
int id = getID(name);
@@ -203,7 +217,8 @@
/**
* @return boolean
- * @param id int
+ * @param id
+ * int
*/
private boolean isValidID(int id) {
return id >= 0 && id < fDecls.length;
@@ -211,8 +226,10 @@
/**
* item method
+ *
* @return CMNode
- * @param index int
+ * @param index
+ * int
*/
public CMNode item(int index) {
if (!isValidID(index))