[Libreoffice-commits] core.git: scripting/java

rbuj robert.buj at gmail.com
Sat Sep 13 08:10:10 PDT 2014


 scripting/java/com/sun/star/script/framework/browse/DialogFactory.java                        |    4 ++--
 scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java                     |    2 +-
 scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java                   |    2 +-
 scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java                  |    2 +-
 scripting/java/org/openoffice/idesupport/SVersionRCFile.java                                  |    2 +-
 scripting/java/org/openoffice/netbeans/modules/office/wizard/ParcelPropertiesVisualPanel.java |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit fafb0db5d24010f7390df0df791cebe3e6ce3164
Author: rbuj <robert.buj at gmail.com>
Date:   Sat Sep 13 10:45:57 2014 +0200

    scripting: use String.length()==0 instead of String.equals(empty string)
    
    Change-Id: Icff6a5d19aaf7ac7ebb0cd54140bd388cba0f24d
    Reviewed-on: https://gerrit.libreoffice.org/11431
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
index 78c97cf..1708bdc 100644
--- a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
+++ b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
@@ -140,12 +140,12 @@ public class DialogFactory
     private XDialog createInputDialog(String title, String prompt)
         throws com.sun.star.uno.Exception
     {
-        if (title == null || title.equals(""))
+        if (title == null || title.length() == 0)
         {
             title = "Scripting Framework";
         }
 
-        if (prompt == null || prompt.equals(""))
+        if (prompt == null || prompt.length() == 0)
         {
             prompt = "Enter name";
         }
diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
index 0e5c721..a2e2423 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
@@ -206,7 +206,7 @@ public class ParcelBrowseNode extends PropertySet
                     newName = AnyConverter.toString(aParams[0]);
                 }
 
-                if ( newName == null || newName.equals(""))
+                if ( newName == null || newName.length() == 0)
                 {
                     result =  new Any(new Type(Boolean.class), Boolean.FALSE);
                 }
diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
index 7e7c938..18cefb0 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
@@ -201,7 +201,7 @@ public class ProviderBrowseNode extends PropertySet
                     name = AnyConverter.toString(aParams[0]);
                 }
 
-                if (name == null || name.equals(""))
+                if (name == null || name.length() == 0)
                 {
                     result =  new Any(new Type(Boolean.class), Boolean.FALSE);
                 }
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
index e94e0de..2d44ff5 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
@@ -332,7 +332,7 @@ public class ParcelDescriptor {
 
         tempitem = document.createElement("description");
         String description = script.getDescription();
-        if (description == null || description.equals(""))
+        if (description == null || description.length() == 0)
         {
             description = script.getLogicalName();
         }
diff --git a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
index a6a841f..883b28f 100644
--- a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
+++ b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java
@@ -127,7 +127,7 @@ public class SVersionRCFile {
               !(s.equals(VERSIONS_LINE))) {}
 
         while ((s = br.readLine()) != null &&
-              !(s.equals(""))) {
+              s.length() != 0) {
             StringTokenizer tokens = new StringTokenizer(s, "=");
             int count = tokens.countTokens();
 
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/wizard/ParcelPropertiesVisualPanel.java b/scripting/java/org/openoffice/netbeans/modules/office/wizard/ParcelPropertiesVisualPanel.java
index ea2cb1b..f9f529e 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/wizard/ParcelPropertiesVisualPanel.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/wizard/ParcelPropertiesVisualPanel.java
@@ -151,7 +151,7 @@ public class ParcelPropertiesVisualPanel extends javax.swing.JPanel {
 
     private void changeName() {
         String name = recipeName.getText().trim();
-        if (name.equals(""))
+        if (name.length() == 0)
             name = null;
         panel.setName(name);
     }


More information about the Libreoffice-commits mailing list