diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-11-24 20:58:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-11-24 20:58:56 +0100 |
commit | 718de51eb9f567fa433ac216114f5e6f16236209 (patch) | |
tree | 01793173eb9c16050f17638d5df0caaf65f7ac22 | |
parent | 224e9c81d87de598c00cd7025dfe43febcc08477 (diff) |
Some Java String clean-up
Change-Id: I6728720a13f4b66edc6c5cd0b7a9bcb036e86ff2
12 files changed, 28 insertions, 30 deletions
diff --git a/qadevOOo/runner/convwatch/MSOfficePrint.java b/qadevOOo/runner/convwatch/MSOfficePrint.java index aa881b5087cf..3b3ed466c895 100644 --- a/qadevOOo/runner/convwatch/MSOfficePrint.java +++ b/qadevOOo/runner/convwatch/MSOfficePrint.java @@ -258,7 +258,7 @@ public class MSOfficePrint { aStr = "\"\""; } - aList[i] = new String(aStr); + aList[i] = aStr; } // This is really the latest point where we can check if we are running within windows environment diff --git a/qadevOOo/runner/convwatch/ReportDesignerTest.java b/qadevOOo/runner/convwatch/ReportDesignerTest.java index ea1a2d8840fe..36b513ee8a7b 100644 --- a/qadevOOo/runner/convwatch/ReportDesignerTest.java +++ b/qadevOOo/runner/convwatch/ReportDesignerTest.java @@ -314,7 +314,7 @@ public class ReportDesignerTest extends ComplexTestCase { // sAppExecutionCommand = utils.replaceAll13(sAppExecutionCommand, "${USERNAME}", sUser); checkIfOfficeExists(sAppExecutionCommand); - param.put("AppExecutionCommand", new String(sAppExecutionCommand)); + param.put("AppExecutionCommand", sAppExecutionCommand); // System.exit(1); diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index 8206f8edfba5..a64c04792f8a 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -341,7 +341,7 @@ public class MSOfficePostscriptCreator implements IOffice { aStr = "\"\""; } - aList[i] = new String(aStr); + aList[i] = aStr; } // This is really the latest point where we can check if we are running within windows environment diff --git a/qadevOOo/runner/helper/ContextMenuInterceptor.java b/qadevOOo/runner/helper/ContextMenuInterceptor.java index 9ff389878d23..87844522865d 100644 --- a/qadevOOo/runner/helper/ContextMenuInterceptor.java +++ b/qadevOOo/runner/helper/ContextMenuInterceptor.java @@ -63,9 +63,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" )); // intialize root menu entry "Help" - xRootMenuEntry.setPropertyValue( "Text", new String( "Help" )); - xRootMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5410" )); - xRootMenuEntry.setPropertyValue( "HelpURL", new String( "5410" )); + xRootMenuEntry.setPropertyValue( "Text", "Help" ); + xRootMenuEntry.setPropertyValue( "CommandURL", "slot:5410" ); + xRootMenuEntry.setPropertyValue( "HelpURL", "5410" ); xRootMenuEntry.setPropertyValue( "SubContainer", xSubMenuContainer ); // create menu entries for the new sub menu @@ -74,9 +74,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { XPropertySet xMenuEntry = UnoRuntime.queryInterface( XPropertySet.class, xMenuElementFactory.createInstance( "com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Content" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5401" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5401" )); + xMenuEntry.setPropertyValue( "Text", "Content" ); + xMenuEntry.setPropertyValue( "CommandURL", "slot:5401" ); + xMenuEntry.setPropertyValue( "HelpURL", "5401" ); // insert menu entry to sub menu xSubMenuContainer.insertByIndex( 0, xMenuEntry ); @@ -86,9 +86,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { xMenuEntry = UnoRuntime.queryInterface( XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Help Agent" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5962" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5962" )); + xMenuEntry.setPropertyValue( "Text", "Help Agent" ); + xMenuEntry.setPropertyValue( "CommandURL", "slot:5962" ); + xMenuEntry.setPropertyValue( "HelpURL", "5962" ); // insert menu entry to sub menu xSubMenuContainer.insertByIndex( 1, xMenuEntry ); @@ -97,9 +97,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { xMenuEntry = UnoRuntime.queryInterface( XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Tips" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5404" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5404" )); + xMenuEntry.setPropertyValue( "Text", "Tips" ); + xMenuEntry.setPropertyValue( "CommandURL", "slot:5404" ); + xMenuEntry.setPropertyValue( "HelpURL", "5404" ); // insert menu entry to sub menu xSubMenuContainer.insertByIndex( 2, xMenuEntry ); @@ -128,4 +128,4 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { return ContextMenuInterceptorAction.IGNORED; } -}
\ No newline at end of file +} diff --git a/qadevOOo/tests/java/ifc/presentation/_Presentation.java b/qadevOOo/tests/java/ifc/presentation/_Presentation.java index 0096abff8c66..3ac26dc41561 100644 --- a/qadevOOo/tests/java/ifc/presentation/_Presentation.java +++ b/qadevOOo/tests/java/ifc/presentation/_Presentation.java @@ -67,9 +67,9 @@ public class _Presentation extends MultiPropertyTest { protected Object getNewValue(String propName, Object oldValue) throws java.lang.IllegalArgumentException { if ( ((String)oldValue).equals("SecondPresentation") ) { - return new String("FirstPresentation"); + return "FirstPresentation"; } else { - return new String("SecondPresentation"); + return "SecondPresentation"; } } }; diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java index 1aeb2064d5d4..18d8ca0f981a 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java @@ -66,7 +66,7 @@ public class _XCellRangeData extends MultiMethodTest { Object[][] emptyData = new Object[newData.length][newData[0].length]; for (int i=0; i<emptyData.length; i++) { for (int j=0; j<emptyData[i].length; j++) { - emptyData[i][j] = new String(); + emptyData[i][j] = ""; } } oObj.setDataArray(emptyData); diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java index c03626e43824..b5f9234657d5 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java @@ -262,7 +262,7 @@ public class _CharacterProperties extends MultiPropertyTest { protected Object getNewValue(String propName, Object oldValue) throws java.lang.IllegalArgumentException { if (utils.isVoid(oldValue)) { - return new String("RubyText"); + return "RubyText"; } else { return ValueChanger.changePValue(oldValue); } diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java index a955158aa156..c958adaf97ba 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java @@ -112,7 +112,7 @@ public class OQueryDesign extends TestCase { log.println("check XMultiServiceFactory"); try { - xConn = xDS.getConnection(new String(), new String()); + xConn = xDS.getConnection("", ""); } catch (SQLException ex) { ex.printStackTrace( log ); throw new StatusException( "Could not get XConnection", ex ); diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java index 7cf1ee9c3a50..5e632d0e8251 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java @@ -179,7 +179,7 @@ public class OSingleSelectQueryComposer extends TestCase { log.println("check XMultiServiceFactory"); XMultiServiceFactory xConn = UnoRuntime.queryInterface(XMultiServiceFactory.class, - xDS.getConnection(new String(),new String())); + xDS.getConnection("", "")); log.println("check getAvailableServiceNames"); String[] sServiceNames = xConn.getAvailableServiceNames(); diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index 9c884d95720c..464c00d50b1c 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -623,7 +623,7 @@ public class ODatabaseForm extends TestCase { /***** statement parameter types and their initial values must be added here as relation. */ - params.add(new String("SAU99")) ; + params.add("SAU99") ; params.add(new Boolean(false)) ; params.add(new Byte((byte) 123)) ; params.add(new Short((short) 234)) ; diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java index 03760b4de45b..370a439c9086 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java @@ -88,7 +88,7 @@ public class AccessibleEditableTextPara extends TestCase { new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { try { - int l = new String("AccessibleEditablePara").length(); + int l = "AccessibleEditablePara".length(); edText.deleteText(0, l); edText.setText("Event"); edText.setText("AccessibleEditablePara"); @@ -147,4 +147,4 @@ public class AccessibleEditableTextPara extends TestCase { } } -}
\ No newline at end of file +} diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java index 3087387ce11a..8c2fc3182c38 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java @@ -90,9 +90,7 @@ public class UnoControlDialogModel extends TestCase { xPSetDialog.setPropertyValue("PositionY", new Integer(100)); xPSetDialog.setPropertyValue("Width", new Integer(150)); xPSetDialog.setPropertyValue("Height", new Integer(100)); - xPSetDialog.setPropertyValue("Title", - new String("Runtime Dialog Demo")); - + xPSetDialog.setPropertyValue("Title", "Runtime Dialog Demo"); // get the service manager from the dialog model xMultiServiceFactory = UnoRuntime.queryInterface( @@ -110,7 +108,7 @@ public class UnoControlDialogModel extends TestCase { xPSetButton.setPropertyValue("Height", new Integer(14)); xPSetButton.setPropertyValue("Name", _buttonName); xPSetButton.setPropertyValue("TabIndex", new Short((short) 0)); - xPSetButton.setPropertyValue("Label", new String("Click Me")); + xPSetButton.setPropertyValue("Label", "Click Me"); // create the label model and set the properties Object labelModel = xMultiServiceFactory.createInstance( @@ -177,4 +175,4 @@ public class UnoControlDialogModel extends TestCase { return tEnv; } // finish method getTestEnvironment -}
\ No newline at end of file +} |