Use toLowerCase() and toUpperCase() with Locale.ENGLISH

This commit updates all `toLowerCase()` and `toUpperCase` invocations to
use the variant that takes a `Locale` to avoid locale-specific side
effect.

Closes gh-12213
This commit is contained in:
Stephane Nicoll
2018-02-26 17:49:03 +01:00
parent 915eaf3447
commit b4a7e1d64b
38 changed files with 148 additions and 87 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package sample.data.gemfire.service;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import javax.annotation.PostConstruct;
@@ -126,7 +127,7 @@ public class GemstoneServiceImpl implements GemstoneService {
}
Gemstone validate(Gemstone gemstone) {
if (!APPROVED_GEMS.contains(gemstone.getName().toUpperCase())) {
if (!APPROVED_GEMS.contains(gemstone.getName().toUpperCase(Locale.ENGLISH))) {
// NOTE if the Gemstone is not valid, throw error...
// Should cause transaction to rollback in GemFire!
System.err.printf("Illegal Gemstone [%1$s]!%n", gemstone.getName());