mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-04-27 09:05:36 +00:00
SPARK-2204: Code cleanup: Replace String.indexOf() with contains() when applicable
This commit is contained in:
@ -598,7 +598,7 @@ public class HistoryTranscript extends SwingWorker {
|
||||
}
|
||||
try {
|
||||
//if the view contains line break char return forced break
|
||||
if (getDocument().getText(p0, p1 - p0).indexOf(SEPARATOR) >= 0) {
|
||||
if (getDocument().getText(p0, p1 - p0).contains(SEPARATOR)) {
|
||||
return View.ForcedBreakWeight;
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ public class WorkgroupInvitationDialog implements PropertyChangeListener {
|
||||
}
|
||||
else if (FpRes.getString("invite").equals(value) || FpRes.getString("transfer").equals(value)) {
|
||||
String agent = jidField.getText();
|
||||
boolean isValidJID = agent.indexOf("@") != -1;
|
||||
boolean isValidJID = agent.contains("@");
|
||||
|
||||
if (!ModelUtil.hasLength(agent)) {
|
||||
JOptionPane.showMessageDialog(dlg, FpRes.getString("message.no.agent.selected.error"),
|
||||
|
||||
@ -117,9 +117,9 @@ public class OSUtils
|
||||
IS_LINUX = false;
|
||||
IS_MAC = false;
|
||||
IS_WINDOWS = true;
|
||||
IS_WINDOWS_VISTA = (osName.indexOf("Vista") != -1);
|
||||
IS_WINDOWS_7 = (osName.indexOf("7") != -1);
|
||||
IS_WINDOWS_8 = (osName.indexOf("8") != -1);
|
||||
IS_WINDOWS_VISTA = (osName.contains("Vista"));
|
||||
IS_WINDOWS_7 = (osName.contains("7"));
|
||||
IS_WINDOWS_8 = (osName.contains("8"));
|
||||
IS_FREEBSD = false;
|
||||
}
|
||||
else if (osName.startsWith("FreeBSD"))
|
||||
@ -153,12 +153,12 @@ public class OSUtils
|
||||
IS_32_BIT = true;
|
||||
IS_64_BIT = false;
|
||||
}
|
||||
else if (osArch.indexOf("32") != -1)
|
||||
else if (osArch.contains("32"))
|
||||
{
|
||||
IS_32_BIT = true;
|
||||
IS_64_BIT = false;
|
||||
}
|
||||
else if (osArch.indexOf("64") != -1)
|
||||
else if (osArch.contains("64"))
|
||||
{
|
||||
IS_32_BIT = false;
|
||||
IS_64_BIT = true;
|
||||
|
||||
Reference in New Issue
Block a user