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 ...@@ -80,17 +80,11 @@ class Proxy implements IQueryInterface, XEventListener
if (object instanceof IQueryInterface) if (object instanceof IQueryInterface)
{ {
IQueryInterface iquery = (IQueryInterface) object; IQueryInterface iquery = (IQueryInterface) object;
if (iquery.getOid().equals(oid)) return (iquery.getOid().equals(oid));
return true;
else
return false;
} }
String oidObj = UnoRuntime.generateOid(object); String oidObj = UnoRuntime.generateOid(object);
if (oidObj.equals(oid)) return (oidObj.equals(oid));
return true;
else
return false;
} }
public Object queryInterface(Type type) { public Object queryInterface(Type type) {
......
...@@ -244,15 +244,8 @@ public class ParameterHelper ...@@ -244,15 +244,8 @@ public class ParameterHelper
String sOfficeViewable = (String)m_aCurrentParams.get(PropertyName.OFFICE_VIEWABLE); String sOfficeViewable = (String)m_aCurrentParams.get(PropertyName.OFFICE_VIEWABLE);
if (sOfficeViewable != null) if (sOfficeViewable != null)
{ {
if (sOfficeViewable.toLowerCase().equals("yes") || return !(sOfficeViewable.toLowerCase().equals("yes") ||
sOfficeViewable.toLowerCase().equals("true")) sOfficeViewable.toLowerCase().equals("true"));
{
return false; // setViewable();
}
else
{
return true; // setHidden();
}
} }
return true; /* default: hidden */ return true; /* default: hidden */
} }
......
...@@ -182,10 +182,7 @@ public class ScriptPanel extends JPanel { ...@@ -182,10 +182,7 @@ public class ScriptPanel extends JPanel {
@Override @Override
public boolean isCellEditable(int row, int col) { public boolean isCellEditable(int row, int col) {
if (col == 0) return (col != 0);
return false;
else
return true;
} }
@Override @Override
......
...@@ -174,9 +174,6 @@ public class ParcelSupport implements ParcelCookie ...@@ -174,9 +174,6 @@ public class ParcelSupport implements ParcelCookie
message, NotifyDescriptor.OK_CANCEL_OPTION); message, NotifyDescriptor.OK_CANCEL_OPTION);
TopManager.getDefault().notify(d); TopManager.getDefault().notify(d);
if (d.getValue() == NotifyDescriptor.CANCEL_OPTION) return (d.getValue() != NotifyDescriptor.CANCEL_OPTION);
return false;
else
return true;
} }
} }
...@@ -66,10 +66,7 @@ public class NagDialog { ...@@ -66,10 +66,7 @@ public class NagDialog {
public boolean show() { public boolean show() {
TopManager.getDefault().notify(descriptor); TopManager.getDefault().notify(descriptor);
if (descriptor.getValue() == NotifyDescriptor.OK_OPTION) return (descriptor.getValue() == NotifyDescriptor.OK_OPTION);
return true;
else
return false;
} }
public boolean getState() { public boolean getState() {
......
...@@ -77,9 +77,6 @@ public class _XFunctionProvider extends MultiMethodTest { ...@@ -77,9 +77,6 @@ public class _XFunctionProvider extends MultiMethodTest {
output = "XFunction.class"; output = "XFunction.class";
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
} }
...@@ -86,10 +86,7 @@ public class _XScriptInfoAccess extends MultiMethodTest { ...@@ -86,10 +86,7 @@ public class _XScriptInfoAccess extends MultiMethodTest {
} }
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
public void _getImplementations() { public void _getImplementations() {
...@@ -143,10 +140,7 @@ public class _XScriptInfoAccess extends MultiMethodTest { ...@@ -143,10 +140,7 @@ public class _XScriptInfoAccess extends MultiMethodTest {
} }
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
public void _getAllImplementations() { public void _getAllImplementations() {
...@@ -196,9 +190,6 @@ public class _XScriptInfoAccess extends MultiMethodTest { ...@@ -196,9 +190,6 @@ public class _XScriptInfoAccess extends MultiMethodTest {
} }
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
} }
...@@ -133,10 +133,7 @@ public class _XScriptInvocation extends MultiMethodTest { ...@@ -133,10 +133,7 @@ public class _XScriptInvocation extends MultiMethodTest {
ctx.dispose(); ctx.dispose();
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
private int getStorageId(String location) { private int getStorageId(String location) {
......
...@@ -112,10 +112,7 @@ public class _XScriptNameResolver extends MultiMethodTest { ...@@ -112,10 +112,7 @@ public class _XScriptNameResolver extends MultiMethodTest {
} }
log.println("expected: " + expected + ", output: " + output); log.println("expected: " + expected + ", output: " + output);
if (output.equals(expected)) return (output.equals(expected));
return true;
else
return false;
} }
private int getStorageId(String location) { private int getStorageId(String location) {
......
...@@ -181,14 +181,7 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -181,14 +181,7 @@ public class _XScriptSecurity extends MultiMethodTest {
expectedPath = uri.substring(0, uri.lastIndexOf('/')); expectedPath = uri.substring(0, uri.lastIndexOf('/'));
} }
log.println("pathlist: expected: " + expectedPath + ", output: " + setPath); log.println("pathlist: expected: " + expectedPath + ", output: " + setPath);
if( setPath.equals( expectedPath ) ) return setPath.equals( expectedPath );
{
return true;
}
else
{
return false;
}
} }
return true; return true;
} }
......
...@@ -299,11 +299,7 @@ class MyTableModelIDE extends AbstractTableModel { ...@@ -299,11 +299,7 @@ class MyTableModelIDE extends AbstractTableModel {
@Override @Override
public boolean isCellEditable(int row, int col) { public boolean isCellEditable(int row, int col) {
if (col == 0) { return (col == 0);
return true;
} else {
return false;
}
} }
@Override @Override
......
...@@ -314,11 +314,7 @@ class MyTableModel extends AbstractTableModel { ...@@ -314,11 +314,7 @@ class MyTableModel extends AbstractTableModel {
@Override @Override
public boolean isCellEditable(int row, int col) { public boolean isCellEditable(int row, int col) {
if (col == 0) { return (col == 0);
return true;
} else {
return false;
}
} }
@Override @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