Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exceptions when app is running with different locale than english #44

Merged
merged 2 commits into from
Oct 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import org.antlr.runtime.ANTLRStringStream;
Expand Down Expand Up @@ -158,7 +159,7 @@ public static UIQueryAST uiQueryFromAst(CommonTree step) {
case UIQueryParser.BEGINPRED:
return UIQueryASTPredicate.newPredicateFromAST(step);
case UIQueryParser.DIRECTION:
return UIQueryDirection.valueOf(step.getText().toUpperCase());
return UIQueryDirection.valueOf(step.getText().toUpperCase(Locale.ENGLISH));

default:
throw new InvalidUIQueryException("Unknown query: " + stepType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.*;

Expand Down Expand Up @@ -165,7 +166,7 @@ public static UIQueryASTPredicate newPredicateFromAST(CommonTree step) {
}

private static UIQueryASTPredicateRelation parseRelation(CommonTree rel) {
String relText = rel.getText().toUpperCase();
String relText = rel.getText().toUpperCase(Locale.ENGLISH);
boolean caseSensitive = true;
final String CASE_INSENSITIVE_SPEC = "[C]";
if (relText.endsWith(CASE_INSENSITIVE_SPEC)) {
Expand Down