summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-13 10:19:51 +0200
committerNoel Grandin <noel@peralex.com>2014-08-20 10:35:53 +0200
commit60f152caeee38579433a31dd3a98e91dc3d23ff6 (patch)
tree15ba69f938e09bb173ca7de2e1b21b62e740ea40 /javaunohelper
parent2922a967a1da5f9c0a07b5390906307d0ae6fe48 (diff)
java: avoid unnecessary comparisons in boolean expressions
i.e. stuff like "x == true" Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
Diffstat (limited to 'javaunohelper')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java6
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java2
-rw-r--r--javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java2
-rw-r--r--javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java4
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java6
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java14
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer_Test.java12
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java28
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java2
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/WeakBase_Test.java8
10 files changed, 42 insertions, 42 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
index caf5cdc9b2f3..650be99c87c3 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
@@ -314,7 +314,7 @@ public class InterfaceContainer implements Cloneable
while (it.hasNext())
{
Object obj= it.next();
- if (false == contains(obj))
+ if (!contains(obj))
{
retVal= false;
break;
@@ -556,7 +556,7 @@ public class InterfaceContainer implements Cloneable
break;
}
}
- if (bExists == false)
+ if (!bExists)
{
itColl= collection.iterator();
while (itColl.hasNext())
@@ -572,7 +572,7 @@ public class InterfaceContainer implements Cloneable
}
}
}
- if (bExists == true)
+ if (bExists)
arRetained[indexRetained++]= curElem;
}
retVal= size != indexRetained;
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index ca72af9c81ac..227dcdeff26e 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -264,7 +264,7 @@ XMultiPropertySet
*/
protected void assignPropertyId(Property prop, Object id)
{
- if (id instanceof String && ((String) id).equals("") == false)
+ if (id instanceof String && !((String) id).equals(""))
_propertyToIdMap.put(prop, id);
}
diff --git a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
index 0031e1a576b3..fc7640ef23ec 100644
--- a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
+++ b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
@@ -109,7 +109,7 @@ public class Bootstrap_Test {
}
}
- System.exit( test(args[0], bootstrap_parameters) == true ? 0: -1 );
+ System.exit( test(args[0], bootstrap_parameters) ? 0: -1 );
}
}
diff --git a/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java b/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java
index a0f69d850923..3df517eec804 100644
--- a/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java
+++ b/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java
@@ -142,7 +142,7 @@ public class SharedLibraryLoader_Test {
result = SharedLibraryLoader.writeRegistryServiceInfo( null, regKey );
System.out.print("Test - ");
- System.out.println( result==false ? "failed" : "successful");
+ System.out.println( !result ? "failed" : "successful");
System.out.println("*******************************************************************");
System.out.println();
return result;
@@ -163,7 +163,7 @@ public class SharedLibraryLoader_Test {
}
static public void main(String args[]) throws java.lang.Exception {
- System.exit( test() == true ? 0: -1 );
+ System.exit( test() ? 0: -1 );
}
}
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java
index 0c517ca68347..5afc6385ea5d 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java
@@ -80,7 +80,7 @@ public class ComponentBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -114,7 +114,7 @@ public class ComponentBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -133,7 +133,7 @@ public class ComponentBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Errors occurred!");
else
System.out.println("No errors.");
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
index 976968f1a6a0..e76825e245d8 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
@@ -94,7 +94,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -114,7 +114,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -135,7 +135,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -155,7 +155,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -194,7 +194,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -229,7 +229,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -915,7 +915,7 @@ public class InterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer_Test.java
index 331c37618b1c..22e664170486 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer_Test.java
@@ -107,7 +107,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -153,7 +153,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -186,7 +186,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -221,7 +221,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -254,7 +254,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -288,7 +288,7 @@ public class MultiTypeInterfaceContainer_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
index c3f950b3031d..8653af4e03be 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
@@ -57,7 +57,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -79,7 +79,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -581,7 +581,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -776,7 +776,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -828,7 +828,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -859,7 +859,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -885,7 +885,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -920,7 +920,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -949,7 +949,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -991,7 +991,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -1025,7 +1025,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -1065,7 +1065,7 @@ public class PropertySet_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Errors occurred!");
else
System.out.println("No errors.");
@@ -1503,7 +1503,7 @@ class TestClass2 extends PropertySet
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -1566,7 +1566,7 @@ class TestClass2 extends PropertySet
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java b/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java
index f5408545b6b5..2e48cd99a010 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java
@@ -43,7 +43,7 @@ public class ProxyProvider
{
Object retVal= null;
- if (obj == null || iface == null || iface.isInstance(obj) == false )
+ if (obj == null || iface == null || !iface.isInstance(obj) )
return retVal;
Type type= new Type(TypeDescription.getTypeDescription(iface));
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/WeakBase_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/WeakBase_Test.java
index 6177a82e53db..81806f6b94ac 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/WeakBase_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/WeakBase_Test.java
@@ -65,7 +65,7 @@ public class WeakBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -99,7 +99,7 @@ public class WeakBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -168,7 +168,7 @@ public class WeakBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Failed");
else
System.out.println("Ok");
@@ -187,7 +187,7 @@ public class WeakBase_Test
boolean bOk= true;
for (int c= 0; c < i; c++)
bOk= bOk && r[c];
- if (bOk == false)
+ if (!bOk)
System.out.println("Errors occurred!");
else
System.out.println("No errors.");