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 24da493
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 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 @@ -99,7 +99,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 24da493

Please sign in to comment.