Skip to content

Commit 96cb63e

Browse files
jukziiloveeclipse
authored andcommitted
Avoid String.toLowerCase() using equalsIgnoreCase
1 parent 044283f commit 96cb63e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ public void setLog(String logFileName) {
12721272
try {
12731273
int index = logFileName.lastIndexOf('.');
12741274
if (index != -1) {
1275-
if (logFileName.substring(index).toLowerCase().equals(".xml")) { //$NON-NLS-1$
1275+
if (logFileName.substring(index).equalsIgnoreCase(".xml")) { //$NON-NLS-1$
12761276
this.log = new GenericXMLWriter(new OutputStreamWriter(new FileOutputStream(logFileName, false), Util.UTF_8), Util.LINE_SEPARATOR, true);
12771277
this.tagBits |= Logger.XML;
12781278
// insert time stamp as comment

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ private boolean isArchive(File f) {
958958
}
959959

960960
private boolean isJrt(File f) {
961-
return f.getName().toLowerCase().equals(JrtFileSystem.BOOT_MODULE);
961+
return f.getName().equalsIgnoreCase(JrtFileSystem.BOOT_MODULE);
962962
}
963963

964964
/* (non-Javadoc)

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public char[][] listPackages() {
264264
try {
265265
this.binaryFolder.accept(r -> {
266266
String extension = r.getFileExtension();
267-
if (r instanceof IFile && extension != null && SuffixConstants.EXTENSION_class.equals(extension.toLowerCase())) {
267+
if (r instanceof IFile && extension != null && SuffixConstants.EXTENSION_class.equalsIgnoreCase(extension)) {
268268
packageNames.add(r.getParent().getFullPath().makeRelativeTo(basePath).toString().replace('/', '.'));
269269
}
270270
return true;

0 commit comments

Comments
 (0)