From be1bb7b1ccee28be616b89cc95e97d656e78bbe3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Aug 2014 14:00:54 +0200 Subject: java: use Boolean.valueOf instead of instantiating Boolean objects Change-Id: Ie41d6b0170a035a694dd270c311a137fd1810e74 --- scripting/examples/java/Highlight/HighlightText.java | 4 ++-- scripting/examples/java/Newsgroup/OfficeAttachment.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripting/examples') 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 ); -- cgit