diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-12 15:27:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:18 +0200 |
commit | 4b4bff34027cca49fd13e82d33d1b399848838fa (patch) | |
tree | 361bde1ae9cf88160694bec9d5f3c1893d398f66 /forms | |
parent | c552aac9f889b094caaa35c3fd9d12fe7c3fc73c (diff) |
java: no need to instantiate String objects directly
Change-Id: I7610774c94bf673ed3b574ffce04c4ee6ca93c03
Diffstat (limited to 'forms')
6 files changed, 16 insertions, 16 deletions
diff --git a/forms/qa/integration/forms/CellBinding.java b/forms/qa/integration/forms/CellBinding.java index d039aee762a2..388ee8112833 100644 --- a/forms/qa/integration/forms/CellBinding.java +++ b/forms/qa/integration/forms/CellBinding.java @@ -110,9 +110,9 @@ public class CellBinding extends complexlib.ComplexTestCase { final short col = 0; final short row = 2; - final String text = new String( "content" ); - final String otherText = new String( "something else" ); - final String yetAnotherText = new String( "yet another text" ); + final String text = "content"; + final String otherText = "something else"; + final String yetAnotherText = "yet another text"; // cretae a normal text control XPropertySet controlModel = m_formLayer.createControlAndShape( "DatabaseTextField", 30, 9, 30, 6 ); @@ -182,8 +182,8 @@ public class CellBinding extends complexlib.ComplexTestCase XPropertySet secondaryRadio = createRadio( 51, "radio button B", "radio ref group", "secodary" ); // give the ref values - String refValueA = new String( "ref value A" ); - String refValueB = new String( "ref value B" ); + String refValueA = "ref value A"; + String refValueB = "ref value B"; primaryRadio.setPropertyValue( "RefValue", refValueA ); secondaryRadio.setPropertyValue( "RefValue", refValueB ); @@ -241,7 +241,7 @@ public class CellBinding extends complexlib.ComplexTestCase /* ------------------------------------------------------------------ */ public void checkStringCheckBoxBinding( ) throws com.sun.star.uno.Exception, java.lang.Exception { - String refValue = new String( "checked " ); + String refValue = "checked "; XPropertySet checkBox = m_formLayer.createControlAndShape( "DatabaseCheckBox", 30, 68, 40, 4 ); checkBox.setPropertyValue( "Label", "check box with ref value" ); diff --git a/forms/qa/integration/forms/DocumentViewHelper.java b/forms/qa/integration/forms/DocumentViewHelper.java index bd4a34474751..5c82fa40b51e 100644 --- a/forms/qa/integration/forms/DocumentViewHelper.java +++ b/forms/qa/integration/forms/DocumentViewHelper.java @@ -100,7 +100,7 @@ public class DocumentViewHelper XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) ); xTransformer.parseStrict( aURL ); - xReturn = xProvider.queryDispatch( aURL[0], new String( ), 0 ); + xReturn = xProvider.queryDispatch( aURL[0], "", 0 ); } return xReturn; } diff --git a/forms/qa/integration/forms/FormControlTest.java b/forms/qa/integration/forms/FormControlTest.java index d78fd581d133..d574640e3038 100644 --- a/forms/qa/integration/forms/FormControlTest.java +++ b/forms/qa/integration/forms/FormControlTest.java @@ -186,7 +186,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE } // okay, now remove the image - xImageModel.setPropertyValue( "ImageURL", new String() ); + xImageModel.setPropertyValue( "ImageURL", "" ); if ( !verifyReferenceImage( new byte[0] ) ) { failed( "image control failed to remove the image" ); @@ -563,8 +563,8 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE XPropertySet xRadio = m_formLayer.createControlAndShape( "DatabaseRadioButton", 106, nYPos, 25, 6 ); xRadio.setPropertyValue( "Label", label ); xRadio.setPropertyValue( "RefValue", refValue ); - xRadio.setPropertyValue( "Name", new String( "radio_group" ) ); - xRadio.setPropertyValue( "DataField", new String( "f_text_enum" ) ); + xRadio.setPropertyValue( "Name", "radio_group" ); + xRadio.setPropertyValue( "DataField", "f_text_enum"); } /* ------------------------------------------------------------------ */ diff --git a/forms/qa/integration/forms/SingleControlValidation.java b/forms/qa/integration/forms/SingleControlValidation.java index 239789decabe..7796568dafec 100644 --- a/forms/qa/integration/forms/SingleControlValidation.java +++ b/forms/qa/integration/forms/SingleControlValidation.java @@ -107,18 +107,18 @@ public class SingleControlValidation implements XFormComponentValidityListener controlPos += 4; XPropertySet xLabel = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null ); - xLabel.setPropertyValue( "Label", new String( "Status:" ) ); + xLabel.setPropertyValue( "Label", "Status:" ); controlPos += 4; m_statusField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null ); - m_statusField.setPropertyValue( "Label", new String( "" ) ); + m_statusField.setPropertyValue( "Label", "" ); controlPos += 6; xLabel = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null ); - xLabel.setPropertyValue( "Label", new String( "Explanation for invalidity:" ) ); + xLabel.setPropertyValue( "Label", "Explanation for invalidity:" ); controlPos += 4; m_explanationField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null ); - m_explanationField.setPropertyValue( "Label", new String( "" ) ); + m_explanationField.setPropertyValue( "Label", "" ); XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, m_inputField ); xValidatable.setValidator( m_validator ); diff --git a/forms/qa/integration/forms/TableCellTextBinding.java b/forms/qa/integration/forms/TableCellTextBinding.java index 5e28bc8ccba8..475ceb6fbd2a 100644 --- a/forms/qa/integration/forms/TableCellTextBinding.java +++ b/forms/qa/integration/forms/TableCellTextBinding.java @@ -55,7 +55,7 @@ public class TableCellTextBinding { m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell ); - m_newCellText = new String(); + m_newCellText = ""; m_listeners = new java.util.LinkedList<com.sun.star.util.XModifyListener>(); start(); diff --git a/forms/qa/org/openoffice/xforms/XMLDocument.java b/forms/qa/org/openoffice/xforms/XMLDocument.java index 339f14a564e6..0f6b337f76c4 100644 --- a/forms/qa/org/openoffice/xforms/XMLDocument.java +++ b/forms/qa/org/openoffice/xforms/XMLDocument.java @@ -91,7 +91,7 @@ public class XMLDocument extends integration.forms.DocumentHelper newModel.setID(_modelName); XFormsUIHelper1 modelHelper = UnoRuntime.queryInterface( XFormsUIHelper1.class, newModel ); - modelHelper.newInstance( "Instance 1", new String(), true ); + modelHelper.newInstance( "Instance 1", "", true ); newModel.initialize(); m_forms.insertByName(_modelName, newModel); |