diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-02 19:51:11 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-10-02 19:54:59 +0000 |
commit | 4959ff5fef4381b7d09650fa62e8cda649ba7676 (patch) | |
tree | 63f24d29e43a780711802962f7cf4a308ff64f44 /scripting/java | |
parent | e02c37866b7fd6984efbeeccafe2b04bcb34c1c4 (diff) |
scripting: The if statement is redundant
Change-Id: Ia6186be4ed48fd75d1063eed233a88e09b675bf1
Reviewed-on: https://gerrit.libreoffice.org/11774
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'scripting/java')
4 files changed, 6 insertions, 18 deletions
diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java index e789d86dd647..adcde1fce8ba 100644 --- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java +++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java @@ -210,10 +210,7 @@ public class SecurityDialog extends WeakBase implements XComponent, // XServiceInfo public boolean supportsService(/*IN*/String serviceName) { - if (serviceName.equals(__serviceName)) - return true; - - return false; + return serviceName.equals(__serviceName); } // XServiceInfo diff --git a/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java b/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java index 178d449fd8ee..25ce3562d638 100644 --- a/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java +++ b/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java @@ -33,11 +33,9 @@ public class ExceptParcelFilter implements FileFilter { public static ExceptParcelFilter getInstance() { return filter; } - public boolean validate(String name) { - if (name.startsWith(ExceptParcelFilter.parcelName)) - return true; - return false; + public boolean validate(String name) { + return name.startsWith(ExceptParcelFilter.parcelName); } @Override diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java index 6f9f48b02489..e662faea400f 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java @@ -215,14 +215,11 @@ public class DeployParcelAction extends CookieAction implements chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setFileFilter(new FileFilter() { public boolean accept(File file) { - if (file.isDirectory() || + return file.isDirectory() || file.getName().endsWith(".sxw") || file.getName().endsWith(".sxc") || file.getName().endsWith(".sxd") || - file.getName().endsWith(".sxi")) - return true; - - return false; + file.getName().endsWith(".sxi"); } public String getDescription() { diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java index a9f04564794f..8d2755576aa6 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java @@ -284,11 +284,7 @@ public class ParcelFolder extends DataFolder { private class ParcelFolderFilter implements DataFilter { public boolean acceptDataObject(DataObject dobj) { String name = dobj.getPrimaryFile().getNameExt(); - - if (name.equals(ParcelZipper.PARCEL_DESCRIPTOR_XML)) - return false; - - return true; + return !name.equals(ParcelZipper.PARCEL_DESCRIPTOR_XML); } } } |