From d1d5dd2549a943a98b5b2156f73ba0e75cbfc5cb Mon Sep 17 00:00:00 2001 From: Andrei Briukhov Date: Thu, 5 Jan 2023 17:44:40 -0300 Subject: [PATCH] Replaced usage of String.to[U/L]Case() with String.equalsIgnoreCase() No needed to convert case to compare strings in different case. The better in memory and cpu way is to use equalsIgnoreCase() method. --- .../glassfish/common/GlassFishSettings.java | 2 +- .../modules/payara/common/PayaraSettings.java | 2 +- .../modules/tomcat5/util/TomcatInstallUtil.java | 4 ++-- .../web/jsf/wizards/ManagedBeanIterator.java | 2 +- .../groovy/editor/completion/MethodCompletion.java | 4 ++-- .../groovy/editor/completion/TypesCompletion.java | 2 +- .../modules/bugzilla/issue/IssuePanel.java | 6 +++--- .../modules/bugzilla/query/QueryParameter.java | 2 +- .../css/editor/module/spi/CompletionContext.java | 4 ++-- .../modules/db/sql/execute/SQLExecuteHelper.java | 2 +- .../modules/db/sql/history/SQLHistoryEntry.java | 4 ++-- .../netbeans/modules/db/sql/visualeditor/Log.java | 2 +- .../modules/db/explorer/DatabaseConnector.java | 2 +- .../org/netbeans/modules/db/test/DBTestBase.java | 8 ++++---- .../modules/db/test/DefaultDBProvider.java | 2 +- .../modules/nativeexecution/api/util/Path.java | 2 +- .../jellytools/modules/editor/KeyMapOperator.java | 8 ++++---- .../client/SvnClientInvocationHandler.java | 2 +- .../modules/terminal/ioprovider/Terminal.java | 14 +++++++------- .../modules/xml/text/syntax/XMLSyntaxSupport.java | 6 +++--- .../modules/debugger/jpda/js/source/Source.java | 2 +- .../form/editors/PrimitiveTypeArrayEditor.java | 2 +- .../modules/java/hints/WrongPackageSuggestion.java | 2 +- .../LatteVariableCompletionProvider.java | 8 ++++---- .../php/zend2/editor/Zend2EditorExtender.java | 2 +- .../core/network/proxy/NetworkProxyReloader.java | 4 ++-- .../src/org/openide/filesystems/FileUtil.java | 2 +- .../src/org/openide/filesystems/MIMESupport.java | 2 +- .../org/netbeans/modules/uihandler/Installer.java | 2 +- .../profiler/nbimpl/javac/JavacClassInfo.java | 2 +- .../oql/language/OQLCompletionProvider.java | 4 ++-- .../modules/javascript/cdnjs/ui/SearchPanel.java | 4 ++-- .../netbeans/modules/web/inspect/ui/DomPanel.java | 4 ++-- 33 files changed, 60 insertions(+), 60 deletions(-) diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishSettings.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishSettings.java index 01338b62b3fd..39f4fd9fd7bf 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishSettings.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishSettings.java @@ -144,7 +144,7 @@ public static boolean showWindowSystem() { String showProperty = System.getProperty("org.netbeans.core.WindowSystem.show"); return showProperty == null - || !showProperty.toLowerCase().equals("false"); + || !showProperty.equalsIgnoreCase("false"); } } diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraSettings.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraSettings.java index 82917819dbfc..fee9cc2d7f56 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraSettings.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraSettings.java @@ -144,7 +144,7 @@ public static boolean showWindowSystem() { String showProperty = System.getProperty("org.netbeans.core.WindowSystem.show"); return showProperty == null - || !showProperty.toLowerCase().equals("false"); + || !showProperty.equalsIgnoreCase("false"); } } diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatInstallUtil.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatInstallUtil.java index 72df3a855718..9ba02ac4ca86 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatInstallUtil.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatInstallUtil.java @@ -223,8 +223,8 @@ public static void updateDocument(final javax.swing.text.Document doc, private static boolean isHttpConnector(String protocol, String scheme, String secure) { return (protocol == null || protocol.length() == 0 || protocol.toLowerCase().startsWith(HTTP)) - && (scheme == null || !scheme.toLowerCase().equals(HTTPS)) - && (secure == null || !secure.toLowerCase().equals(TRUE)); + && (scheme == null || !scheme.equalsIgnoreCase(HTTPS)) + && (secure == null || !secure.equalsIgnoreCase(TRUE)); } public static boolean setServerPort(int port, File tomcatConf) { diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanIterator.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanIterator.java index 34202132af43..e9abb2be16b4 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanIterator.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanIterator.java @@ -181,7 +181,7 @@ public Set instantiate(TemplateWizard wizard) throws IOException { break; } } else { - if (targetName.equalsIgnoreCase(beanName) && targetName.substring(0, 1).toLowerCase().equals(beanName.substring(0, 1))) { + if (targetName.equalsIgnoreCase(beanName) && targetName.substring(0, 1).equalsIgnoreCase(beanName.substring(0, 1))) { templateProperties.put("classAnnotation", "@ManagedBean"); //NOI18N } else { templateProperties.put("classAnnotation", "@ManagedBean(name=\"" + beanName + "\")"); //NOI18N diff --git a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/MethodCompletion.java b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/MethodCompletion.java index be8717a96285..21b3fde68593 100644 --- a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/MethodCompletion.java +++ b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/MethodCompletion.java @@ -276,7 +276,7 @@ private List getTypesInSameFile() { */ private boolean exactConstructorExists(List typelist, String prefix) { for (Element element : typelist) { - if (prefix.toUpperCase().equals(element.getSimpleName().toString().toUpperCase())) { + if (prefix.equalsIgnoreCase(element.getSimpleName().toString())) { return true; } } @@ -294,7 +294,7 @@ private void addExactProposals(FileObject source, List typeli // all the constructors are named . String constructorName = element.getSimpleName().toString(); - if (constructorName.toUpperCase().equals(context.getPrefix().toUpperCase())) { + if (constructorName.equalsIgnoreCase(context.getPrefix())) { addConstructorProposal(tel.getQualifiedName().toString(), (ExecutableElement) encl); } } diff --git a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/TypesCompletion.java b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/TypesCompletion.java index 675ca3728577..ca6d7b30b0a6 100644 --- a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/TypesCompletion.java +++ b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/TypesCompletion.java @@ -311,7 +311,7 @@ private void addToProposalUsingFilter(Set alreadyPresent, TypeHolder // If we are in situation: "String s = new String|" we don't want to show // String type as a option - we want to show String constructors + types // prefixed with String (e.g. StringBuffer) - if (constructorCompletion && typeName.toUpperCase().equals(request.getPrefix().toUpperCase())) { + if (constructorCompletion && typeName.equalsIgnoreCase(request.getPrefix())) { return; } diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java index 9890ce20f851..69a0efdc7662 100644 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java +++ b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java @@ -489,7 +489,7 @@ private String findInModel(JComboBox combo, String value) { ComboBoxModel model = combo.getModel(); for(int i = 0; i < model.getSize(); i++) { String element = model.getElementAt(i).toString(); - if(value.toLowerCase().equals(element.toString().toLowerCase())) { + if(value.equalsIgnoreCase(element)) { return element; } } @@ -3011,7 +3011,7 @@ private boolean productChanged(boolean reload) { List versions = repository.getConfiguration().getVersions(product); String defaultVersion = getCurrentNetBeansVersion(); for (String v : versions) { - if (v.trim().toLowerCase().equals(defaultVersion.toLowerCase())) { + if (v.trim().equalsIgnoreCase(defaultVersion)) { issue.setFieldValue(IssueField.VERSION, v); } } @@ -3727,7 +3727,7 @@ void makeCaretVisible(JTextArea textArea) { private String getCurrentNetBeansVersion() { String version = parseProductVersion(getProductVersionValue()); if(version != null) { - if(version.toLowerCase().equals("dev")) { // NOI18N + if(version.equalsIgnoreCase("dev")) { // NOI18N return CURRENT_NB_VERSION; } else { return version; diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java index bb1e5ce37115..f625673b855d 100644 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java +++ b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java @@ -345,7 +345,7 @@ public void setValues(ParameterValue[] values) { // need case sensitive compare for(int j = 0; j < model.getSize(); j++) { ParameterValue pv = (ParameterValue) model.getElementAt(j); - if(pv.getValue().toLowerCase().equals(values[i].getValue().toLowerCase())) { + if(pv.getValue().equalsIgnoreCase(values[i].getValue())) { selectionList.add(j); break; } diff --git a/ide/css.editor/src/org/netbeans/modules/css/editor/module/spi/CompletionContext.java b/ide/css.editor/src/org/netbeans/modules/css/editor/module/spi/CompletionContext.java index fdbf5240a250..2143ea4abb12 100644 --- a/ide/css.editor/src/org/netbeans/modules/css/editor/module/spi/CompletionContext.java +++ b/ide/css.editor/src/org/netbeans/modules/css/editor/module/spi/CompletionContext.java @@ -143,7 +143,7 @@ public Node getNodeForNonWhiteTokenBackward() { //empty file return getParseTreeRoot(); } - if(!CssTokenIdCategory.WHITESPACES.name().toLowerCase().equals(t.id().primaryCategory())) { + if(!CssTokenIdCategory.WHITESPACES.name().equalsIgnoreCase(t.id().primaryCategory())) { return NodeUtil.findNonTokenNodeAtOffset(getParseTreeRoot(), ts.offset() + t.length()); } else { if(!ts.movePrevious()) { @@ -175,7 +175,7 @@ public CssTokenId getNonWhiteTokenIdBackward() { //empty file return null; } - if(!CssTokenIdCategory.WHITESPACES.name().toLowerCase().equals(t.id().primaryCategory())) { + if(!CssTokenIdCategory.WHITESPACES.name().equalsIgnoreCase(t.id().primaryCategory())) { return t.id(); } else { if(!ts.movePrevious()) { diff --git a/ide/db.core/src/org/netbeans/modules/db/sql/execute/SQLExecuteHelper.java b/ide/db.core/src/org/netbeans/modules/db/sql/execute/SQLExecuteHelper.java index 01fff0232012..f6361c6d6f0e 100644 --- a/ide/db.core/src/org/netbeans/modules/db/sql/execute/SQLExecuteHelper.java +++ b/ide/db.core/src/org/netbeans/modules/db/sql/execute/SQLExecuteHelper.java @@ -578,7 +578,7 @@ private boolean isToken(String token) { return false; } - if ( substr.toUpperCase().equals(token.toUpperCase())) { // NOI18N + if ( substr.equalsIgnoreCase(token)) { // NOI18N return true; } diff --git a/ide/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryEntry.java b/ide/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryEntry.java index d3dc575f3bd6..0c3bcec80e9a 100644 --- a/ide/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryEntry.java +++ b/ide/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryEntry.java @@ -105,10 +105,10 @@ public boolean equals(Object obj) { return false; } final SQLHistoryEntry other = (SQLHistoryEntry) obj; - if ((this.url == null) ? (other.url != null) : !this.url.toLowerCase().equals(other.url.toLowerCase())) { + if ((this.url == null) ? (other.url != null) : !this.url.equalsIgnoreCase(other.url)) { return false; } - if ((this.sql == null) ? (other.sql != null) : !this.sql.toLowerCase().equals(other.sql.toLowerCase())) { + if ((this.sql == null) ? (other.sql != null) : !this.sql.equalsIgnoreCase(other.sql)) { return false; } return true; diff --git a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/Log.java b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/Log.java index 96d177642078..a5b9025baded 100644 --- a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/Log.java +++ b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/Log.java @@ -62,7 +62,7 @@ private Logger getPackageLogger() { if (logger == null) { String prop = System.getProperty(packageName, DEFAULT_NAME); for (int i = 1; i < LEVELS.length; i++) { - if (prop.toLowerCase().equals(LEVEL_NAMES[i].toLowerCase())) { + if (prop.equalsIgnoreCase(LEVEL_NAMES[i])) { level = LEVELS[i]; break; } diff --git a/ide/db/src/org/netbeans/modules/db/explorer/DatabaseConnector.java b/ide/db/src/org/netbeans/modules/db/explorer/DatabaseConnector.java index c0d0a4660993..87413c83fba4 100644 --- a/ide/db/src/org/netbeans/modules/db/explorer/DatabaseConnector.java +++ b/ide/db/src/org/netbeans/modules/db/explorer/DatabaseConnector.java @@ -214,7 +214,7 @@ public TableColumn getColumnSpecification(Table table, Column column) throws Dat col.setColumnSize(0); } - col.setNullAllowed((rset.get(Integer.valueOf(18))).toUpperCase().equals("YES")); //NOI18N + col.setNullAllowed((rset.get(Integer.valueOf(18))).equalsIgnoreCase("YES")); //NOI18N col.setDefaultValue(rset.get(Integer.valueOf(13))); rset.clear(); } else { diff --git a/ide/db/test/unit/src/org/netbeans/modules/db/test/DBTestBase.java b/ide/db/test/unit/src/org/netbeans/modules/db/test/DBTestBase.java index 13d8ccb6ebad..bc57c8a72992 100644 --- a/ide/db/test/unit/src/org/netbeans/modules/db/test/DBTestBase.java +++ b/ide/db/test/unit/src/org/netbeans/modules/db/test/DBTestBase.java @@ -176,7 +176,7 @@ protected TableNode getTableNode(String tablename) throws Exception { // DatabaseNodeInfo.printChildren("tables", tables); for (Node table : tables) { - if (tablename.toLowerCase().equals(table.getDisplayName().toLowerCase())) { + if (tablename.equalsIgnoreCase(table.getDisplayName())) { return (TableNode)table; } } @@ -189,7 +189,7 @@ protected TableNode getTableNode(String tablename) throws Exception { // DatabaseNodeInfo.printChildren("tables", tables); for (Node table : tables) { - if (tablename.toLowerCase().equals(table.getDisplayName().toLowerCase())) { + if (tablename.equalsIgnoreCase(table.getDisplayName())) { return (TableNode)table; } } @@ -224,7 +224,7 @@ protected ViewNode getViewNode(String viewname) throws Exception { // DatabaseNodeInfo.printChildren("tables", tables); for (Node view : views) { - if (viewname.toLowerCase().equals(view.getDisplayName().toLowerCase())) { + if (viewname.equalsIgnoreCase(view.getDisplayName())) { return (ViewNode)view; } } @@ -237,7 +237,7 @@ protected ViewNode getViewNode(String viewname) throws Exception { // DatabaseNodeInfo.printChildren("tables", tables); for (Node view : views) { - if (viewname.toLowerCase().equals(view.getDisplayName().toLowerCase())) { + if (viewname.equalsIgnoreCase(view.getDisplayName())) { return (ViewNode)view; } } diff --git a/ide/db/test/unit/src/org/netbeans/modules/db/test/DefaultDBProvider.java b/ide/db/test/unit/src/org/netbeans/modules/db/test/DefaultDBProvider.java index 712f48c09538..029586537ce2 100644 --- a/ide/db/test/unit/src/org/netbeans/modules/db/test/DefaultDBProvider.java +++ b/ide/db/test/unit/src/org/netbeans/modules/db/test/DefaultDBProvider.java @@ -80,7 +80,7 @@ public boolean schemaExists(Connection conn, String schemaName) throws Exception ResultSet rs = md.getSchemas(); while ( rs.next() ) { - if ( schemaName.toLowerCase().equals(rs.getString(1).toLowerCase())) { + if ( schemaName.equalsIgnoreCase(rs.getString(1))) { return true; } } diff --git a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/Path.java b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/Path.java index be8323fe7178..805b9500a5e2 100644 --- a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/Path.java +++ b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/Path.java @@ -100,7 +100,7 @@ public static String getPathName() { if (pathName == null) { if (Utilities.isWindows()) { for (String key : System.getenv().keySet()) { - if (key.toLowerCase().equals("path")) { // NOI18N + if (key.equalsIgnoreCase("path")) { // NOI18N pathName = key.substring(0, 4); return pathName; } diff --git a/ide/editor/test/qa-functional/src/org/netbeans/jellytools/modules/editor/KeyMapOperator.java b/ide/editor/test/qa-functional/src/org/netbeans/jellytools/modules/editor/KeyMapOperator.java index 45bdbe5e7424..c536c0c1ba37 100644 --- a/ide/editor/test/qa-functional/src/org/netbeans/jellytools/modules/editor/KeyMapOperator.java +++ b/ide/editor/test/qa-functional/src/org/netbeans/jellytools/modules/editor/KeyMapOperator.java @@ -164,7 +164,7 @@ public Vector getAllShortcutsForAction(String actionName) { String _scStr; for (int i = 0; i < tm.getRowCount(); i++) { _str = tm.getValueAt(i, 0).toString(); - if (_str.toLowerCase().equals(actionName.toLowerCase()) || _str.toLowerCase().equals(actionName.toLowerCase() + " (alternative shortcut)")) { + if (_str.equalsIgnoreCase(actionName) || _str.equalsIgnoreCase(actionName + " (alternative shortcut)")) { _scStr = tm.getValueAt(i, 1).toString().toLowerCase(); lstr.add(_scStr); System.out.println("[TEST_DEBUG] -> found action \"" + _str + "\" with shortcut " + _scStr); @@ -192,7 +192,7 @@ public boolean assignShortcutToAction(String actionName, boolean ctrl, boolean s for (int i = 0; i < tab.getRowCount(); i++) { _str = tm.getValueAt(i, 0).toString(); System.out.println("[TEST_DEBUG] Examining action \"" + _str + "\", which is no. " + (i + 1) + " in the table..."); - if (_str.toLowerCase().equals(actionName.toLowerCase())) { + if (_str.equalsIgnoreCase(actionName)) { System.out.println("[TEST_DEBUG] -> action \"" + _str + "\" (" + actionName + ") was found"); sleep(100); tab.clickForEdit(i, 1); @@ -232,7 +232,7 @@ public boolean assignAlternativeShortcutToAction(String actionName, boolean ctrl for (int i = 0; i < tab.getRowCount(); i++) { _str = tm.getValueAt(i, 0).toString(); System.out.println("[TEST_DEBUG] Examining action " + _str + ", which is no. " + (i + 1) + "in the table..."); - if (_str.toLowerCase().equals(actionName.toLowerCase())) { + if (_str.equalsIgnoreCase(actionName)) { System.out.println("[TEST_DEBUG] Action " + actionName + "was found"); JListOperator jli = clickShortcutEllipsisButton(tab, i); retval = true; @@ -271,7 +271,7 @@ public boolean unassignAlternativeShortcutToAction(String actionName, String sho for (int i = 0; i < tab.getRowCount(); i++) { _str = tm.getValueAt(i, 0).toString(); System.out.println("[TEST_DEBUG] Examining action " + _str + ", which is no. " + (i + 1) + "in the table..."); - if (_str.toLowerCase().startsWith(actionName.toLowerCase()) && tm.getValueAt(i, 1).toString().toLowerCase().equals(shortcutStr.toLowerCase())) { + if (_str.toLowerCase().startsWith(actionName.toLowerCase()) && tm.getValueAt(i, 1).toString().equalsIgnoreCase(shortcutStr)) { System.out.println("[TEST_DEBUG] Action " + actionName + "was found"); JListOperator jli = clickShortcutEllipsisButton(tab, i); jli.clickOnItem("Clear"); diff --git a/ide/subversion/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandler.java b/ide/subversion/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandler.java index 284f365eaf03..d462d46e13d6 100644 --- a/ide/subversion/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandler.java +++ b/ide/subversion/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandler.java @@ -221,7 +221,7 @@ public Object run () throws Exception { } catch (SSLKeyException ex) { if(ex.getCause() instanceof InvalidKeyException) { InvalidKeyException ike = (InvalidKeyException) ex.getCause(); - if(ike.getMessage().toLowerCase().equals("illegal key size or default parameters")) { // NOI18N + if(ike.getMessage().equalsIgnoreCase("illegal key size or default parameters")) { // NOI18N SvnClientExceptionHandler.handleInvalidKeyException(ike); } return null; diff --git a/ide/terminal.nb/src/org/netbeans/modules/terminal/ioprovider/Terminal.java b/ide/terminal.nb/src/org/netbeans/modules/terminal/ioprovider/Terminal.java index 2574aa5bdeeb..c6597c699bc5 100644 --- a/ide/terminal.nb/src/org/netbeans/modules/terminal/ioprovider/Terminal.java +++ b/ide/terminal.nb/src/org/netbeans/modules/terminal/ioprovider/Terminal.java @@ -586,19 +586,19 @@ private void applyDebugFlags() { StringTokenizer st = new StringTokenizer(value, ","); // NOI18N while (st.hasMoreTokens()) { String s = st.nextToken(); - if (s.toLowerCase().equals("ops")) // NOI18N + if (s.equalsIgnoreCase("ops")) // NOI18N flags |= Term.DEBUG_OPS; - else if (s.toLowerCase().equals("keys")) // NOI18N + else if (s.equalsIgnoreCase("keys")) // NOI18N flags |= Term.DEBUG_KEYS; - else if (s.toLowerCase().equals("input")) // NOI18N + else if (s.equalsIgnoreCase("input")) // NOI18N flags |= Term.DEBUG_INPUT; - else if (s.toLowerCase().equals("output")) // NOI18N + else if (s.equalsIgnoreCase("output")) // NOI18N flags |= Term.DEBUG_OUTPUT; - else if (s.toLowerCase().equals("wrap")) // NOI18N + else if (s.equalsIgnoreCase("wrap")) // NOI18N flags |= Term.DEBUG_WRAP; - else if (s.toLowerCase().equals("margins")) // NOI18N + else if (s.equalsIgnoreCase("margins")) // NOI18N flags |= Term.DEBUG_MARGINS; - else if (s.toLowerCase().equals("sequences")) // NOI18N + else if (s.equalsIgnoreCase("sequences")) // NOI18N term.setSequenceLogging(true); else ; diff --git a/ide/xml.text.obsolete90/src/org/netbeans/modules/xml/text/syntax/XMLSyntaxSupport.java b/ide/xml.text.obsolete90/src/org/netbeans/modules/xml/text/syntax/XMLSyntaxSupport.java index 66da0c419a04..8309d76a3d76 100644 --- a/ide/xml.text.obsolete90/src/org/netbeans/modules/xml/text/syntax/XMLSyntaxSupport.java +++ b/ide/xml.text.obsolete90/src/org/netbeans/modules/xml/text/syntax/XMLSyntaxSupport.java @@ -875,7 +875,7 @@ public int[] findMatch(int offset, boolean simpleSearch) String tag = token.getImage().substring(2).trim().toLowerCase(); while ( token != null){ if (token.getTokenID() == XMLTokenIDs.TAG && !">".equals(token.getImage())) { - if (token.getImage().substring(1).trim().toLowerCase().equals(tag) + if (token.getImage().substring(1).trim().equalsIgnoreCase(tag) && !isSingletonTag(token)) { //it's an open tag if (poss == 0){ @@ -911,7 +911,7 @@ public int[] findMatch(int offset, boolean simpleSearch) String tag = token.getImage().substring(1).toLowerCase(); while ( token != null){ if (token.getTokenID() == XMLTokenIDs.TAG && !">".equals(token.getImage())) { - if (token.getImage().substring(2).trim().toLowerCase().equals(tag)) { + if (token.getImage().substring(2).trim().equalsIgnoreCase(tag)) { //it's a close tag if (poss == 0) { //get offset of previous token: < or getMethodsToScan() { diff --git a/php/php.zend2/src/org/netbeans/modules/php/zend2/editor/Zend2EditorExtender.java b/php/php.zend2/src/org/netbeans/modules/php/zend2/editor/Zend2EditorExtender.java index 8ba8cd38e81a..9234019f63a6 100644 --- a/php/php.zend2/src/org/netbeans/modules/php/zend2/editor/Zend2EditorExtender.java +++ b/php/php.zend2/src/org/netbeans/modules/php/zend2/editor/Zend2EditorExtender.java @@ -199,7 +199,7 @@ public void visit(ClassDeclaration node) { @Override public void visit(MethodDeclaration node) { - if (CodeUtils.extractMethodName(node).toLowerCase().equalsIgnoreCase(action)) { + if (CodeUtils.extractMethodName(node).equalsIgnoreCase(action)) { actionDeclarations.add(node); } } diff --git a/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxyReloader.java b/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxyReloader.java index 6692e1321509..a1be6b98bba1 100644 --- a/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxyReloader.java +++ b/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxyReloader.java @@ -207,12 +207,12 @@ private static NetworkProxyResolver getNetworkProxyResolver() { if (Utilities.isUnix()){ String env = System.getProperty(RUNNING_ENV_SYS_PROPERTY); if (env != null) { - if (env.toLowerCase().equals(GNOME)) { + if (env.equalsIgnoreCase(GNOME)) { LOGGER.log(Level.INFO, "System network proxy resolver: Gnome"); //NOI18N return new GnomeNetworkProxy(); } - if (env.toLowerCase().equals(KDE)) { + if (env.equalsIgnoreCase(KDE)) { LOGGER.log(Level.INFO, "System network proxy resolver: KDE"); //NOI18N return new KdeNetworkProxy(); } diff --git a/platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java b/platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java index 8aa969d5733e..104d79c500a6 100644 --- a/platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java +++ b/platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java @@ -1325,7 +1325,7 @@ public static FileObject findBrother(FileObject fo, String ext) { @Deprecated public static String getMIMEType(String ext) { assert false : "FileUtil.getMIMEType(String extension) is deprecated. Please, use FileUtil.getMIMEType(FileObject)."; //NOI18N - if (ext.toLowerCase().equals("xml")) { //NOI18N + if (ext.equalsIgnoreCase("xml")) { //NOI18N return "text/xml"; // NOI18N } return null; diff --git a/platform/openide.filesystems/src/org/openide/filesystems/MIMESupport.java b/platform/openide.filesystems/src/org/openide/filesystems/MIMESupport.java index 1ad36f679f21..690f87403a18 100644 --- a/platform/openide.filesystems/src/org/openide/filesystems/MIMESupport.java +++ b/platform/openide.filesystems/src/org/openide/filesystems/MIMESupport.java @@ -287,7 +287,7 @@ public String getMIMEType(String... withinMIMETypes) { resolvedMimeType = resolveMIME(withinMIMETypes); if (resolvedMimeType == null) { // fallback for xml files to be recognized e.g. in platform without any MIME resolver registered - if (getExt().toLowerCase().equals("xml")) { //NOI18N + if (getExt().equalsIgnoreCase("xml")) { //NOI18N resolvedMimeType = "text/xml"; // NOI18N } else { // general fallback diff --git a/platform/uihandler/src/org/netbeans/modules/uihandler/Installer.java b/platform/uihandler/src/org/netbeans/modules/uihandler/Installer.java index 3e89d3f09724..bad0b9aafe51 100644 --- a/platform/uihandler/src/org/netbeans/modules/uihandler/Installer.java +++ b/platform/uihandler/src/org/netbeans/modules/uihandler/Installer.java @@ -2679,7 +2679,7 @@ protected void alterMessage(final DialogDescriptor dd) { String rptr = null; if (obj instanceof AbstractButton ) { abut = (AbstractButton) obj; - if(abut.getText().toLowerCase().equals("send")){ + if(abut.getText().equalsIgnoreCase("send")){ // disable sen button initialy, report panel can later enable it abut.setEnabled(false); abut.setToolTipText(NbBundle.getMessage(Installer.class, "ReportPanel.sendButton.tooltip"));//NOI18N diff --git a/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/javac/JavacClassInfo.java b/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/javac/JavacClassInfo.java index 0998b64a1cdb..0437a4ef96a1 100644 --- a/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/javac/JavacClassInfo.java +++ b/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/javac/JavacClassInfo.java @@ -388,7 +388,7 @@ private synchronized JavaSource getSource(boolean allowSourceLess) { JavaSource jSrc = sourceRef != null ? sourceRef.get() : null; if (jSrc == null || (!allowSourceLess && jSrc.getFileObjects().isEmpty())) { FileObject f = getFile(); - if (f.getExt().toLowerCase().equals("java") || f.getExt().toLowerCase().equals("class")) { // NOI18N + if (f.getExt().equalsIgnoreCase("java") || f.getExt().equalsIgnoreCase("class")) { // NOI18N jSrc = cpInfo != null ? JavaSource.create(cpInfo, f) : JavaSource.forFileObject(f); } else if (cpInfo != null) { jSrc = JavaSource.create(cpInfo); diff --git a/profiler/profiler.oql.language/src/org/netbeans/modules/profiler/oql/language/OQLCompletionProvider.java b/profiler/profiler.oql.language/src/org/netbeans/modules/profiler/oql/language/OQLCompletionProvider.java index 74205e57762a..83f29516b733 100644 --- a/profiler/profiler.oql.language/src/org/netbeans/modules/profiler/oql/language/OQLCompletionProvider.java +++ b/profiler/profiler.oql.language/src/org/netbeans/modules/profiler/oql/language/OQLCompletionProvider.java @@ -149,7 +149,7 @@ protected void query(final CompletionResultSet resultSet, Document doc, int care int backout = 0; if (ts.movePrevious()) backout++; if (ts.movePrevious()) backout++; // check for "heap.somet[...]" - isHeap = ts.token().text().toString().trim().toLowerCase().equals("heap"); // NOI18N + isHeap = ts.token().text().toString().trim().equalsIgnoreCase("heap"); // NOI18N // get to the current token for(int i=backout;i>0;i--) { ts.moveNext(); @@ -199,7 +199,7 @@ protected void query(final CompletionResultSet resultSet, Document doc, int care } case DOT: { ts.movePrevious(); - if (ts.token().text().toString().trim().toLowerCase().equals("heap")) { // NOI18N + if (ts.token().text().toString().trim().equalsIgnoreCase("heap")) { // NOI18N ts.moveNext(); for(String method : heapMethods) { diff --git a/webcommon/javascript.cdnjs/src/org/netbeans/modules/javascript/cdnjs/ui/SearchPanel.java b/webcommon/javascript.cdnjs/src/org/netbeans/modules/javascript/cdnjs/ui/SearchPanel.java index f7a8131b5ea6..caabf1b7b185 100644 --- a/webcommon/javascript.cdnjs/src/org/netbeans/modules/javascript/cdnjs/ui/SearchPanel.java +++ b/webcommon/javascript.cdnjs/src/org/netbeans/modules/javascript/cdnjs/ui/SearchPanel.java @@ -182,9 +182,9 @@ final void updateLibraries(Library[] libraries) { */ private void preSelectSearchedLibrary(Library[] libraries) { int index = 0; - String term = lastSearchTerm == null ? "" : lastSearchTerm.toLowerCase(); // NOI18N + String term = lastSearchTerm == null ? "" : lastSearchTerm; // NOI18N for (int i=0; i