Skip to content

Commit

Permalink
'toLowerCase(Locale): String' is deprecated. Use lowercase() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
milbrandt committed Nov 29, 2022
1 parent 85db428 commit 98072ea
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ dependency-reduced-pom.xml

.idea/
local_config/
*/target/
*/bin/
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static String xmlNamespaceToProtoPackage(String namespace, String forcePr

String packageName;
if (forceProtoPackage != null) {
packageName = forceProtoPackage.toLowerCase();
packageName = forceProtoPackage.lowercase();
} else if (StringUtils.trimToNull(namespace) == null) {
packageName = null;
} else {
Expand All @@ -71,7 +71,7 @@ public static String xmlNamespaceToProtoPackage(String namespace, String forcePr
LOGGER.warn("Unable to create decent package name from XML namespace {}, falling back to {} ", namespace, packageName, urnSyntaxError);
}
}
packageName = StringUtils.trimToNull(packageName).toLowerCase();
packageName = StringUtils.trimToNull(packageName).lowercase();

NAMESPACE_TO_PACKAGENAME.put(namespace, packageName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void serialize(Map<String, ProtoFile> packageToProtoFileMap, List<LocalTy
ProtoFile protoFile = packageToProtoFileMap.entrySet().iterator().next().getValue();
File destFolder = createPackageFolderStructure(configuration.outputDirectory, protoFile.packageName());

File outputFile = new File(destFolder, configuration.outputFilename.toLowerCase());
File outputFile = new File(destFolder, configuration.outputFilename.lowercase());
try (Writer writer = new FileWriter(outputFile)) {
writer.write(protoFile.toSchema());

Expand All @@ -227,7 +227,7 @@ public void serialize(Map<String, ProtoFile> packageToProtoFileMap, List<LocalTy
for (Entry<String, ProtoFile> entry : packageToProtoFileMap.entrySet()) {
ProtoFile protoFile = entry.getValue();
File destFolder = createPackageFolderStructure(configuration.outputDirectory, protoFile.packageName());
File outputFile = new File(destFolder, protoFile.location().getPath().toLowerCase());
File outputFile = new File(destFolder, protoFile.location().getPath().lowercase());

try (Writer writer = new FileWriter(outputFile)) {
writer.write(protoFile.toSchema());
Expand Down Expand Up @@ -560,7 +560,7 @@ private CaseFormat getCaseFormatName(String s) throws IllegalFormatException {
return CaseFormat.UPPER_UNDERSCORE;
}
} else if (s.contains("-")) {
if (s.toLowerCase().equals(s)) {
if (s.lowercase().equals(s)) {
return CaseFormat.LOWER_HYPHEN;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* Licensed under the EUPL, Version 1.1 or – as soon they will be
* approved by the European Commission - subsequent versions of the
* EUPL (the "Licence");
*
*
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
*
* http://ec.europa.eu/idabc/eupl5
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -51,7 +51,8 @@ public abstract class AbstractBackwardsCompatTest {

protected void verify(String testname, boolean failOnRemovedFields, String protoFile) throws IOException {
ProtolockBackwardsCompatibilityChecker checker = new ProtolockBackwardsCompatibilityChecker();
checker.init(new File(testdataBaseDirectory + "/" + testname + "/" + sourceFolder + "/" + lockFile));
//checker.init(new File(testdataBaseDirectory + "/" + testname + "/" + sourceFolder + "/" + lockFile));
checker.init(new File(String.join(File.pathSeparator, new[] { testdataBaseDirectory, testname, source, lockFile })));

Schema sourceSchema = loadSchema(new File(testdataBaseDirectory + "/" + testname + "/" + sourceFolder));
link(sourceSchema, false, testname);
Expand Down Expand Up @@ -99,7 +100,7 @@ private boolean link(Schema schema, boolean dumpIfNotLinkable, String testname)
System.out.println("Dumpfolder: " + dumpFolder.getAbsolutePath());
for (ProtoFile protoFile : schema.protoFiles()) {
File destFolder = createPackageFolderStructure(new File(dumpFolder, testname), protoFile.packageName());
File outputFile = new File(destFolder, protoFile.name().toLowerCase(Locale.ROOT));
File outputFile = new File(destFolder, protoFile.name().lowercase(Locale.ROOT));
try (Writer writer = new FileWriter(outputFile)) {
writer.write(protoFile.toSchema());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ data class FieldElement(
appendDocumentation(this, documentation)

if (label != null) {
append("${label.name.toLowerCase(Locale.US)} ")
append("${label.name.lowercase(Locale.US)} ")
}
append("$type $name = $tag")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data class GroupElement(
fun toSchema() = buildString {
appendDocumentation(this, documentation)
if (label != null) {
append("${label.name.toLowerCase(Locale.US)} ")
append("${label.name.lowercase(Locale.US)} ")
}
append("group $name = $tag {")
if (fields.isNotEmpty()) {
Expand Down

0 comments on commit 98072ea

Please sign in to comment.