diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-12 15:12:27 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:18 +0200 |
commit | 0764292c5dcb7daa62e9adeb1ac9af1dbe14066f (patch) | |
tree | 17a4e9f2393d23aaba1e68bbc944aa8e18b9e2f6 /qadevOOo/tests/java/ifc | |
parent | 8a2c6c29af41cd7a62f37861fb0d4e81a857bb45 (diff) |
java: use 'Short.valueOf' instead of 'new Short'
Change-Id: Icef19ef61ee0af2dd3bda527263934006271f219
Diffstat (limited to 'qadevOOo/tests/java/ifc')
20 files changed, 42 insertions, 42 deletions
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java index c1b700e29bc3..e4362339f976 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java @@ -320,7 +320,7 @@ public class _XAccessibleValue extends MultiMethodTest { return Integer.valueOf((int)val); } else if (clazz.equals(Short.class)) { - return new Short((short)val); + return Short.valueOf((short)val); } else if (clazz.equals(Float.class)) { return new Float((float)val); diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java index d49fdb62cca1..93d2063d5ea6 100644 --- a/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java +++ b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java @@ -107,7 +107,7 @@ public class _UnoControlButtonModel extends MultiPropertyTest { public void _PushButtonType() { log.println("Testing with custom Property tester") ; testProperty("PushButtonType", - new Short((short)0), new Short((short)1)); + Short.valueOf((short)0), Short.valueOf((short)1)); } diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java index 1d1bf7880bd0..7e3202eba111 100644 --- a/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java +++ b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java @@ -99,7 +99,7 @@ public class _UnoControlComboBoxModel extends MultiPropertyTest { public void _Text() { try { - oObj.setPropertyValue("MaxTextLen",new Short((short)0)); + oObj.setPropertyValue("MaxTextLen",Short.valueOf((short)0)); } catch (com.sun.star.beans.UnknownPropertyException ue) { } catch (com.sun.star.beans.PropertyVetoException pe) { } catch (com.sun.star.lang.IllegalArgumentException ie) { diff --git a/qadevOOo/tests/java/ifc/document/_Settings.java b/qadevOOo/tests/java/ifc/document/_Settings.java index c1f5e3ec0cd0..01e7be08f35e 100644 --- a/qadevOOo/tests/java/ifc/document/_Settings.java +++ b/qadevOOo/tests/java/ifc/document/_Settings.java @@ -40,7 +40,7 @@ public class _Settings extends MultiPropertyTest { public void _PrinterIndependentLayout() { try{ Short oldVal = (Short) oObj.getPropertyValue("PrinterIndependentLayout"); - Short newVal = oldVal.intValue() == 1 ? new Short("3") : new Short("1"); + Short newVal = oldVal.intValue() == 1 ? Short.valueOf("3") : Short.valueOf("1"); testProperty("PrinterIndependentLayout", oldVal, newVal); diff --git a/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java index 760446d2e022..85db87e12c88 100644 --- a/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java +++ b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java @@ -74,7 +74,7 @@ public class _RotationDescriptor extends MultiPropertyTest { } try { - oObj.setPropertyValue("RotateAngle",new Short((short) 0)); + oObj.setPropertyValue("RotateAngle",Short.valueOf((short) 0)); } catch (Exception e) { } log.println("Testing with custom Property tester") ; diff --git a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java index eb12935a20c6..b5efcabbe44c 100644 --- a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java @@ -58,7 +58,7 @@ public class _XComponentLoader extends MultiMethodTest { PropertyValue [] szArgs = new PropertyValue [1]; PropertyValue Arg = new PropertyValue(); Arg.Name = "UpdateDocMode"; - Arg.Value = new Short(com.sun.star.document.UpdateDocMode.NO_UPDATE); + Arg.Value = Short.valueOf(com.sun.star.document.UpdateDocMode.NO_UPDATE); szArgs[0]=Arg; String url = util.utils.getFullTestURL("Writer_link.sxw"); log.println("try to load '" + url + "'"); diff --git a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java index 81777db051d5..cd8ef6b894d6 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java +++ b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java @@ -576,7 +576,7 @@ public class _XBreakIterator extends MultiMethodTest { vCharBlockBounds.add(new Boundary(startPos, endPos)); log.println("" + vCharBlockBounds.size() + "). Bounds: [" + startPos + "," + endPos + "]; Type = " + charType); - vCharBlockTypes.add(new Short(charType)); + vCharBlockTypes.add(Short.valueOf(charType)); } for(int i = 0; i < vCharBlockBounds.size() - 1; i++) { diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java index 5aa4994daf98..2e90a1f666c2 100644 --- a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java +++ b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java @@ -52,8 +52,8 @@ import lib.MultiPropertyTest; */ public class _SpreadsheetViewSettings extends MultiPropertyTest { public void _ZoomType() { - testProperty("ZoomType", new Short(DocumentZoomType.PAGE_WIDTH), - new Short(DocumentZoomType.BY_VALUE)); + testProperty("ZoomType", Short.valueOf(DocumentZoomType.PAGE_WIDTH), + Short.valueOf(DocumentZoomType.BY_VALUE)); } /** diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java index da30b2cbed20..7a53627de3e4 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java @@ -250,13 +250,13 @@ public class _CharacterProperties extends MultiPropertyTest { Object oPara = tEnv.getObjRelation("PARA"); Object oPort = tEnv.getObjRelation("PORTION"); if (oPara == null) { - testProperty("RubyAdjust",new Short((short)0),new Short((short)1)); + testProperty("RubyAdjust",Short.valueOf((short)0),Short.valueOf((short)1)); } else { - Short aShort = new Short((short) 1); + Short aShort = Short.valueOf((short) 1); changeProp((XPropertySet) oPara, (XPropertySet) oPort,"RubyAdjust", aShort); } - new Short((short) 1); + Short.valueOf((short) 1); } /** @@ -324,7 +324,7 @@ public class _CharacterProperties extends MultiPropertyTest { * new value must be specified. */ public void _CharRotation() { - Short aShort = new Short((short) 10); + Short aShort = Short.valueOf((short) 10); changeProp(oObj,oObj, "CharRotation", aShort); } @@ -360,8 +360,8 @@ public class _CharacterProperties extends MultiPropertyTest { } if (name.equals("CharRotation")) { - Short s1 = new Short((short) 0); - Short s2 = new Short((short) 900); + Short s1 = Short.valueOf((short) 0); + Short s2 = Short.valueOf((short) 900); if (gValue.equals(s1)) { ValueToSet = s2; } else { diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java index 33caa19966f3..27f5788caf51 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java @@ -171,10 +171,10 @@ public class _ParagraphProperties extends MultiPropertyTest { @Override protected Object getNewValue(String propName, Object oldValue) { if ((oldValue != null) && - (oldValue.equals(new Short((short) 0)))) { - return new Short((short) 2); + (oldValue.equals(Short.valueOf((short) 0)))) { + return Short.valueOf((short) 2); } else { - return new Short((short) 0); + return Short.valueOf((short) 0); } } }; diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java index a05b4d2946cb..09c00af10e26 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java @@ -32,9 +32,9 @@ public class _ParagraphPropertiesComplex extends MultiPropertyTest { protected PropertyTester WritingModeTester = new PropertyTester() { @Override protected Object getNewValue(String propName, Object oldValue) { - if ((oldValue != null) && (oldValue.equals(new Short(com.sun.star.text.WritingMode2.LR_TB)))) - return new Short(com.sun.star.text.WritingMode2.PAGE); else - return new Short(com.sun.star.text.WritingMode2.LR_TB); + if ((oldValue != null) && (oldValue.equals(Short.valueOf(com.sun.star.text.WritingMode2.LR_TB)))) + return Short.valueOf(com.sun.star.text.WritingMode2.PAGE); else + return Short.valueOf(com.sun.star.text.WritingMode2.LR_TB); } } ; diff --git a/qadevOOo/tests/java/ifc/text/_CellProperties.java b/qadevOOo/tests/java/ifc/text/_CellProperties.java index 6cefdad8ac12..25b739cc71e7 100644 --- a/qadevOOo/tests/java/ifc/text/_CellProperties.java +++ b/qadevOOo/tests/java/ifc/text/_CellProperties.java @@ -84,8 +84,8 @@ public class _CellProperties extends MultiPropertyTest { * Redefined method returns value, that differs from property value. */ public void _BackColor() { - final Short val1 = new Short( (short) 4 ); - final Short val2 = new Short( (short) 6 ); + final Short val1 = Short.valueOf( (short) 4 ); + final Short val2 = Short.valueOf( (short) 6 ); log.println("Testing with custom Property tester") ; testProperty("BackColor", new PropertyTester() { @Override diff --git a/qadevOOo/tests/java/ifc/text/_CellRange.java b/qadevOOo/tests/java/ifc/text/_CellRange.java index e98b2f791b72..c2942a1c5766 100644 --- a/qadevOOo/tests/java/ifc/text/_CellRange.java +++ b/qadevOOo/tests/java/ifc/text/_CellRange.java @@ -51,8 +51,8 @@ public class _CellRange extends MultiPropertyTest { * Redefined method returns value, that differs from property value. */ public void _BackColor() { - final Short val1 = new Short( (short) 4 ); - final Short val2 = new Short( (short) 6 ); + final Short val1 = Short.valueOf( (short) 4 ); + final Short val2 = Short.valueOf( (short) 6 ); log.println("Testing with custom Property tester") ; testProperty("BackColor", new PropertyTester() { @Override diff --git a/qadevOOo/tests/java/ifc/text/_Footnote.java b/qadevOOo/tests/java/ifc/text/_Footnote.java index 6f9793ab79b3..4af1725644be 100644 --- a/qadevOOo/tests/java/ifc/text/_Footnote.java +++ b/qadevOOo/tests/java/ifc/text/_Footnote.java @@ -36,8 +36,8 @@ public class _Footnote extends MultiPropertyTest { * value must be defined. */ public void _ReferenceId() { - final Short val1 = new Short( (short) 1); - final Short val2 = new Short( (short) 2); + final Short val1 = Short.valueOf( (short) 1); + final Short val2 = Short.valueOf( (short) 2); log.println("Testing with custom Property tester"); testProperty("ReferenceId", val1, val2); diff --git a/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java b/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java index 8e6db87a3f31..77cc50d87274 100644 --- a/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java +++ b/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java @@ -73,8 +73,8 @@ public class _FootnoteSettings extends MultiPropertyTest { * value must be defined. */ public void _NumberingType() { - Short val1 = new Short(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT); - Short val2 = new Short(com.sun.star.text.FootnoteNumbering.PER_PAGE); + Short val1 = Short.valueOf(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT); + Short val2 = Short.valueOf(com.sun.star.text.FootnoteNumbering.PER_PAGE); log.println("Testing with custom Property tester") ; testProperty("NumberingType", val1, val2) ; } @@ -84,8 +84,8 @@ public class _FootnoteSettings extends MultiPropertyTest { * value must be defined. */ public void _FootnoteCounting() { - Short val1 = new Short( (short) 1 ); - Short val2 = new Short( (short) 2 ); + Short val1 = Short.valueOf( (short) 1 ); + Short val2 = Short.valueOf( (short) 2 ); log.println("Testing with custom Property tester") ; testProperty("FootnoteCounting", val1, val2) ; } diff --git a/qadevOOo/tests/java/ifc/text/_TextFrame.java b/qadevOOo/tests/java/ifc/text/_TextFrame.java index c501654f4a40..a23d22862a37 100644 --- a/qadevOOo/tests/java/ifc/text/_TextFrame.java +++ b/qadevOOo/tests/java/ifc/text/_TextFrame.java @@ -43,9 +43,9 @@ public class _TextFrame extends MultiPropertyTest { @Override protected Object getNewValue(String propName, Object oldValue) throws java.lang.IllegalArgumentException { - if (oldValue.equals(new Short(com.sun.star.text.WritingMode2.LR_TB))) - return new Short(com.sun.star.text.WritingMode2.TB_LR); else - return new Short(com.sun.star.text.WritingMode2.LR_TB); + if (oldValue.equals(Short.valueOf(com.sun.star.text.WritingMode2.LR_TB))) + return Short.valueOf(com.sun.star.text.WritingMode2.TB_LR); else + return Short.valueOf(com.sun.star.text.WritingMode2.LR_TB); } } ; diff --git a/qadevOOo/tests/java/ifc/text/_TextPortion.java b/qadevOOo/tests/java/ifc/text/_TextPortion.java index 7a1c8569dbff..24096fe6daa5 100644 --- a/qadevOOo/tests/java/ifc/text/_TextPortion.java +++ b/qadevOOo/tests/java/ifc/text/_TextPortion.java @@ -40,8 +40,8 @@ public class _TextPortion extends MultiPropertyTest { */ public void _ControlCharacter() { testProperty("ControlCharacter", - new Short(ControlCharacter.LINE_BREAK), - new Short(ControlCharacter.PARAGRAPH_BREAK)) ; + Short.valueOf(ControlCharacter.LINE_BREAK), + Short.valueOf(ControlCharacter.PARAGRAPH_BREAK)) ; } } //finish class _TextPortion diff --git a/qadevOOo/tests/java/ifc/text/_TextSection.java b/qadevOOo/tests/java/ifc/text/_TextSection.java index b3e3a34eb265..3c756a60f7f0 100644 --- a/qadevOOo/tests/java/ifc/text/_TextSection.java +++ b/qadevOOo/tests/java/ifc/text/_TextSection.java @@ -82,8 +82,8 @@ public class _TextSection extends MultiPropertyTest { public void _FootnoteNumberingType() { log.println("Testing with custom Property tester") ; testProperty("FootnoteNumberingType", - new Short(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT), - new Short(com.sun.star.text.FootnoteNumbering.PER_PAGE)) ; + Short.valueOf(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT), + Short.valueOf(com.sun.star.text.FootnoteNumbering.PER_PAGE)) ; } diff --git a/qadevOOo/tests/java/ifc/text/_TextTable.java b/qadevOOo/tests/java/ifc/text/_TextTable.java index fac44cdb96fc..ad3645d220a3 100644 --- a/qadevOOo/tests/java/ifc/text/_TextTable.java +++ b/qadevOOo/tests/java/ifc/text/_TextTable.java @@ -69,7 +69,7 @@ public class _TextTable extends MultiPropertyTest { * set to non-automatic. */ public void _Width() { - Short align = new Short(com.sun.star.text.HoriOrientation.CENTER); + Short align = Short.valueOf(com.sun.star.text.HoriOrientation.CENTER); try { oObj.setPropertyValue("HoriOrient",align); } @@ -86,7 +86,7 @@ public class _TextTable extends MultiPropertyTest { * set to non-automatic. */ public void _RelativeWidth() { - Short align = new Short(com.sun.star.text.HoriOrientation.CENTER); + Short align = Short.valueOf(com.sun.star.text.HoriOrientation.CENTER); try { oObj.setPropertyValue("HoriOrient",align); } diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java index f57ccc97374e..b67ed2d5a324 100644 --- a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java +++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java @@ -300,7 +300,7 @@ public class _XUIConfigurationManager extends MultiMethodTest { prop[1].Value = sLabelName; prop[2] = new PropertyValue(); prop[2].Name = "Type"; - prop[2].Value = new Short((short)0); + prop[2].Value = Short.valueOf((short)0); prop[3] = new PropertyValue(); prop[3].Name = "ItemDescriptorContainer"; @@ -337,7 +337,7 @@ public class _XUIConfigurationManager extends MultiMethodTest { aMenuItem[1].Value = sLabelName; aMenuItem[2] = new PropertyValue(); aMenuItem[2].Name = "Type"; - aMenuItem[2].Value = new Short((short)0); + aMenuItem[2].Value = Short.valueOf((short)0); try { xDescriptionContainer.insertByIndex(0, aMenuItem); |