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 | |
parent | Java5 update - usage generics where possible (diff) | |
download | core-453d7edc424d6652e209ace4915d96193a79be71.tar.gz core-453d7edc424d6652e209ace4915d96193a79be71.zip |
Java5 update - convert more code to use generics:wq
Change-Id: I7ea32cad40a6657e4e5886d04af008cb6d67ac6e
Diffstat (limited to 'qadevOOo/tests/java/ifc')
88 files changed, 182 insertions, 234 deletions
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java index 22c8cea37406..9116fb3fc030 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java @@ -314,7 +314,7 @@ public class _XAccessibleValue extends MultiMethodTest { } } - private Object getObjectValue(double val, Class clazz) { + private Object getObjectValue(double val, Class<?> clazz) { if (clazz.equals(Integer.class)) { return new Integer((int)val); } diff --git a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java index 8a11d4ac501b..d01afc0b3051 100644 --- a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java +++ b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java @@ -250,7 +250,7 @@ public class _XCurrencyField extends MultiMethodTest { oObj.setDecimalDigits((short) (digits + 1)); short res = oObj.getDecimalDigits(); - result = res == ((short) digits + 1); + result = res == (digits + 1); tRes.tested("setDecimalDigits()", result); } diff --git a/qadevOOo/tests/java/ifc/awt/_XNumericField.java b/qadevOOo/tests/java/ifc/awt/_XNumericField.java index 9aa17dad308c..abe98def21b6 100644 --- a/qadevOOo/tests/java/ifc/awt/_XNumericField.java +++ b/qadevOOo/tests/java/ifc/awt/_XNumericField.java @@ -251,7 +251,7 @@ public class _XNumericField extends MultiMethodTest { oObj.setDecimalDigits((short)(digits + 1)) ; short res = oObj.getDecimalDigits() ; - result = res == ((short)digits + 1) ; + result = res == (digits + 1) ; tRes.tested("setDecimalDigits()", result) ; } diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java index 8b35f7cf6217..6ee8c0c611c9 100644 --- a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java @@ -57,15 +57,15 @@ public class _XFastPropertySet extends MultiMethodTest { public XFastPropertySet oObj = null; private List<Integer> handles = new ArrayList<Integer>(); private int handle = -1; - private Set exclude = null ; + private Set<String> exclude = null ; /** * Retrieves relation. */ protected void before() { - exclude = (Set) tEnv.getObjRelation("XFastPropertySet.ExcludeProps") ; + exclude = (Set<String>) tEnv.getObjRelation("XFastPropertySet.ExcludeProps") ; if (exclude == null) { - exclude = new java.util.HashSet() ; + exclude = new java.util.HashSet<String>() ; } } @@ -77,7 +77,7 @@ public class _XFastPropertySet extends MultiMethodTest { * before and no exceptions were thrown. <p> */ public void _setFastPropertyValue() { - XPropertySet PS = (XPropertySet)UnoRuntime.queryInterface + XPropertySet PS = UnoRuntime.queryInterface (XPropertySet.class, oObj); XPropertySetInfo propertySetInfo = PS.getPropertySetInfo(); @@ -124,7 +124,7 @@ public class _XFastPropertySet extends MultiMethodTest { * Has <b> OK </b> status if exceptions were thrown. <p> */ public void _getFastPropertyValue() { - XPropertySet PS = (XPropertySet)UnoRuntime.queryInterface + XPropertySet PS = UnoRuntime.queryInterface (XPropertySet.class, oObj); XPropertySetInfo propertySetInfo = PS.getPropertySetInfo(); diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java index 93fe3e598fd3..49c4c9d6d12d 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java @@ -74,7 +74,7 @@ public class _XMultiPropertySet extends MultiMethodTest { private Object[] values = null; - private Set exclProps = null; + private Set<String> exclProps = null; /** * Initializes some fields. @@ -82,8 +82,8 @@ public class _XMultiPropertySet extends MultiMethodTest { public void before() { _log = log; - exclProps = (Set) tEnv.getObjRelation("XMultiPropertySet.ExcludeProps"); - if (exclProps == null) exclProps = new HashSet(0); + exclProps = (Set<String>) tEnv.getObjRelation("XMultiPropertySet.ExcludeProps"); + if (exclProps == null) exclProps = new HashSet<String>(0); } /** diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java index 18efd978b8d0..bbe5fa1916ba 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java @@ -125,8 +125,7 @@ public class _XMultiPropertyStates extends MultiMethodTest { for(int i = 0; i < names.length; i++) { if (!mayBeDef && states[i] != PropertyState.DEFAULT_VALUE ) { propName = names[i]; - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); XPropertySetInfo xPropSetInfo = xPropSet.getPropertySetInfo(); Property prop = null; try { @@ -196,8 +195,7 @@ public class _XMultiPropertyStates extends MultiMethodTest { if (!part_result) { log.println("Property '" + names[i] + "' wasn't set to default"); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); XPropertySetInfo xPropSetInfo = xPropSet.getPropertySetInfo(); Property prop = xPropSetInfo.getPropertyByName(names[i]); diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertyState.java b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java index f3c35f79606e..3ca5e376d778 100644 --- a/qadevOOo/tests/java/ifc/beans/_XPropertyState.java +++ b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java @@ -70,8 +70,7 @@ public class _XPropertyState extends MultiMethodTest { * implemented by object. */ public void before() throws StatusException { - oPS = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, oObj ); + oPS = UnoRuntime.queryInterface( XPropertySet.class, oObj ); if (oPS == null) throw new StatusException ("XPropertySet interface isn't implemented.", diff --git a/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java index 06d32c933e83..5d38019a41d6 100644 --- a/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java @@ -57,7 +57,7 @@ public class _XTolerantMultiPropertySet extends MultiMethodTest { * Throws a lib StatusException if the Component doesn't support XPropertySet or XPropertyState */ public void before() { - PS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, + PS = UnoRuntime.queryInterface(XPropertySet.class, tEnv.getTestObject()); if (PS == null) { diff --git a/qadevOOo/tests/java/ifc/chart/_BarDiagram.java b/qadevOOo/tests/java/ifc/chart/_BarDiagram.java index f188abe5896a..601b6e0e570a 100644 --- a/qadevOOo/tests/java/ifc/chart/_BarDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_BarDiagram.java @@ -72,8 +72,7 @@ public class _BarDiagram extends MultiPropertyTest { oldDiagram = doc.getDiagram(); doc.setDiagram(bar); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); log.println("Set it to 3D"); try { oObj.setPropertyValue("Dim3D", new Boolean(true)); diff --git a/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java b/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java index 1bb49c0558c0..99bb00065ddb 100644 --- a/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java +++ b/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java @@ -62,8 +62,7 @@ public class _Chart3DBarProperties extends MultiPropertyTest { doc.setDiagram(bar); log.println("Change Diagram to 3D"); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); try { oObj.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { @@ -95,8 +94,7 @@ public class _Chart3DBarProperties extends MultiPropertyTest { ("Relation 'CHARTDOC' not found")); log.println("Change Diagram to 3D"); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); try { oObj.setPropertyValue("Dim3D", new Boolean(false)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java index 92bdde4b284b..0253e8c34cfe 100644 --- a/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java +++ b/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java @@ -54,8 +54,7 @@ public class _ChartAxisYSupplier extends MultiPropertyTest { if (doc == null) throw new StatusException(Status.failed ("Relation 'CHARTDOC' not found")); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } public void _HasYAxis() { diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java index c0debc4a6be7..42ba8b17af78 100644 --- a/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java +++ b/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java @@ -64,8 +64,7 @@ public class _ChartAxisZSupplier extends MultiPropertyTest { doc.setDiagram(bar); log.println("Set it to 3D"); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); try { oObj.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java b/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java index 54852ff7f9d1..d7f3be6cf9e4 100644 --- a/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java +++ b/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java @@ -58,8 +58,7 @@ public class _ChartStatistics extends MultiPropertyTest { if (doc == null) throw new StatusException(Status.failed ("Relation 'CHARTDOC' not found")); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } } diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java index 814be9287f3a..10b1345a6248 100644 --- a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java +++ b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java @@ -66,8 +66,7 @@ public class _ChartTwoAxisXSupplier extends MultiPropertyTest { doc.setDiagram(bar); log.println("Set it to 3D"); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); try { oObj.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java index 50cef10c98cd..1333c6011b89 100644 --- a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java +++ b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java @@ -66,8 +66,7 @@ public class _ChartTwoAxisYSupplier extends MultiPropertyTest { doc.setDiagram(bar); log.println("Set it to 3D"); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); try { oObj.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/ifc/chart/_Diagram.java b/qadevOOo/tests/java/ifc/chart/_Diagram.java index 277c69ef3f3e..3ab90b84784c 100644 --- a/qadevOOo/tests/java/ifc/chart/_Diagram.java +++ b/qadevOOo/tests/java/ifc/chart/_Diagram.java @@ -52,8 +52,7 @@ public class _Diagram extends MultiPropertyTest { if (doc == null) throw new StatusException(Status.failed ("Relation 'CHARTDOC' not found")); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } } diff --git a/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java b/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java index 4dfaf4feee6e..0288aeb6cbf5 100644 --- a/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java @@ -51,8 +51,7 @@ public class _Dim3DDiagram extends MultiPropertyTest { if (doc == null) throw new StatusException(Status.failed ("Relation 'CHARTDOC' not found")); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } } // EOF Dim3DDiagram diff --git a/qadevOOo/tests/java/ifc/chart/_LineDiagram.java b/qadevOOo/tests/java/ifc/chart/_LineDiagram.java index f5e5436dd74a..4632bc8f9e66 100644 --- a/qadevOOo/tests/java/ifc/chart/_LineDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_LineDiagram.java @@ -74,8 +74,7 @@ public class _LineDiagram extends MultiPropertyTest { oldDiagram = doc.getDiagram(); doc.setDiagram(Line); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } /** diff --git a/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java b/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java index 4d6b07dbf1fd..bb7a36080197 100644 --- a/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java @@ -65,8 +65,7 @@ public class _StackableDiagram extends MultiPropertyTest { oldDiagram = doc.getDiagram(); doc.setDiagram(stack); - oObj = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); + oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() ); } /** diff --git a/qadevOOo/tests/java/ifc/chart/_StockDiagram.java b/qadevOOo/tests/java/ifc/chart/_StockDiagram.java index 013edc6da8a9..d54a0e7aab44 100644 --- a/qadevOOo/tests/java/ifc/chart/_StockDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_StockDiagram.java @@ -64,8 +64,7 @@ public class _StockDiagram extends MultiPropertyTest { oldDiagram = doc.getDiagram(); doc.setDiagram(stock); - oObj = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, doc.getDiagram()); + oObj = UnoRuntime.queryInterface(XPropertySet.class, doc.getDiagram()); } /** diff --git a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java index d8fa658111bd..5233db64848d 100644 --- a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java +++ b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java @@ -56,7 +56,7 @@ public class _XChartDataArray extends MultiMethodTest { msExcludeMessage = (String)o; } if (!mbExcludeSetRowAndSetColumn) { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oObj); if(xProp != null) { try { boolean columnAsLabel = ((Boolean)xProp.getPropertyValue("ChartColumnAsLabel")).booleanValue(); diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java index aa1fbcfb8090..dd69bbdc0b99 100644 --- a/qadevOOo/tests/java/ifc/container/_XContainer.java +++ b/qadevOOo/tests/java/ifc/container/_XContainer.java @@ -92,7 +92,7 @@ public class _XContainer extends MultiMethodTest { oObj = UnoRuntime.queryInterface(XContainer.class, altObj); } - NC = (XNameContainer) UnoRuntime.queryInterface + NC = UnoRuntime.queryInterface (XNameContainer.class, oObj) ; Object container = null; diff --git a/qadevOOo/tests/java/ifc/container/_XIndexReplace.java b/qadevOOo/tests/java/ifc/container/_XIndexReplace.java index e634a2b6b02d..411b7e8ac43e 100644 --- a/qadevOOo/tests/java/ifc/container/_XIndexReplace.java +++ b/qadevOOo/tests/java/ifc/container/_XIndexReplace.java @@ -137,8 +137,7 @@ public class _XIndexReplace extends MultiMethodTest { log.println("1. replaceByIndex(): Exception expected! - FAILED"); - XNameContainer xNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj) ; + XNameContainer xNC = UnoRuntime.queryInterface(XNameContainer.class, oObj) ; String[] names = xNC.getElementNames() ; log.println("Element names :") ; for (int i = 0; i<names.length; i++) { @@ -164,8 +163,7 @@ public class _XIndexReplace extends MultiMethodTest { log.println("2. replaceByIndex(): Exception expected! - FAILED"); - XNameContainer xNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj) ; + XNameContainer xNC = UnoRuntime.queryInterface(XNameContainer.class, oObj) ; String[] names = xNC.getElementNames() ; log.println("Element names :") ; for (int i = 0; i<names.length; i++) { diff --git a/qadevOOo/tests/java/ifc/container/_XNameReplace.java b/qadevOOo/tests/java/ifc/container/_XNameReplace.java index 0c040344797c..c2b9c62fdf32 100644 --- a/qadevOOo/tests/java/ifc/container/_XNameReplace.java +++ b/qadevOOo/tests/java/ifc/container/_XNameReplace.java @@ -106,7 +106,7 @@ public class _XNameReplace extends MultiMethodTest { } log.println("getting the existant object's name"); - XNameAccess oNameAccess = (XNameAccess)UnoRuntime.queryInterface( + XNameAccess oNameAccess = UnoRuntime.queryInterface( XNameAccess.class, oObj); oNames = oNameAccess.getElementNames(); /* Some Objects can't replace the firsr that comes along, i.e. diff --git a/qadevOOo/tests/java/ifc/document/_Settings.java b/qadevOOo/tests/java/ifc/document/_Settings.java index 4a8dde8fb10e..7d6c3937a7d4 100644 --- a/qadevOOo/tests/java/ifc/document/_Settings.java +++ b/qadevOOo/tests/java/ifc/document/_Settings.java @@ -61,7 +61,7 @@ public class _Settings extends MultiPropertyTest { Exception ex = null; try { - Class cPrinterJob = Class.forName("java.awt.print.PrinterJob"); + Class<?> cPrinterJob = Class.forName("java.awt.print.PrinterJob"); Method lookupMethod = cPrinterJob.getDeclaredMethod("lookupPrintServices", new Class[0]); Object retValue = lookupMethod.invoke(cPrinterJob, new Object[0]); oServices = (Object[])retValue; @@ -146,12 +146,12 @@ public class _Settings extends MultiPropertyTest { private String getPrinterNameWithReflection(Object pService) { String pName = null; try { - Class cPrintService = Class.forName("javax.print.PrintService"); + Class<?> cPrintService = Class.forName("javax.print.PrintService"); Method getNameMethod = cPrintService.getDeclaredMethod("getName", new Class[0]); Object retValue = getNameMethod.invoke(pService, new Object[0]); pName = (String)retValue; } - // ignore all excptions: we already ran into one of these if Java is too old + // ignore all exceptions: we already ran into one of these if Java is too old catch(java.lang.ClassNotFoundException e) { } catch(java.lang.NoSuchMethodException e) { diff --git a/qadevOOo/tests/java/ifc/document/_XDocumentInfoSupplier.java b/qadevOOo/tests/java/ifc/document/_XDocumentInfoSupplier.java index b92d50eef7cf..5810ae83dabf 100644 --- a/qadevOOo/tests/java/ifc/document/_XDocumentInfoSupplier.java +++ b/qadevOOo/tests/java/ifc/document/_XDocumentInfoSupplier.java @@ -32,13 +32,13 @@ public class _XDocumentInfoSupplier extends MultiMethodTest { public void _getDocumentInfo() { // returns a com.sun.star.document.DocumentInfo XDocumentInfo info = oObj.getDocumentInfo(); - XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, info); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, info); String title = null; try { title = (String)xPropertySet.getPropertyValue("Title"); } catch(Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); title = null; } log.println("Got document title: " + title); diff --git a/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java b/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java index d07f60b0a190..88f60d43573a 100644 --- a/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java +++ b/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java @@ -60,8 +60,7 @@ public class _XStandaloneDocumentInfo extends MultiMethodTest { public void _storeIntoURL() { try { oObj.loadFromURL(url); - XPropertySet propSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet propSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); oldProp = (String)propSet.getPropertyValue("Author"); newProp = oldProp + "_"; propSet.setPropertyValue("Author", newProp); @@ -98,8 +97,7 @@ public class _XStandaloneDocumentInfo extends MultiMethodTest { requiredMethod("storeIntoURL()"); try { oObj.loadFromURL(url); - XPropertySet propSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet propSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); String resProp = (String)propSet.getPropertyValue("Author"); log.println("Was: '" + oldProp + "',Set: '" + newProp + "', New: " + resProp + "'"); diff --git a/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java b/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java index e5966fbd189b..62a56e1d1a56 100644 --- a/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java +++ b/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java @@ -86,7 +86,7 @@ public class _XViewDataSupplier extends MultiMethodTest { } } catch(Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); } } @@ -107,7 +107,7 @@ public class _XViewDataSupplier extends MultiMethodTest { } } catch(Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); } return retValue; } diff --git a/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java index a44cd890f18b..feb8a8d8847a 100644 --- a/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java +++ b/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java @@ -33,8 +33,7 @@ public class _LineShapeDescriptor extends MultiMethodTest { public void _LineColor() { - XServiceInfo xInfo = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, oObj); + XServiceInfo xInfo = UnoRuntime.queryInterface(XServiceInfo.class, oObj); if ( ! xInfo.supportsService ("com.sun.star.drawing.LineShapeDescriptor")) { log.println("Service not available !!!!!!!!!!!!!"); diff --git a/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java index 083b6e5707c2..5e3049c73495 100644 --- a/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java +++ b/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java @@ -32,9 +32,8 @@ public class _ShapeDescriptor extends MultiMethodTest { public boolean ro = false; public void _LayerID() { - com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo) - UnoRuntime.queryInterface - (com.sun.star.lang.XServiceInfo.class, oObj); + com.sun.star.lang.XServiceInfo xInfo = UnoRuntime.queryInterface + (com.sun.star.lang.XServiceInfo.class, oObj); if ( ! xInfo.supportsService("com.sun.star.drawing.ShapeDescriptor")) { log.println("Service not available !!!!!!!!!!!!!"); tRes.tested("Supported", false); diff --git a/qadevOOo/tests/java/ifc/drawing/_XShape.java b/qadevOOo/tests/java/ifc/drawing/_XShape.java index d0dd93675654..cff0c553e414 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XShape.java +++ b/qadevOOo/tests/java/ifc/drawing/_XShape.java @@ -63,7 +63,7 @@ public class _XShape extends MultiMethodTest { log.println("get the size"); - sOld = (Size) oObj.getSize(); + sOld = oObj.getSize(); result = true; tRes.tested("getSize()", result); @@ -88,7 +88,7 @@ public class _XShape extends MultiMethodTest { } log.println("get the position"); - pOld = (Point) oObj.getPosition(); + pOld = oObj.getPosition(); result = true; tRes.tested("getPosition()", result); diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java index 515cdeee06d6..0356d53c2636 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java +++ b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java @@ -53,8 +53,7 @@ public class _XShapeDescriptor extends MultiMethodTest { String stype = oObj.getShapeType(); log.println("Current Shape Type is " + stype); - XServiceInfo SI = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, oObj); + XServiceInfo SI = UnoRuntime.queryInterface(XServiceInfo.class, oObj); String[] serviceNames = SI.getSupportedServiceNames(); diff --git a/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java index 80e888516d99..4868f75f29e5 100644 --- a/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java +++ b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java @@ -55,7 +55,7 @@ public class _XDatabaseParameterBroadcaster extends MultiMethodTest { protected void before() { listenerChecker = (CheckParameterListener) tEnv.getObjRelation("ParameterListenerChecker"); - listenerChecker.setLog((PrintWriter)log); + listenerChecker.setLog(log); } /** @@ -78,7 +78,7 @@ public class _XDatabaseParameterBroadcaster extends MultiMethodTest { catch(com.sun.star.sdbc.SQLException e) { log.println("Exception in XDatabaseParameterBroadcaster test."); log.println("This does not let the test fail, but should be inquired."); - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); } // was the listener called? oObj.removeParameterListener(listenerChecker); diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java index 337582e0d593..899155c2a808 100644 --- a/qadevOOo/tests/java/ifc/form/_XSubmit.java +++ b/qadevOOo/tests/java/ifc/form/_XSubmit.java @@ -114,7 +114,7 @@ public class _XSubmit extends MultiMethodTest { log.println("Testing submit() ..."); XControl cntrl = (XControl) tEnv.getObjRelation("XSubmit.Control") ; - XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, oObj) ; if (xPS != null) { diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java index 57d7cb756dcf..4b30bce6ebfc 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java @@ -81,7 +81,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - Object inst = (XInterface)((XMultiServiceFactory)tParam.getMSF()).createInstance + Object inst = ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.frame.Desktop"); desktop = UnoRuntime.queryInterface (XDesktop.class, inst); diff --git a/qadevOOo/tests/java/ifc/frame/_XStorable.java b/qadevOOo/tests/java/ifc/frame/_XStorable.java index b5ea65c4ab15..86a4eabc11f2 100644 --- a/qadevOOo/tests/java/ifc/frame/_XStorable.java +++ b/qadevOOo/tests/java/ifc/frame/_XStorable.java @@ -129,7 +129,7 @@ public class _XStorable extends MultiMethodTest { */ public void _storeAsURL() { // getting an url to store - String url = (String) utils.getOfficeTemp( + String url = utils.getOfficeTemp( (XMultiServiceFactory)tParam.getMSF()); if (url != null) { @@ -157,7 +157,7 @@ public class _XStorable extends MultiMethodTest { */ public void _storeToURL() { // getting an url to store - String url = (String) utils.getOfficeTemp( + String url = utils.getOfficeTemp( (XMultiServiceFactory)tParam.getMSF()); if (url != null) { diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedTransliteration.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedTransliteration.java index 333838d3ec72..3422d06d4e54 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XExtendedTransliteration.java +++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedTransliteration.java @@ -49,7 +49,7 @@ public class _XExtendedTransliteration extends MultiMethodTest { result &= out == '$'; } catch(com.sun.star.i18n.MultipleCharsOutputException e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); } tRes.tested("transliterateChar2Char()", result); } diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java b/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java index 975f55d64254..10a503780514 100644 --- a/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java +++ b/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java @@ -55,7 +55,7 @@ public class _XActiveDataSink extends MultiMethodTest { */ public void before() { XInterface x = (XInterface)tEnv.getObjRelation("InputStream"); - iStream = (XInputStream) UnoRuntime.queryInterface + iStream = UnoRuntime.queryInterface (XInputStream.class, x) ; } diff --git a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java index cb96c3ca11a6..2671b4baf620 100644 --- a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java @@ -81,7 +81,7 @@ public class _XDataInputStream extends MultiMethodTest { XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter") ; oStream = UnoRuntime.queryInterface( XDataOutputStream.class, x); - List data = (List) tEnv.getObjRelation("StreamData") ; + List<Object> data = (List<Object>) tEnv.getObjRelation("StreamData") ; if (data == null || oStream == null) { throw new StatusException(Status.failed("Object relation not found.")); } diff --git a/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java index 293c872d43e0..bb8db3113690 100644 --- a/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java @@ -70,7 +70,7 @@ public class _XDataOutputStream extends MultiMethodTest { */ public void before() throws RuntimeException { - List data = (List) tEnv.getObjRelation("StreamData") ; + List<Object> data = (List<Object>) tEnv.getObjRelation("StreamData") ; if (data == null) { throw new RuntimeException("Object relation 'StreamData' not found."); } diff --git a/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java b/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java index 04858de3093c..01235e3d39d8 100644 --- a/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java @@ -95,10 +95,10 @@ public class _XObjectInputStream extends MultiMethodTest { XPropertySet props1 = null ; XPropertySet props2 = null ; - props1 = (XPropertySet) UnoRuntime.queryInterface + props1 = UnoRuntime.queryInterface (XPropertySet.class, objRead) ; - props2 = (XPropertySet) UnoRuntime.queryInterface + props2 = UnoRuntime.queryInterface (XPropertySet.class, objWrite) ; if (props1 == null) { diff --git a/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java b/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java index 1215a7331508..86efebe52c66 100644 --- a/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java @@ -66,8 +66,7 @@ public class _XObjectOutputStream extends MultiMethodTest { if (objWrite == null) throw new StatusException(Status.failed("Relation 'PersistObject' failed")); - XPropertySet propObjWrite = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, objWrite); + XPropertySet propObjWrite = UnoRuntime.queryInterface(XPropertySet.class, objWrite); // This XPersistObject has a property called 'String' propObjWrite.setPropertyValue("String", "XObjectOutputStream"); @@ -75,8 +74,7 @@ public class _XObjectOutputStream extends MultiMethodTest { log.println("Writing object with label 'XObjectOutputStream'"); oObj.writeObject(objWrite); XPersistObject readObj = oInStream.readObject(); - XPropertySet propSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, readObj); + XPropertySet propSet = UnoRuntime.queryInterface(XPropertySet.class, readObj); String label = (String)propSet.getPropertyValue("String"); log.println("Object with label '" + label + "' was read"); diff --git a/qadevOOo/tests/java/ifc/io/_XPersistObject.java b/qadevOOo/tests/java/ifc/io/_XPersistObject.java index fe8f9c162fd9..a21da9bd32e4 100644 --- a/qadevOOo/tests/java/ifc/io/_XPersistObject.java +++ b/qadevOOo/tests/java/ifc/io/_XPersistObject.java @@ -111,19 +111,18 @@ public class _XPersistObject extends MultiMethodTest { try { Object noPS = tEnv.getObjRelation("noPS"); if ( noPS == null) { - XPropertySet objps = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet objps = UnoRuntime.queryInterface( XPropertySet.class, oObj); XPropertySetInfo objpsi = objps.getPropertySetInfo(); Property[] objprops = objpsi.getProperties(); Object oCopy = ((XMultiServiceFactory)tParam.getMSF()).createInstance(sname); - XPersistObject persCopy = (XPersistObject) - UnoRuntime.queryInterface(XPersistObject.class, oCopy); + XPersistObject persCopy = UnoRuntime.queryInterface(XPersistObject.class, oCopy); persCopy.read(iStream); - XPropertySet copyps = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet copyps = UnoRuntime.queryInterface( XPropertySet.class, oCopy); XPropertySetInfo copypsi = copyps.getPropertySetInfo(); @@ -158,8 +157,7 @@ public class _XPersistObject extends MultiMethodTest { } } else { Object oCopy = ((XMultiServiceFactory)tParam.getMSF()).createInstance(sname); - XPersistObject persCopy = (XPersistObject) - UnoRuntime.queryInterface(XPersistObject.class, oCopy); + XPersistObject persCopy = UnoRuntime.queryInterface(XPersistObject.class, oCopy); persCopy.read(iStream); @@ -219,11 +217,9 @@ public class _XPersistObject extends MultiMethodTest { XActiveDataSink xdSmi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); - XInputStream miStream = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, mistream); + XInputStream miStream = UnoRuntime.queryInterface(XInputStream.class, mistream); XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream); - XInputStream PipeIn = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, aPipe); + XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe); XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); xdSi.setInputStream(miStream); diff --git a/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java index 6fde194d8298..208e91c1b0d8 100644 --- a/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java +++ b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java @@ -55,7 +55,7 @@ import com.sun.star.uno.UnoRuntime; public class _XSingleServiceFactory extends MultiMethodTest { public XSingleServiceFactory oObj = null; - private Class[] mustSupport = null ; + private Class<?>[] mustSupport = null ; public void before() { mustSupport = (Class[]) tEnv.getObjRelation diff --git a/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java b/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java index 9135865fc5a7..91557d92a6a5 100644 --- a/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java +++ b/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java @@ -145,7 +145,7 @@ public class _XImplementationLoader extends MultiMethodTest { throw new StatusException("Can not activate factory", e) ; } - XServiceInfo xServInf = (XServiceInfo) UnoRuntime.queryInterface + XServiceInfo xServInf = UnoRuntime.queryInterface (XServiceInfo.class, factory) ; if (xServInf == null) { diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java index c3b6b7ca4a0f..0eab955df86b 100644 --- a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java +++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java @@ -70,7 +70,7 @@ public class _XInvocationAdapterFactory extends MultiMethodTest { Object oInvFac = xMSF.createInstance ("com.sun.star.script.Invocation") ; - XSingleServiceFactory xInvFac = (XSingleServiceFactory) UnoRuntime. + XSingleServiceFactory xInvFac = UnoRuntime. queryInterface(XSingleServiceFactory.class, oInvFac) ; Object oInv = xInvFac.createInstanceWithArguments(args) ; @@ -88,7 +88,7 @@ public class _XInvocationAdapterFactory extends MultiMethodTest { Object adp = oObj.createAdapter(xInv, new Type(XInputStream.class)) ; - xInStr = (XInterface) UnoRuntime.queryInterface + xInStr = UnoRuntime.queryInterface (XInputStream.class, adp) ; diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java index 4f739caebf3f..c9a381aa2587 100644 --- a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java +++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java @@ -70,7 +70,7 @@ public class _XInvocationAdapterFactory2 extends MultiMethodTest { Object oInvFac = xMSF.createInstance ("com.sun.star.script.Invocation") ; - XSingleServiceFactory xInvFac = (XSingleServiceFactory) UnoRuntime. + XSingleServiceFactory xInvFac = UnoRuntime. queryInterface(XSingleServiceFactory.class, oInvFac) ; Object oInv = xInvFac.createInstanceWithArguments(args) ; @@ -90,7 +90,7 @@ public class _XInvocationAdapterFactory2 extends MultiMethodTest { Object adp = oObj.createAdapter(xInv,types); - xInStr = (XInterface) UnoRuntime.queryInterface + xInStr = UnoRuntime.queryInterface (XInputStream.class, adp) ; diff --git a/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java index 450b4b5af02d..f8f2d94a5b43 100644 --- a/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java +++ b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java @@ -76,16 +76,16 @@ public class _DataAccessDescriptor 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("DataAccessDescriptor.XConnection")); + XConnection newValue = UnoRuntime.queryInterface(XConnection.class,tEnv.getObjRelation("DataAccessDescriptor.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/sdb/_XCompletedExecution.java b/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java index 177f38be86fb..28c03caf8618 100644 --- a/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java +++ b/qadevOOo/tests/java/ifc/sdb/_XCompletedExecution.java @@ -52,7 +52,7 @@ public class _XCompletedExecution extends MultiMethodTest { tEnv.getObjRelation("InteractionHandlerChecker"); if (checkHandler == null) throw new StatusException("Missing object relation 'InteractionHandlerChecker'", new Exception()); - checkHandler.setLog((PrintWriter)log); + checkHandler.setLog(log); } @@ -61,7 +61,7 @@ public class _XCompletedExecution extends MultiMethodTest { oObj.executeWithCompletion(checkHandler); } catch(com.sun.star.sdbc.SQLException e) { - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); tRes.tested("executeWithCompletion()", false); return; } diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java index e5c901cb56c2..8ba1702e3b44 100644 --- a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java @@ -81,9 +81,8 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { } - xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, - tEnv.getObjRelation("xProp")); + xProp = UnoRuntime.queryInterface(XPropertySet.class, + tEnv.getObjRelation("xProp")); if (xProp == null) { throw new StatusException(Status.failed( diff --git a/qadevOOo/tests/java/ifc/sdbc/_XParameters.java b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java index 06b50e2ccb38..e9d9774c0688 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XParameters.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java @@ -95,13 +95,13 @@ public class _XParameters extends MultiMethodTest { // oObj filled by MultiMethodTest public XParameters oObj = null ; - private List data = null ; + private List<Object> data = null ; /** * Gets object relation */ public void before() { - data = (List) tEnv.getObjRelation("XParameters.ParamValues") ; + data = (List<Object>) tEnv.getObjRelation("XParameters.ParamValues") ; if (data == null) { log.println("!!! Relation not found !!!") ; } @@ -402,7 +402,7 @@ public class _XParameters extends MultiMethodTest { try { Object oStream = ((XMultiServiceFactory)tParam.getMSF()). createInstance("com.sun.star.io.DataInputStream") ; - XInputStream xStream = (XInputStream)UnoRuntime.queryInterface + XInputStream xStream = UnoRuntime.queryInterface (XInputStream.class, oStream); oObj.setBinaryStream(idx, xStream, 2) ; @@ -432,7 +432,7 @@ public class _XParameters extends MultiMethodTest { try { Object oStream = ((XMultiServiceFactory)tParam.getMSF()) .createInstance("com.sun.star.io.TextInputStream") ; - XInputStream xStream = (XInputStream)UnoRuntime.queryInterface + XInputStream xStream = UnoRuntime.queryInterface (XInputStream.class, oStream); oObj.setCharacterStream(idx, xStream, 2) ; @@ -553,8 +553,7 @@ public class _XParameters extends MultiMethodTest { * Finds in relation vector index of parameter of the appropriate * type. */ - private int findParamOfType(Class clz) { - + private int findParamOfType(Class<?> clz) { for (int i = 0; i < data.size(); i++) if (clz.isInstance(data.get(i))) return i + 1 ; return -1 ; diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRow.java b/qadevOOo/tests/java/ifc/sdbc/_XRow.java index 12f4f22fca55..fa1d1b89fda0 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XRow.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XRow.java @@ -95,14 +95,14 @@ public class _XRow extends MultiMethodTest { // oObj filled by MultiMethodTest public XRow oObj = null ; - private List data = null ; + private List<Object> data = null ; private boolean notNullRes = true ; /** * Retrieves object relation first. */ public void before() { - data = (List) tEnv.getObjRelation("CurrentRowData") ; + data = (List<Object>) tEnv.getObjRelation("CurrentRowData") ; } /** @@ -524,7 +524,7 @@ public class _XRow extends MultiMethodTest { * Finds in relation vector index of column of the appropriate * type. */ - protected int findColumnOfType(Class clz) { + protected int findColumnOfType(Class<?> clz) { for (int i = 0; i < data.size(); i++) if (clz.isInstance(data.get(i))) return i + 1 ; diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java index b08cd9256ebb..53cd93d9fa5b 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java @@ -93,14 +93,14 @@ public class _XRowUpdate extends MultiMethodTest { // oObj filled by MultiMethodTest public XRowUpdate oObj = null ; - private List rowData = null ; + private List<Object> rowData = null ; private XRow row = null ; /** * Gets relations. */ public void before() { - rowData = (List) tEnv.getObjRelation("CurrentRowData") ; + rowData = (List<Object>) tEnv.getObjRelation("CurrentRowData") ; if (rowData == null) { log.println("!!! 'CurrentRowData' relation not found !!!") ; } @@ -538,7 +538,7 @@ public class _XRowUpdate extends MultiMethodTest { try { Object oStream = ((XMultiServiceFactory)tParam.getMSF()). createInstance("com.sun.star.io.DataInputStream") ; - XInputStream newVal = (XInputStream) UnoRuntime.queryInterface + XInputStream newVal = UnoRuntime.queryInterface (XInputStream.class, oStream); oObj.updateBinaryStream(idx, newVal, 0) ; @@ -575,7 +575,7 @@ public class _XRowUpdate extends MultiMethodTest { try { Object oStream = ((XMultiServiceFactory)tParam.getMSF()). createInstance("com.sun.star.io.TextInputStream") ; - XInputStream newVal = (XInputStream) UnoRuntime.queryInterface + XInputStream newVal = UnoRuntime.queryInterface (XInputStream.class, oStream); oObj.updateCharacterStream(idx, newVal, 0) ; @@ -667,7 +667,7 @@ public class _XRowUpdate extends MultiMethodTest { * Finds in relation vector index of column of the appropriate * type. */ - protected int findColumnOfType(Class clz) { + protected int findColumnOfType(Class<?> clz) { for (int i = 0; i < rowData.size(); i++) if (clz.isInstance(rowData.get(i))) return i + 1 ; diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XTablesSupplier.java b/qadevOOo/tests/java/ifc/sdbcx/_XTablesSupplier.java index eec83adea83b..ca61c91d2977 100644 --- a/qadevOOo/tests/java/ifc/sdbcx/_XTablesSupplier.java +++ b/qadevOOo/tests/java/ifc/sdbcx/_XTablesSupplier.java @@ -56,7 +56,7 @@ public class _XTablesSupplier extends MultiMethodTest { XServiceInfo info = null ; try { - info = (XServiceInfo) UnoRuntime.queryInterface + info = UnoRuntime.queryInterface (XServiceInfo.class, tabs.getByName(tabNames[0])) ; } catch (com.sun.star.uno.Exception e) {} diff --git a/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java b/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java index e70f92d49c9a..8787a2844d40 100644 --- a/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java +++ b/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java @@ -50,8 +50,7 @@ public class _FunctionDescription extends MultiMethodTest { public void _Arguments() { // check if Service is available - XServiceInfo xInfo = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, oObj ); + XServiceInfo xInfo = UnoRuntime.queryInterface(XServiceInfo.class, oObj ); if ( ! xInfo.supportsService ( "com.sun.star.sheet.FunctionDescription" ) ) { diff --git a/qadevOOo/tests/java/ifc/sheet/_Scenario.java b/qadevOOo/tests/java/ifc/sheet/_Scenario.java index 8d67c1455c34..ce01ebf4d91d 100644 --- a/qadevOOo/tests/java/ifc/sheet/_Scenario.java +++ b/qadevOOo/tests/java/ifc/sheet/_Scenario.java @@ -25,7 +25,7 @@ import lib.MultiPropertyTest; public class _Scenario extends MultiPropertyTest { public void before() { - oObj = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, + oObj = UnoRuntime.queryInterface(XPropertySet.class, tEnv.getObjRelation( "ScenarioSheet")); } diff --git a/qadevOOo/tests/java/ifc/sheet/_Shape.java b/qadevOOo/tests/java/ifc/sheet/_Shape.java index beed8da55061..c5def63c4379 100644 --- a/qadevOOo/tests/java/ifc/sheet/_Shape.java +++ b/qadevOOo/tests/java/ifc/sheet/_Shape.java @@ -36,7 +36,7 @@ public class _Shape extends MultiPropertyTest { XCell xCell = null; try { - xSheet = (XSpreadsheet) UnoRuntime.queryInterface( + xSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xSheetDoc.getSheets().getByName(sheetNames[0])); xCell = xSheet.getCellByPosition(0, 0); diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java index 837b2ecea427..3bb40649889b 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java @@ -58,8 +58,7 @@ public class _XCellRangeMovement extends MultiMethodTest { */ public void _copyRange(){ log.println("Prepare cells before test methods."); - XSpreadsheet oSheet = (XSpreadsheet) - UnoRuntime.queryInterface(XSpreadsheet.class, oObj); + XSpreadsheet oSheet = UnoRuntime.queryInterface(XSpreadsheet.class, oObj); try { oSheet.getCellByPosition(1,1).setValue(100); oSheet.getCellByPosition(1,2).setValue(200); @@ -106,8 +105,7 @@ public class _XCellRangeMovement extends MultiMethodTest { public void _insertCells(){ boolean result = false; - XSpreadsheet oSheet = (XSpreadsheet) - UnoRuntime.queryInterface(XSpreadsheet.class, oObj); + XSpreadsheet oSheet = UnoRuntime.queryInterface(XSpreadsheet.class, oObj); XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; try { @@ -129,7 +127,7 @@ public class _XCellRangeMovement extends MultiMethodTest { "Delete old cells now"); XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); oRows.removeByIndex(21,1); } CellRangeAddress sSrc = new CellRangeAddress(iSheet, 0, 21, 5, 21); @@ -157,8 +155,7 @@ public class _XCellRangeMovement extends MultiMethodTest { public void _moveRange(){ boolean result = false; - XSpreadsheet oSheet = (XSpreadsheet) - UnoRuntime.queryInterface(XSpreadsheet.class, oObj); + XSpreadsheet oSheet = UnoRuntime.queryInterface(XSpreadsheet.class, oObj); XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); @@ -199,8 +196,7 @@ public class _XCellRangeMovement extends MultiMethodTest { public void _removeRange(){ boolean result = false; - XSpreadsheet oSheet = (XSpreadsheet) - UnoRuntime.queryInterface(XSpreadsheet.class, oObj); + XSpreadsheet oSheet = UnoRuntime.queryInterface(XSpreadsheet.class, oObj); XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; try { diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java index 0a9636a680c3..225e0f97766f 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java @@ -71,7 +71,7 @@ public class _XCellRangesQuery extends MultiMethodTest { if (oSheet == null) { log.println("Object relation oSheet is missing"); log.println("Trying to query the needed Interface"); - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, tEnv.getTestObject()); if (oSheet == null) { @@ -87,8 +87,8 @@ public class _XCellRangesQuery extends MultiMethodTest { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface( XColumnRowRange.class, oSheet); - oRows = (XTableRows)oColumnRowRange.getRows(); - oColumns = (XTableColumns) oColumnRowRange.getColumns(); + oRows = oColumnRowRange.getRows(); + oColumns = oColumnRowRange.getColumns(); // set this in object if the interface has to make its own settings // and the environment has to be disposed: this is necessary for objects @@ -266,7 +266,7 @@ public class _XCellRangesQuery extends MultiMethodTest { protected void setRowVisible(boolean vis) { try { - XPropertySet rowProp = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet rowProp = UnoRuntime.queryInterface( XPropertySet.class, oRows.getByIndex(0)); rowProp.setPropertyValue("IsVisible", new Boolean(vis)); diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellSeries.java b/qadevOOo/tests/java/ifc/sheet/_XCellSeries.java index fcc8d72c1889..6152d2c243ee 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellSeries.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellSeries.java @@ -42,7 +42,7 @@ public class _XCellSeries extends MultiMethodTest { if (oSheet == null) { log.println("Object relation oSheet is missing"); log.println("Trying to query the needed Interface"); - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, tEnv.getTestObject()); if (oSheet == null) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java index 92c50495e3d9..99d4856903cf 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java @@ -204,8 +204,7 @@ public class _XDataPilotDescriptor extends MultiMethodTest { fieldsNames[cnt] = name ; - XPropertySet props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, field); + XPropertySet props = UnoRuntime.queryInterface(XPropertySet.class, field); try { switch (cnt % 5) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java index c08960529c73..be4fb06fecaf 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java @@ -38,7 +38,7 @@ public class _XDataPilotFieldGrouping extends MultiMethodTest boolean result = true; try { XDataPilotField xDataPilotField = UnoRuntime.queryInterface(XDataPilotField.class, oObj); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xDataPilotField.getItems ()); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, xDataPilotField.getItems ()); String[] elements = xNameAccess.getElementNames (); oObj.createNameGroup(elements); } catch (com.sun.star.lang.IllegalArgumentException e) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java index 18d33a96334b..da56fbb3071c 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java @@ -217,7 +217,7 @@ public class _XDataPilotTable2 extends MultiMethodTest XSpreadsheet xSheet = null; try { - xSheet = (XSpreadsheet)UnoRuntime.queryInterface( + xSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xIA.getByIndex(addr.Sheet)); } catch (com.sun.star.uno.Exception e) @@ -425,7 +425,7 @@ public class _XDataPilotTable2 extends MultiMethodTest try { Object field = xFields.getByIndex(i); - XPropertySet propSet = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet propSet = UnoRuntime.queryInterface( XPropertySet.class, field); DataPilotFieldOrientation orient = (DataPilotFieldOrientation)propSet.getPropertyValue("Orientation"); diff --git a/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java b/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java index 936351a30353..6f9da14a34ec 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java @@ -59,10 +59,10 @@ public class _XDocumentAuditing extends MultiMethodTest { XSpreadsheets oSheets = xSpreadsheetDocument.getSheets(); XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); - XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + XSpreadsheet oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, oIndexSheets.getByIndex(0)); xSheet[0] = oSheet; - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, oIndexSheets.getByIndex(1)); xSheet[1] = oSheet; } @@ -85,7 +85,7 @@ public class _XDocumentAuditing extends MultiMethodTest { try { XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, oObj); Object o = oDPS.getDrawPages().getByIndex(1); - xDrawPage = (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, o); + xDrawPage = UnoRuntime.queryInterface(XDrawPage.class, o); } catch(com.sun.star.lang.IndexOutOfBoundsException e) { } // ignore exceptions, we'll run into next if statement anyway diff --git a/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java b/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java index 989e3e3cdce3..5a9d5bd53b72 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java +++ b/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java @@ -50,7 +50,7 @@ public class _XFormulaQuery extends MultiMethodTest { if (oSheet == null) { log.println("Object relation oSheet is missing"); log.println("Trying to query the needed Interface"); - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, tEnv.getTestObject()); if (oSheet == null) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java b/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java index 6b7ddd18b203..d19a94cb85e5 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java +++ b/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java @@ -45,7 +45,7 @@ public class _XGoalSeek extends MultiMethodTest { XSpreadsheets oSheets = xSpreadsheetDocument.getSheets(); XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); - xSheet = (XSpreadsheet) UnoRuntime.queryInterface( + xSheet = UnoRuntime.queryInterface( XSpreadsheet.class, oIndexSheets.getByIndex(1)); } catch(com.sun.star.lang.IndexOutOfBoundsException e) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java index 7fbad5549625..856cb61d8668 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java +++ b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java @@ -133,7 +133,7 @@ public class _XRecentFunctions extends MultiMethodTest { PropertyValue[] propVals = (PropertyValue[]) functionList.getByName(names[i]); for (int j = 0; j < propVals.length; j++) { - String propName = (String)propVals[j].Name; + String propName = propVals[j].Name; if (propName.equals("Id")) { IDs[i - startIdx] = ((Integer)propVals[j].Value).intValue(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java index f2f943a7069d..345e07cdfe8d 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java @@ -58,7 +58,7 @@ public class _XSheetAuditing extends MultiMethodTest { xDrawPage = (XDrawPage)tEnv.getObjRelation("XSheetAuditing.DrawPage"); if (xDrawPage == null) { // get from object XDrawPageSupplier oDPS = UnoRuntime.queryInterface(XDrawPageSupplier.class, oObj); - xDrawPage = (XDrawPage) oDPS.getDrawPage(); + xDrawPage = oDPS.getDrawPage(); } if (xDrawPage == null) { throw new StatusException(Status.failed("'XSheetAuditing.DrawPage' object relation not found.")); @@ -70,7 +70,7 @@ public class _XSheetAuditing extends MultiMethodTest { // get a sheet for changing the cells XSpreadsheet xSheet = (XSpreadsheet)tEnv.getObjRelation("XSheetAuditing.Spreadsheet"); if (xSheet == null) // query on ther object - xSheet = (XSpreadsheet)UnoRuntime.queryInterface(XSpreadsheet.class, oObj); + xSheet = UnoRuntime.queryInterface(XSpreadsheet.class, oObj); if (xSheet == null) throw new StatusException(Status.failed("'XSheetAuditing.Spreadsheet' object relation not found.")); try { @@ -136,9 +136,9 @@ public class _XSheetAuditing extends MultiMethodTest { xAddress.setValue(2.5); try { // add a validitation to a cell: only whole numbers are allowed - XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xAddress); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xAddress); Object o = xPropertySet.getPropertyValue("Validation"); - XPropertySet xValidation = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, o); + XPropertySet xValidation = UnoRuntime.queryInterface(XPropertySet.class, o); xValidation.setPropertyValue("Type", ValidationType.WHOLE); xPropertySet.setPropertyValue("Validation", xValidation); // test @@ -154,7 +154,7 @@ public class _XSheetAuditing extends MultiMethodTest { result &= hasRightAmountOfShapes(0); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); result = false; } diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java index 892fadee5961..b230bd0b866d 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java @@ -42,7 +42,7 @@ public class _XSheetFilterable extends MultiMethodTest { if (oSheet == null) { log.println("Object relation oSheet is missing"); log.println("Trying to query the needed Interface"); - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, tEnv.getTestObject()); if (oSheet == null) { @@ -85,8 +85,8 @@ public class _XSheetFilterable extends MultiMethodTest { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface( XColumnRowRange.class, oSheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); - XPropertySet rowProp = (XPropertySet) UnoRuntime.queryInterface( + XTableRows oRows = oColumnRowRange.getRows(); + XPropertySet rowProp = UnoRuntime.queryInterface( XPropertySet.class, oRows.getByIndex(0)); boolean locRes = ((Boolean) rowProp.getPropertyValue("IsVisible")).booleanValue(); @@ -98,7 +98,7 @@ public class _XSheetFilterable extends MultiMethodTest { res &= true; } - rowProp = (XPropertySet) UnoRuntime.queryInterface( + rowProp = UnoRuntime.queryInterface( XPropertySet.class, oRows.getByIndex(1)); locRes = ((Boolean) rowProp.getPropertyValue("IsVisible")).booleanValue(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSubTotalCalculatable.java b/qadevOOo/tests/java/ifc/sheet/_XSubTotalCalculatable.java index 875e73e1d241..d34f89f4403f 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSubTotalCalculatable.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSubTotalCalculatable.java @@ -39,7 +39,7 @@ public class _XSubTotalCalculatable extends MultiMethodTest { if (oSheet == null) { log.println("Object relation oSheet is missing"); log.println("Trying to query the needed Interface"); - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, tEnv.getTestObject()); if (oSheet == null) { diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java index c009b351229d..4abf8c93c95d 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java @@ -183,10 +183,10 @@ public class _ParagraphProperties extends MultiPropertyTest { protected PropertyTester BooleanTester = new PropertyTester() { protected Object getNewValue(String propName, Object oldValue) { if ((oldValue != null) && - (oldValue.equals(new Boolean((boolean) false)))) { - return new Boolean((boolean) true); + (oldValue.equals(new Boolean(false)))) { + return new Boolean(true); } else { - return new Boolean((boolean) false); + return new Boolean(false); } } }; diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java index 100c4e1f6f6a..c82b8e0f0d32 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java @@ -40,10 +40,10 @@ public class _ParagraphPropertiesAsian extends MultiPropertyTest { protected PropertyTester BooleanTester = new PropertyTester() { protected Object getNewValue(String propName, Object oldValue) { if ((oldValue != null) && - (oldValue.equals(new Boolean((boolean) false)))) { - return new Boolean((boolean) true); + (oldValue.equals(new Boolean(false)))) { + return new Boolean(true); } else { - return new Boolean((boolean) false); + return new Boolean(false); } } }; diff --git a/qadevOOo/tests/java/ifc/system/_XProxySettings.java b/qadevOOo/tests/java/ifc/system/_XProxySettings.java index dd08f4cfec96..06b18d1a2269 100644 --- a/qadevOOo/tests/java/ifc/system/_XProxySettings.java +++ b/qadevOOo/tests/java/ifc/system/_XProxySettings.java @@ -57,7 +57,7 @@ public class _XProxySettings extends MultiMethodTest { * Contains a HashMap with correct results of the tested methods. See * the class description. */ - Map expectedProxies; + Map<String,String> expectedProxies; /** * Checks that the "XProxySettings.proxySettings" object relation is @@ -68,7 +68,7 @@ public class _XProxySettings extends MultiMethodTest { * @see #expectedProxies */ public void before() { - expectedProxies = (Map)tEnv.getObjRelation( + expectedProxies = (Map<String,String>)tEnv.getObjRelation( "XProxySettings.proxySettings"); if (expectedProxies == null) { @@ -85,8 +85,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getFtpProxyAddress() { String ftpProxyAddress = oObj.getFtpProxyAddress(); - String expectedFtpProxyAddress = (String) - expectedProxies.get("ftpProxyAddress"); + String expectedFtpProxyAddress = expectedProxies.get("ftpProxyAddress"); log.println("getFtpProxyAddress"); log.println("getting: "+ftpProxyAddress); @@ -104,8 +103,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getFtpProxyPort() { String ftpProxyPort = oObj.getFtpProxyPort(); - String expectedFtpProxyPort = (String) - expectedProxies.get("ftpProxyPort"); + String expectedFtpProxyPort = expectedProxies.get("ftpProxyPort"); log.println("getFtpProxyPort"); log.println("getting: "+ftpProxyPort); @@ -123,8 +121,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getGopherProxyAddress() { String gopherProxyAddress = oObj.getGopherProxyAddress(); - String expectedGopherProxyAddress = (String) - expectedProxies.get("gopherProxyAddress"); + String expectedGopherProxyAddress = expectedProxies.get("gopherProxyAddress"); tRes.tested("getGopherProxyAddress()", gopherProxyAddress.equals(expectedGopherProxyAddress)); @@ -138,8 +135,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getGopherProxyPort() { String gopherProxyPort = oObj.getGopherProxyPort(); - String expectedGopherProxyPort = (String) - expectedProxies.get("gopherProxyPort"); + String expectedGopherProxyPort = expectedProxies.get("gopherProxyPort"); tRes.tested("getGopherProxyPort()", gopherProxyPort.equals(expectedGopherProxyPort)); @@ -153,8 +149,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getHttpProxyAddress() { String httpProxyAddress = oObj.getHttpProxyAddress(); - String expectedHttpProxyAddress = (String) - expectedProxies.get("httpProxyAddress"); + String expectedHttpProxyAddress = expectedProxies.get("httpProxyAddress"); log.println("getHttpProxyAddress"); log.println("getting: "+httpProxyAddress); @@ -172,8 +167,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getHttpProxyPort() { String httpProxyPort = oObj.getHttpProxyPort(); - String expectedHttpProxyPort = (String) - expectedProxies.get("httpProxyPort"); + String expectedHttpProxyPort = expectedProxies.get("httpProxyPort"); log.println("getHttpProxyPort"); log.println("getting: "+httpProxyPort); @@ -191,8 +185,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getHttpsProxyAddress() { String httpsProxyAddress = oObj.getHttpsProxyAddress(); - String expectedHttpsProxyAddress = (String) - expectedProxies.get("httpsProxyAddress"); + String expectedHttpsProxyAddress = expectedProxies.get("httpsProxyAddress"); log.println("getHttpsProxyAddress"); log.println("getting: "+httpsProxyAddress); @@ -210,8 +203,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getHttpsProxyPort() { String httpsProxyPort = oObj.getHttpsProxyPort(); - String expectedHttpsProxyPort = (String) - expectedProxies.get("httpsProxyPort"); + String expectedHttpsProxyPort = expectedProxies.get("httpsProxyPort"); log.println("getHttpsProxyPort"); log.println("getting: "+httpsProxyPort); @@ -229,8 +221,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getProxyBypassAddress() { String proxyBypassAddress = oObj.getProxyBypassAddress(); - String expectedProxyBypassAddress = (String) - expectedProxies.get("proxyBypassAddress"); + String expectedProxyBypassAddress = expectedProxies.get("proxyBypassAddress"); log.println("getProxyBypassAddress"); log.println("getting: "+proxyBypassAddress); @@ -248,8 +239,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getSocksProxyAddress() { String socksProxyAddress = oObj.getSocksProxyAddress(); - String expectedSocksProxyAddress = (String) - expectedProxies.get("socksProxyAddress"); + String expectedSocksProxyAddress = expectedProxies.get("socksProxyAddress"); log.println("getSocksProxyAddress"); log.println("getting: "+socksProxyAddress); @@ -267,8 +257,7 @@ public class _XProxySettings extends MultiMethodTest { */ public void _getSocksProxyPort() { String socksProxyPort = oObj.getSocksProxyPort(); - String expectedSocksProxyPort = (String) - expectedProxies.get("socksProxyPort"); + String expectedSocksProxyPort = expectedProxies.get("socksProxyPort"); log.println("getSocksProxyPort"); log.println("getting: "+socksProxyPort); @@ -287,7 +276,7 @@ public class _XProxySettings extends MultiMethodTest { public void _isProxyEnabled() { boolean proxyEnabled = oObj.isProxyEnabled(); - String proxyEnabledStr = (String)expectedProxies.get("proxyEnabled"); + String proxyEnabledStr = expectedProxies.get("proxyEnabled"); boolean expected = proxyEnabledStr != null && proxyEnabledStr.equalsIgnoreCase("true"); diff --git a/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java b/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java index 0f04e36fe9d4..58b4d343c1a6 100644 --- a/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java +++ b/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java @@ -52,7 +52,7 @@ public class _XSimpleMailClientSupplier extends MultiMethodTest { */ public void _querySimpleMailClient() { if (Boolean.TRUE.equals - ((Boolean)tEnv.getObjRelation("SystemMailExist"))) { + (tEnv.getObjRelation("SystemMailExist"))) { XSimpleMailClient aClient = oObj.querySimpleMailClient(); tRes.tested("querySimpleMailClient()",aClient != null); diff --git a/qadevOOo/tests/java/ifc/table/_TableColumn.java b/qadevOOo/tests/java/ifc/table/_TableColumn.java index e69ed634be73..05b39cea1b88 100644 --- a/qadevOOo/tests/java/ifc/table/_TableColumn.java +++ b/qadevOOo/tests/java/ifc/table/_TableColumn.java @@ -43,8 +43,7 @@ public class _TableColumn extends MultiPropertyTest { boolean res = false; try { XInterface tObject = tEnv.getTestObject(); - XCellRange aRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, tObject); + XCellRange aRange = UnoRuntime.queryInterface(XCellRange.class, tObject); aRange.getCellByPosition(0,0).setFormula("Thats a pretty long text"); Object width_before = oObj.getPropertyValue("Width"); log.println("Before setting to optimal width: "+width_before); diff --git a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java index eed30301a723..87d729bc962b 100644 --- a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java +++ b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java @@ -61,10 +61,10 @@ public class _XAutoFormattable extends MultiMethodTest { oObj.autoFormat(name); // applying default format // getting current background of the cell - XCellRange cellRange = (XCellRange) UnoRuntime.queryInterface( + XCellRange cellRange = UnoRuntime.queryInterface( XCellRange.class, oObj); XCell oCell = cellRange.getCellByPosition(0, 0); - XPropertySet PS = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PS = UnoRuntime.queryInterface( XPropertySet.class, oCell); Integer bkgrnd1; @@ -77,7 +77,7 @@ public class _XAutoFormattable extends MultiMethodTest { // getting formats names. XInterface iFormats = (XInterface) oMSF.createInstance( "com.sun.star.sheet.TableAutoFormats"); - XNameAccess formats = (XNameAccess) UnoRuntime.queryInterface( + XNameAccess formats = UnoRuntime.queryInterface( XNameAccess.class, iFormats); String[] names = formats.getElementNames(); diff --git a/qadevOOo/tests/java/ifc/table/_XCell.java b/qadevOOo/tests/java/ifc/table/_XCell.java index 6620b24b10b3..a5ad522cbe60 100644 --- a/qadevOOo/tests/java/ifc/table/_XCell.java +++ b/qadevOOo/tests/java/ifc/table/_XCell.java @@ -83,7 +83,7 @@ public class _XCell extends MultiMethodTest { log.println("getFormula()"); oObj.setFormula("=2+2"); - formula = (String) oObj.getFormula(); + formula = oObj.getFormula(); result &= formula.endsWith("2+2"); tRes.tested("getFormula()", result); @@ -117,7 +117,7 @@ public class _XCell extends MultiMethodTest { double value = 0; log.println("getValue() ..."); - value = (double) oObj.getValue(); + value = oObj.getValue(); tRes.tested("getValue()",result); } // end getValue() @@ -133,7 +133,7 @@ public class _XCell extends MultiMethodTest { oObj.setFormula("=2/6") ; - formula = (String) oObj.getFormula(); + formula = oObj.getFormula(); result &= formula.endsWith("2/6"); tRes.tested ("setFormula()", result) ; @@ -149,7 +149,7 @@ public class _XCell extends MultiMethodTest { log.println("setValue() ..."); oObj.setValue(222.333) ; - cellValue = (double) oObj.getValue() ; + cellValue = oObj.getValue() ; result &= (cellValue == 222.333); tRes.tested("setValue()", result); 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); } diff --git a/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java index cdb39ce6037f..8a9dfe7b3b15 100644 --- a/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java +++ b/qadevOOo/tests/java/ifc/ui/_XModuleUIConfigurationManagerSupplier.java @@ -36,7 +36,7 @@ public class _XModuleUIConfigurationManagerSupplier extends MultiMethodTest { // get a config manager for the StartModule Object o = oObj.getUIConfigurationManager(configManagerName); - XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, o); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, o); String impName = xServiceInfo.getImplementationName(); boolean result = impName.equals(implementationName); if (!result) { diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java index c21bb0182792..3cb5616d6675 100644 --- a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java +++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java @@ -266,7 +266,7 @@ public class _XUIConfigurationManager extends MultiMethodTest { */ public void _getShortCutManager() { Object o = oObj.getShortCutManager(); - XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class,o); + XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class,o); String[] serviceNames = xSI.getSupportedServiceNames(); boolean bSupportedServiceFound = false; for (int i=0; i<serviceNames.length; i++) { @@ -306,8 +306,8 @@ public class _XUIConfigurationManager extends MultiMethodTest { XSingleComponentFactory xFactory = UnoRuntime.queryInterface( XSingleComponentFactory.class, xMenuBarSettings); try { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); - XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xMSF); + XComponentContext xContext = UnoRuntime.queryInterface( XComponentContext.class, xProp.getPropertyValue("DefaultContext")); prop[3].Value = xFactory.createInstanceWithContext(xContext); } diff --git a/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java b/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java index ae479891bb27..03cd68b8b35b 100644 --- a/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java +++ b/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java @@ -161,7 +161,7 @@ public class _XChangesNotifier extends MultiMethodTest { xBatch.commitChanges(); } catch(com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); return false; } return true; @@ -178,7 +178,7 @@ public class _XChangesNotifier extends MultiMethodTest { xBatch.commitChanges(); } catch(com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); return false; } return true; @@ -194,7 +194,7 @@ public class _XChangesNotifier extends MultiMethodTest { xProp.setPropertyValue(elementName, element); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); return false; } } @@ -203,7 +203,7 @@ public class _XChangesNotifier extends MultiMethodTest { xNameReplace.replaceByName(elementName, element); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); return false; } } diff --git a/qadevOOo/tests/java/ifc/util/_XCloneable.java b/qadevOOo/tests/java/ifc/util/_XCloneable.java index 3be749df54c5..f08d593cae98 100644 --- a/qadevOOo/tests/java/ifc/util/_XCloneable.java +++ b/qadevOOo/tests/java/ifc/util/_XCloneable.java @@ -59,8 +59,7 @@ public class _XCloneable extends MultiMethodTest { protected byte[] getImplementationID(XInterface ifc) { byte[] res = new byte[0]; - XTypeProvider provider = (XTypeProvider) - UnoRuntime.queryInterface(XTypeProvider.class, ifc); + XTypeProvider provider = UnoRuntime.queryInterface(XTypeProvider.class, ifc); if (provider != null) { res = provider.getImplementationId(); } @@ -79,8 +78,7 @@ public class _XCloneable extends MultiMethodTest { protected String getImplementationName(XInterface ifc) { String res = ""; - XServiceInfo info = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, ifc); + XServiceInfo info = UnoRuntime.queryInterface(XServiceInfo.class, ifc); if (info != null) { res = info.getImplementationName(); } diff --git a/qadevOOo/tests/java/ifc/util/_XImportable.java b/qadevOOo/tests/java/ifc/util/_XImportable.java index f3c08a4364d5..5224cee08a1d 100644 --- a/qadevOOo/tests/java/ifc/util/_XImportable.java +++ b/qadevOOo/tests/java/ifc/util/_XImportable.java @@ -165,7 +165,7 @@ public class _XImportable extends MultiMethodTest { } protected boolean checkA1(String expected) { - XCellRange range = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, tEnv.getTestObject()); + XCellRange range = UnoRuntime.queryInterface(XCellRange.class, tEnv.getTestObject()); boolean res = false; try{ String a1 = range.getCellByPosition(0,0).getFormula(); diff --git a/qadevOOo/tests/java/ifc/view/_XControlAccess.java b/qadevOOo/tests/java/ifc/view/_XControlAccess.java index 68a43c1633a9..1a23d3fd8dae 100644 --- a/qadevOOo/tests/java/ifc/view/_XControlAccess.java +++ b/qadevOOo/tests/java/ifc/view/_XControlAccess.java @@ -76,7 +76,7 @@ public class _XControlAccess extends MultiMethodTest { XDrawPage oDP = null; if (isSheet != null) { XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, oDoc); - oDP = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, oDPS.getDrawPages().getByIndex(0)); + oDP = UnoRuntime.queryInterface(XDrawPage.class, oDPS.getDrawPages().getByIndex(0)); } else { |