summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-12 14:00:54 +0200
committerNoel Grandin <noel@peralex.com>2014-08-19 14:57:16 +0200
commitbe1bb7b1ccee28be616b89cc95e97d656e78bbe3 (patch)
treed67d16a68d1469b5096a27c743c4b0326a0c0ebe /scripting
parent56ef5533fc1bce2134721ae64d4d6c18a3526a7a (diff)
java: use Boolean.valueOf instead of instantiating Boolean objects
Change-Id: Ie41d6b0170a035a694dd270c311a137fd1810e74
Diffstat (limited to 'scripting')
-rw-r--r--scripting/examples/java/Highlight/HighlightText.java4
-rw-r--r--scripting/examples/java/Newsgroup/OfficeAttachment.java6
-rw-r--r--scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java8
-rw-r--r--scripting/workben/ifc/scripting/_XScriptSecurity.java12
-rw-r--r--scripting/workben/installer/IdeVersion.java2
-rw-r--r--scripting/workben/installer/Version.java2
6 files changed, 17 insertions, 17 deletions
diff --git a/scripting/examples/java/Highlight/HighlightText.java b/scripting/examples/java/Highlight/HighlightText.java
index 99af06f25468..11f5249acba8 100644
--- a/scripting/examples/java/Highlight/HighlightText.java
+++ b/scripting/examples/java/Highlight/HighlightText.java
@@ -163,8 +163,8 @@ public class HighlightText implements com.sun.star.awt.XActionListener {
// Only matches whole words and case sensitive
descriptor.setPropertyValue(
- "SearchCaseSensitive", new Boolean(true));
- descriptor.setPropertyValue("SearchWords", new Boolean(true));
+ "SearchCaseSensitive", Boolean.TRUE);
+ descriptor.setPropertyValue("SearchWords", Boolean.TRUE);
}
catch (com.sun.star.beans.UnknownPropertyException upe) {
System.err.println("Error setting up search properties");
diff --git a/scripting/examples/java/Newsgroup/OfficeAttachment.java b/scripting/examples/java/Newsgroup/OfficeAttachment.java
index 41ccfd3dd591..8e36d1fb47f1 100644
--- a/scripting/examples/java/Newsgroup/OfficeAttachment.java
+++ b/scripting/examples/java/Newsgroup/OfficeAttachment.java
@@ -105,7 +105,7 @@ public class OfficeAttachment
PropertyValue[] propertyvalue_html = new PropertyValue[2];
propertyvalue_html[0] = new PropertyValue();
propertyvalue_html[0].Name = new String("Overwrite");
- propertyvalue_html[0].Value = new Boolean(true);
+ propertyvalue_html[0].Value = Boolean.TRUE;
propertyvalue_html[1] = new PropertyValue();
propertyvalue_html[1].Name = ("FilterName");
propertyvalue_html[1].Value = new String("swriter: HTML (StarWriter)");
@@ -131,10 +131,10 @@ public class OfficeAttachment
PropertyValue[] propertyvalue_sxw = new PropertyValue[2];
propertyvalue_sxw[0] = new PropertyValue();
propertyvalue_sxw[0].Name = new String("Overwrite");
- propertyvalue_sxw[0].Value = new Boolean(true);
+ propertyvalue_sxw[0].Value = Boolean.TRUE;
propertyvalue_sxw[1] = new PropertyValue();
propertyvalue_sxw[1].Name = new String("Overwrite");
- propertyvalue_sxw[1].Value = new Boolean(true);
+ propertyvalue_sxw[1].Value = Boolean.TRUE;
storedDoc.storeAsURL( filenameURL + ".sxw", propertyvalue_sxw);
File homedir = new File( templocationSystem );
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java
index 1b0283e96678..a56cdfa97779 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java
@@ -91,7 +91,7 @@ public class OfficeSettings extends SystemOption {
}
public void setWarnBeforeDocDeploy(boolean value) {
- putProperty(WARN_BEFORE_DOC_DEPLOY, new Boolean(value), true);
+ putProperty(WARN_BEFORE_DOC_DEPLOY, Boolean.valueOf(value), true);
}
public boolean getWarnBeforeParcelDelete() {
@@ -99,7 +99,7 @@ public class OfficeSettings extends SystemOption {
}
public void setWarnBeforeParcelDelete(boolean value) {
- putProperty(WARN_BEFORE_PARCEL_DELETE, new Boolean(value), true);
+ putProperty(WARN_BEFORE_PARCEL_DELETE, Boolean.valueOf(value), true);
}
public boolean getWarnAfterDirDeploy() {
@@ -107,7 +107,7 @@ public class OfficeSettings extends SystemOption {
}
public void setWarnAfterDirDeploy(boolean value) {
- putProperty(WARN_AFTER_DIR_DEPLOY, new Boolean(value), true);
+ putProperty(WARN_AFTER_DIR_DEPLOY, Boolean.valueOf(value), true);
}
public boolean getWarnBeforeMount() {
@@ -115,6 +115,6 @@ public class OfficeSettings extends SystemOption {
}
public void setWarnBeforeMount(boolean value) {
- putProperty(WARN_BEFORE_MOUNT, new Boolean(value), true);
+ putProperty(WARN_BEFORE_MOUNT, Boolean.valueOf(value), true);
}
}
diff --git a/scripting/workben/ifc/scripting/_XScriptSecurity.java b/scripting/workben/ifc/scripting/_XScriptSecurity.java
index bbaf7dd02ea0..4f6abe8edbf8 100644
--- a/scripting/workben/ifc/scripting/_XScriptSecurity.java
+++ b/scripting/workben/ifc/scripting/_XScriptSecurity.java
@@ -212,7 +212,7 @@ public class _XScriptSecurity extends MultiMethodTest {
// we don't want to cache the write
PropertyValue aModeArg = new PropertyValue();
aModeArg.Name="lazywrite";
- aModeArg.Value=new Boolean(false);
+ aModeArg.Value=Boolean.FALSE;
Object[] aArgs = new Object[2];
aArgs[0]=aPathArg;
@@ -253,7 +253,7 @@ public class _XScriptSecurity extends MultiMethodTest {
// we don't want to cache the write
PropertyValue aModeArg = new PropertyValue();
aModeArg.Name="lazywrite";
- aModeArg.Value=new Boolean(false);
+ aModeArg.Value=Boolean.FALSE;
Object[] aArgs = new Object[2];
aArgs[0]=aPathArg;
@@ -283,11 +283,11 @@ public class _XScriptSecurity extends MultiMethodTest {
Boolean bConfirm = null;
if( ( confirm != null ) && ( confirm.equals("true") ) )
{
- bConfirm = new Boolean( true );
+ bConfirm = Boolean.TRUE;
}
else
{
- bConfirm = new Boolean( false );
+ bConfirm = Boolean.FALSE;
}
log.println("setting Confirmation");
xNameReplace.replaceByName( "Confirmation", bConfirm );
@@ -295,11 +295,11 @@ public class _XScriptSecurity extends MultiMethodTest {
Boolean bWarning = null;
if( ( warning != null ) && ( warning.equals("true") ) )
{
- bWarning = new Boolean( true );
+ bWarning = Boolean.TRUE;
}
else
{
- bWarning = new Boolean( false );
+ bWarning = Boolean.FALSE;
}
log.println("setting Warning");
xNameReplace.replaceByName( "Warning", bWarning );
diff --git a/scripting/workben/installer/IdeVersion.java b/scripting/workben/installer/IdeVersion.java
index 72635e25c721..65b18f61338f 100644
--- a/scripting/workben/installer/IdeVersion.java
+++ b/scripting/workben/installer/IdeVersion.java
@@ -253,7 +253,7 @@ class MyTableModelIDE extends AbstractTableModel {
if ((path = properties.getProperty(key)) != null) {
ArrayList<Object> row = new ArrayList<Object>();
- row.add(0, new Boolean(false));
+ row.add(0, Boolean.FALSE);
row.add(1, key);
if (key.length() > ((String)longValues[1]).length()) {
diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java
index 38da3f21befb..37bc7dde043c 100644
--- a/scripting/workben/installer/Version.java
+++ b/scripting/workben/installer/Version.java
@@ -267,7 +267,7 @@ class MyTableModel extends AbstractTableModel {
if ( pkgChk.exists() )
{
ArrayList<Object> row = new ArrayList<Object>();
- row.add(0, new Boolean(false));
+ row.add(0, Boolean.FALSE);
row.add(1, key);
if (key.length() > ((String)longValues[1]).length()) {