diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 16:08:28 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:01 +0200 |
commit | 453d7edc424d6652e209ace4915d96193a79be71 (patch) | |
tree | 0a6af928cf7d1fd90ec995ae7d114f08eaf617fd /qadevOOo/tests/java/ifc/text | |
parent | b65017a2a7af290f6681da7b197a52efe83d5185 (diff) |
Java5 update - convert more code to use generics:wq
Change-Id: I7ea32cad40a6657e4e5886d04af008cb6d67ac6e
Diffstat (limited to 'qadevOOo/tests/java/ifc/text')
5 files changed, 13 insertions, 14 deletions
diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndex.java b/qadevOOo/tests/java/ifc/text/_BaseIndex.java index 2176db890b24..c0a3863a7383 100644 --- a/qadevOOo/tests/java/ifc/text/_BaseIndex.java +++ b/qadevOOo/tests/java/ifc/text/_BaseIndex.java @@ -61,7 +61,7 @@ public class _BaseIndex extends MultiPropertyTest { */ protected PropertyTester CustomTester = new PropertyTester() { protected Object getNewValue(String propName, Object oldValue) { - XTextColumns TC = (XTextColumns) UnoRuntime.queryInterface( + XTextColumns TC = UnoRuntime.queryInterface( XTextColumns.class, oldValue); TC.setColumnCount((short) (TC.getColumnCount() + (short) 1)); @@ -103,7 +103,7 @@ public class _BaseIndex extends MultiPropertyTest { PropertyValue[][] oldVal = null; protected Object getNewValue(String propName, Object oldValue) { - XIndexReplace indProp = (XIndexReplace) UnoRuntime.queryInterface( + XIndexReplace indProp = UnoRuntime.queryInterface( XIndexReplace.class, oldValue); try { @@ -162,7 +162,7 @@ public class _BaseIndex extends MultiPropertyTest { * value into <code>log</code>. */ private void printLevelFormatProperty(Object value) { - XIndexReplace indProp = (XIndexReplace) UnoRuntime.queryInterface( + XIndexReplace indProp = UnoRuntime.queryInterface( XIndexReplace.class, value); PropertyValue[][] val = null; diff --git a/qadevOOo/tests/java/ifc/text/_MailMerge.java b/qadevOOo/tests/java/ifc/text/_MailMerge.java index 5e03ae64986e..f9d4c8d6b741 100644 --- a/qadevOOo/tests/java/ifc/text/_MailMerge.java +++ b/qadevOOo/tests/java/ifc/text/_MailMerge.java @@ -102,16 +102,16 @@ public class _MailMerge extends MultiPropertyTest { try{ log.println("try to get value from property..."); - XConnection oldValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName)); + XConnection oldValue = UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName)); log.println("try to get value from object relation..."); - XConnection newValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,tEnv.getObjRelation("MailMerge.XConnection")); + XConnection newValue = UnoRuntime.queryInterface(XConnection.class,tEnv.getObjRelation("MailMerge.XConnection")); log.println("set property to a new value..."); oObj.setPropertyValue(propName, newValue); log.println("get the new value..."); - XConnection getValue = (XConnection) UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName)); + XConnection getValue = UnoRuntime.queryInterface(XConnection.class,oObj.getPropertyValue(propName)); tRes.tested(propName, this.compare(newValue, getValue)); } catch (com.sun.star.beans.PropertyVetoException e){ diff --git a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java index 3d8428434620..2355bdc90994 100644 --- a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java +++ b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java @@ -139,8 +139,8 @@ public class _NumberingLevel { // get rest of properties and check if they are optional if (! NumberingLevel.isEmpty()){ - for (Iterator e = NumberingLevel.keySet().iterator() ; e.hasNext() ;) { - String property = (String) e.next(); + for (Iterator<String> e = NumberingLevel.keySet().iterator() ; e.hasNext() ;) { + String property = e.next(); // if some elements are not optional -> failed if ( ! NumberingLevel.get(property).booleanValue() ){ diff --git a/qadevOOo/tests/java/ifc/text/_TextColumns.java b/qadevOOo/tests/java/ifc/text/_TextColumns.java index 716471624d90..a1cafda4f456 100644 --- a/qadevOOo/tests/java/ifc/text/_TextColumns.java +++ b/qadevOOo/tests/java/ifc/text/_TextColumns.java @@ -49,9 +49,8 @@ public class _TextColumns extends MultiPropertyTest { log.println("Testing with custom Property tester") ; testProperty("AutomaticDistance", new PropertyTester() { protected Object getNewValue(String propName, Object oldValue) { - XTextColumns xTC = (XTextColumns) - UnoRuntime.queryInterface - (XTextColumns.class,tEnv.getTestObject()); + XTextColumns xTC = UnoRuntime.queryInterface + (XTextColumns.class,tEnv.getTestObject()); int ref = xTC.getReferenceValue(); int setting = ( ( (Integer) oldValue).intValue() + ref) / 2; return new Integer(setting); diff --git a/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java index e23ef8d94d3e..e8fe1dc78e61 100644 --- a/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java +++ b/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java @@ -93,8 +93,8 @@ public class _XTextFieldsSupplier extends MultiMethodTest { if (mbCreateFieldMaster) { Object FieldMaster = _oMSF.createInstance("com.sun.star.text.FieldMaster.User"); - XPropertySet PFieldMaster = (XPropertySet) UnoRuntime.queryInterface - (XPropertySet.class,(XInterface) FieldMaster); + XPropertySet PFieldMaster = UnoRuntime.queryInterface + (XPropertySet.class,FieldMaster); XDependentTextField xTF = UnoRuntime.queryInterface(XDependentTextField.class,aField); @@ -166,7 +166,7 @@ public class _XTextFieldsSupplier extends MultiMethodTest { */ private void setMethodFalse(String method, Exception e) { log.println("Exception while executing '" + method + "'"); - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); tRes.tested(method, false); } |