diff options
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common')
2 files changed, 10 insertions, 5 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java index 6e5b287..17726d0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java @@ -28,8 +28,10 @@ import static com.android.ide.common.layout.LayoutConstants.ATTR_TEXT; import static com.android.ide.common.layout.LayoutConstants.DOT_LAYOUT_PARAMS; import static com.android.ide.common.layout.LayoutConstants.ID_PREFIX; import static com.android.ide.common.layout.LayoutConstants.NEW_ID_PREFIX; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FALSE; import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; import static com.android.ide.common.layout.LayoutConstants.VALUE_MATCH_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_TRUE; import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_FRAGMENT; @@ -59,6 +61,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -644,11 +647,12 @@ public class BaseViewRule extends AbstractViewRule { // Toggles are handled as a multiple-choice between true, false // and nothing (clear) String value = selectedNode.getStringAttr(ANDROID_URI, id); - if (value != null) - value = value.toLowerCase(); - if ("true".equals(value)) { //$NON-NLS-1$ + if (value != null) { + value = value.toLowerCase(Locale.US); + } + if (VALUE_TRUE.equals(value)) { value = TRUE_ID; - } else if ("false".equals(value)) { //$NON-NLS-1$ + } else if (VALUE_FALSE.equals(value)) { value = FALSE_ID; } else { value = CLEAR_ID; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttrsXmlParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttrsXmlParser.java index ed2fb75..abe56d8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttrsXmlParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttrsXmlParser.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.TreeSet; @@ -475,7 +476,7 @@ public final class AttrsXmlParser { if (attrFormat != null) { for (String f : attrFormat.getNodeValue().split("\\|")) { //$NON-NLS-1$ try { - Format format = AttributeInfo.Format.valueOf(f.toUpperCase()); + Format format = AttributeInfo.Format.valueOf(f.toUpperCase(Locale.US)); // enum and flags are handled differently right below if (format != null && format != AttributeInfo.Format.ENUM && |