java: avoid unnecessary comparisons in boolean expressions

i.e. stuff like "x == true"

Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
This commit is contained in:
Noel Grandin
2014-08-13 10:19:51 +02:00
parent 2922a967a1
commit 60f152caee
93 changed files with 225 additions and 226 deletions

View File

@@ -184,7 +184,7 @@ public class ParcelBrowseNode extends PropertySet
String newName;
if (aParams == null || aParams.length < 1 ||
AnyConverter.isString(aParams[0]) == false)
!AnyConverter.isString(aParams[0]))
{
String prompt = "Enter name for new Script";
String title = "Create Script";
@@ -269,7 +269,7 @@ public class ParcelBrowseNode extends PropertySet
{
if (aParams == null || aParams.length < 1 ||
AnyConverter.isString(aParams[0]) == false)
!AnyConverter.isString(aParams[0]))
{
String prompt = "Enter new name for Library";
String title = "Rename Library";

View File

@@ -183,7 +183,7 @@ public class ProviderBrowseNode extends PropertySet
String name;
if (aParams == null || aParams.length < 1 ||
AnyConverter.isString(aParams[0]) == false)
!AnyConverter.isString(aParams[0]))
{
String prompt = "Enter name for new Parcel";
String title = "Create Parcel";

View File

@@ -83,7 +83,7 @@ public class ScriptBrowseNode extends PropertySet
LogUtils.DEBUG("** caught exception getting script data for " + name + " ->" + e.toString() );
}
if (provider.hasScriptEditor() == true)
if (provider.hasScriptEditor())
{
this.editable = true;

View File

@@ -193,7 +193,7 @@ public abstract class ScriptProvider
contextUrl = getDocUrlFromModel( m_xModel );
m_container = new ParcelContainer( m_xContext, contextUrl, language );
}
else if (AnyConverter.isString(aArguments[0]) == true)
else if (AnyConverter.isString(aArguments[0]))
{
String originalContextURL = AnyConverter.toString(aArguments[0]);
LogUtils.DEBUG("creating Application, path: " + originalContextURL );

View File

@@ -55,7 +55,7 @@ public class PlainSourceView extends JScrollPane
so we don't get a storm of DocumentEvents during loading */
ta.getDocument().removeDocumentListener(this);
if (isModified == false)
if (!isModified)
{
int pos = ta.getCaretPosition();
ta.setText(model.getText());

View File

@@ -314,7 +314,7 @@ public class ScriptEditorForBeanShell
else if (result == JOptionPane.YES_OPTION)
{
boolean saveSuccess = saveTextArea();
if (saveSuccess == false)
if (!saveSuccess)
{
return;
}

View File

@@ -224,7 +224,7 @@ class ScriptImpl implements XScript
}
if (editor != null && editor.isModified() == true)
if (editor != null && editor.isModified())
{
LogUtils.DEBUG("GOT A MODIFIED SOURCE");
source = editor.getText();