Kaydet (Commit) a753a458 authored tarafından Noel Grandin's avatar Noel Grandin

java: avoid if..else when returning boolean values

Change-Id: Iab52762a9abfe8735223372b09638ce9d8d44318
üst 60f152ca
......@@ -80,17 +80,11 @@ class Proxy implements IQueryInterface, XEventListener
if (object instanceof IQueryInterface)
{
IQueryInterface iquery = (IQueryInterface) object;
if (iquery.getOid().equals(oid))
return true;
else
return false;
return (iquery.getOid().equals(oid));
}
String oidObj = UnoRuntime.generateOid(object);
if (oidObj.equals(oid))
return true;
else
return false;
return (oidObj.equals(oid));
}
public Object queryInterface(Type type) {
......
......@@ -244,15 +244,8 @@ public class ParameterHelper
String sOfficeViewable = (String)m_aCurrentParams.get(PropertyName.OFFICE_VIEWABLE);
if (sOfficeViewable != null)
{
if (sOfficeViewable.toLowerCase().equals("yes") ||
sOfficeViewable.toLowerCase().equals("true"))
{
return false; // setViewable();
}
else
{
return true; // setHidden();
}
return !(sOfficeViewable.toLowerCase().equals("yes") ||
sOfficeViewable.toLowerCase().equals("true"));
}
return true; /* default: hidden */
}
......
......@@ -182,10 +182,7 @@ public class ScriptPanel extends JPanel {
@Override
public boolean isCellEditable(int row, int col) {
if (col == 0)
return false;
else
return true;
return (col != 0);
}
@Override
......
......@@ -174,9 +174,6 @@ public class ParcelSupport implements ParcelCookie
message, NotifyDescriptor.OK_CANCEL_OPTION);
TopManager.getDefault().notify(d);
if (d.getValue() == NotifyDescriptor.CANCEL_OPTION)
return false;
else
return true;
return (d.getValue() != NotifyDescriptor.CANCEL_OPTION);
}
}
......@@ -66,10 +66,7 @@ public class NagDialog {
public boolean show() {
TopManager.getDefault().notify(descriptor);
if (descriptor.getValue() == NotifyDescriptor.OK_OPTION)
return true;
else
return false;
return (descriptor.getValue() == NotifyDescriptor.OK_OPTION);
}
public boolean getState() {
......
......@@ -77,9 +77,6 @@ public class _XFunctionProvider extends MultiMethodTest {
output = "XFunction.class";
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
}
......@@ -86,10 +86,7 @@ public class _XScriptInfoAccess extends MultiMethodTest {
}
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
public void _getImplementations() {
......@@ -143,10 +140,7 @@ public class _XScriptInfoAccess extends MultiMethodTest {
}
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
public void _getAllImplementations() {
......@@ -196,9 +190,6 @@ public class _XScriptInfoAccess extends MultiMethodTest {
}
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
}
......@@ -133,10 +133,7 @@ public class _XScriptInvocation extends MultiMethodTest {
ctx.dispose();
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
private int getStorageId(String location) {
......
......@@ -112,10 +112,7 @@ public class _XScriptNameResolver extends MultiMethodTest {
}
log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected))
return true;
else
return false;
return (output.equals(expected));
}
private int getStorageId(String location) {
......
......@@ -181,14 +181,7 @@ public class _XScriptSecurity extends MultiMethodTest {
expectedPath = uri.substring(0, uri.lastIndexOf('/'));
}
log.println("pathlist: expected: " + expectedPath + ", output: " + setPath);
if( setPath.equals( expectedPath ) )
{
return true;
}
else
{
return false;
}
return setPath.equals( expectedPath );
}
return true;
}
......
......@@ -299,11 +299,7 @@ class MyTableModelIDE extends AbstractTableModel {
@Override
public boolean isCellEditable(int row, int col) {
if (col == 0) {
return true;
} else {
return false;
}
return (col == 0);
}
@Override
......
......@@ -314,11 +314,7 @@ class MyTableModel extends AbstractTableModel {
@Override
public boolean isCellEditable(int row, int col) {
if (col == 0) {
return true;
} else {
return false;
}
return (col == 0);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment