Kaydet (Commit) a795c366 authored tarafından rbuj's avatar rbuj Kaydeden (comit) Thomas Arnhold

scripting: the if statement is redundant

Change-Id: I7e61d740d6f58afbcdad630deb0de0ef548efcfb
Reviewed-on: https://gerrit.libreoffice.org/11288Reviewed-by: 's avatarThomas Arnhold <thomas@arnhold.org>
Tested-by: 's avatarThomas Arnhold <thomas@arnhold.org>
üst 652b8076
......@@ -37,12 +37,7 @@ public class PkgProviderBrowseNode extends ProviderBrowseNode
@Override
public String getName() {
String name = "Unknown";
if ( container != null )
{
name = container.getName();
}
return name;
return (container != null) ? container.getName() : "Unknown";
}
}
......@@ -140,11 +140,7 @@ public class Parcel implements XNameContainer
public boolean hasElements()
{
if ( m_descriptor != null && m_descriptor.getScriptEntries().length > 0 )
{
return true;
}
return false;
return m_descriptor != null && m_descriptor.getScriptEntries().length > 0;
}
public void replaceByName( String aName, java.lang.Object aElement ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
......
......@@ -362,11 +362,7 @@ public class ParcelContainer implements XNameAccess
}
public boolean hasElements()
{
if ( parcels == null || parcels.isEmpty() )
{
return false;
}
return true;
return !(parcels == null || parcels.isEmpty());
}
private void loadParcels() throws com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException
......
......@@ -76,13 +76,11 @@ public class ScriptEntry implements Cloneable {
}
public boolean equals(ScriptEntry other) {
if (language.equals(other.getLanguage()) &&
languagename.equals(other.getLanguageName()) &&
logicalname.equals(other.getLogicalName()) &&
languagedepprops.equals(other.getLanguageProperties()) &&
location.equals(other.getLocation()))
return true;
return false;
return language.equals(other.getLanguage()) &&
languagename.equals(other.getLanguageName()) &&
logicalname.equals(other.getLogicalName()) &&
languagedepprops.equals(other.getLanguageProperties()) &&
location.equals(other.getLocation());
}
public Map<String,String> getLanguageProperties()
......
......@@ -65,39 +65,17 @@ public class ScriptMetaData extends ScriptEntry {
{
return hasSource;
}
public String getSource()
{
if ( source !=null && hasSource )
{
return source;
}
else
{
return null;
}
public String getSource() {
return ( source !=null && hasSource ) ? source : null;
}
public byte[] getSourceBytes()
{
if ( source !=null && hasSource )
{
return source.getBytes();
}
else
{
return null;
}
public byte[] getSourceBytes() {
return ( source !=null && hasSource ) ? source.getBytes() : null;
}
public boolean equals(ScriptMetaData other) {
if (super.equals(other) &&
hasSource == other.hasSource() )
{
return true;
}
return false;
return super.equals(other) && hasSource == other.hasSource();
}
public String getScriptFullURL()
......
......@@ -68,14 +68,8 @@ public class UnoPkgContainer extends ParcelContainer
return result;
}
public boolean hasRegisteredUnoPkgContainer( String url )
{
boolean result = false;
if ( getRegisteredUnoPkgContainer( url ) != null )
{
result = true;
}
return result;
public boolean hasRegisteredUnoPkgContainer( String url ) {
return getRegisteredUnoPkgContainer( url ) != null;
}
private void registerPackageContainer( String url, ParcelContainer c )
......
......@@ -557,14 +557,8 @@ public abstract class ScriptProvider
// Performs the getRegStatus functionality for the PkgMgr
public boolean hasByName( String aName )
{
boolean result = false;
if ( ((UnoPkgContainer)m_container).hasRegisteredUnoPkgContainer( aName ) )
{
result = true;
}
return result;
public boolean hasByName( String aName ) {
return ((UnoPkgContainer)m_container).hasRegisteredUnoPkgContainer( aName );
}
public com.sun.star.uno.Type getElementType()
......
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