You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ji...@apache.org on 2026/10/13 15:25:17 UTC

(openoffice) 11/19: Remove unnecessary casts on the return values from UnoRuntime.queryInterface().

This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO50X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit cb508685aba5ea4e031f44271452f293dcf987a5
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sat Oct 3 10:20:41 2026 +0200

    Remove unnecessary casts on the return values from UnoRuntime.queryInterface().
    
    Patch by: me
    
    (cherry picked from commit f44a16118bea57f8bcef4ba642542011bc077ed8)
---
 .../org/openoffice/accessibility/AccessBridge.java |   4 +-
 .../accessibility/WindowsAccessBridgeAdapter.java  |   2 +-
 .../java/accessibility/AbstractButton.java         |   4 +-
 .../accessibility/AccessibleComponentImpl.java     |   2 +-
 .../accessibility/AccessibleHypertextImpl.java     |   4 +-
 .../accessibility/AccessibleObjectFactory.java     |   2 +-
 .../java/accessibility/AccessibleTextImpl.java     |   2 +-
 .../openoffice/java/accessibility/ComboBox.java    |   2 +-
 .../openoffice/java/accessibility/Component.java   |  12 +-
 .../openoffice/java/accessibility/Container.java   |   8 +-
 .../java/accessibility/DescendantManager.java      |   4 +-
 .../org/openoffice/java/accessibility/Dialog.java  |   2 +-
 .../org/openoffice/java/accessibility/Frame.java   |   2 +-
 .../org/openoffice/java/accessibility/Icon.java    |   2 +-
 .../org/openoffice/java/accessibility/Label.java   |   2 +-
 .../org/openoffice/java/accessibility/List.java    |  12 +-
 .../org/openoffice/java/accessibility/Menu.java    |   2 +-
 .../java/accessibility/MenuContainer.java          |   2 +-
 .../openoffice/java/accessibility/Paragraph.java   |   4 +-
 .../openoffice/java/accessibility/ScrollBar.java   |   4 +-
 .../org/openoffice/java/accessibility/Table.java   |  14 +-
 .../java/accessibility/TextComponent.java          |   6 +-
 .../java/accessibility/ToggleButton.java           |   2 +-
 .../org/openoffice/java/accessibility/ToolTip.java |   2 +-
 .../org/openoffice/java/accessibility/Tree.java    |  16 +-
 .../org/openoffice/java/accessibility/Window.java  |   2 +-
 .../accessibility/logging/XAccessibleEventLog.java |   4 +-
 .../accessibility/logging/XAccessibleTextLog.java  |   2 +-
 .../accessibility/awb/AccessibilityWorkBench.java  |   2 +-
 .../accessibility/awb/canvas/CanvasShape.java      |   4 +-
 .../accessibility/awb/tree/ToolkitNode.java        |   6 +-
 .../accessibility/awb/view/ComponentView.java      |   4 +-
 .../accessibility/awb/view/EditableTextView.java   |   4 +-
 .../accessibility/awb/view/FocusView.java          |   4 +-
 .../accessibility/awb/view/SelectionView.java      |   4 +-
 .../awb/view/ServiceInterfaceView.java             |   6 +-
 .../accessibility/awb/view/TableView.java          |   2 +-
 .../accessibility/awb/view/TextView.java           |   6 +-
 .../awb/view/text/TextActionDialog.java            |   6 +-
 .../accessibility/misc/InformationWriter.java      |  28 +-
 .../accessibility/misc/OfficeConnection.java       |   4 +-
 .../accessibility/misc/SimpleOffice.java           |  28 +-
 main/avmedia/source/java/FrameGrabber.java         |   2 +-
 .../com/sun/star/beans/LocalOfficeConnection.java  |   6 +-
 .../java/com/sun/star/beans/LocalOfficeWindow.java |  14 +-
 .../java/com/sun/star/comp/beans/Controller.java   |   2 +-
 .../main/java/com/sun/star/comp/beans/Frame.java   |   4 +-
 .../sun/star/comp/beans/LocalOfficeConnection.java |  10 +-
 .../com/sun/star/comp/beans/LocalOfficeWindow.java |  14 +-
 .../main/java/com/sun/star/comp/beans/OOoBean.java |  28 +-
 .../com/sun/star/comp/beans/OfficeDocument.java    |   6 +-
 .../main/java/com/sun/star/comp/beans/Wrapper.java |   2 +-
 main/chart2/qa/complex/chart2/TestCaseOldAPI.java  |  76 +-
 .../qa/complex/connectivity/HsqlDriverTest.java    |  16 +-
 .../complex/connectivity/JdbcLongVarCharTest.java  |  10 +-
 .../connectivity/dbase/DBaseDateFunctions.java     |  10 +-
 .../connectivity/dbase/DBaseNumericFunctions.java  |  10 +-
 .../complex/connectivity/dbase/DBaseSqlTests.java  |   6 +-
 .../connectivity/dbase/DBaseStringFunctions.java   |  10 +-
 .../complex/connectivity/hsqldb/TestCacheSize.java |  22 +-
 .../qa/connectivity/tools/HsqlDatabase.java        |   6 +-
 .../connectivity/qa/connectivity/tools/RowSet.java |   4 +-
 main/dbaccess/qa/complex/dbaccess/RowSet.java      |   2 +-
 .../comp/extensionoptions/OptionsEventHandler.java |  22 +-
 main/embeddedobj/qa/complex/embedding/Test01.java  |  16 +-
 .../embeddedobj/test/Container1/BitmapPainter.java |   2 +-
 main/embeddedobj/test/Container1/EmbedContApp.java |  72 +-
 .../test/Container1/EmbedContFrame.java            |   6 +-
 main/embeddedobj/test/Container1/PaintThread.java  |   2 +-
 main/embeddedobj/test/Container1/WindowHelper.java |  12 +-
 .../qa/integration/extensions/ConsoleWait.java     |   2 +-
 .../qa/integration/extensions/Frame.java           |  12 +-
 .../qa/integration/extensions/MethodHandler.java   |   4 +-
 .../qa/integration/extensions/ObjectInspector.java |   8 +-
 .../qa/integration/extensions/ServicesHandler.java |   6 +-
 main/extensions/test/pgp/TestPGP.java              |   6 +-
 .../detection/typeDetection/TypeDetection.java     |   2 +-
 .../comp/xsltfilter/XSLTFilterOLEExtracter.java    |  26 +-
 .../sun/star/comp/xsltfilter/XSLTransformer.java   |   2 +-
 .../integration/complex/forms/tools/ResultSet.java |   4 +-
 main/forms/qa/integration/forms/CellBinding.java   |  38 +-
 .../qa/integration/forms/ControlValidation.java    |   2 +-
 .../forms/qa/integration/forms/DocumentHelper.java |  36 +-
 .../qa/integration/forms/DocumentViewHelper.java   |  12 +-
 main/forms/qa/integration/forms/FormComponent.java |  18 +-
 .../qa/integration/forms/FormControlTest.java      |  26 +-
 main/forms/qa/integration/forms/FormLayer.java     |  10 +-
 main/forms/qa/integration/forms/ListSelection.java |  16 +-
 main/forms/qa/integration/forms/RadioButtons.java  |   4 +-
 .../integration/forms/SingleControlValidation.java |   6 +-
 .../qa/integration/forms/SpreadsheetDocument.java  |  10 +-
 .../qa/integration/forms/SpreadsheetView.java      |   8 +-
 .../qa/integration/forms/TableCellTextBinding.java |   2 +-
 main/forms/qa/integration/forms/ValueBinding.java  |   6 +-
 .../qa/integration/forms/XMLFormSettings.java      |  10 +-
 main/forms/qa/integration/xforms/Model.java        |   6 +-
 main/forms/qa/integration/xforms/XMLDocument.java  |   6 +-
 .../qa/complex/api_internal/CheckAPI.java          |   2 +-
 .../qa/complex/framework/recovery/CrashThread.java |   6 +-
 .../complex/framework/recovery/RecoveryTest.java   |  38 +-
 .../complex/framework/recovery/RecoveryTools.java  |   8 +-
 .../qa/complex/imageManager/CheckImageManager.java |   2 +-
 .../complex/loadAllDocuments/StreamSimulator.java  |   6 +-
 main/framework/source/services/backingcomp.cxx     |   8 +-
 .../Accessibility/ConnectionTask.java              |   6 +-
 .../Accessibility/EventListenerProxy.java          |   4 +-
 .../Accessibility/GraphicalDisplay.java            |   2 +-
 .../Accessibility/RegistrationThread.java          |   2 +-
 .../Accessibility/TextualDisplay.java              |   2 +-
 .../CreatingDialogs/SampleDialog.java              |  30 +-
 .../DevelopersGuide/Charts/CalcHelper.java         |  40 +-
 .../DevelopersGuide/Charts/ChartHelper.java        |  36 +-
 .../DevelopersGuide/Charts/ChartInCalc.java        |  30 +-
 .../DevelopersGuide/Charts/ChartInDraw.java        |  16 +-
 .../DevelopersGuide/Charts/ChartInWriter.java      |   8 +-
 .../examples/DevelopersGuide/Charts/Helper.java    |   6 +-
 .../Charts/JavaSampleChartAddIn.java               |  50 +-
 .../Charts/ListenAtCalcRangeInDraw.java            |  16 +-
 .../Charts/SelectionChangeListener.java            |  22 +-
 .../Components/Addons/JobsAddon/AsyncJob.java      |   6 +-
 .../ProtocolHandlerAddon.java                      |   8 +-
 .../JavaComponent/TestJavaComponent.java           |   4 +-
 .../dialogcomponent/DialogComponent.java           |  14 +-
 .../DevelopersGuide/Config/ConfigExamples.java     |  86 +--
 .../DevelopersGuide/Database/CodeSamples.java      |  34 +-
 .../DevelopersGuide/Database/OpenQuery.java        |  14 +-
 .../examples/DevelopersGuide/Database/RowSet.java  |  32 +-
 .../examples/DevelopersGuide/Database/Sales.java   |  30 +-
 .../DevelopersGuide/Database/SalesMan.java         |   4 +-
 .../examples/DevelopersGuide/Database/sdbcx.java   |  62 +-
 .../DevelopersGuide/Drawing/ChangeOrderDemo.java   |   6 +-
 .../Drawing/ControlAndSelectDemo.java              |  20 +-
 .../DevelopersGuide/Drawing/CustomShowDemo.java    |  20 +-
 .../DevelopersGuide/Drawing/DrawViewDemo.java      |   6 +-
 .../DevelopersGuide/Drawing/DrawingDemo.java       |  18 +-
 .../Drawing/FillAndLineStyleDemo.java              |   4 +-
 .../DevelopersGuide/Drawing/GluePointDemo.java     |  14 +-
 .../DevelopersGuide/Drawing/GraphicExportDemo.java |   8 +-
 .../examples/DevelopersGuide/Drawing/Helper.java   |   4 +-
 .../DevelopersGuide/Drawing/LayerDemo.java         |  10 +-
 .../Drawing/ObjectTransformationDemo.java          |   6 +-
 .../DevelopersGuide/Drawing/Organigram.java        |  18 +-
 .../DevelopersGuide/Drawing/PageHelper.java        |  32 +-
 .../DevelopersGuide/Drawing/PresentationDemo.java  |  20 +-
 .../DevelopersGuide/Drawing/ShapeHelper.java       |  18 +-
 .../DevelopersGuide/Drawing/StyleDemo.java         |  22 +-
 .../examples/DevelopersGuide/Drawing/TextDemo.java |   6 +-
 .../FirstSteps/FirstLoadComponent.java             |  36 +-
 .../FirstSteps/HelloTextTableShape.java            |  84 +--
 .../DevelopersGuide/Forms/ButtonOperator.java      |   2 +-
 .../DevelopersGuide/Forms/ControlLock.java         |   4 +-
 .../DevelopersGuide/Forms/DataAwareness.java       |  12 +-
 .../Forms/DocumentBasedExample.java                |   6 +-
 .../DevelopersGuide/Forms/DocumentHelper.java      |  38 +-
 .../DevelopersGuide/Forms/DocumentViewHelper.java  |  14 +-
 .../examples/DevelopersGuide/Forms/FLTools.java    |  14 +-
 .../examples/DevelopersGuide/Forms/FormLayer.java  |  12 +-
 .../DevelopersGuide/Forms/GridFieldValidator.java  |   4 +-
 .../DevelopersGuide/Forms/HsqlDatabase.java        |  18 +-
 .../DevelopersGuide/Forms/KeyGenerator.java        |  20 +-
 .../odk/examples/DevelopersGuide/Forms/RowSet.java |  10 +-
 .../DevelopersGuide/Forms/SalesFilter.java         |   2 +-
 .../Forms/SingleControlValidation.java             |   6 +-
 .../DevelopersGuide/Forms/SpreadsheetDocument.java |  10 +-
 .../Forms/SpreadsheetValueBinding.java             |   6 +-
 .../DevelopersGuide/Forms/SpreadsheetView.java     |   8 +-
 .../Forms/TableCellTextBinding.java                |   2 +-
 main/odk/examples/DevelopersGuide/Forms/UNO.java   |  18 +-
 .../DevelopersGuide/Forms/ValueBinding.java        |   6 +-
 .../DevelopersGuide/GUI/DialogDocument.java        |  12 +-
 .../DevelopersGuide/GUI/ImageControlSample.java    |  12 +-
 .../examples/DevelopersGuide/GUI/MessageBox.java   |  16 +-
 .../GUI/RoadmapItemStateChangeListener.java        |   2 +-
 .../examples/DevelopersGuide/GUI/SystemDialog.java |  22 +-
 .../DevelopersGuide/GUI/UnoDialogSample.java       | 188 ++---
 .../DevelopersGuide/GUI/UnoDialogSample2.java      |  14 +-
 main/odk/examples/DevelopersGuide/GUI/UnoMenu.java |  18 +-
 .../odk/examples/DevelopersGuide/GUI/UnoMenu2.java |   8 +-
 .../OfficeDev/Clipboard/Clipboard.java             |  14 +-
 .../OfficeDev/ContextMenuInterceptor.java          |  28 +-
 .../OfficeDev/DesktopEnvironment/DocumentView.java |   2 +-
 .../DesktopEnvironment/FunctionHelper.java         |  54 +-
 .../OfficeDev/DesktopEnvironment/Interceptor.java  |   4 +-
 .../DesktopEnvironment/StatusListener.java         |   2 +-
 .../DisableCommands/DisableCommandsTest.java       |  32 +-
 .../AsciiFilter/AsciiReplaceFilter.java            |  16 +-
 .../AsciiFilter/FilterOptions.java                 |   2 +-
 .../FlatXmlFilter_java/FlatXml.java                |   6 +-
 .../OfficeDev/Linguistic/LinguisticExamples.java   |   4 +-
 .../OfficeDev/Linguistic/OneInstanceFactory.java   |   6 +-
 .../OfficeDev/Linguistic/SampleHyphenator.java     |   2 +-
 .../OfficeDev/Linguistic/SampleSpellChecker.java   |   2 +-
 .../OfficeDev/Linguistic/SampleThesaurus.java      |   2 +-
 .../DevelopersGuide/OfficeDev/MenuElement.java     |   4 +-
 .../DevelopersGuide/OfficeDev/Number_Formats.java  |  22 +-
 .../OfficeDev/PathSettings/PathSettingsTest.java   |   2 +-
 .../PathSubstitution/PathSubstitutionTest.java     |   2 +-
 .../OfficeDev/TerminationTest/TerminationTest.java |   2 +-
 .../InterprocessConn/ConnectionAwareClient.java    |  14 +-
 .../ProfUNO/InterprocessConn/UrlResolver.java      |   2 +-
 .../SimpleBootstrap_java/SimpleBootstrap_java.java |   2 +-
 .../SayHello/SayHello/SayHello.java                |   4 +-
 .../ScriptSelector/ScriptSelector.java             |  10 +-
 .../Spreadsheet/GeneralTableSample.java            |  28 +-
 .../Spreadsheet/SpreadsheetDocHelper.java          |  34 +-
 .../Spreadsheet/SpreadsheetSample.java             | 182 ++---
 .../DevelopersGuide/Spreadsheet/ViewSample.java    |  18 +-
 .../DevelopersGuide/Text/TextDocuments.java        | 228 +++---
 .../DevelopersGuide/UCB/ChildrenRetriever.java     |   6 +-
 main/odk/examples/DevelopersGuide/UCB/Helper.java  |   8 +-
 .../DevelopersGuide/UCB/PropertiesComposer.java    |   4 +-
 .../DevelopersGuide/UCB/PropertiesRetriever.java   |   2 +-
 .../DevelopersGuide/UCB/ResourceCreator.java       |   2 +-
 .../java/ConverterServlet/ConverterServlet.java    |  16 +-
 .../java/DocumentHandling/DocumentConverter.java   |   8 +-
 .../java/DocumentHandling/DocumentLoader.java      |   2 +-
 .../java/DocumentHandling/DocumentPrinter.java     |   4 +-
 .../java/DocumentHandling/DocumentSaver.java       |   8 +-
 main/odk/examples/java/Drawing/SDraw.java          |  26 +-
 .../EmbedDocument/Container1/EmbedContApp.java     |  52 +-
 .../EmbedDocument/Container1/EmbedContFrame.java   |   6 +-
 .../EmbeddedObject/OwnEmbeddedObject.java          |  34 +-
 main/odk/examples/java/Inspector/Inspector.java    |  30 +-
 .../examples/java/Inspector/InspectorAddon.java    |   8 +-
 .../odk/examples/java/Inspector/InspectorPane.java |   4 +-
 main/odk/examples/java/Inspector/Introspector.java |  28 +-
 .../java/Inspector/ProtocolHandlerAddon.java       |   8 +-
 main/odk/examples/java/Inspector/TDocSupplier.java |  14 +-
 .../odk/examples/java/Inspector/TestInspector.java |   4 +-
 main/odk/examples/java/Inspector/UnoNode.java      |  12 +-
 .../examples/java/Inspector/UnoPropertyNode.java   |   2 +-
 .../odk/examples/java/NotesAccess/NotesAccess.java |   8 +-
 .../examples/java/Spreadsheet/ChartTypeChange.java |  42 +-
 .../examples/java/Spreadsheet/EuroAdaption.java    |  28 +-
 main/odk/examples/java/Spreadsheet/SCalc.java      |  38 +-
 .../java/Storage/StorageFunctionality.java         |   8 +-
 main/odk/examples/java/Storage/Test01.java         |   6 +-
 main/odk/examples/java/Storage/Test02.java         |   4 +-
 main/odk/examples/java/Storage/Test03.java         |   8 +-
 main/odk/examples/java/Storage/Test04.java         |   8 +-
 main/odk/examples/java/Storage/Test05.java         |   4 +-
 main/odk/examples/java/Storage/Test06.java         |   4 +-
 main/odk/examples/java/Storage/Test07.java         |   8 +-
 main/odk/examples/java/Storage/Test08.java         |  10 +-
 main/odk/examples/java/Storage/Test09.java         |   6 +-
 main/odk/examples/java/Storage/TestHelper.java     |  44 +-
 main/odk/examples/java/Text/BookmarkInsertion.java |  18 +-
 main/odk/examples/java/Text/GraphicsInserter.java  |  12 +-
 main/odk/examples/java/Text/HardFormatting.java    |  18 +-
 main/odk/examples/java/Text/SWriter.java           |  24 +-
 main/odk/examples/java/Text/StyleCreation.java     |  16 +-
 .../examples/java/Text/StyleInitialization.java    |  30 +-
 .../examples/java/Text/TextDocumentStructure.java  |  22 +-
 main/odk/examples/java/Text/TextReplace.java       |  12 +-
 main/odk/examples/java/Text/WriterSelector.java    |  20 +-
 main/odk/examples/java/ToDo/ToDo.java              |  34 +-
 .../offapi/com/sun/star/document/FilterFactory.idl |   2 +-
 .../sun/star/form/PropertyBrowserController.idl    |   4 +-
 main/offapi/com/sun/star/frame/XDispatch.idl       |   2 +-
 .../com/sun/star/text/XDependentTextField.idl      |   2 +-
 .../qa/ofopxmlstorages/StorageUnitTest.java        |   2 +-
 main/package/qa/ofopxmlstorages/Test03.java        |   6 +-
 main/package/qa/ofopxmlstorages/Test04.java        |   2 +-
 main/package/qa/ofopxmlstorages/Test07.java        |   4 +-
 main/package/qa/ofopxmlstorages/TestHelper.java    |  44 +-
 main/package/qa/storages/BorderedStream.java       |   4 +-
 .../package/qa/storages/RegressionTest_114358.java |   6 +-
 .../package/qa/storages/RegressionTest_125919.java |   6 +-
 .../package/qa/storages/RegressionTest_i26398.java |   2 +-
 .../package/qa/storages/RegressionTest_i27773.java |   6 +-
 .../package/qa/storages/RegressionTest_i29169.java |   6 +-
 .../package/qa/storages/RegressionTest_i29321.java |   2 +-
 .../package/qa/storages/RegressionTest_i30400.java |   8 +-
 .../package/qa/storages/RegressionTest_i30677.java |   6 +-
 .../package/qa/storages/RegressionTest_i35095.java |   4 +-
 .../package/qa/storages/RegressionTest_i46848.java |   6 +-
 .../package/qa/storages/RegressionTest_i49755.java |   6 +-
 .../package/qa/storages/RegressionTest_i55821.java |   4 +-
 .../package/qa/storages/RegressionTest_i59886.java |  10 +-
 .../package/qa/storages/RegressionTest_i61909.java |   4 +-
 .../package/qa/storages/RegressionTest_i84234.java |   4 +-
 main/package/qa/storages/StorageUnitTest.java      |   2 +-
 main/package/qa/storages/Test01.java               |   6 +-
 main/package/qa/storages/Test02.java               |   4 +-
 main/package/qa/storages/Test03.java               |   8 +-
 main/package/qa/storages/Test04.java               |   8 +-
 main/package/qa/storages/Test05.java               |   4 +-
 main/package/qa/storages/Test06.java               |   4 +-
 main/package/qa/storages/Test07.java               |   8 +-
 main/package/qa/storages/Test08.java               |  10 +-
 main/package/qa/storages/Test09.java               |   6 +-
 main/package/qa/storages/Test10.java               |   6 +-
 main/package/qa/storages/Test11.java               |   4 +-
 main/package/qa/storages/Test12.java               |   6 +-
 main/package/qa/storages/Test13.java               |   6 +-
 main/package/qa/storages/Test14.java               |   6 +-
 main/package/qa/storages/Test15.java               |  12 +-
 main/package/qa/storages/Test16.java               |   6 +-
 main/package/qa/storages/Test17.java               |   4 +-
 main/package/qa/storages/Test18.java               |   6 +-
 main/package/qa/storages/TestHelper.java           |  98 +--
 .../src/main/java/basicrunner/BasicHandler.java    |  12 +-
 .../java/basicrunner/BasicHandlerProvider.java     |   4 +-
 .../java/basicrunner/basichelper/Connector.java    |   2 +-
 .../main/java/basicrunner/basichelper/Filter.java  |   4 +-
 .../java/basicrunner/basichelper/ThreadRunner.java |   8 +-
 .../java/convwatch/GraphicalDifferenceCheck.java   |   4 +-
 .../java/convwatch/GraphicalTestArguments.java     |   2 +-
 .../main/java/convwatch/ReportDesignerTest.java    |  24 +-
 .../OpenOfficeDatabaseReportExtractor.java         |   6 +-
 .../src/main/java/helper/ConfigHelper.java         |  26 +-
 .../src/main/java/helper/ConfigurationRead.java    |   6 +-
 .../main/java/helper/ContextMenuInterceptor.java   |  14 +-
 .../OOoRunner/src/main/java/helper/InetTools.java  |   6 +-
 .../src/main/java/helper/StreamSimulator.java      |   6 +-
 .../src/main/java/helper/UnoProvider.java          |   2 +-
 .../ifc/accessibility/_XAccessibleComponent.java   |  16 +-
 .../_XAccessibleEventBroadcaster.java              |   2 +-
 .../_XAccessibleExtendedComponent.java             |   2 +-
 .../ifc/accessibility/_XAccessibleSelection.java   |   6 +-
 .../java/ifc/accessibility/_XAccessibleTable.java  |   4 +-
 .../java/ifc/accessibility/_XAccessibleText.java   |   6 +-
 .../src/main/java/ifc/awt/_XScrollBar.java         |   6 +-
 .../src/main/java/ifc/awt/_XSpinValue.java         |   6 +-
 .../src/main/java/ifc/awt/_XTopWindow.java         |   2 +-
 .../main/java/ifc/awt/_XUserInputInterception.java |   2 +-
 .../src/main/java/ifc/beans/_XFastPropertySet.java |   4 +-
 .../main/java/ifc/beans/_XMultiPropertyStates.java |   4 +-
 .../src/main/java/ifc/beans/_XPropertyState.java   |   2 +-
 .../java/ifc/beans/_XTolerantMultiPropertySet.java |   4 +-
 .../src/main/java/ifc/bridge/_XBridge.java         |   2 +-
 .../src/main/java/ifc/bridge/_XBridgeFactory.java  |   4 +-
 .../src/main/java/ifc/bridge/_XUnoUrlResolver.java |   6 +-
 .../src/main/java/ifc/chart/_BarDiagram.java       |   2 +-
 .../main/java/ifc/chart/_Chart3DBarProperties.java |   4 +-
 .../main/java/ifc/chart/_ChartAxisYSupplier.java   |   2 +-
 .../main/java/ifc/chart/_ChartAxisZSupplier.java   |   2 +-
 .../src/main/java/ifc/chart/_ChartStatistics.java  |   2 +-
 .../java/ifc/chart/_ChartTwoAxisXSupplier.java     |   2 +-
 .../java/ifc/chart/_ChartTwoAxisYSupplier.java     |   2 +-
 .../src/main/java/ifc/chart/_Diagram.java          |   2 +-
 .../src/main/java/ifc/chart/_Dim3DDiagram.java     |   2 +-
 .../src/main/java/ifc/chart/_LineDiagram.java      |   2 +-
 .../src/main/java/ifc/chart/_StackableDiagram.java |   2 +-
 .../src/main/java/ifc/chart/_StockDiagram.java     |   2 +-
 .../src/main/java/ifc/chart/_XChartData.java       |   4 +-
 .../src/main/java/ifc/chart/_XChartDataArray.java  |   2 +-
 .../java/ifc/configuration/backend/_XBackend.java  |   2 +-
 .../ifc/configuration/backend/_XLayerHandler.java  |   6 +-
 .../java/ifc/configuration/backend/_XSchema.java   |   4 +-
 .../src/main/java/ifc/connection/_XAcceptor.java   |   4 +-
 .../src/main/java/ifc/connection/_XConnector.java  |   2 +-
 .../src/main/java/ifc/container/_XChild.java       |   2 +-
 .../src/main/java/ifc/container/_XContainer.java   |   4 +-
 .../main/java/ifc/container/_XIndexReplace.java    |   4 +-
 .../src/main/java/ifc/container/_XNameReplace.java |   6 +-
 .../clipboard/_XClipboardNotifier.java             |   4 +-
 .../src/main/java/ifc/document/_LinkTarget.java    |   2 +-
 .../src/main/java/ifc/document/_Settings.java      |   2 +-
 .../java/ifc/document/_XDocumentInfoSupplier.java  |   2 +-
 .../java/ifc/document/_XDocumentInsertable.java    |   2 +-
 .../main/java/ifc/document/_XEventBroadcaster.java |   4 +-
 .../src/main/java/ifc/document/_XFilter.java       |   2 +-
 .../ifc/document/_XStandaloneDocumentInfo.java     |   4 +-
 .../main/java/ifc/document/_XViewDataSupplier.java |   2 +-
 .../java/ifc/drawing/_DrawingDocumentDrawView.java |   8 +-
 .../main/java/ifc/drawing/_GraphicObjectShape.java |   4 +-
 .../java/ifc/drawing/_LineShapeDescriptor.java     |   2 +-
 .../main/java/ifc/drawing/_ShapeDescriptor.java    |   2 +-
 .../main/java/ifc/drawing/_XConnectorShape.java    |   4 +-
 .../src/main/java/ifc/drawing/_XControlShape.java  |   2 +-
 .../java/ifc/drawing/_XDrawPageDuplicator.java     |   2 +-
 .../src/main/java/ifc/drawing/_XLayerSupplier.java |   2 +-
 .../src/main/java/ifc/drawing/_XShapeBinder.java   |   2 +-
 .../src/main/java/ifc/drawing/_XShapeCombiner.java |   2 +-
 .../main/java/ifc/drawing/_XShapeDescriptor.java   |   2 +-
 .../src/main/java/ifc/drawing/_XShapeGrouper.java  |   2 +-
 .../main/java/ifc/form/_XChangeBroadcaster.java    |   4 +-
 .../ifc/form/_XDatabaseParameterBroadcaster.java   |   2 +-
 .../src/main/java/ifc/form/_XFormController.java   |   4 +-
 .../OOoRunner/src/main/java/ifc/form/_XSubmit.java |   2 +-
 .../validation/_XValidatableFormComponent.java     |   2 +-
 .../validation/_XValidityConstraintListener.java   |   2 +-
 .../src/main/java/ifc/frame/_XDispatch.java        |   2 +-
 .../main/java/ifc/frame/_XDispatchProvider.java    |   4 +-
 .../main/java/ifc/frame/_XDispatchRecorder.java    |   2 +-
 .../java/ifc/frame/_XDispatchRecorderSupplier.java |   8 +-
 .../main/java/ifc/frame/_XDocumentTemplates.java   |   8 +-
 .../src/main/java/ifc/frame/_XFrameLoader.java     |   2 +-
 .../java/ifc/frame/_XSynchronousFrameLoader.java   |   4 +-
 .../src/main/java/ifc/io/_XActiveDataSink.java     |   2 +-
 .../src/main/java/ifc/io/_XActiveDataSource.java   |   2 +-
 .../src/main/java/ifc/io/_XConnectable.java        |   2 +-
 .../src/main/java/ifc/io/_XDataInputStream.java    |   2 +-
 .../src/main/java/ifc/io/_XInputStream.java        |   2 +-
 .../src/main/java/ifc/io/_XObjectInputStream.java  |   4 +-
 .../src/main/java/ifc/io/_XObjectOutputStream.java |   4 +-
 .../src/main/java/ifc/io/_XPersistObject.java      |  28 +-
 .../java/ifc/loader/_XImplementationLoader.java    |   2 +-
 .../main/java/ifc/reflection/_XProxyFactory.java   |   2 +-
 .../ifc/script/_XInvocationAdapterFactory.java     |   4 +-
 .../ifc/script/_XInvocationAdapterFactory2.java    |   4 +-
 .../main/java/ifc/sdb/_DataAccessDescriptor.java   |  12 +-
 .../java/ifc/sdb/_XSingleSelectQueryAnalyzer.java  |   2 +-
 .../java/ifc/sdb/_XSingleSelectQueryComposer.java  |   4 +-
 .../src/main/java/ifc/sdbc/_XCloseable.java        |   2 +-
 .../src/main/java/ifc/sdbc/_XParameters.java       |   4 +-
 .../src/main/java/ifc/sdbc/_XResultSet.java        |   4 +-
 .../src/main/java/ifc/sdbc/_XResultSetUpdate.java  |   2 +-
 .../src/main/java/ifc/sdbc/_XRowUpdate.java        |   4 +-
 .../src/main/java/ifc/sdbcx/_XColumnsSupplier.java |   2 +-
 .../java/ifc/sdbcx/_XDataDefinitionSupplier.java   |   2 +-
 .../src/main/java/ifc/sdbcx/_XDeleteRows.java      |   4 +-
 .../src/main/java/ifc/sdbcx/_XTablesSupplier.java  |   2 +-
 .../main/java/ifc/sheet/_FunctionDescription.java  |   2 +-
 .../src/main/java/ifc/sheet/_Scenario.java         |   2 +-
 .../OOoRunner/src/main/java/ifc/sheet/_Shape.java  |   4 +-
 .../ifc/sheet/_SpreadsheetDocumentSettings.java    |   4 +-
 .../java/ifc/sheet/_XActivationBroadcaster.java    |   2 +-
 .../main/java/ifc/sheet/_XArrayFormulaRange.java   |   2 +-
 .../main/java/ifc/sheet/_XCellRangeMovement.java   |  18 +-
 .../main/java/ifc/sheet/_XCellRangeReferrer.java   |   2 +-
 .../src/main/java/ifc/sheet/_XCellRangesQuery.java |   6 +-
 .../src/main/java/ifc/sheet/_XCellSeries.java      |   2 +-
 .../main/java/ifc/sheet/_XDataPilotDescriptor.java |   6 +-
 .../java/ifc/sheet/_XDataPilotFieldGrouping.java   |   4 +-
 .../src/main/java/ifc/sheet/_XDataPilotTable2.java |  20 +-
 .../main/java/ifc/sheet/_XDocumentAuditing.java    |  26 +-
 .../ifc/sheet/_XEnhancedMouseClickBroadcaster.java |   4 +-
 .../src/main/java/ifc/sheet/_XFormulaQuery.java    |   2 +-
 .../src/main/java/ifc/sheet/_XGoalSeek.java        |   6 +-
 .../main/java/ifc/sheet/_XMultipleOperation.java   |   6 +-
 .../src/main/java/ifc/sheet/_XNamedRanges.java     |   6 +-
 .../src/main/java/ifc/sheet/_XRangeSelection.java  |  18 +-
 .../main/java/ifc/sheet/_XScenarioEnhanced.java    |   2 +-
 .../src/main/java/ifc/sheet/_XSheetAnnotation.java |   4 +-
 .../java/ifc/sheet/_XSheetAnnotationAnchor.java    |   4 +-
 .../src/main/java/ifc/sheet/_XSheetAuditing.java   |  12 +-
 .../src/main/java/ifc/sheet/_XSheetCellCursor.java |  38 +-
 .../src/main/java/ifc/sheet/_XSheetFilterable.java |   8 +-
 .../main/java/ifc/sheet/_XSheetFilterableEx.java   |   2 +-
 .../src/main/java/ifc/sheet/_XSheetOutline.java    |   2 +-
 .../src/main/java/ifc/sheet/_XSpreadsheet.java     |   2 +-
 .../java/ifc/sheet/_XSubTotalCalculatable.java     |   2 +-
 .../src/main/java/ifc/sheet/_XUsedAreaCursor.java  |   4 +-
 .../main/java/ifc/system/_XSystemShellExecute.java |   2 +-
 .../src/main/java/ifc/table/_TableColumn.java      |   2 +-
 .../src/main/java/ifc/table/_XAutoFormattable.java |   6 +-
 .../src/main/java/ifc/table/_XCellCursor.java      |  14 +-
 .../src/main/java/ifc/table/_XTableColumns.java    |   4 +-
 .../main/java/ifc/task/_XInteractionHandler.java   |   4 +-
 .../src/main/java/ifc/text/_BaseIndex.java         |   8 +-
 .../src/main/java/ifc/text/_MailMerge.java         |  12 +-
 .../src/main/java/ifc/text/_TextColumns.java       |   2 +-
 .../src/main/java/ifc/text/_TextGraphicObject.java |   4 +-
 .../src/main/java/ifc/text/_XDocumentIndex.java    |   4 +-
 .../java/ifc/text/_XRelativeTextContentInsert.java |   2 +-
 .../main/java/ifc/text/_XTextFieldsSupplier.java   |  12 +-
 .../src/main/java/ifc/text/_XTextRangeCompare.java |   2 +-
 .../ucb/_XCachedDynamicResultSetStubFactory.java   |   2 +-
 .../src/main/java/ifc/ucb/_XCommandProcessor.java  |   2 +-
 .../java/ifc/ucb/_XContentProviderManager.java     |   4 +-
 .../src/main/java/ifc/ucb/_XSimpleFileAccess.java  |   2 +-
 .../ifc/ucb/_XSortedDynamicResultSetFactory.java   |   6 +-
 .../java/ifc/ui/_XContextMenuInterception.java     |  10 +-
 .../ui/_XModuleUIConfigurationManagerSupplier.java |   2 +-
 .../main/java/ifc/ui/_XUIConfigurationManager.java |  18 +-
 .../main/java/ifc/ui/dialogs/_XControlAccess.java  |   2 +-
 .../java/ifc/ui/dialogs/_XExecutableDialog.java    |   4 +-
 .../java/ifc/ui/dialogs/_XFilePickerNotifier.java  |   8 +-
 .../src/main/java/ifc/uno/_XComponentContext.java  |   2 +-
 .../src/main/java/ifc/util/_XCloneable.java        |   4 +-
 .../src/main/java/ifc/util/_XImportable.java       |   2 +-
 .../src/main/java/ifc/view/_XControlAccess.java    |   8 +-
 .../main/java/ifc/view/_XPrintJobBroadcaster.java  |   2 +-
 .../src/main/java/ifc/view/_XPrintable.java        |   2 +-
 .../src/main/java/lib/MultiPropertyTest.java       |   2 +-
 .../src/main/java/lib/TestParameters.java          |   2 +-
 .../src/main/java/mod/_basctl/AccessibleShape.java |   8 +-
 .../mod/_cached/CachedContentResultSetFactory.java |   8 +-
 .../_cached/CachedContentResultSetStubFactory.java |   6 +-
 .../mod/_cached/CachedDynamicResultSetFactory.java |   8 +-
 .../_cached/CachedDynamicResultSetStubFactory.java |   6 +-
 .../main/java/mod/_cnt/ChaosContentProvider.java   |   2 +-
 .../main/java/mod/_cnt/CntUnoDataContainer.java    |   2 +-
 .../mod/_dbaccess/ConnectionLineAccessibility.java |  16 +-
 .../java/mod/_dbaccess/JoinViewAccessibility.java  |  16 +-
 .../main/java/mod/_dbaccess/ODatabaseContext.java  |   8 +-
 .../main/java/mod/_dbaccess/ODatabaseSource.java   |   8 +-
 .../java/mod/_dbaccess/ODatasourceBrowser.java     |  16 +-
 .../src/main/java/mod/_dbaccess/OQueryDesign.java  |  28 +-
 .../main/java/mod/_dbaccess/OSQLMessageDialog.java |   4 +-
 .../mod/_dbaccess/OSingleSelectQueryComposer.java  |  16 +-
 .../main/java/mod/_dbaccess/SbaXGridControl.java   |  32 +-
 .../mod/_dbaccess/TableWindowAccessibility.java    |  18 +-
 .../src/main/java/mod/_forms/GenericModelTest.java |  16 +-
 .../src/main/java/mod/_forms/OButtonControl.java   |   6 +-
 .../src/main/java/mod/_forms/OCheckBoxControl.java |   8 +-
 .../src/main/java/mod/_forms/OComboBoxControl.java |   8 +-
 .../src/main/java/mod/_forms/OCurrencyControl.java |   8 +-
 .../src/main/java/mod/_forms/ODatabaseForm.java    |  40 +-
 .../src/main/java/mod/_forms/ODateControl.java     |   8 +-
 .../src/main/java/mod/_forms/OEditControl.java     |  10 +-
 .../main/java/mod/_forms/OFileControlModel.java    |   8 +-
 .../main/java/mod/_forms/OFormattedControl.java    |   8 +-
 .../src/main/java/mod/_forms/OFormsCollection.java |   4 +-
 .../main/java/mod/_forms/OGridControlModel.java    |  14 +-
 .../src/main/java/mod/_forms/OGroupBoxControl.java |   4 +-
 .../src/main/java/mod/_forms/OHiddenModel.java     |   4 +-
 .../main/java/mod/_forms/OImageButtonControl.java  |   6 +-
 .../main/java/mod/_forms/OImageControlControl.java |   6 +-
 .../src/main/java/mod/_forms/OListBoxControl.java  |  10 +-
 .../src/main/java/mod/_forms/OListBoxModel.java    |   4 +-
 .../java/mod/_forms/ONavigationBarControl.java     |   4 +-
 .../src/main/java/mod/_forms/ONumericControl.java  |   8 +-
 .../src/main/java/mod/_forms/OPatternControl.java  |   8 +-
 .../main/java/mod/_forms/ORadioButtonControl.java  |   6 +-
 .../src/main/java/mod/_forms/OScrollBarModel.java  |   2 +-
 .../src/main/java/mod/_forms/OSpinButtonModel.java |   2 +-
 .../src/main/java/mod/_forms/OTimeControl.java     |   8 +-
 .../src/main/java/mod/_forms/OTimeModel.java       |   4 +-
 .../main/java/mod/_fwk/ControlMenuController.java  |   6 +-
 .../OOoRunner/src/main/java/mod/_fwk/Desktop.java  |   2 +-
 .../src/main/java/mod/_fwk/DispatchRecorder.java   |   8 +-
 .../src/main/java/mod/_fwk/DocumentProperties.java |   4 +-
 .../OOoRunner/src/main/java/mod/_fwk/Frame.java    |   4 +-
 .../src/main/java/mod/_fwk/JobExecutor.java        |  24 +-
 .../src/main/java/mod/_fwk/LayoutManager.java      |   6 +-
 .../src/main/java/mod/_fwk/ModuleManager.java      |  14 +-
 .../mod/_fwk/ModuleUIConfigurationManager.java     |  18 +-
 .../main/java/mod/_fwk/ObjectMenuController.java   |   2 +-
 .../java/mod/_fwk/PopupMenuControllerFactory.java  |   8 +-
 .../java/mod/_fwk/StatusBarControllerFactory.java  |   4 +-
 .../main/java/mod/_fwk/UIConfigurationManager.java |  12 +-
 .../java/mod/_fwk/UIElementFactoryManager.java     |   2 +-
 .../main/java/mod/_fwl/ContentHandlerFactory.java  |   2 +-
 .../src/main/java/mod/_fwl/FilterFactory.java      |   2 +-
 .../src/main/java/mod/_fwl/FrameLoaderFactory.java |   2 +-
 .../src/main/java/mod/_fwl/PathSettings.java       |   2 +-
 .../src/main/java/mod/_fwl/TypeDetection.java      |   4 +-
 .../OOoRunner/src/main/java/mod/_lng/DicList.java  |   2 +-
 .../src/main/java/mod/_lnn/Hyphenator.java         |   2 +-
 .../src/main/java/mod/_lnn/SpellChecker.java       |   2 +-
 .../src/main/java/mod/_pcr/ObjectInspector.java    |  18 +-
 .../main/java/mod/_pcr/ObjectInspectorModel.java   |   8 +-
 .../_rdbtdp/RegistryTypeDescriptionProvider.java   |   6 +-
 .../RegistryTypeDescriptionProvider.java           |   6 +-
 .../main/java/mod/_remotebridge.uno/various.java   |  16 +-
 .../src/main/java/mod/_remotebridge/various.java   |  16 +-
 .../AccessibleEditableTextPara_HeaderFooter.java   |  18 +-
 .../AccessibleEditableTextPara_PreviewCell.java    |  10 +-
 .../src/main/java/mod/_sc/ScAccessibleCell.java    |  12 +-
 .../src/main/java/mod/_sc/ScAccessibleCsvCell.java |   8 +-
 .../src/main/java/mod/_sc/ScAccessibleCsvGrid.java |   6 +-
 .../main/java/mod/_sc/ScAccessibleCsvRuler.java    |  10 +-
 .../main/java/mod/_sc/ScAccessibleDocument.java    |   2 +-
 .../mod/_sc/ScAccessibleDocumentPagePreview.java   |  14 +-
 .../main/java/mod/_sc/ScAccessiblePageHeader.java  |  14 +-
 .../java/mod/_sc/ScAccessiblePageHeaderArea.java   |  14 +-
 .../main/java/mod/_sc/ScAccessiblePreviewCell.java |  10 +-
 .../mod/_sc/ScAccessiblePreviewHeaderCell.java     |  18 +-
 .../java/mod/_sc/ScAccessiblePreviewTable.java     |  12 +-
 .../main/java/mod/_sc/ScAccessibleSpreadsheet.java |   6 +-
 .../src/main/java/mod/_sc/ScAnnotationObj.java     |  10 +-
 .../main/java/mod/_sc/ScAnnotationShapeObj.java    |  16 +-
 .../main/java/mod/_sc/ScAnnotationTextCursor.java  |  12 +-
 .../src/main/java/mod/_sc/ScAnnotationsObj.java    |  14 +-
 .../src/main/java/mod/_sc/ScAreaLinkObj.java       |   4 +-
 .../src/main/java/mod/_sc/ScAreaLinksObj.java      |   6 +-
 .../main/java/mod/_sc/ScAutoFormatFieldObj.java    |   4 +-
 .../src/main/java/mod/_sc/ScAutoFormatObj.java     |   4 +-
 .../src/main/java/mod/_sc/ScAutoFormatsObj.java    |   4 +-
 .../src/main/java/mod/_sc/ScCellCursorObj.java     |   8 +-
 .../src/main/java/mod/_sc/ScCellFieldObj.java      |  14 +-
 .../src/main/java/mod/_sc/ScCellFieldsObj.java     |  12 +-
 .../java/mod/_sc/ScCellFormatsEnumeration.java     |   8 +-
 .../src/main/java/mod/_sc/ScCellFormatsObj.java    |   6 +-
 .../OOoRunner/src/main/java/mod/_sc/ScCellObj.java |   8 +-
 .../src/main/java/mod/_sc/ScCellRangeObj.java      |  10 +-
 .../src/main/java/mod/_sc/ScCellRangesObj.java     |  10 +-
 .../src/main/java/mod/_sc/ScCellSearchObj.java     |   6 +-
 .../src/main/java/mod/_sc/ScCellTextCursor.java    |   6 +-
 .../src/main/java/mod/_sc/ScCellsEnumeration.java  |  10 +-
 .../src/main/java/mod/_sc/ScCellsObj.java          |  10 +-
 .../src/main/java/mod/_sc/ScChartObj.java          |  10 +-
 .../src/main/java/mod/_sc/ScChartsObj.java         |  10 +-
 .../java/mod/_sc/ScConsolidationDescriptor.java    |   4 +-
 .../src/main/java/mod/_sc/ScDDELinkObj.java        |   6 +-
 .../src/main/java/mod/_sc/ScDDELinksObj.java       |   4 +-
 .../java/mod/_sc/ScDataPilotFieldGroupItemObj.java |  34 +-
 .../java/mod/_sc/ScDataPilotFieldGroupObj.java     |  32 +-
 .../java/mod/_sc/ScDataPilotFieldGroupsObj.java    |  28 +-
 .../src/main/java/mod/_sc/ScDataPilotFieldObj.java |  12 +-
 .../main/java/mod/_sc/ScDataPilotFieldsObj.java    |   6 +-
 .../src/main/java/mod/_sc/ScDataPilotItemObj.java  |  16 +-
 .../src/main/java/mod/_sc/ScDataPilotItemsObj.java |  14 +-
 .../src/main/java/mod/_sc/ScDataPilotTableObj.java |  12 +-
 .../main/java/mod/_sc/ScDataPilotTablesObj.java    |   6 +-
 .../src/main/java/mod/_sc/ScDatabaseRangeObj.java  |  16 +-
 .../src/main/java/mod/_sc/ScDatabaseRangesObj.java |   4 +-
 .../main/java/mod/_sc/ScDocumentConfiguration.java |   2 +-
 .../src/main/java/mod/_sc/ScDrawPageObj.java       |   6 +-
 .../src/main/java/mod/_sc/ScDrawPagesObj.java      |   4 +-
 .../main/java/mod/_sc/ScFilterDescriptorBase.java  |   6 +-
 .../java/mod/_sc/ScFunctionDescriptionObj.java     |   2 +-
 .../src/main/java/mod/_sc/ScFunctionListObj.java   |   2 +-
 .../src/main/java/mod/_sc/ScHeaderFieldObj.java    |  12 +-
 .../src/main/java/mod/_sc/ScHeaderFieldsObj.java   |  12 +-
 .../java/mod/_sc/ScHeaderFooterContentObj.java     |   6 +-
 .../java/mod/_sc/ScHeaderFooterTextCursor.java     |   6 +-
 .../main/java/mod/_sc/ScHeaderFooterTextObj.java   |   6 +-
 .../main/java/mod/_sc/ScImportDescriptorBase.java  |   8 +-
 ...ndexEnumeration_CellAnnotationsEnumeration.java |   8 +-
 ...cIndexEnumeration_CellAreaLinksEnumeration.java |   8 +-
 .../ScIndexEnumeration_DDELinksEnumeration.java    |   6 +-
 ...ndexEnumeration_DataPilotFieldsEnumeration.java |   8 +-
 ...IndexEnumeration_DataPilotItemsEnumeration.java |  16 +-
 ...ndexEnumeration_DataPilotTablesEnumeration.java |   8 +-
 ...IndexEnumeration_DatabaseRangesEnumeration.java |   6 +-
 ...Enumeration_FunctionDescriptionEnumeration.java |   4 +-
 .../ScIndexEnumeration_LabelRangesEnumeration.java |   8 +-
 .../ScIndexEnumeration_NamedRangesEnumeration.java |   8 +-
 .../ScIndexEnumeration_ScenariosEnumeration.java   |  12 +-
 ...ndexEnumeration_SheetCellRangesEnumeration.java |  10 +-
 .../ScIndexEnumeration_SheetLinksEnumeration.java  |  12 +-
 ...numeration_SpreadsheetViewPanesEnumeration.java |   8 +-
 ...ScIndexEnumeration_SpreadsheetsEnumeration.java |   6 +-
 ...IndexEnumeration_SubTotalFieldsEnumeration.java |  10 +-
 ...ndexEnumeration_TableAutoFormatEnumeration.java |   4 +-
 .../ScIndexEnumeration_TableChartsEnumeration.java |  12 +-
 ...ScIndexEnumeration_TableColumnsEnumeration.java |   8 +-
 ...umeration_TableConditionalEntryEnumeration.java |  10 +-
 .../ScIndexEnumeration_TableRowsEnumeration.java   |   8 +-
 .../ScIndexEnumeration_TextFieldEnumeration.java   |  12 +-
 .../src/main/java/mod/_sc/ScLabelRangeObj.java     |   6 +-
 .../src/main/java/mod/_sc/ScLabelRangesObj.java    |   6 +-
 .../src/main/java/mod/_sc/ScModelObj.java          |  16 +-
 .../src/main/java/mod/_sc/ScNamedRangeObj.java     |   6 +-
 .../src/main/java/mod/_sc/ScNamedRangesObj.java    |   8 +-
 .../main/java/mod/_sc/ScRecentFunctionsObj.java    |   4 +-
 .../src/main/java/mod/_sc/ScScenariosObj.java      |  10 +-
 .../src/main/java/mod/_sc/ScShapeObj.java          |   2 +-
 .../src/main/java/mod/_sc/ScSheetLinkObj.java      |  10 +-
 .../src/main/java/mod/_sc/ScSheetLinksObj.java     |  10 +-
 .../main/java/mod/_sc/ScSortDescriptorBase.java    |   8 +-
 .../java/mod/_sc/ScSpreadsheetSettingsObj.java     |   2 +-
 .../src/main/java/mod/_sc/ScStyleFamiliesObj.java  |   4 +-
 .../src/main/java/mod/_sc/ScStyleFamilyObj.java    |  10 +-
 .../src/main/java/mod/_sc/ScStyleObj.java          |  18 +-
 .../java/mod/_sc/ScSubTotalDescriptorBase.java     |   6 +-
 .../src/main/java/mod/_sc/ScSubTotalFieldObj.java  |   8 +-
 .../src/main/java/mod/_sc/ScTabViewObj.java        |  18 +-
 .../src/main/java/mod/_sc/ScTableColumnObj.java    |   8 +-
 .../src/main/java/mod/_sc/ScTableColumnsObj.java   |   6 +-
 .../main/java/mod/_sc/ScTableConditionalEntry.java |   8 +-
 .../java/mod/_sc/ScTableConditionalFormat.java     |   8 +-
 .../src/main/java/mod/_sc/ScTableRowObj.java       |   8 +-
 .../src/main/java/mod/_sc/ScTableRowsObj.java      |   6 +-
 .../src/main/java/mod/_sc/ScTableSheetObj.java     |  12 +-
 .../src/main/java/mod/_sc/ScTableSheetsObj.java    |   4 +-
 .../main/java/mod/_sc/ScTableValidationObj.java    |   6 +-
 .../mod/_sc/ScUniqueCellFormatsEnumeration.java    |  10 +-
 .../main/java/mod/_sc/ScUniqueCellFormatsObj.java  |   8 +-
 .../src/main/java/mod/_sc/ScViewPaneObj.java       |  12 +-
 .../src/main/java/mod/_sc/XMLContentExporter.java  |   6 +-
 .../src/main/java/mod/_sc/XMLContentImporter.java  |   4 +-
 .../src/main/java/mod/_sc/XMLExporter.java         |   8 +-
 .../src/main/java/mod/_sc/XMLImporter.java         |   6 +-
 .../src/main/java/mod/_sc/XMLMetaExporter.java     |   6 +-
 .../src/main/java/mod/_sc/XMLMetaImporter.java     |   8 +-
 .../src/main/java/mod/_sc/XMLSettingsExporter.java |   6 +-
 .../src/main/java/mod/_sc/XMLSettingsImporter.java |   8 +-
 .../src/main/java/mod/_sc/XMLStylesExporter.java   |   6 +-
 .../src/main/java/mod/_sc/XMLStylesImporter.java   |   8 +-
 .../OOoRunner/src/main/java/mod/_sch/AccArea.java  |   4 +-
 .../OOoRunner/src/main/java/mod/_sch/AccAxis.java  |   4 +-
 .../src/main/java/mod/_sch/AccDataPoint.java       |   4 +-
 .../src/main/java/mod/_sch/AccDataSeries.java      |   4 +-
 .../src/main/java/mod/_sch/AccDiagram.java         |   4 +-
 .../OOoRunner/src/main/java/mod/_sch/AccFloor.java |   6 +-
 .../OOoRunner/src/main/java/mod/_sch/AccGrid.java  |   4 +-
 .../src/main/java/mod/_sch/AccLegend.java          |   4 +-
 .../src/main/java/mod/_sch/AccLegendEntry.java     |   4 +-
 .../main/java/mod/_sch/AccStatisticsObject.java    |   6 +-
 .../OOoRunner/src/main/java/mod/_sch/AccTitle.java |   4 +-
 .../OOoRunner/src/main/java/mod/_sch/AccWall.java  |   6 +-
 .../main/java/mod/_sch/AccessibleDocumentView.java |   2 +-
 .../src/main/java/mod/_sch/ChXChartAxis.java       |   2 +-
 .../src/main/java/mod/_sch/ChXChartDocument.java   |   2 +-
 .../src/main/java/mod/_sch/ChXChartView.java       |   6 +-
 .../src/main/java/mod/_sch/ChXDataPoint.java       |   2 +-
 .../src/main/java/mod/_sch/ChXDataRow.java         |   2 +-
 .../src/main/java/mod/_sch/ChXDiagram.java         |  16 +-
 .../src/main/java/mod/_sch/ChartArea.java          |   2 +-
 .../src/main/java/mod/_sch/ChartGrid.java          |   2 +-
 .../src/main/java/mod/_sch/ChartLegend.java        |   2 +-
 .../java/mod/_sd/AccessibleDrawDocumentView.java   |   8 +-
 .../main/java/mod/_sd/AccessibleOutlineView.java   |   8 +-
 .../src/main/java/mod/_sd/AccessibleSlideView.java |   8 +-
 .../main/java/mod/_sd/DrawController_DrawView.java |  22 +-
 .../java/mod/_sd/DrawController_HandoutView.java   |  26 +-
 .../java/mod/_sd/DrawController_NotesView.java     |  26 +-
 .../java/mod/_sd/DrawController_OutlineView.java   |  26 +-
 .../mod/_sd/DrawController_PresentationView.java   |  26 +-
 .../src/main/java/mod/_sd/SdDocLinkTargets.java    |   2 +-
 .../src/main/java/mod/_sd/SdDrawPage.java          |   8 +-
 .../src/main/java/mod/_sd/SdDrawPagesAccess.java   |   2 +-
 .../src/main/java/mod/_sd/SdGenericDrawPage.java   |   6 +-
 .../OOoRunner/src/main/java/mod/_sd/SdLayer.java   |   6 +-
 .../src/main/java/mod/_sd/SdLayerManager.java      |   8 +-
 .../src/main/java/mod/_sd/SdMasterPage.java        |   6 +-
 .../src/main/java/mod/_sd/SdMasterPagesAccess.java |   2 +-
 .../src/main/java/mod/_sd/SdPageLinkTargets.java   |   6 +-
 .../src/main/java/mod/_sd/SdUnoDrawView.java       |  22 +-
 .../src/main/java/mod/_sd/SdUnoOutlineView.java    |  18 +-
 .../src/main/java/mod/_sd/SdUnoPresView.java       |  24 +-
 .../src/main/java/mod/_sd/SdUnoSlideView.java      |  12 +-
 .../main/java/mod/_sd/SdXCustomPresentation.java   |  12 +-
 .../java/mod/_sd/SdXCustomPresentationAccess.java  |   6 +-
 .../src/main/java/mod/_sd/SdXImpressDocument.java  |   8 +-
 .../src/main/java/mod/_sd/SdXPresentation.java     |   6 +-
 .../OOoRunner/src/main/java/mod/_sd/SdXShape.java  |  10 +-
 .../java/mod/_servicemgr.uno/OServiceManager.java  |   6 +-
 .../src/main/java/mod/_sfx/DocumentTemplates.java  |   2 +-
 .../main/java/mod/_sfx/StandaloneDocumentInfo.java |   2 +-
 .../src/main/java/mod/_sm/SmEditAccessible.java    |   6 +-
 .../src/main/java/mod/_sm/SmGraphicAccessible.java |   6 +-
 .../src/main/java/mod/_sm/XMLExporter.java         |   4 +-
 .../src/main/java/mod/_sm/XMLImporter.java         |   2 +-
 .../src/main/java/mod/_sm/XMLMetaExporter.java     |   4 +-
 .../src/main/java/mod/_sm/XMLMetaImporter.java     |   4 +-
 .../src/main/java/mod/_sm/XMLSettingsExporter.java |   4 +-
 .../src/main/java/mod/_sm/XMLSettingsImporter.java |   2 +-
 .../src/main/java/mod/_smgr/OServiceManager.java   |   6 +-
 .../src/main/java/mod/_stm/DataInputStream.java    |  10 +-
 .../src/main/java/mod/_stm/DataOutputStream.java   |  10 +-
 .../main/java/mod/_stm/MarkableInputStream.java    |   8 +-
 .../main/java/mod/_stm/MarkableOutputStream.java   |  12 +-
 .../src/main/java/mod/_stm/ObjectInputStream.java  |  24 +-
 .../src/main/java/mod/_stm/ObjectOutputStream.java |  28 +-
 .../OOoRunner/src/main/java/mod/_stm/Pipe.java     |   2 +-
 .../OOoRunner/src/main/java/mod/_stm/Pump.java     |   4 +-
 .../java/mod/_streams.uno/DataInputStream.java     |  10 +-
 .../java/mod/_streams.uno/DataOutputStream.java    |  10 +-
 .../java/mod/_streams.uno/MarkableInputStream.java |   8 +-
 .../mod/_streams.uno/MarkableOutputStream.java     |  12 +-
 .../java/mod/_streams.uno/ObjectInputStream.java   |  24 +-
 .../java/mod/_streams.uno/ObjectOutputStream.java  |  28 +-
 .../src/main/java/mod/_streams.uno/Pipe.java       |   2 +-
 .../src/main/java/mod/_streams.uno/Pump.java       |   4 +-
 .../java/mod/_svtools/AccessibleBrowseBox.java     |   8 +-
 .../mod/_svtools/AccessibleBrowseBoxHeaderBar.java |  10 +-
 .../_svtools/AccessibleBrowseBoxHeaderCell.java    |   8 +-
 .../mod/_svtools/AccessibleBrowseBoxTable.java     |   8 +-
 .../mod/_svtools/AccessibleBrowseBoxTableCell.java |   8 +-
 .../mod/_svtools/AccessibleIconChoiceCtrl.java     |  16 +-
 .../_svtools/AccessibleIconChoiceCtrlEntry.java    |  12 +-
 .../main/java/mod/_svtools/AccessibleTabBar.java   |   4 +-
 .../java/mod/_svtools/AccessibleTabBarPage.java    |   8 +-
 .../mod/_svtools/AccessibleTabBarPageList.java     |  10 +-
 .../java/mod/_svtools/AccessibleTreeListBox.java   |   6 +-
 .../mod/_svtools/AccessibleTreeListBoxEntry.java   |  12 +-
 .../main/java/mod/_svx/AccessibleControlShape.java |   2 +-
 .../java/mod/_svx/AccessibleEditableTextPara.java  |   8 +-
 .../main/java/mod/_svx/AccessibleGraphicShape.java |   2 +-
 .../src/main/java/mod/_svx/AccessibleOLEShape.java |   4 +-
 .../main/java/mod/_svx/AccessiblePageShape.java    |   4 +-
 .../_svx/AccessiblePresentationGraphicShape.java   |   8 +-
 .../mod/_svx/AccessiblePresentationOLEShape.java   |   8 +-
 .../java/mod/_svx/AccessiblePresentationShape.java |   8 +-
 .../src/main/java/mod/_svx/AccessibleShape.java    |   2 +-
 .../src/main/java/mod/_svx/GraphicExporter.java    |   8 +-
 .../src/main/java/mod/_svx/SvxDrawPage.java        |   8 +-
 .../mod/_svx/SvxGraphCtrlAccessibleContext.java    |  20 +-
 .../src/main/java/mod/_svx/SvxGraphicObject.java   |   8 +-
 .../OOoRunner/src/main/java/mod/_svx/SvxShape.java |   4 +-
 .../src/main/java/mod/_svx/SvxShapeCircle.java     |   6 +-
 .../src/main/java/mod/_svx/SvxShapeCollection.java |   2 +-
 .../src/main/java/mod/_svx/SvxShapeConnector.java  |   8 +-
 .../src/main/java/mod/_svx/SvxShapeControl.java    |   4 +-
 .../main/java/mod/_svx/SvxShapeDimensioning.java   |   4 +-
 .../src/main/java/mod/_svx/SvxShapeGroup.java      |  12 +-
 .../main/java/mod/_svx/SvxShapePolyPolygon.java    |  10 +-
 .../java/mod/_svx/SvxShapePolyPolygonBezier.java   |  10 +-
 .../main/java/mod/_svx/SvxUnoNumberingRules.java   |   4 +-
 .../src/main/java/mod/_svx/SvxUnoText.java         |   4 +-
 .../src/main/java/mod/_svx/SvxUnoTextContent.java  |   4 +-
 .../main/java/mod/_svx/SvxUnoTextContentEnum.java  |   4 +-
 .../src/main/java/mod/_svx/SvxUnoTextCursor.java   |   2 +-
 .../src/main/java/mod/_svx/SvxUnoTextField.java    |   6 +-
 .../src/main/java/mod/_svx/SvxUnoTextRange.java    |   6 +-
 .../java/mod/_svx/SvxUnoTextRangeEnumeration.java  |   6 +-
 .../src/main/java/mod/_sw/CharacterStyle.java      |  20 +-
 .../java/mod/_sw/ConditionalParagraphStyle.java    |  18 +-
 .../OOoRunner/src/main/java/mod/_sw/PageStyle.java |  18 +-
 .../src/main/java/mod/_sw/ParagraphStyle.java      |  18 +-
 .../java/mod/_sw/SwAccessibleDocumentPageView.java |   6 +-
 .../java/mod/_sw/SwAccessibleDocumentView.java     |   4 +-
 .../main/java/mod/_sw/SwAccessibleEndnoteView.java |  10 +-
 .../main/java/mod/_sw/SwAccessibleFooterView.java  |   8 +-
 .../java/mod/_sw/SwAccessibleFootnoteView.java     |   8 +-
 .../main/java/mod/_sw/SwAccessibleHeaderView.java  |   6 +-
 .../main/java/mod/_sw/SwAccessiblePageView.java    |  16 +-
 .../java/mod/_sw/SwAccessibleParagraphView.java    |   2 +-
 .../java/mod/_sw/SwAccessibleTableCellView.java    |   4 +-
 .../main/java/mod/_sw/SwAccessibleTableView.java   |   4 +-
 .../mod/_sw/SwAccessibleTextEmbeddedObject.java    |   4 +-
 .../java/mod/_sw/SwAccessibleTextFrameView.java    |   8 +-
 .../mod/_sw/SwAccessibleTextGraphicObject.java     |   6 +-
 .../main/java/mod/_sw/SwXAutoTextContainer.java    |   2 +-
 .../src/main/java/mod/_sw/SwXAutoTextEntry.java    |   6 +-
 .../src/main/java/mod/_sw/SwXAutoTextGroup.java    |   6 +-
 .../src/main/java/mod/_sw/SwXBookmark.java         |   2 +-
 .../src/main/java/mod/_sw/SwXBookmarks.java        |   2 +-
 .../OOoRunner/src/main/java/mod/_sw/SwXCell.java   |   2 +-
 .../src/main/java/mod/_sw/SwXCellRange.java        |   4 +-
 .../src/main/java/mod/_sw/SwXChapterNumbering.java |   2 +-
 .../src/main/java/mod/_sw/SwXDocumentIndex.java    |   4 +-
 .../main/java/mod/_sw/SwXDocumentIndexMark.java    |   6 +-
 .../src/main/java/mod/_sw/SwXDocumentIndexes.java  |   2 +-
 .../src/main/java/mod/_sw/SwXDrawPage.java         |   4 +-
 .../main/java/mod/_sw/SwXEndnoteProperties.java    |   8 +-
 .../src/main/java/mod/_sw/SwXFieldEnumeration.java |  10 +-
 .../src/main/java/mod/_sw/SwXFieldMaster.java      |   2 +-
 .../src/main/java/mod/_sw/SwXFootnote.java         |   6 +-
 .../main/java/mod/_sw/SwXFootnoteProperties.java   |   6 +-
 .../src/main/java/mod/_sw/SwXFootnoteText.java     |   6 +-
 .../src/main/java/mod/_sw/SwXFootnotes.java        |   6 +-
 .../OOoRunner/src/main/java/mod/_sw/SwXFrames.java |   6 +-
 .../src/main/java/mod/_sw/SwXHeadFootText.java     |   6 +-
 .../java/mod/_sw/SwXLineNumberingProperties.java   |   2 +-
 .../src/main/java/mod/_sw/SwXMailMerge.java        |  26 +-
 .../src/main/java/mod/_sw/SwXNumberingRules.java   |   8 +-
 .../src/main/java/mod/_sw/SwXParagraph.java        |  12 +-
 .../main/java/mod/_sw/SwXParagraphEnumeration.java |   2 +-
 .../src/main/java/mod/_sw/SwXPrintSettings.java    |   2 +-
 .../src/main/java/mod/_sw/SwXPropertySetInfo.java  |   2 +-
 .../src/main/java/mod/_sw/SwXReferenceMark.java    |   8 +-
 .../src/main/java/mod/_sw/SwXReferenceMarks.java   |  12 +-
 .../OOoRunner/src/main/java/mod/_sw/SwXShape.java  |   4 +-
 .../OOoRunner/src/main/java/mod/_sw/SwXStyle.java  |  16 +-
 .../src/main/java/mod/_sw/SwXStyleFamilies.java    |   4 +-
 .../src/main/java/mod/_sw/SwXStyleFamily.java      |   8 +-
 .../src/main/java/mod/_sw/SwXTableCellText.java    |   2 +-
 .../src/main/java/mod/_sw/SwXTextColumns.java      |   6 +-
 .../src/main/java/mod/_sw/SwXTextCursor.java       |   4 +-
 .../src/main/java/mod/_sw/SwXTextDefaults.java     |   2 +-
 .../src/main/java/mod/_sw/SwXTextDocument.java     |  32 +-
 .../main/java/mod/_sw/SwXTextEmbeddedObject.java   |  14 +-
 .../main/java/mod/_sw/SwXTextEmbeddedObjects.java  |   8 +-
 .../src/main/java/mod/_sw/SwXTextField.java        |  10 +-
 .../src/main/java/mod/_sw/SwXTextFieldMasters.java |   2 +-
 .../src/main/java/mod/_sw/SwXTextFieldTypes.java   |   2 +-
 .../src/main/java/mod/_sw/SwXTextFrame.java        |   8 +-
 .../src/main/java/mod/_sw/SwXTextFrameText.java    |   4 +-
 .../main/java/mod/_sw/SwXTextGraphicObject.java    |  10 +-
 .../main/java/mod/_sw/SwXTextGraphicObjects.java   |   6 +-
 .../src/main/java/mod/_sw/SwXTextPortion.java      |   8 +-
 .../java/mod/_sw/SwXTextPortionEnumeration.java    |   4 +-
 .../src/main/java/mod/_sw/SwXTextRanges.java       |   2 +-
 .../src/main/java/mod/_sw/SwXTextSearch.java       |   2 +-
 .../src/main/java/mod/_sw/SwXTextSection.java      |  20 +-
 .../src/main/java/mod/_sw/SwXTextSections.java     |   8 +-
 .../src/main/java/mod/_sw/SwXTextTable.java        |  12 +-
 .../src/main/java/mod/_sw/SwXTextTableRow.java     |   2 +-
 .../src/main/java/mod/_sw/SwXTextTables.java       |   4 +-
 .../src/main/java/mod/_sw/SwXTextView.java         |  20 +-
 .../src/main/java/mod/_sw/SwXTextViewCursor.java   |   2 +-
 .../src/main/java/mod/_sw/SwXViewSettings.java     |   2 +-
 .../src/main/java/mod/_sw/XMLContentExporter.java  |   2 +-
 .../src/main/java/mod/_sw/XMLContentImporter.java  |   4 +-
 .../src/main/java/mod/_sw/XMLExporter.java         |   2 +-
 .../src/main/java/mod/_sw/XMLImporter.java         |   4 +-
 .../src/main/java/mod/_sw/XMLMetaExporter.java     |   6 +-
 .../src/main/java/mod/_sw/XMLMetaImporter.java     |   6 +-
 .../src/main/java/mod/_sw/XMLSettingsExporter.java |   4 +-
 .../src/main/java/mod/_sw/XMLSettingsImporter.java |   2 +-
 .../src/main/java/mod/_sw/XMLStylesExporter.java   |   4 +-
 .../src/main/java/mod/_sw/XMLStylesImporter.java   |   2 +-
 .../java/mod/_tdmgr/TypeDescriptionManager.java    |   4 +-
 .../main/java/mod/_toolkit/AccessibleButton.java   |  16 +-
 .../main/java/mod/_toolkit/AccessibleCheckBox.java |  16 +-
 .../main/java/mod/_toolkit/AccessibleComboBox.java |  18 +-
 .../mod/_toolkit/AccessibleDropDownComboBox.java   |   2 +-
 .../mod/_toolkit/AccessibleDropDownListBox.java    |   2 +-
 .../src/main/java/mod/_toolkit/AccessibleEdit.java |  16 +-
 .../java/mod/_toolkit/AccessibleFixedText.java     |  18 +-
 .../src/main/java/mod/_toolkit/AccessibleList.java |  18 +-
 .../main/java/mod/_toolkit/AccessibleListBox.java  |  18 +-
 .../main/java/mod/_toolkit/AccessibleListItem.java |  16 +-
 .../src/main/java/mod/_toolkit/AccessibleMenu.java |   6 +-
 .../main/java/mod/_toolkit/AccessibleMenuBar.java  |   2 +-
 .../main/java/mod/_toolkit/AccessibleMenuItem.java |  10 +-
 .../java/mod/_toolkit/AccessibleMenuSeparator.java |   2 +-
 .../java/mod/_toolkit/AccessiblePopupMenu.java     |  12 +-
 .../java/mod/_toolkit/AccessibleRadioButton.java   |  20 +-
 .../java/mod/_toolkit/AccessibleScrollBar.java     |   6 +-
 .../java/mod/_toolkit/AccessibleStatusBar.java     |   2 +-
 .../java/mod/_toolkit/AccessibleStatusBarItem.java |   4 +-
 .../java/mod/_toolkit/AccessibleTabControl.java    |  16 +-
 .../main/java/mod/_toolkit/AccessibleTabPage.java  |  18 +-
 .../main/java/mod/_toolkit/AccessibleToolBox.java  |   4 +-
 .../java/mod/_toolkit/AccessibleToolBoxItem.java   |   6 +-
 .../main/java/mod/_toolkit/AccessibleWindow.java   |   8 +-
 .../java/mod/_toolkit/MutableTreeDataModel.java    |   2 +-
 .../main/java/mod/_toolkit/MutableTreeNode.java    |   6 +-
 .../src/main/java/mod/_toolkit/TabController.java  |   6 +-
 .../src/main/java/mod/_toolkit/Toolkit.java        |   8 +-
 .../main/java/mod/_toolkit/UnoControlButton.java   |   2 +-
 .../main/java/mod/_toolkit/UnoControlCheckBox.java |   4 +-
 .../main/java/mod/_toolkit/UnoControlComboBox.java |   6 +-
 .../java/mod/_toolkit/UnoControlContainer.java     |  14 +-
 .../java/mod/_toolkit/UnoControlCurrencyField.java |   6 +-
 .../java/mod/_toolkit/UnoControlDateField.java     |   4 +-
 .../main/java/mod/_toolkit/UnoControlDialog.java   |  24 +-
 .../java/mod/_toolkit/UnoControlDialogModel.java   |  18 +-
 .../src/main/java/mod/_toolkit/UnoControlEdit.java |   6 +-
 .../java/mod/_toolkit/UnoControlFileControl.java   |   6 +-
 .../java/mod/_toolkit/UnoControlFixedText.java     |   4 +-
 .../mod/_toolkit/UnoControlFormattedField.java     |   8 +-
 .../main/java/mod/_toolkit/UnoControlGroupBox.java |   4 +-
 .../java/mod/_toolkit/UnoControlImageControl.java  |   6 +-
 .../main/java/mod/_toolkit/UnoControlListBox.java  |   6 +-
 .../java/mod/_toolkit/UnoControlNumericField.java  |   8 +-
 .../java/mod/_toolkit/UnoControlPatternField.java  |   6 +-
 .../java/mod/_toolkit/UnoControlRadioButton.java   |   4 +-
 .../java/mod/_toolkit/UnoControlTimeField.java     |   6 +-
 .../java/mod/_toolkit/UnoScrollBarControl.java     |   6 +-
 .../java/mod/_toolkit/UnoSpinButtonControl.java    |   4 +-
 .../src/main/java/mod/_toolkit/UnoTreeControl.java |  32 +-
 .../mod/_typemgr.uno/TypeDescriptionManager.java   |   4 +-
 .../main/java/mod/_ucb/UniversalContentBroker.java |   2 +-
 .../java/mod/_ucpchelp/CHelpContentProvider.java   |   2 +-
 .../java/mod/_ucpdav/WebDAVContentProvider.java    |   2 +-
 .../src/main/java/mod/_ucpfile/FileProvider.java   |   2 +-
 .../main/java/mod/_ucpftp/FTPContentProvider.java  |   2 +-
 .../mod/_ucphier/HierarchyContentProvider.java     |   2 +-
 .../java/mod/_ucppkg/PackageContentProvider.java   |   2 +-
 .../src/main/java/mod/_ucprmt/ContentProvider.java |   2 +-
 .../main/java/mod/_ucprmt/ProviderAcceptor.java    |   2 +-
 .../src/main/java/mod/_ucprmt/ProxyProvider.java   |   2 +-
 .../java/mod/_xmloff/Chart/XMLContentExporter.java |   4 +-
 .../java/mod/_xmloff/Chart/XMLContentImporter.java |   2 +-
 .../main/java/mod/_xmloff/Chart/XMLExporter.java   |   4 +-
 .../main/java/mod/_xmloff/Chart/XMLImporter.java   |   2 +-
 .../java/mod/_xmloff/Chart/XMLStylesExporter.java  |   2 +-
 .../java/mod/_xmloff/Draw/XMLContentExporter.java  |  12 +-
 .../java/mod/_xmloff/Draw/XMLContentImporter.java  |   4 +-
 .../main/java/mod/_xmloff/Draw/XMLExporter.java    |  12 +-
 .../main/java/mod/_xmloff/Draw/XMLImporter.java    |   4 +-
 .../java/mod/_xmloff/Draw/XMLMetaExporter.java     |   6 +-
 .../java/mod/_xmloff/Draw/XMLMetaImporter.java     |   4 +-
 .../java/mod/_xmloff/Draw/XMLSettingsExporter.java |   6 +-
 .../java/mod/_xmloff/Draw/XMLSettingsImporter.java |   4 +-
 .../java/mod/_xmloff/Draw/XMLStylesExporter.java   |   8 +-
 .../java/mod/_xmloff/Draw/XMLStylesImporter.java   |   4 +-
 .../mod/_xmloff/Impress/XMLContentExporter.java    |   6 +-
 .../mod/_xmloff/Impress/XMLContentImporter.java    |   4 +-
 .../main/java/mod/_xmloff/Impress/XMLExporter.java |   6 +-
 .../main/java/mod/_xmloff/Impress/XMLImporter.java |   4 +-
 .../java/mod/_xmloff/Impress/XMLMetaExporter.java  |   6 +-
 .../java/mod/_xmloff/Impress/XMLMetaImporter.java  |   4 +-
 .../mod/_xmloff/Impress/XMLSettingsExporter.java   |  10 +-
 .../mod/_xmloff/Impress/XMLSettingsImporter.java   |   4 +-
 .../mod/_xmloff/Impress/XMLStylesExporter.java     |   8 +-
 .../mod/_xmloff/Impress/XMLStylesImporter.java     |   4 +-
 .../src/main/java/util/AccessibilityTools.java     |   6 +-
 .../src/main/java/util/BasicMacroTools.java        |  22 +-
 .../OOoRunner/src/main/java/util/CalcTools.java    |   6 +-
 .../java/OOoRunner/src/main/java/util/DBTools.java |  38 +-
 .../OOoRunner/src/main/java/util/DesktopTools.java |  32 +-
 .../OOoRunner/src/main/java/util/DrawTools.java    |   4 +-
 .../OOoRunner/src/main/java/util/FormTools.java    |  52 +-
 .../OOoRunner/src/main/java/util/FrameDsc.java     |   4 +-
 .../OOoRunner/src/main/java/util/InstCreator.java  |  14 +-
 .../src/main/java/util/RegistryTools.java          |   2 +-
 .../src/main/java/util/SOfficeFactory.java         |  48 +-
 .../OOoRunner/src/main/java/util/SysUtils.java     |   6 +-
 .../java/OOoRunner/src/main/java/util/UITools.java |  46 +-
 .../OOoRunner/src/main/java/util/WriterTools.java  |  12 +-
 .../OOoRunner/src/main/java/util/XMLTools.java     |  22 +-
 .../src/main/java/util/db/DataSource.java          |   6 +-
 .../src/main/java/util/db/DatabaseDocument.java    |   8 +-
 .../java/OOoRunner/src/main/java/util/dbg.java     |   6 +-
 .../java/OOoRunner/src/main/java/util/utils.java   |  26 +-
 .../backend/org/openoffice/JavaSystemBackend.java  |   2 +-
 .../java/com/sun/star/report/SDBCReportData.java   |  12 +-
 .../com/sun/star/report/SDBCReportDataFactory.java |  24 +-
 .../java/com/sun/star/report/SOImageService.java   |   6 +-
 .../com/sun/star/report/StorageRepository.java     |  12 +-
 .../sun/star/report/pentaho/SOFormulaParser.java   |   2 +-
 .../star/report/pentaho/SOReportJobFactory.java    |  16 +-
 .../complex/reportdesign/ReportDesignerTest.java   |   2 +-
 main/sc/qa/complex/calcPreview/ViewForwarder.java  |   2 +-
 main/sc/source/ui/vba/vbachart.cxx                 |   8 +-
 .../examples/beanshell/Capitalise/capitalise.bsh   |  12 +-
 .../examples/beanshell/HelloWorld/helloworld.bsh   |   2 +-
 .../beanshell/Highlight/ButtonPressHandler.bsh     |  14 +-
 .../examples/beanshell/Highlight/ShowDialog.bsh    |   4 +-
 .../examples/beanshell/Highlight/highlighter.bsh   |   6 +-
 .../examples/beanshell/MemoryUsage/memusage.bsh    |  26 +-
 .../examples/beanshell/WordCount/wordcount.bsh     |   8 +-
 .../examples/java/HelloWorld/HelloWorld.java       |   2 +-
 .../examples/java/Highlight/HighlightText.java     |  18 +-
 .../examples/java/MemoryUsage/MemoryUsage.java     |  26 +-
 .../examples/java/Newsgroup/MimeConfiguration.java |   2 +-
 .../examples/java/Newsgroup/OfficeAttachment.java  |   2 +-
 .../examples/java/selector/ScriptSelector.java     |  16 +-
 .../script/framework/security/SecurityDialog.java  |  48 +-
 .../script/framework/browse/DialogFactory.java     |  62 +-
 .../script/framework/browse/ParcelBrowseNode.java  |   2 +-
 .../framework/browse/ProviderBrowseNode.java       |   2 +-
 .../script/framework/browse/ScriptBrowseNode.java  |   2 +-
 .../star/script/framework/container/Parcel.java    |   2 +-
 .../framework/container/ParcelContainer.java       |   8 +-
 .../script/framework/container/ScriptMetaData.java |   2 +-
 .../framework/container/UnoPkgContainer.java       |   2 +-
 .../star/script/framework/io/UCBStreamHandler.java |   2 +-
 .../star/script/framework/io/XStorageHelper.java   |  14 +-
 .../framework/provider/EditorScriptContext.java    |   4 +-
 .../script/framework/provider/ScriptContext.java   |   2 +-
 .../script/framework/provider/ScriptProvider.java  |  24 +-
 .../framework/provider/beanshell/template.bsh      |   2 +-
 .../idesupport/localoffice/LocalOfficeImpl.java    |  10 +-
 .../office/resources/templates/HelloWorld.java_    |   2 +-
 .../workben/ifc/scripting/ScriptingUtils.java      |   8 +-
 .../workben/ifc/scripting/SecurityDialogUtil.java  |   8 +-
 .../workben/ifc/scripting/_XScriptInfoAccess.java  |   2 +-
 .../workben/ifc/scripting/_XScriptInvocation.java  |  10 +-
 .../ifc/scripting/_XScriptNameResolver.java        |   8 +-
 .../workben/ifc/scripting/_XScriptSecurity.java    |  20 +-
 .../ifc/scripting/_XScriptStorageManager.java      |   2 +-
 .../scripting/workben/mod/_scripting/Dispatch.java |   4 +-
 .../scripting/workben/mod/_scripting/Function.java |   4 +-
 .../workben/mod/_scripting/FunctionProvider.java   |   2 +-
 .../workben/mod/_scripting/ScriptInfo.java         |   4 +-
 .../workben/mod/_scripting/ScriptStorage.java      |   2 +-
 .../mod/_scripting/ScriptStorageManager.java       |   4 +-
 main/sfx2/qa/complex/sfx2/DocumentInfo.java        |   2 +-
 main/sfx2/qa/complex/sfx2/DocumentProperties.java  |   4 +-
 .../accessibility/AccessibleRelationSet.java       |  20 +-
 .../sw/qa/complex/checkColor/CheckChangeColor.java |   6 +-
 .../CheckIndeterminateState.java                   |   4 +-
 main/sw/qa/complex/writer/CheckBookmarks.java      |  18 +-
 .../sw/qa/complex/writer/CheckCrossReferences.java |  36 +-
 main/sw/qa/complex/writer/CheckFlies.java          |  12 +-
 main/sw/qa/complex/writer/LoadSaveTest.java        |   8 +-
 .../complex/writer/TextPortionEnumerationTest.java | 218 +++---
 .../mediawiki/src/com/sun/star/wiki/Helper.java    |  58 +-
 .../sun/star/wiki/MainThreadDialogExecutor.java    |   2 +-
 .../mediawiki/src/com/sun/star/wiki/Settings.java  |  20 +-
 .../src/com/sun/star/wiki/WikiDialog.java          |  32 +-
 .../src/com/sun/star/wiki/WikiEditorImpl.java      |  20 +-
 .../sun/star/wiki/WikiOptionsEventHandlerImpl.java |   6 +-
 main/toolkit/test/accessibility/AccTreeNode.java   |  14 +-
 .../test/accessibility/AccessibilityTreeModel.java |   2 +-
 .../test/accessibility/AccessibilityWorkBench.java |   2 +-
 .../accessibility/AccessibleActionHandler.java     |   4 +-
 .../test/accessibility/AccessibleCellHandler.java  |   4 +-
 .../accessibility/AccessibleComponentHandler.java  |   2 +-
 .../AccessibleEditableTextHandler.java             |   4 +-
 .../AccessibleExtendedComponentHandler.java        |   4 +-
 .../accessibility/AccessibleHyperlinkHandler.java  |   4 +-
 .../accessibility/AccessibleHypertextHandler.java  |   4 +-
 .../test/accessibility/AccessibleImageHandler.java |   4 +-
 .../accessibility/AccessibleRelationHandler.java   |   2 +-
 .../accessibility/AccessibleSelectionHandler.java  |   2 +-
 .../test/accessibility/AccessibleTableHandler.java |   4 +-
 .../test/accessibility/AccessibleTextHandler.java  |   2 +-
 .../test/accessibility/AccessibleUNOHandler.java   |   4 +-
 .../test/accessibility/ChildEventHandler.java      |   4 +-
 main/toolkit/test/accessibility/EventHandler.java  |   4 +-
 .../test/accessibility/InformationWriter.java      |  28 +-
 .../test/accessibility/OfficeConnection.java       |   4 +-
 .../toolkit/test/accessibility/QueuedListener.java |   4 +-
 main/toolkit/test/accessibility/SimpleOffice.java  |  28 +-
 .../test/accessibility/TextUpdateListener.java     |   2 +-
 .../test/accessibility/TopWindowListener.java      |   4 +-
 main/toolkit/test/accessibility/ov/FocusView.java  |   4 +-
 .../test/accessibility/ov/ListeningObjectView.java |   4 +-
 .../test/accessibility/ov/SelectionView.java       |   4 +-
 main/toolkit/test/accessibility/ov/TextView.java   |   4 +-
 main/ucb/qa/complex/tdoc/_XChild.java              |   2 +-
 main/ucb/qa/complex/tdoc/_XCommandProcessor.java   |   4 +-
 .../com/sun/star/comp/ucb/GlobalTransfer_Test.java |   8 +-
 .../source/skeletonmaker/javacompskeleton.cxx      |   2 +-
 .../com/sun/star/wizards/common/FileAccess.java    |   4 +-
 .../com/sun/star/wizards/db/TableDescriptor.java   |   2 +-
 .../sun/star/wizards/report/CallReportWizard.java  |   2 +-
 .../sun/star/wizards/report/ReportFinalizer.java   |   2 +-
 .../sun/star/wizards/report/ReportLayouter.java    |   2 +-
 .../layout/ReportBuilderLayouter.java              |   6 +-
 .../com/sun/star/wizards/ui/ButtonList.java        |   2 +-
 .../sun/star/wizards/ui/CommandFieldSelection.java |   2 +-
 .../com/sun/star/wizards/ui/DocumentPreview.java   |   6 +-
 .../wizards/com/sun/star/wizards/ui/ImageList.java |   4 +-
 .../wizards/com/sun/star/wizards/ui/UnoDialog.java |   6 +-
 .../com/sun/star/wizards/ui/WizardDialog.java      |   2 +-
 .../com/sun/star/wizards/web/WWD_Events.java       |   2 +-
 .../star/wizards/web/export/AbstractExporter.java  |   2 +-
 .../XMergeBridge/src/main/java/XMergeBridge.java   |  14 +-
 main/xmlsecurity/tools/uno/EncryptionEntity.java   |  24 +-
 main/xmlsecurity/tools/uno/SecurityEntity.java     |   6 +-
 main/xmlsecurity/tools/uno/SignatureEntity.java    |  26 +-
 main/xmlsecurity/tools/uno/TestTool.java           |  12 +-
 .../tools/uno/XMLSecurityFrameworkController.java  |  22 +-
 .../source/api/i18n/XBreakIteratorTest.java        |   2 +-
 test/testuno/source/fvt/mix/MixedTest.java         |   4 +-
 .../fvt/mix/sc/sheet/InsertCalcSheetTest.java      |  18 +-
 .../fvt/mix/sc/sheet/InsertExcelSheetTest.java     |  18 +-
 test/testuno/source/fvt/uno/db/DBAccess.java       |  16 +-
 test/testuno/source/fvt/uno/ffc/FFCTest.java       |   6 +-
 .../source/fvt/uno/sc/cell/DeleteContents.java     |  10 +-
 .../source/fvt/uno/sc/cell/InsertDeleteCells.java  |  24 +-
 .../source/fvt/uno/sc/data/AdvanceFilter.java      |  18 +-
 test/testuno/source/fvt/uno/sc/data/DataSort.java  |  16 +-
 .../fvt/uno/sc/data/StandardFilterOption.java      | 114 +--
 .../source/fvt/uno/sc/data/StardarFilterTest.java  |  16 +-
 .../source/fvt/uno/sc/data/SubTotalsFunction.java  |   4 +-
 .../source/fvt/uno/sc/data/SubtotalsForGroup.java  |   8 +-
 .../source/fvt/uno/sc/data/ValidityTypeTest.java   |   6 +-
 .../source/fvt/uno/sc/formula/TestFormulaDocs.java |  10 +-
 .../fvt/uno/sc/formula/TestFormulaRoundTrip.java   |   6 +-
 .../source/fvt/uno/sc/object/DrawingObject.java    |  14 +-
 .../source/fvt/uno/sc/rowcolumn/CellMerge.java     |   6 +-
 .../CreateShowHideEditDeleteComments.java          |  28 +-
 .../uno/sc/rowcolumn/InsertDeleteRowAndColumn.java |  12 +-
 .../uno/sc/rowcolumn/ResizeHideShowRowColumn.java  |  48 +-
 .../source/fvt/uno/sc/sheet/SheetBasicTest.java    |   6 +-
 .../fvt/uno/sd/animation/CustomAnimation.java      |  26 +-
 .../source/fvt/uno/sd/animation/TextAnimation.java |  22 +-
 .../fvt/uno/sd/bullet/CheckBuildInBullet.java      |  12 +-
 .../source/fvt/uno/sd/bullet/CheckBulletStyle.java |  12 +-
 .../fvt/uno/sd/bullet/GraphicBulletFromFile.java   |  12 +-
 .../fvt/uno/sd/bullet/NumberingBulletTypes.java    |  12 +-
 .../fvt/uno/sd/bullet/NumberingProperty.java       |  56 +-
 .../fvt/uno/sd/character/CheckCharacterStyle.java  |  28 +-
 .../testuno/source/fvt/uno/sd/chart/ChartData.java |  24 +-
 .../source/fvt/uno/sd/chart/ChartProperties.java   |  80 +-
 .../source/fvt/uno/sd/chart/ChartTypes.java        |  26 +-
 .../fvt/uno/sd/file/CheckFileProperties.java       |  14 +-
 .../fvt/uno/sd/graphic/GraphicPro_Border.java      |  24 +-
 .../fvt/uno/sd/graphic/GraphicPro_Position.java    |  12 +-
 .../source/fvt/uno/sd/graphic/GraphicPro_Size.java |  12 +-
 .../fvt/uno/sd/paragraph/ParagraphStyle.java       |  22 +-
 .../uno/sd/paragraph/ParagraphTextProperty.java    |  20 +-
 .../source/fvt/uno/sd/shape/ShapeProperties.java   |  56 +-
 .../source/fvt/uno/sd/shape/ShapeTypes.java        |  22 +-
 .../source/fvt/uno/sd/slideshow/CustomShow.java    |  26 +-
 .../source/fvt/uno/sd/slideshow/SlideShow.java     |  22 +-
 .../source/fvt/uno/sd/textbox/FillProperties.java  |  30 +-
 .../source/fvt/uno/sd/textbox/LineProperties.java  |  22 +-
 test/testuno/source/fvt/uno/sw/DocumentTest.java   |  32 +-
 .../source/fvt/uno/sw/bookmark/CheckBookmarks.java |  12 +-
 .../source/fvt/uno/sw/breaks/CheckBreaks.java      |  20 +-
 .../sw/crossreference/CheckCrossReferences.java    |  38 +-
 .../fvt/uno/sw/field/CheckDateTimeField.java       |  30 +-
 .../source/fvt/uno/sw/field/PageCountField.java    |  10 +-
 .../source/fvt/uno/sw/field/PageNumberField.java   |  10 +-
 .../source/fvt/uno/sw/field/SubjectField.java      |   8 +-
 .../source/fvt/uno/sw/field/TitleField.java        |   8 +-
 .../source/fvt/uno/sw/frame/CheckFrames.java       |   8 +-
 .../source/fvt/uno/sw/frame/FrameAnchorType.java   |  16 +-
 .../source/fvt/uno/sw/frame/FrameBackColor.java    |  24 +-
 .../source/fvt/uno/sw/frame/FrameBackGraphic.java  |  16 +-
 .../source/fvt/uno/sw/frame/FrameBorder.java       |  22 +-
 .../uno/sw/frame/FrameBorderSpacingtoContent.java  |  24 +-
 .../source/fvt/uno/sw/frame/FrameDescription.java  |  14 +-
 .../source/fvt/uno/sw/frame/FrameHyperlink.java    |  16 +-
 .../source/fvt/uno/sw/frame/FramePosition.java     |  16 +-
 .../source/fvt/uno/sw/frame/FrameShadow.java       |  18 +-
 .../testuno/source/fvt/uno/sw/frame/FrameSize.java |  24 +-
 .../source/fvt/uno/sw/frame/FrameWrapType.java     |  18 +-
 .../source/fvt/uno/sw/frame/InsertFrame.java       |  14 +-
 .../fvt/uno/sw/paragraph/ParagraphAlignment.java   |  64 +-
 .../fvt/uno/sw/paragraph/ParagraphBackColor.java   |  16 +-
 .../fvt/uno/sw/paragraph/ParagraphBackGraphic.java | 192 ++---
 .../fvt/uno/sw/paragraph/ParagraphBorder.java      |  32 +-
 .../fvt/uno/sw/paragraph/ParagraphDropcap.java     |  40 +-
 .../sw/paragraph/ParagraphIndentAndSpacing.java    |  32 +-
 .../fvt/uno/sw/paragraph/ParagraphInsertBreak.java | 224 +++---
 .../fvt/uno/sw/paragraph/ParagraphLineSpacing.java | 140 ++--
 .../ParagraphNumberingAndBulletAlignment.java      |  96 +--
 .../ParagraphNumberingAndBulletCharacterStyle.java | 832 ++++++++++-----------
 ...agraphNumberingAndBulletIndentAtAndAlignAt.java |  32 +-
 .../ParagraphNumberingAndBulletTabStop.java        |  32 +-
 ...aragraphNumberingAndBullet_CharacterBullet.java |  64 +-
 .../ParagraphNumberingAndBullet_Graphic.java       |  32 +-
 ...agraphNumberingAndBullet_Graphic_Alignment.java | 288 +++----
 ...hNumberingAndBullet_Graphic_WidthAndHeight.java |  32 +-
 ...ngAndBullet_Number_BeforeAndAfterCharacter.java |  32 +-
 ...ragraphNumberingAndBullet_Number_StartWith.java |  32 +-
 .../ParagraphNumberingAndBullet_Numbering.java     | 256 +++----
 .../sw/paragraph/ParagraphOutlineAndNumbering.java |  32 +-
 .../fvt/uno/sw/paragraph/ParagraphShadow.java      | 100 +--
 .../uno/sw/paragraph/ParagraphSpacingtoBorder.java |  16 +-
 .../source/fvt/uno/sw/paragraph/ParagraphTabs.java | 100 +--
 .../sw/paragraph/ParagraphTexttoTextAlignment.java |  80 +-
 .../fvt/uno/sw/puretext/CharacterBackColor.java    |  16 +-
 .../source/fvt/uno/sw/puretext/CharacterBlink.java |  16 +-
 .../fvt/uno/sw/puretext/CharacterChangeCase.java   |  80 +-
 .../source/fvt/uno/sw/puretext/CharacterColor.java |  16 +-
 .../fvt/uno/sw/puretext/CharacterEmphasis.java     |  16 +-
 .../fvt/uno/sw/puretext/CharacterFontname.java     |  16 +-
 .../fvt/uno/sw/puretext/CharacterHidden.java       |  16 +-
 .../fvt/uno/sw/puretext/CharacterHyperlink.java    |  16 +-
 .../fvt/uno/sw/puretext/CharacterLocale.java       |  18 +-
 .../fvt/uno/sw/puretext/CharacterOutline.java      |  16 +-
 .../fvt/uno/sw/puretext/CharacterPosition.java     |  48 +-
 .../fvt/uno/sw/puretext/CharacterRelief.java       |  16 +-
 .../puretext/CharacterRotationAndScaleWidth.java   |  48 +-
 .../fvt/uno/sw/puretext/CharacterShadow.java       |  16 +-
 .../source/fvt/uno/sw/puretext/CharacterSize.java  |  16 +-
 .../fvt/uno/sw/puretext/CharacterSpacing.java      |  48 +-
 .../uno/sw/puretext/CharacterStrikeThrough.java    |  16 +-
 .../source/fvt/uno/sw/puretext/CharacterStyle.java |  16 +-
 .../fvt/uno/sw/puretext/CharacterUnderline.java    |  16 +-
 .../uno/sw/puretext/InsertCharacterToTable.java    |  30 +-
 .../source/fvt/uno/sw/table/TableBasic.java        | 326 ++++----
 .../uno/sw/table/TableBorderSpacingtoContent.java  |  32 +-
 .../source/fvt/uno/sw/table/TableCellProtect.java  |  32 +-
 .../source/fvt/uno/sw/table/TableInsertBreak.java  | 416 +++++------
 .../testuno/source/fvt/uno/sw/table/TableName.java |  32 +-
 .../fvt/uno/sw/table/TableVerticalAlignment.java   |  96 +--
 .../source/org/openoffice/test/uno/UnoApp.java     |  26 +-
 test/testuno/source/pvt/uno/Conversion.java        |   2 +-
 test/testuno/source/testlib/uno/ChartUtil.java     |  16 +-
 test/testuno/source/testlib/uno/DBUtil.java        |   8 +-
 test/testuno/source/testlib/uno/GraphicUtil.java   |  18 +-
 test/testuno/source/testlib/uno/PageUtil.java      |   6 +-
 test/testuno/source/testlib/uno/SCUtil.java        |  90 +--
 test/testuno/source/testlib/uno/SDUtil.java        |  14 +-
 test/testuno/source/testlib/uno/SWUtil.java        |  58 +-
 test/testuno/source/testlib/uno/ShapeUtil.java     |  34 +-
 test/testuno/source/testlib/uno/TestUtil.java      |   2 +-
 1235 files changed, 8265 insertions(+), 8265 deletions(-)

diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/AccessBridge.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/AccessBridge.java
index ac5194c69f..70f66a11c9 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/AccessBridge.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/AccessBridge.java
@@ -182,7 +182,7 @@ public class AccessBridge {
         * XTopWindowListener
         */
         public void windowOpened(com.sun.star.lang.EventObject event) {
-            XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(XAccessible.class,
+            XAccessible xAccessible = UnoRuntime.queryInterface(XAccessible.class,
                     event.Source);
             java.awt.Window w = getTopWindow(xAccessible);
         }
@@ -203,7 +203,7 @@ public class AccessBridge {
         }
 
         public void windowClosed(com.sun.star.lang.EventObject event) {
-            XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(XAccessible.class,
+            XAccessible xAccessible = UnoRuntime.queryInterface(XAccessible.class,
                     event.Source);
 
             java.awt.Window w = removeTopWindow(xAccessible);
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/WindowsAccessBridgeAdapter.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/WindowsAccessBridgeAdapter.java
index 631677e583..3731301179 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/WindowsAccessBridgeAdapter.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/accessibility/WindowsAccessBridgeAdapter.java
@@ -68,7 +68,7 @@ public class WindowsAccessBridgeAdapter {
                         "/singletons/com.sun.star.java.theJavaVirtualMachine");
 
                 if (AnyConverter.isObject(any)) {
-                    XJavaVM xJavaVM = (XJavaVM) UnoRuntime.queryInterface(XJavaVM.class,
+                    XJavaVM xJavaVM = UnoRuntime.queryInterface(XJavaVM.class,
                             AnyConverter.toObject(new Type(XJavaVM.class), any));
 
                     if (xJavaVM != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AbstractButton.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AbstractButton.java
index 448ed0a848..884e648d9e 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AbstractButton.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AbstractButton.java
@@ -62,7 +62,7 @@ public abstract class AbstractButton extends Component {
                 return null;
 
             try {
-                XAccessibleText unoAccessibleText = (XAccessibleText)
+                XAccessibleText unoAccessibleText =
                     UnoRuntime.queryInterface(XAccessibleText.class,unoAccessibleComponent);
                 if (unoAccessibleText != null) {
                     return new AccessibleTextImpl(unoAccessibleText);
@@ -142,7 +142,7 @@ public abstract class AbstractButton extends Component {
                         XAccessibleContext xAccessibleContext = unoAccessibleContext;
                         if (xAccessibleContext != null) {
                             // Query for XAccessibleAction interface
-                            XAccessibleAction xAccessibleAction = (XAccessibleAction)
+                            XAccessibleAction xAccessibleAction =
                                 UnoRuntime.queryInterface(XAccessibleAction.class, xAccessibleContext);
 
                             if (xAccessibleAction != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleComponentImpl.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleComponentImpl.java
index ac2f955449..a08644f4fe 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleComponentImpl.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleComponentImpl.java
@@ -41,7 +41,7 @@ public class AccessibleComponentImpl implements javax.accessibility.AccessibleCo
 
     protected boolean hasState(short state) {
         try {
-            XAccessibleContext unoAccessibleContext = (XAccessibleContext)
+            XAccessibleContext unoAccessibleContext =
                 UnoRuntime.queryInterface(XAccessibleContext.class, unoObject);
             // All UNO accessibility implementations must support XAccessibleContext
             // and return a valid XAccessibleStateSet ..
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleHypertextImpl.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleHypertextImpl.java
index 803ac4d83e..4f71da2d84 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleHypertextImpl.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleHypertextImpl.java
@@ -141,13 +141,13 @@ public class AccessibleHypertextImpl extends AccessibleTextImpl
 
     public static javax.accessibility.AccessibleText get(com.sun.star.uno.XInterface unoObject) {
         try {
-            XAccessibleHypertext unoAccessibleHypertext = (XAccessibleHypertext)
+            XAccessibleHypertext unoAccessibleHypertext =
                 UnoRuntime.queryInterface(XAccessibleHypertext.class, unoObject);
             if (unoAccessibleHypertext != null) {
                 return new AccessibleHypertextImpl(unoAccessibleHypertext);
             }
 
-            XAccessibleText unoAccessibleText = (XAccessibleText)
+            XAccessibleText unoAccessibleText =
                 UnoRuntime.queryInterface(XAccessibleText.class, unoObject);
             if (unoAccessibleText != null) {
                 return new AccessibleTextImpl(unoAccessibleText);
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleObjectFactory.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleObjectFactory.java
index 91a81ad38b..35f60be45a 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleObjectFactory.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleObjectFactory.java
@@ -488,7 +488,7 @@ public class AccessibleObjectFactory {
         if (xAccessibleContext != null) {
             short role = xAccessibleContext.getAccessibleRole();
             XAccessibleStateSet xAccessibleStateSet = xAccessibleContext.getAccessibleStateSet();
-            XAccessibleComponent xAccessibleComponent = (XAccessibleComponent)
+            XAccessibleComponent xAccessibleComponent =
                 UnoRuntime.queryInterface(XAccessibleComponent.class, xAccessibleContext);
 
             java.awt.Window w;
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleTextImpl.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleTextImpl.java
index 9b1d435b54..2235d3f4e6 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleTextImpl.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/AccessibleTextImpl.java
@@ -80,7 +80,7 @@ public class AccessibleTextImpl implements javax.accessibility.AccessibleText {
 
 	public static javax.accessibility.AccessibleText get(com.sun.star.uno.XInterface unoObject) {
 		try {
-			XAccessibleText unoAccessibleText = (XAccessibleText)
+			XAccessibleText unoAccessibleText =
 				UnoRuntime.queryInterface(XAccessibleText.class, unoObject);
 			if (unoAccessibleText != null) {
 				return new AccessibleTextImpl(unoAccessibleText);
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ComboBox.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ComboBox.java
index 8fd3270fe5..5910f4f765 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ComboBox.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ComboBox.java
@@ -73,7 +73,7 @@ public class ComboBox extends Container {
         /** Gets the AccessibleAction associated with this object that supports one or more actions */
         public javax.accessibility.AccessibleAction getAccessibleAction() {
             if (unoAccessibleAction == null) {
-                unoAccessibleAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class,
+                unoAccessibleAction = UnoRuntime.queryInterface(XAccessibleAction.class,
                         unoAccessibleContext);
 
                 if (unoAccessibleAction == null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Component.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Component.java
index a3b3d4058b..04c0bd9666 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Component.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Component.java
@@ -43,11 +43,11 @@ public abstract class Component extends java.awt.Component {
 		super();
 		unoAccessible = xAccessible;
 		unoAccessibleContext = xAccessibleContext;
-		unoAccessibleComponent = (XAccessibleComponent)
+		unoAccessibleComponent =
 			UnoRuntime.queryInterface(XAccessibleComponent.class, xAccessibleContext);
 		// Add the event listener right away, because the global focus notification doesn't
 		// work yet...
-		XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+		XAccessibleEventBroadcaster broadcaster =
 			UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class,
 			unoAccessibleComponent);
 		if (broadcaster != null) {
@@ -130,7 +130,7 @@ public abstract class Component extends java.awt.Component {
 			java.util.ArrayList list = new java.util.ArrayList(targetSet.length);
 			for (int i=0; i < targetSet.length; i++) {
 				java.awt.Component c = AccessibleObjectFactory.getAccessibleComponent(
-					(XAccessible) UnoRuntime.queryInterface(XAccessible.class, targetSet[i]));
+					UnoRuntime.queryInterface(XAccessible.class, targetSet[i]));
 				if (c != null) {
 					list.add(c);
 				}
@@ -664,7 +664,7 @@ public abstract class Component extends java.awt.Component {
 
 		public String getToolTipText() {
 			try {
-				XAccessibleExtendedComponent unoAccessibleExtendedComponent = (XAccessibleExtendedComponent)
+				XAccessibleExtendedComponent unoAccessibleExtendedComponent =
 					UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, unoAccessibleComponent);
 				if (unoAccessibleExtendedComponent != null) {
 					return unoAccessibleExtendedComponent.getToolTipText();
@@ -677,7 +677,7 @@ public abstract class Component extends java.awt.Component {
 
 		public String getTitledBorderText() {
 			try {
-				XAccessibleExtendedComponent unoAccessibleExtendedComponent = (XAccessibleExtendedComponent)
+				XAccessibleExtendedComponent unoAccessibleExtendedComponent =
 					UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, unoAccessibleComponent);
 				if (unoAccessibleExtendedComponent != null) {
 					return unoAccessibleExtendedComponent.getTitledBorderText();
@@ -690,7 +690,7 @@ public abstract class Component extends java.awt.Component {
 
 		public javax.accessibility.AccessibleKeyBinding getAccessibleKeyBinding() {
 			try {
-				XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+				XAccessibleAction unoAccessibleAction =
 					UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleComponent);
 				if (unoAccessibleAction != null) {
 					XAccessibleKeyBinding unoAccessibleKeyBinding = unoAccessibleAction.getAccessibleActionKeyBinding(0);
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Container.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Container.java
index 141a219428..81c5d0f674 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Container.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Container.java
@@ -44,13 +44,13 @@ public class Container extends java.awt.Container implements javax.accessibility
 		accessibleRole = role;
 		unoAccessible = xAccessible;
 		unoAccessibleContext = xAccessibleContext;
-		unoAccessibleComponent = (XAccessibleComponent)
+		unoAccessibleComponent =
 			UnoRuntime.queryInterface(XAccessibleComponent.class,
 			xAccessibleContext);
 
 		// Add the event listener right away, because the global focus notification doesn't
 		// work yet...
-		XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+		XAccessibleEventBroadcaster broadcaster =
 			UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class,
 			unoAccessibleContext);
 		if (broadcaster != null) {
@@ -133,7 +133,7 @@ public class Container extends java.awt.Container implements javax.accessibility
 			java.util.ArrayList list = new java.util.ArrayList(targetSet.length);
 			for (int i=0; i < targetSet.length; i++) {
 				java.awt.Component c = AccessibleObjectFactory.getAccessibleComponent(
-					(XAccessible) UnoRuntime.queryInterface(XAccessible.class, targetSet[i]));
+					UnoRuntime.queryInterface(XAccessible.class, targetSet[i]));
 				if (c != null) {
 					list.add(c);
 				}
@@ -572,7 +572,7 @@ public class Container extends java.awt.Container implements javax.accessibility
 		/** Returns the AccessibleSelection interface for this object */
 		public javax.accessibility.AccessibleSelection getAccessibleSelection() {
 			try {
-				XAccessibleSelection unoAccessibleSelection = (XAccessibleSelection)
+				XAccessibleSelection unoAccessibleSelection =
 					UnoRuntime.queryInterface(XAccessibleSelection.class, unoAccessibleContext);
 				if (unoAccessibleSelection != null) {
 					return new AccessibleSelectionImpl(unoAccessibleSelection);
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/DescendantManager.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/DescendantManager.java
index 6282da7a5f..92e1dd9ed5 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/DescendantManager.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/DescendantManager.java
@@ -51,7 +51,7 @@ public abstract class DescendantManager extends Component {
     protected class AccessibleDescendantManagerListener
         extends AccessibleUNOComponentListener {
         protected AccessibleDescendantManagerListener() {
-            unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class,
+            unoAccessibleSelection = UnoRuntime.queryInterface(XAccessibleSelection.class,
                     unoAccessibleContext);
         }
 
@@ -74,7 +74,7 @@ public abstract class DescendantManager extends Component {
         extends AccessibleUNOComponent
         implements javax.accessibility.AccessibleSelection {
         protected AccessibleDescendantManager() {
-            unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class,
+            unoAccessibleSelection = UnoRuntime.queryInterface(XAccessibleSelection.class,
                     unoAccessibleContext);
         }
 
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Dialog.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Dialog.java
index 89343e52ba..c276b78265 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Dialog.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Dialog.java
@@ -55,7 +55,7 @@ public class Dialog extends java.awt.Dialog implements javax.accessibility.Acces
     private void initialize(XAccessibleComponent xAccessibleComponent) {
         unoAccessibleComponent = xAccessibleComponent;
         eventQueue = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue();
-        XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+        XAccessibleEventBroadcaster broadcaster =
             UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class,
             xAccessibleComponent);
         if (broadcaster != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Frame.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Frame.java
index 1fdde7acc4..161c206b65 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Frame.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Frame.java
@@ -47,7 +47,7 @@ public class Frame extends java.awt.Frame implements javax.accessibility.Accessi
     private void initialize(XAccessibleComponent xAccessibleComponent) {
         unoAccessibleComponent = xAccessibleComponent;
         eventQueue = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue();
-        XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+        XAccessibleEventBroadcaster broadcaster =
             UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class,
             unoAccessibleComponent);
         if (broadcaster != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Icon.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Icon.java
index 61c20b1949..6f6ee32977 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Icon.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Icon.java
@@ -52,7 +52,7 @@ public class Icon extends Component implements javax.accessibility.Accessible {
         /** Gets the AccessibleText associated with this object presenting text on the display */
         public javax.accessibility.AccessibleIcon[] getAccessibleIcon() {
             try {
-                XAccessibleImage unoAccessibleImage = (XAccessibleImage) UnoRuntime.queryInterface(XAccessibleImage.class,
+                XAccessibleImage unoAccessibleImage = UnoRuntime.queryInterface(XAccessibleImage.class,
                         unoAccessibleComponent);
 
                 if (unoAccessibleImage != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Label.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Label.java
index e9c2632956..52820b613f 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Label.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Label.java
@@ -65,7 +65,7 @@ public class Label extends Component implements javax.accessibility.Accessible {
                 return null;
 
             try {
-                XAccessibleText unoAccessibleText = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class,
+                XAccessibleText unoAccessibleText = UnoRuntime.queryInterface(XAccessibleText.class,
                         unoAccessibleContext);
 
                 if (unoAccessibleText != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/List.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/List.java
index ab6581d95e..7d07aad84d 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/List.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/List.java
@@ -238,7 +238,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
             try {
                 java.util.ArrayList list = new java.util.ArrayList(targetSet.length);
                 for (int i=0; i < targetSet.length; i++) {
-                    XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(
+                    XAccessible xAccessible = UnoRuntime.queryInterface(
                         XAccessible.class, targetSet[i]);
                     if (xAccessible != null) {
                         list.add(new ListItem(xAccessible));
@@ -380,7 +380,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleComponent associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleComponent getAccessibleComponent() {
                 try {
-                    XAccessibleComponent unoAccessibleComponent = (XAccessibleComponent)
+                    XAccessibleComponent unoAccessibleComponent =
                         UnoRuntime.queryInterface(XAccessibleComponent.class, unoAccessibleContext);
                     return (unoAccessibleComponent != null) ?
                         new AccessibleComponentImpl(unoAccessibleComponent) : null;
@@ -392,7 +392,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleAction associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleAction getAccessibleAction() {
                 try {
-                    XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+                    XAccessibleAction unoAccessibleAction =
                         UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleContext);
                     return (unoAccessibleAction != null) ?
                         new AccessibleActionImpl(unoAccessibleAction) : null;
@@ -408,7 +408,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
                     return null;
 
                 try {
-                    XAccessibleText unoAccessibleText = (XAccessibleText)
+                    XAccessibleText unoAccessibleText =
                         UnoRuntime.queryInterface(XAccessibleText.class, unoAccessibleContext);
                     return (unoAccessibleText != null) ?
                         new AccessibleTextImpl(unoAccessibleText) : null;
@@ -420,7 +420,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleValue associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleValue getAccessibleValue() {
                 try {
-                    XAccessibleValue unoAccessibleValue = (XAccessibleValue)
+                    XAccessibleValue unoAccessibleValue =
                         UnoRuntime.queryInterface(XAccessibleValue.class, unoAccessibleContext);
                     return (unoAccessibleValue != null) ?
                         new AccessibleValueImpl(unoAccessibleValue) : null;
@@ -432,7 +432,7 @@ public class List extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleText associated with this object presenting text on the display */
             public javax.accessibility.AccessibleIcon[] getAccessibleIcon() {
                 try {
-                    XAccessibleImage unoAccessibleImage = (XAccessibleImage)
+                    XAccessibleImage unoAccessibleImage =
                         UnoRuntime.queryInterface(XAccessibleImage.class, unoAccessibleContext);
                     if (unoAccessibleImage != null) {
                         javax.accessibility.AccessibleIcon[] icons = { new AccessibleIconImpl(unoAccessibleImage) };
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Menu.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Menu.java
index c3f6bb4c3c..e139283884 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Menu.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Menu.java
@@ -177,7 +177,7 @@ public class Menu extends AbstractButton
     protected class AccessibleMenu extends AccessibleAbstractButton
         implements javax.accessibility.AccessibleSelection {
         protected AccessibleMenu() {
-            unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class,
+            unoAccessibleSelection = UnoRuntime.queryInterface(XAccessibleSelection.class,
                     unoAccessibleContext);
         }
 
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/MenuContainer.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/MenuContainer.java
index 12eb457a6a..bca95e273f 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/MenuContainer.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/MenuContainer.java
@@ -72,7 +72,7 @@ public class MenuContainer extends Container implements javax.accessibility.Acce
     protected class AccessibleMenuContainer extends AccessibleContainer implements javax.accessibility.AccessibleSelection {
 
         protected AccessibleMenuContainer() {
-            unoAccessibleSelection = (XAccessibleSelection) UnoRuntime.queryInterface(XAccessibleSelection.class,
+            unoAccessibleSelection = UnoRuntime.queryInterface(XAccessibleSelection.class,
                     unoAccessibleContext);
         }
 
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Paragraph.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Paragraph.java
index 4aad0766eb..c610162225 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Paragraph.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Paragraph.java
@@ -133,7 +133,7 @@ public class Paragraph extends Container implements javax.accessibility.Accessib
 				return null;
 
 			try {
-				XAccessibleEditableText unoAccessibleText = (XAccessibleEditableText)
+				XAccessibleEditableText unoAccessibleText =
 					UnoRuntime.queryInterface(XAccessibleEditableText.class,
 					unoAccessibleComponent);
 				if (unoAccessibleText != null) {
@@ -149,7 +149,7 @@ public class Paragraph extends Container implements javax.accessibility.Accessib
 		/** Gets the AccessibleAction associated with this object that has a graphical representation */
 		public javax.accessibility.AccessibleAction getAccessibleAction() {
 			try {
-				XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+				XAccessibleAction unoAccessibleAction =
 					UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleComponent);
 				return (unoAccessibleAction != null) ?
 					new AccessibleActionImpl(unoAccessibleAction) : null;
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ScrollBar.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ScrollBar.java
index 4647f012a9..1d57964357 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ScrollBar.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ScrollBar.java
@@ -54,7 +54,7 @@ public class ScrollBar extends Component implements SwingConstants, javax.access
         */
         protected AccessibleScrollBar() {
             super();
-            unoAccessibleAction = (XAccessibleAction) UnoRuntime.queryInterface(
+            unoAccessibleAction = UnoRuntime.queryInterface(
                 XAccessibleAction.class, unoAccessibleContext);
             if (unoAccessibleAction != null) {
                 actionCount = unoAccessibleAction.getAccessibleActionCount();
@@ -73,7 +73,7 @@ public class ScrollBar extends Component implements SwingConstants, javax.access
         /** Gets the AccessibleValue associated with this object that has a graphical representation */
         public javax.accessibility.AccessibleValue getAccessibleValue() {
             try {
-                XAccessibleValue unoAccessibleValue = (XAccessibleValue)
+                XAccessibleValue unoAccessibleValue =
                     UnoRuntime.queryInterface(XAccessibleValue.class, unoAccessibleContext);
                 return (unoAccessibleValue != null) ?
                     new AccessibleValueImpl(unoAccessibleValue) : null;
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Table.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Table.java
index 76df466026..b8f592bbb2 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Table.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Table.java
@@ -135,7 +135,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
         protected XAccessibleTable unoAccessibleTable;
 
         public AccessibleTable() {
-            unoAccessibleTable = (XAccessibleTable) UnoRuntime.queryInterface(XAccessibleTable.class, unoAccessibleContext);
+            unoAccessibleTable = UnoRuntime.queryInterface(XAccessibleTable.class, unoAccessibleContext);
         }
 
         /** Gets the role of this object */
@@ -464,7 +464,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
             try {
                 java.util.ArrayList list = new java.util.ArrayList(targetSet.length);
                 for (int i=0; i < targetSet.length; i++) {
-                    XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(
+                    XAccessible xAccessible = UnoRuntime.queryInterface(
                         XAccessible.class, targetSet[i]);
                     if (xAccessible != null) {
                         list.add(new TableCell(xAccessible));
@@ -655,7 +655,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
             /** Gets the AccessibleComponent associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleComponent getAccessibleComponent() {
                 try {
-                    XAccessibleComponent unoAccessibleComponent = (XAccessibleComponent)
+                    XAccessibleComponent unoAccessibleComponent =
                         UnoRuntime.queryInterface(XAccessibleComponent.class, unoAccessibleContext);
                     return (unoAccessibleComponent != null) ?
                         new AccessibleComponentImpl(unoAccessibleComponent) : null;
@@ -667,7 +667,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
             /** Gets the AccessibleAction associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleAction getAccessibleAction() {
                 try {
-                    XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+                    XAccessibleAction unoAccessibleAction =
                         UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleContext);
                     return (unoAccessibleAction != null) ?
                         new AccessibleActionImpl(unoAccessibleAction) : null;
@@ -683,7 +683,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
                     return null;
 
                 try {
-                    XAccessibleText unoAccessibleText = (XAccessibleText)
+                    XAccessibleText unoAccessibleText =
                         UnoRuntime.queryInterface(XAccessibleText.class, unoAccessibleContext);
                     return (unoAccessibleText != null) ?
                         new AccessibleTextImpl(unoAccessibleText) : null;
@@ -695,7 +695,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
             /** Gets the AccessibleValue associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleValue getAccessibleValue() {
                 try {
-                    XAccessibleValue unoAccessibleValue = (XAccessibleValue)
+                    XAccessibleValue unoAccessibleValue =
                         UnoRuntime.queryInterface(XAccessibleValue.class, unoAccessibleContext);
                     return (unoAccessibleValue != null) ?
                         new AccessibleValueImpl(unoAccessibleValue) : null;
@@ -707,7 +707,7 @@ public class Table extends DescendantManager implements javax.accessibility.Acce
             /** Gets the AccessibleText associated with this object presenting text on the display */
             public javax.accessibility.AccessibleIcon[] getAccessibleIcon() {
                 try {
-                    XAccessibleImage unoAccessibleImage = (XAccessibleImage)
+                    XAccessibleImage unoAccessibleImage =
                         UnoRuntime.queryInterface(XAccessibleImage.class, unoAccessibleContext);
                     if (unoAccessibleImage != null) {
                         javax.accessibility.AccessibleIcon[] icons = { new AccessibleIconImpl(unoAccessibleImage) };
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/TextComponent.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/TextComponent.java
index 4034b3db0a..4e8c0d02d2 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/TextComponent.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/TextComponent.java
@@ -91,7 +91,7 @@ public class TextComponent extends Component implements javax.accessibility.Acce
                 return null;
 
             try {
-                XAccessibleText unoAccessibleText = (XAccessibleText)
+                XAccessibleText unoAccessibleText =
                     UnoRuntime.queryInterface(XAccessibleText.class,unoAccessibleComponent);
                 if (unoAccessibleText != null) {
                     return new AccessibleTextImpl(unoAccessibleText);
@@ -106,7 +106,7 @@ public class TextComponent extends Component implements javax.accessibility.Acce
         /** Gets the AccessibleEditableText associated with this object presenting text on the display */
         public javax.accessibility.AccessibleEditableText getAccessibleEditableText() {
             try {
-                XAccessibleEditableText unoAccessibleText = (XAccessibleEditableText)
+                XAccessibleEditableText unoAccessibleText =
                     UnoRuntime.queryInterface(XAccessibleEditableText.class,unoAccessibleComponent);
                 if (unoAccessibleText != null) {
                     return new AccessibleEditableTextImpl(unoAccessibleText);
@@ -121,7 +121,7 @@ public class TextComponent extends Component implements javax.accessibility.Acce
         /** Gets the AccessibleAction associated with this object that has a graphical representation */
         public javax.accessibility.AccessibleAction getAccessibleAction() {
             try {
-                XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+                XAccessibleAction unoAccessibleAction =
                     UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleComponent);
                 return (unoAccessibleAction != null) ?
                     new AccessibleActionImpl(unoAccessibleAction) : null;
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToggleButton.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToggleButton.java
index 171eb4e44b..225cf1b58b 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToggleButton.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToggleButton.java
@@ -45,7 +45,7 @@ class ToggleButton extends AbstractButton implements javax.accessibility.Accessi
         /** Gets the AccessibleValue associated with this object that has a graphical representation */
         public javax.accessibility.AccessibleValue getAccessibleValue() {
             try {
-                XAccessibleValue unoAccessibleValue = (XAccessibleValue) UnoRuntime.queryInterface(XAccessibleValue.class,
+                XAccessibleValue unoAccessibleValue = UnoRuntime.queryInterface(XAccessibleValue.class,
                         unoAccessibleContext);
 
                 return (unoAccessibleValue != null)
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToolTip.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToolTip.java
index a4c8347cbf..c7f65d2028 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToolTip.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/ToolTip.java
@@ -59,7 +59,7 @@ public class ToolTip extends Component implements javax.accessibility.Accessible
                 return null;
 
             try {
-                XAccessibleText unoAccessibleText = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class,
+                XAccessibleText unoAccessibleText = UnoRuntime.queryInterface(XAccessibleText.class,
                         unoAccessibleComponent);
 
                 if (unoAccessibleText != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Tree.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Tree.java
index a8b9652955..4c24e272b0 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Tree.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Tree.java
@@ -141,7 +141,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
         protected XAccessibleTable unoAccessibleTable;
 
         public AccessibleTree() {
-            unoAccessibleTable = (XAccessibleTable) UnoRuntime.queryInterface(XAccessibleTable.class, unoAccessibleContext);
+            unoAccessibleTable = UnoRuntime.queryInterface(XAccessibleTable.class, unoAccessibleContext);
         }
 
         /*
@@ -474,7 +474,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
             try {
                 java.util.ArrayList list = new java.util.ArrayList(targetSet.length);
                 for (int i=0; i < targetSet.length; i++) {
-                    XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(
+                    XAccessible xAccessible = UnoRuntime.queryInterface(
                         XAccessible.class, targetSet[i]);
                     if (xAccessible != null) {
                         list.add(new TreeItem(xAccessible));
@@ -515,7 +515,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
 
             public AccessibleTreeItem(XAccessibleContext xAccessibleContext) {
                 unoAccessibleContext = xAccessibleContext;
-                unoAccessibleSelection = (XAccessibleSelection)
+                unoAccessibleSelection =
                     UnoRuntime.queryInterface(XAccessibleSelection.class, xAccessibleContext);
             }
 
@@ -619,7 +619,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleComponent associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleComponent getAccessibleComponent() {
                 try {
-                    XAccessibleComponent unoAccessibleComponent = (XAccessibleComponent)
+                    XAccessibleComponent unoAccessibleComponent =
                         UnoRuntime.queryInterface(XAccessibleComponent.class, unoAccessibleContext);
                     return (unoAccessibleComponent != null) ?
                         new AccessibleComponentImpl(unoAccessibleComponent) : null;
@@ -636,7 +636,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleAction associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleAction getAccessibleAction() {
                 try {
-                    XAccessibleAction unoAccessibleAction = (XAccessibleAction)
+                    XAccessibleAction unoAccessibleAction =
                         UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleContext);
                     return (unoAccessibleAction != null) ?
                         new AccessibleActionImpl(unoAccessibleAction) : null;
@@ -652,7 +652,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
                     return null;
 
                 try {
-                    XAccessibleText unoAccessibleText = (XAccessibleText)
+                    XAccessibleText unoAccessibleText =
                         UnoRuntime.queryInterface(XAccessibleText.class, unoAccessibleContext);
                     return (unoAccessibleText != null) ?
                         new AccessibleTextImpl(unoAccessibleText) : null;
@@ -664,7 +664,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleValue associated with this object that has a graphical representation */
             public javax.accessibility.AccessibleValue getAccessibleValue() {
                 try {
-                    XAccessibleValue unoAccessibleValue = (XAccessibleValue)
+                    XAccessibleValue unoAccessibleValue =
                         UnoRuntime.queryInterface(XAccessibleValue.class, unoAccessibleContext);
                     return (unoAccessibleValue != null) ?
                         new AccessibleValueImpl(unoAccessibleValue) : null;
@@ -676,7 +676,7 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
             /** Gets the AccessibleText associated with this object presenting text on the display */
             public javax.accessibility.AccessibleIcon[] getAccessibleIcon() {
                 try {
-                    XAccessibleImage unoAccessibleImage = (XAccessibleImage)
+                    XAccessibleImage unoAccessibleImage =
                         UnoRuntime.queryInterface(XAccessibleImage.class, unoAccessibleContext);
                     if (unoAccessibleImage != null) {
                         javax.accessibility.AccessibleIcon[] icons = { new AccessibleIconImpl(unoAccessibleImage) };
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Window.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Window.java
index 8ad3ad055e..7ad623293f 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Window.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/Window.java
@@ -42,7 +42,7 @@ public class Window extends java.awt.Window implements javax.accessibility.Acces
     private void initialize(XAccessibleComponent xAccessibleComponent) {
         unoAccessibleComponent = xAccessibleComponent;
         eventQueue = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue();
-        XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+        XAccessibleEventBroadcaster broadcaster =
             UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class,
             unoAccessibleComponent);
         if (broadcaster != null) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleEventLog.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleEventLog.java
index 645d1c1524..e5009ab708 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleEventLog.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleEventLog.java
@@ -47,7 +47,7 @@ public class XAccessibleEventLog implements XAccessibleEventListener {
     }
 
     public static void addEventListener(XAccessibleContext xac, java.awt.Component c) {
-        XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster)
+        XAccessibleEventBroadcaster broadcaster =
             UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, xac);
         if (broadcaster != null) {
             broadcaster.addEventListener(XAccessibleEventLog.get());
@@ -142,7 +142,7 @@ public class XAccessibleEventLog implements XAccessibleEventListener {
     }
 
     protected static void logMessage(Object o, String s) {
-        XAccessibleContext xac = (XAccessibleContext) UnoRuntime.queryInterface(XAccessibleContext.class, o);
+        XAccessibleContext xac = UnoRuntime.queryInterface(XAccessibleContext.class, o);
         if( xac != null ) {
             String oid = UnoRuntime.generateOid(xac);
             synchronized (proxyList) {
diff --git a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleTextLog.java b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleTextLog.java
index 3227ef03fd..1b4f0c5694 100644
--- a/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleTextLog.java
+++ b/main/accessibility/java/java_uno_accessbridge/src/main/java/org/openoffice/java/accessibility/logging/XAccessibleTextLog.java
@@ -43,7 +43,7 @@ public class XAccessibleTextLog
     private void setName(
         com.sun.star.accessibility.XAccessibleText xAccessibleText) {
         try {
-            com.sun.star.accessibility.XAccessibleContext unoAccessibleContext = (com.sun.star.accessibility.XAccessibleContext) com.sun.star.uno.UnoRuntime.queryInterface(com.sun.star.accessibility.XAccessibleContext.class,
+            com.sun.star.accessibility.XAccessibleContext unoAccessibleContext = com.sun.star.uno.UnoRuntime.queryInterface(com.sun.star.accessibility.XAccessibleContext.class,
                     xAccessibleText);
 
             if (unoAccessibleContext != null) {
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java b/main/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java
index 5fdda61afc..c8c78d826f 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java
@@ -621,7 +621,7 @@ public class AccessibilityWorkBench
     // XEventListener
     public void disposing (EventObject aSourceObj)
     {
-		XFrame xFrame = (XFrame)UnoRuntime.queryInterface(
+		XFrame xFrame = UnoRuntime.queryInterface(
 		    XFrame.class, aSourceObj.Source);
 
 		if( xFrame != null )
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java b/main/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java
index d7b736c637..4a113ddbb1 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java
@@ -89,7 +89,7 @@ class CanvasShape implements XAccessibleEventListener
     {
         if (maNode instanceof XAccessible) {
             mxContext = ((XAccessible) maNode).getAccessibleContext();
-            mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface(
+            mxComponent = UnoRuntime.queryInterface(
                 XAccessibleComponent.class, mxContext);
         }
 
@@ -257,7 +257,7 @@ class CanvasShape implements XAccessibleEventListener
     {
         XAccessibleText xText = null;
         // get XAccessibleText
-        xText = (XAccessibleText)UnoRuntime.queryInterface(
+        xText = UnoRuntime.queryInterface(
             XAccessibleText.class, mxContext);
 
         // Draw every character in the text string.
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/tree/ToolkitNode.java b/main/accessibility/workben/org/openoffice/accessibility/awb/tree/ToolkitNode.java
index d563139ec6..503b78003d 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/tree/ToolkitNode.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/tree/ToolkitNode.java
@@ -110,7 +110,7 @@ public class ToolkitNode extends DefaultMutableTreeNode
 
     /** Returns the XAccessible interface corresponding to the toplevel window */
     private AccessibilityNode getTopWindowNode(XTopWindow w) {
-        XAccessible xAccessible = (XAccessible)
+        XAccessible xAccessible =
             UnoRuntime.queryInterface(XAccessible.class, w);
         if (xAccessible != null) {
             // XTopWindows usually have an accessible parent, which is the
@@ -144,7 +144,7 @@ public class ToolkitNode extends DefaultMutableTreeNode
     }
 
     public void windowClosed(com.sun.star.lang.EventObject eventObject) {
-        XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(
+        XAccessible xAccessible = UnoRuntime.queryInterface(
             XAccessible.class, eventObject.Source);
         if (xAccessible != null) {
             AccessibilityNode node = treeModel.findNode(xAccessible);
@@ -188,7 +188,7 @@ public class ToolkitNode extends DefaultMutableTreeNode
     }
 
     public void windowOpened(com.sun.star.lang.EventObject eventObject) {
-        final XTopWindow xTopWindow = (XTopWindow) UnoRuntime.queryInterface(
+        final XTopWindow xTopWindow = UnoRuntime.queryInterface(
             XTopWindow.class, eventObject.Source);
         if (xTopWindow != null) {
             final ToolkitNode tn = this;
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java
index ddf634f332..94aa1d3a59 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java
@@ -76,7 +76,7 @@ public class ComponentView
 
     public void SetObject (XAccessibleContext xContext)
     {
-        mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface(
+        mxComponent = UnoRuntime.queryInterface(
             XAccessibleComponent.class, xContext);
         super.SetObject (xContext);
     }
@@ -132,7 +132,7 @@ public class ComponentView
 					"Bounding box conflicts with size";
 			XAccessible xParent = mxContext.getAccessibleParent();
 			XAccessibleComponent xParentComponent =
-				(XAccessibleComponent)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XAccessibleComponent.class, xParent);
 			if (xParentComponent == null)
 			{
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java
index 60d60e7122..d85c10affa 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java
@@ -46,7 +46,7 @@ public class EditableTextView
         XAccessibleContext xContext)
     {
         XAccessibleEditableText xEditableText =
-            (XAccessibleEditableText)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 XAccessibleEditableText.class, xContext);
         if (xEditableText != null)
             return new EditableTextView (aContainer);
@@ -82,7 +82,7 @@ public class EditableTextView
     */
     public void SetObject (XAccessibleContext xObject)
     {
-        mxEditableText = (XAccessibleEditableText)UnoRuntime.queryInterface(
+        mxEditableText = UnoRuntime.queryInterface(
             XAccessibleEditableText.class, xObject);
         super.SetObject (xObject);
     }
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java
index 61b86343d0..d7fad3c4c7 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java
@@ -51,7 +51,7 @@ public class FocusView
         ObjectViewContainer aContainer,
         XAccessibleContext xContext)
     {
-        XAccessibleComponent xComponent = (XAccessibleComponent)UnoRuntime.queryInterface(
+        XAccessibleComponent xComponent = UnoRuntime.queryInterface(
                 XAccessibleComponent.class, xContext);
         if (xComponent != null)
             return new FocusView (aContainer);
@@ -88,7 +88,7 @@ public class FocusView
     */
     public void SetObject (XAccessibleContext xObject)
     {
-        mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface(
+        mxComponent = UnoRuntime.queryInterface(
                 XAccessibleComponent.class, xObject);
         super.SetObject (xObject);
     }
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java
index 7b13be06e6..9e2070e5aa 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java
@@ -70,7 +70,7 @@ class SelectionView
         ObjectViewContainer aContainer,
         XAccessibleContext xContext)
     {
-        XAccessibleSelection xSelection = (XAccessibleSelection)UnoRuntime.queryInterface(
+        XAccessibleSelection xSelection = UnoRuntime.queryInterface(
                 XAccessibleSelection.class, xContext);
         if (xSelection != null)
             return new SelectionView(aContainer);
@@ -147,7 +147,7 @@ class SelectionView
 
     public void SetObject (XAccessibleContext xContext)
     {
-        mxSelection = (XAccessibleSelection)UnoRuntime.queryInterface(
+        mxSelection = UnoRuntime.queryInterface(
             XAccessibleSelection.class, xContext);
         super.SetObject (xContext);
     }
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/ServiceInterfaceView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/ServiceInterfaceView.java
index c18549986f..8af95e8a84 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/ServiceInterfaceView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/ServiceInterfaceView.java
@@ -109,7 +109,7 @@ public class ServiceInterfaceView
 
     private void CreateImplementationNameTree ()
     {
-        XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo xServiceInfo = UnoRuntime.queryInterface(
             XServiceInfo.class, mxContext);
         maImplementationNameRoot.removeAllChildren();
         if (xServiceInfo != null)
@@ -124,7 +124,7 @@ public class ServiceInterfaceView
 
     private void CreateServiceTree ()
     {
-        XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo xServiceInfo = UnoRuntime.queryInterface(
             XServiceInfo.class, mxContext);
         maServiceRoot.removeAllChildren();
         if (xServiceInfo != null)
@@ -142,7 +142,7 @@ public class ServiceInterfaceView
 
     private void CreateInterfaceTree ()
     {
-        XTypeProvider xTypeProvider = (XTypeProvider)UnoRuntime.queryInterface(
+        XTypeProvider xTypeProvider = UnoRuntime.queryInterface(
             XTypeProvider.class, mxContext);
         maInterfaceRoot.removeAllChildren();
         if (xTypeProvider != null)
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java
index 04b5f89039..9b78f9109e 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java
@@ -71,7 +71,7 @@ public class TableView
 
     public void SetObject (XAccessibleContext xContext)
     {
-        mxTable = (XAccessibleTable)UnoRuntime.queryInterface(
+        mxTable = UnoRuntime.queryInterface(
             XAccessibleTable.class, xContext);
         super.SetObject (xContext);
     }
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/TextView.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/TextView.java
index 911f807a44..209fda0285 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/TextView.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/TextView.java
@@ -74,7 +74,7 @@ public class TextView
         ObjectViewContainer aContainer,
         XAccessibleContext xContext)
     {
-        XAccessibleText xText = (XAccessibleText)UnoRuntime.queryInterface(
+        XAccessibleText xText = UnoRuntime.queryInterface(
                 XAccessibleText.class, xContext);
         if (xText != null)
             return new TextView (aContainer);
@@ -130,7 +130,7 @@ public class TextView
     */
     public void SetObject (XAccessibleContext xObject)
     {
-        mxText = (XAccessibleText)UnoRuntime.queryInterface(
+        mxText = UnoRuntime.queryInterface(
             XAccessibleText.class, xObject);
         maCaretSpinnerModel = new CaretSpinnerModel(mxText);
         maCaretPositionSpinner.setModel (maCaretSpinnerModel);
@@ -178,7 +178,7 @@ public class TextView
             maCaretPositionSpinner.setValue (new Integer (mxText.getCaretPosition()));
 
             // Multi line methods.
-            XAccessibleMultiLineText xMultiText = (XAccessibleMultiLineText)
+            XAccessibleMultiLineText xMultiText =
                 UnoRuntime.queryInterface( XAccessibleMultiLineText.class, mxText );
 
             if( null != xMultiText ) {
diff --git a/main/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextActionDialog.java b/main/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextActionDialog.java
index ef53977385..7c1452b1c1 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextActionDialog.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextActionDialog.java
@@ -86,7 +86,7 @@ class TextActionDialog
         maText.setEditable (false);
         aContent.add (maText, BorderLayout.CENTER);
 
-        XAccessibleText xText = (XAccessibleText)UnoRuntime.queryInterface(
+        XAccessibleText xText = UnoRuntime.queryInterface(
             XAccessibleText.class, mxContext);
         String sText = xText.getText();
         maText.setText (sText);
@@ -154,13 +154,13 @@ class TextActionDialog
         try
         {
             XAccessibleText xText =
-                (XAccessibleText)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XAccessibleText.class, mxContext);
             if (xText != null)
                 bSuccess = bSuccess && TextAction (xText);
 
             XAccessibleEditableText xEditableText =
-                (XAccessibleEditableText)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XAccessibleEditableText.class, mxContext);
             if (xEditableText != null)
                 bSuccess = bSuccess && EditableTextAction (xEditableText);
diff --git a/main/accessibility/workben/org/openoffice/accessibility/misc/InformationWriter.java b/main/accessibility/workben/org/openoffice/accessibility/misc/InformationWriter.java
index 2dd25c65f5..b5b9b718aa 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/misc/InformationWriter.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/misc/InformationWriter.java
@@ -95,7 +95,7 @@ public class InformationWriter
     {
         try
         {
-            XPropertySet xPropertySet =  (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xPropertySet =  UnoRuntime.queryInterface(
                 XPropertySet.class, xObject);
             maOut.println (prefix +
                 xPropertySet.getPropertyValue (name));
@@ -113,24 +113,24 @@ public class InformationWriter
     {
         try
         {
-            XIndexAccess xShapeList = (XIndexAccess) UnoRuntime.queryInterface(
+            XIndexAccess xShapeList = UnoRuntime.queryInterface(
                 XIndexAccess.class, xPage);
 
             maOut.println ("There are " + xShapeList.getCount()
                 + " shapes");
             for (int i=0; i<xShapeList.getCount(); i++)
             {
-                XShape xShape = (XShape) UnoRuntime.queryInterface(
+                XShape xShape = UnoRuntime.queryInterface(
                     XShape.class, xShapeList.getByIndex (i));
 
                 XShapeDescriptor xShapeDescriptor =
-                    (XShapeDescriptor) UnoRuntime.queryInterface(
+                    UnoRuntime.queryInterface(
                         XShapeDescriptor.class, xShape);
                 String sName = xShapeDescriptor.getShapeType ();
                 maOut.println ("   shape " + i + " : " + sName);
 
                 XPropertySet xPropertySet =
-                    (XPropertySet) UnoRuntime.queryInterface(
+                    UnoRuntime.queryInterface(
                         XPropertySet.class, xShape);
                 Integer nZOrder =
                     (Integer) xPropertySet.getPropertyValue ("ZOrder");
@@ -154,7 +154,7 @@ public class InformationWriter
         try
         {
             maOut.println ("Services:");
-            XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface (
+            XMultiServiceFactory xMSF = UnoRuntime.queryInterface (
                 XMultiServiceFactory.class,
                 xObject
                 );
@@ -184,7 +184,7 @@ public class InformationWriter
         {
             System.out.println ("Info:");
             // Use interface XServiceName to retrieve name of (main) service.
-            XServiceName xSN = (XServiceName) UnoRuntime.queryInterface (
+            XServiceName xSN = UnoRuntime.queryInterface (
                 XServiceName.class, xObject);
             if (xSN == null)
                 maOut.println ("    interface XServiceName not supported");
@@ -195,7 +195,7 @@ public class InformationWriter
 
             // Use interface XServiceInfo to retrieve information about
             // supported services.
-            XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface (
+            XServiceInfo xSI = UnoRuntime.queryInterface (
                 XServiceInfo.class, xObject);
             if (xSI == null)
                 maOut.println ("    interface XServiceInfo not supported");
@@ -223,7 +223,7 @@ public class InformationWriter
             maOut.println ("Interfaces:");
             // Use interface XTypeProvider to retrieve a list of supported
             // interfaces.
-            XTypeProvider xTP = (XTypeProvider) UnoRuntime.queryInterface (
+            XTypeProvider xTP = UnoRuntime.queryInterface (
                 XTypeProvider.class, xObject);
             if (xTP == null)
                 maOut.println ("    interface XTypeProvider not supported");
@@ -259,12 +259,12 @@ public class InformationWriter
             //  Get XAccessibleContext object if given object does not
             //  already support this interface.
             XAccessibleContext xContext
-                = (XAccessibleContext) UnoRuntime.queryInterface (
+                = UnoRuntime.queryInterface (
                     XAccessibleContext.class, xObject);
             if (xContext == null)
             {
                 XAccessible xAccessible
-                    = (XAccessible) UnoRuntime.queryInterface (
+                    = UnoRuntime.queryInterface (
                         XAccessible.class, xObject);
                 if (xAccessible == null)
                 {
@@ -319,7 +319,7 @@ public class InformationWriter
                 if (xStateSet != null)
                 {
                     XIndexAccess xStates =
-                        (XIndexAccess) UnoRuntime.queryInterface (
+                        UnoRuntime.queryInterface (
                             XIndexAccess.class, xStateSet);
                     maOut.print (xStates.getCount() + " (");
                     for (int i=0; i<xStates.getCount(); i++)
@@ -359,7 +359,7 @@ public class InformationWriter
         try
         {
             XAccessibleComponent xComponent =
-                (XAccessibleComponent) UnoRuntime.queryInterface (
+                UnoRuntime.queryInterface (
                     XAccessibleComponent.class, xObject);
 
             //  Print information about the accessible context.
@@ -424,7 +424,7 @@ public class InformationWriter
 
     public void showProperties (XInterface xObject)
     {
-        XPropertySet xSet = (XPropertySet) UnoRuntime.queryInterface (
+        XPropertySet xSet = UnoRuntime.queryInterface (
             XPropertySet.class, xObject);
         if (xSet == null)
             maOut.println ("object does not support XPropertySet");
diff --git a/main/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java b/main/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java
index 77a8091cde..83a7f34f53 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java
@@ -109,14 +109,14 @@ public class OfficeConnection
             XMultiServiceFactory aLocalServiceManager =
                 Bootstrap.createSimpleServiceManager();
             XUnoUrlResolver aURLResolver =
-				(XUnoUrlResolver) UnoRuntime.queryInterface (
+				UnoRuntime.queryInterface (
 					XUnoUrlResolver.class,
 					aLocalServiceManager.createInstance (
 						"com.sun.star.bridge.UnoUrlResolver")
 					);
 
             maServiceManager =
-				(XMultiServiceFactory) UnoRuntime.queryInterface (
+				UnoRuntime.queryInterface (
                     XMultiServiceFactory.class,
                     aURLResolver.resolve (sConnectString)
                     );
diff --git a/main/accessibility/workben/org/openoffice/accessibility/misc/SimpleOffice.java b/main/accessibility/workben/org/openoffice/accessibility/misc/SimpleOffice.java
index 968ab09eee..8e9f4c061e 100644
--- a/main/accessibility/workben/org/openoffice/accessibility/misc/SimpleOffice.java
+++ b/main/accessibility/workben/org/openoffice/accessibility/misc/SimpleOffice.java
@@ -92,7 +92,7 @@ public class SimpleOffice
         {
             //  Load the document from the specified URL.
             XComponentLoader xLoader =
-                (XComponentLoader)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XComponentLoader.class, mxDesktop);
 
             XComponent xComponent = xLoader.loadComponentFromURL (
@@ -102,7 +102,7 @@ public class SimpleOffice
                 new PropertyValue[0]
                 );
 
-            xModel = (XModel) UnoRuntime.queryInterface(
+            xModel = UnoRuntime.queryInterface(
                 XModel.class, xComponent);
         }
         catch (java.lang.NullPointerException e)
@@ -127,13 +127,13 @@ public class SimpleOffice
         try
         {
             XTasksSupplier xTasksSupplier =
-                (XTasksSupplier) UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XTasksSupplier.class, mxDesktop);
             XEnumerationAccess xEA = xTasksSupplier.getTasks();
             XEnumeration xE = xEA.createEnumeration();
             while (xE.hasMoreElements())
             {
-                XTask xTask = (XTask) UnoRuntime.queryInterface(
+                XTask xTask = UnoRuntime.queryInterface(
                     XTask.class, xE.nextElement());
                 MessageArea.print (xTask.getName());
             }
@@ -149,7 +149,7 @@ public class SimpleOffice
 
     public XModel GetModel (XDrawView xView)
     {
-        XController xController = (XController) UnoRuntime.queryInterface(
+        XController xController = UnoRuntime.queryInterface(
             XController.class, xView);
         if (xController != null)
             return xController.getModel();
@@ -181,7 +181,7 @@ public class SimpleOffice
                 MessageArea.println ("Connected successfully.");
 
             //  Create a new desktop.
-            mxDesktop = (XDesktop) UnoRuntime.queryInterface(
+            mxDesktop = UnoRuntime.queryInterface(
                 XDesktop.class,
                 xMSF.createInstance ("com.sun.star.frame.Desktop")
                 );
@@ -210,7 +210,7 @@ public class SimpleOffice
 						OfficeConnection.Instance().GetServiceManager ();
                 if (xMSF != null)
                 {
-                    xToolkit = (XExtendedToolkit) UnoRuntime.queryInterface(
+                    xToolkit = UnoRuntime.queryInterface(
                         XExtendedToolkit.class,
                         xMSF.createInstance ("stardiv.Toolkit.VCLXToolkit")
                         );
@@ -232,7 +232,7 @@ public class SimpleOffice
         XAccessible xAccessible = null;
         try
         {
-            xAccessible = (XAccessible) UnoRuntime.queryInterface(
+            xAccessible = UnoRuntime.queryInterface(
                 XAccessible.class, xObject);
         }
         catch (Exception e)
@@ -287,7 +287,7 @@ public class SimpleOffice
     */
     public XWindow GetCurrentWindow ()
     {
-        return GetCurrentWindow ((XModel) UnoRuntime.queryInterface(
+        return GetCurrentWindow (UnoRuntime.queryInterface(
                 XModel.class, GetDesktop()));
     }
 
@@ -326,7 +326,7 @@ public class SimpleOffice
     public XDrawPage GetCurrentDrawPage ()
     {
         return GetCurrentDrawPage (
-			(XDrawView) UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
                 XDrawView.class,
 				GetCurrentView()));
     }
@@ -382,7 +382,7 @@ public class SimpleOffice
             if (xController == null)
                 MessageArea.println ("can't get controller to retrieve current view");
 
-            xView = (XDrawView) UnoRuntime.queryInterface(
+            xView = UnoRuntime.queryInterface(
                 XDrawView.class, xController);
             if (xView == null)
                 MessageArea.println ("could not cast controller into view");
@@ -401,7 +401,7 @@ public class SimpleOffice
     //  Return the accessible object of the document window.
     public static XAccessible GetAccessibleDocumentWindow (XDrawPage xPage)
     {
-        XIndexAccess xShapeList = (XIndexAccess) UnoRuntime.queryInterface(
+        XIndexAccess xShapeList = UnoRuntime.queryInterface(
             XIndexAccess.class, xPage);
         if (xShapeList.getCount() > 0)
         {
@@ -411,11 +411,11 @@ public class SimpleOffice
             // the object directly is implemented.
             XShape xShape = null;
             try{
-                xShape = (XShape) UnoRuntime.queryInterface(
+                xShape = UnoRuntime.queryInterface(
                     XShape.class, xShapeList.getByIndex (0));
             } catch (Exception e)
             {}
-            XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface (
+            XAccessible xAccessible = UnoRuntime.queryInterface (
                 XAccessible.class, xShape);
             return xAccessible;
         }
diff --git a/main/avmedia/source/java/FrameGrabber.java b/main/avmedia/source/java/FrameGrabber.java
index c9b0ce8ad2..9725f95b01 100644
--- a/main/avmedia/source/java/FrameGrabber.java
+++ b/main/avmedia/source/java/FrameGrabber.java
@@ -96,7 +96,7 @@ public class FrameGrabber implements com.sun.star.lang.XServiceInfo,
                         javax.imageio.ImageIO.write( (java.awt.image.BufferedImage) aImage, "png", aTempFile );
 
                         com.sun.star.graphic.XGraphicProvider aProvider =
-                            (com.sun.star.graphic.XGraphicProvider) UnoRuntime.queryInterface(
+                            UnoRuntime.queryInterface(
                                 com.sun.star.graphic.XGraphicProvider.class,
                                 maFactory.createInstance("com.sun.star.graphic.GraphicProvider") );
 
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeConnection.java b/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeConnection.java
index 13acef31c1..067059591a 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeConnection.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeConnection.java
@@ -226,7 +226,7 @@ public class LocalOfficeConnection
 
 			// query for the XUnoUrlResolver interface
 			XUnoUrlResolver xUrlResolver =
-				(XUnoUrlResolver) UnoRuntime.queryInterface( XUnoUrlResolver.class, urlResolver );
+				UnoRuntime.queryInterface( XUnoUrlResolver.class, urlResolver );
 
 			// try to connect to soffice
 			Object aInitialObject = null;
@@ -266,10 +266,10 @@ public class LocalOfficeConnection
 			// XComponentContext
 			if( null != aInitialObject )
 			{
-				XPropertySet xPropertySet = (XPropertySet)
+				XPropertySet xPropertySet =
 					UnoRuntime.queryInterface( XPropertySet.class, aInitialObject);
 						Object xContext = xPropertySet.getPropertyValue("DefaultContext");
-						XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(
+						XComponentContext xComponentContext = UnoRuntime.queryInterface(
 					XComponentContext.class, xContext);
 				return xComponentContext;
 			}
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeWindow.java b/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeWindow.java
index 3a151ca69b..998aa067e8 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeWindow.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/beans/LocalOfficeWindow.java
@@ -114,10 +114,10 @@ public class LocalOfficeWindow
 			{
 				compfactory     = mConnection.getComponentContext().getServiceManager();
 				XMultiServiceFactory    factory;
-				factory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+				factory = UnoRuntime.queryInterface(
 						XMultiServiceFactory.class, compfactory);
 				Object          object = factory.createInstance( "com.sun.star.awt.Toolkit");
-				return (XToolkit)UnoRuntime.queryInterface(XToolkit.class, object);
+				return UnoRuntime.queryInterface(XToolkit.class, object);
 			}
 			else
 				return null;
@@ -129,13 +129,13 @@ public class LocalOfficeWindow
 		if ( !bPeer )
 		{
 			// set real parent
-			XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
+			XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
 			xVclWindowPeer.setProperty( "PluginParent", getNativeWindow() );
 			bPeer = true;
 
 		       	// show document window
-			XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+			XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( true );
 		}
 	}
@@ -146,11 +146,11 @@ public class LocalOfficeWindow
 		if ( bPeer )
 		{
 		       	// hide document window
-			XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+			XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( false );
 
 			// set null parent
-			XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
+			XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
 			xVclWindowPeer.setProperty( "PluginParent", 0L );
 			bPeer = false;
@@ -233,7 +233,7 @@ public class LocalOfficeWindow
 			addComponentListener( new ComponentEventHandler() );
 
 			// set initial visibility
-						XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+						XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( bPeer );
 		}
 		catch (com.sun.star.uno.Exception exp) {
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Controller.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Controller.java
index a82bb167c5..f92728355e 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Controller.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Controller.java
@@ -41,7 +41,7 @@ public class Controller
 	{
 		super( xController );
 		this.xController = xController;
-		xDispatchProvider = (com.sun.star.frame.XDispatchProvider)
+		xDispatchProvider =
 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
 				xController );
 	}
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Frame.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Frame.java
index 430d8dfb46..0d4abcc9de 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Frame.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Frame.java
@@ -44,10 +44,10 @@ public class Frame
 	{
 		super( xFrame );
 		this.xFrame = xFrame;
-		xDispatchProvider = (com.sun.star.frame.XDispatchProvider)
+		xDispatchProvider =
 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
 				xFrame );
-		xDispatchProviderInterception = (com.sun.star.frame.XDispatchProviderInterception)
+		xDispatchProviderInterception =
 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProviderInterception.class,
 				xFrame );
 	}
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeConnection.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeConnection.java
index aaaf54e494..16eba0f28a 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeConnection.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeConnection.java
@@ -264,7 +264,7 @@ public class LocalOfficeConnection
         // to the office including the bridge needs to be terminated.
         if (mBridge != null)
         {
-            XComponent comp = (XComponent)UnoRuntime.queryInterface(
+            XComponent comp = UnoRuntime.queryInterface(
                     XComponent.class, mBridge);
             if (comp != null)
                comp.dispose();
@@ -350,10 +350,10 @@ public class LocalOfficeConnection
 			// XComponentContext
 			if( null != aInitialObject )
 			{
-				XPropertySet xPropertySet = (XPropertySet)
+				XPropertySet xPropertySet =
 					UnoRuntime.queryInterface( XPropertySet.class, aInitialObject);
             			Object xContext = xPropertySet.getPropertyValue("DefaultContext");
-            			XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(
+            			XComponentContext xComponentContext = UnoRuntime.queryInterface(
 					XComponentContext.class, xContext);
 				return xComponentContext;
 			}
@@ -432,7 +432,7 @@ public class LocalOfficeConnection
 
         XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
         try {
-            xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(
+            xBridgeFactory = UnoRuntime.queryInterface(
                     XBridgeFactory.class,
                     xLocalServiceManager.createInstanceWithContext(
                         "com.sun.star.bridge.BridgeFactory", xLocalContext));
@@ -448,7 +448,7 @@ public class LocalOfficeConnection
                 } catch (com.sun.star.uno.Exception e) {
                     throw new com.sun.star.uno.RuntimeException(e.getMessage());
                 }
-                XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector);
+                XConnector connector_xConnector = UnoRuntime.queryInterface(XConnector.class, connector);
                 // connect to the server
                 XConnection xConnection = connector_xConnector.connect(conDcp);
                 // create the bridge name. This should not be necessary if we pass an
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeWindow.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeWindow.java
index e7e2183785..3fa2837447 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -118,10 +118,10 @@ public class LocalOfficeWindow
 			{
 				compfactory     = mConnection.getComponentContext().getServiceManager();
 				XMultiServiceFactory    factory;
-				factory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+				factory = UnoRuntime.queryInterface(
 						XMultiServiceFactory.class, compfactory);
 				Object          object  = factory.createInstance( "com.sun.star.awt.Toolkit");
-				return (XToolkit)UnoRuntime.queryInterface(XToolkit.class, object);
+				return UnoRuntime.queryInterface(XToolkit.class, object);
 			}
 			else
 				return null;
@@ -133,13 +133,13 @@ public class LocalOfficeWindow
 		if ( !bPeer )
 		{
 			// set real parent
-			XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
+			XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
 
 			xVclWindowPeer.setProperty( "PluginParent", getWrappedWindowHandle());
 			bPeer = true;
             // show document window
-			XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+			XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( true );
 		}
 	}
@@ -150,11 +150,11 @@ public class LocalOfficeWindow
 		if ( bPeer )
 		{
 		       	// hide document window
-			XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+			XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( false );
 
 			// set null parent
-			XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
+			XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
 			xVclWindowPeer.setProperty( "PluginParent", 0L );
 			bPeer = false;
@@ -214,7 +214,7 @@ public class LocalOfficeWindow
 
 
 			// set initial visibility
-			XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
+			XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
 			aWindow.setVisible( bPeer );
 		}
 		catch (com.sun.star.uno.Exception exp) {
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OOoBean.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OOoBean.java
index 43dd81df77..3fc6893796 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OOoBean.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OOoBean.java
@@ -299,7 +299,7 @@ public class OOoBean
 				{
 					com.sun.star.lang.XMultiComponentFactory aFactory =
 						iConn.getComponentContext().getServiceManager();
-					xServiceFactory	= (com.sun.star.lang.XMultiServiceFactory)
+					xServiceFactory	=
 						UnoRuntime.queryInterface(
 							com.sun.star.lang.XMultiServiceFactory.class, aFactory );
 				}
@@ -328,7 +328,7 @@ public class OOoBean
 			try
 			{
 				Object aObject = getMultiServiceFactory().createInstance( "com.sun.star.frame.Desktop");
-				xDesktop = (com.sun.star.frame.XDesktop) UnoRuntime.queryInterface(
+				xDesktop = UnoRuntime.queryInterface(
 						com.sun.star.frame.XDesktop.class, aObject );
 			}
 			catch ( com.sun.star.uno.Exception aExc )
@@ -385,7 +385,7 @@ public class OOoBean
 				new CallWatchThread( nOOoCallTimeOut, "clear" );
 			// By closing the frame we avoid that dialogs are displayed, for example when
 			// the document is modified.
-			com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
+			com.sun.star.util.XCloseable xCloseable =
 				UnoRuntime.queryInterface( com.sun.star.util.XCloseable.class, aFrame );
 			if ( xCloseable != null )
 			{
@@ -419,7 +419,7 @@ public class OOoBean
 			{
 				try
 				{
-					com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent)
+					com.sun.star.lang.XComponent xComp =
 						UnoRuntime.queryInterface(
 							com.sun.star.lang.XComponent.class, xURLTransformer );
 					if ( xComp != null )
@@ -577,23 +577,23 @@ public class OOoBean
 					{
 						// create the frame
 						com.sun.star.awt.XWindow xWindow =
-							(com.sun.star.awt.XWindow) UnoRuntime.queryInterface(
+							UnoRuntime.queryInterface(
 							com.sun.star.awt.XWindow.class, xFrameWindow.getUNOWindowPeer());
 						Object xFrame = xServiceFactory.createInstance( "com.sun.star.frame.Frame");
-						aFrame = new Frame( (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(
+						aFrame = new Frame( UnoRuntime.queryInterface(
 								com.sun.star.frame.XFrame.class, xFrame ) );
 						aFrame.initialize( xWindow );
 						aFrame.setName( aFrame.toString() );
 
 						// register the frame at the desktop
 						com.sun.star.frame.XFrames xFrames =
-								( (com.sun.star.frame.XFramesSupplier)UnoRuntime.queryInterface(
+								( UnoRuntime.queryInterface(
 								com.sun.star.frame.XFramesSupplier.class, getOOoDesktop() ) ).getFrames();
 						xFrames.append( aFrame );
 					}
 
 					// Initializes the slot command execution environment.
-					xURLTransformer	= (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+					xURLTransformer	= UnoRuntime.queryInterface(
 						com.sun.star.util.XURLTransformer.class,
 						xServiceFactory.createInstance( "com.sun.star.util.URLTransformer") );
 
@@ -607,7 +607,7 @@ public class OOoBean
 										}
 
 					// get XComponentLoader from frame
-					com.sun.star.frame.XComponentLoader xLoader = (com.sun.star.frame.XComponentLoader)
+					com.sun.star.frame.XComponentLoader xLoader =
 						UnoRuntime.queryInterface( com.sun.star.frame.XComponentLoader.class, aFrame );
 					if ( xLoader == null )
 					{
@@ -672,7 +672,7 @@ public class OOoBean
 
 					// Get document's XModifiable interface if any.
 					aDocument = new OfficeDocument(
-						(com.sun.star.frame.XModel) UnoRuntime.queryInterface(
+						UnoRuntime.queryInterface(
 						com.sun.star.frame.XModel.class, xComponent ) );
 					bLoaded = true;
 				}
@@ -1026,10 +1026,10 @@ public class OOoBean
 		which can be obtained from a frame, to control toolbars. For example:
 		<pre>
 com.sun.star.beans.XPropertySet xPropSet =
-  (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
+  UnoRuntime.queryInterface(
 	com.sun.star.beans.XPropertySet.class, aFrame );
 com.sun.star.frame.XLayoutManager xLayoutManager =
-  (com.sun.star.frame.XLayoutManager) UnoRuntime.queryInterface(
+  UnoRuntime.queryInterface(
 	com.sun.star.frame.XLayoutManager.class,
 	xPropSet.getPropertyValue( "LayoutManager" ) );
 xLayoutManager.showElement("private:resource/menubar/menubar");
@@ -1092,10 +1092,10 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
 				try
 				{
 					com.sun.star.beans.XPropertySet xPropSet =
-							(com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
+							UnoRuntime.queryInterface(
 							com.sun.star.beans.XPropertySet.class, aFrame );
 					com.sun.star.frame.XLayoutManager xLayoutManager =
-							(com.sun.star.frame.XLayoutManager) UnoRuntime.queryInterface(
+							UnoRuntime.queryInterface(
 							com.sun.star.frame.XLayoutManager.class,
 							xPropSet.getPropertyValue( "LayoutManager" ) );
 					if ( bNewValue )
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OfficeDocument.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OfficeDocument.java
index ecdd43ab88..53fe008105 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OfficeDocument.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/OfficeDocument.java
@@ -52,13 +52,13 @@ public class OfficeDocument extends Wrapper
 		super( xModel );
 
 		this.xModel = xModel;
-		this.xModifiable = (com.sun.star.util.XModifiable)
+		this.xModifiable =
 			UnoRuntime.queryInterface(
 				com.sun.star.util.XModifiable.class, xModel );
-		this.xPrintable = (com.sun.star.view.XPrintable)
+		this.xPrintable =
 			UnoRuntime.queryInterface(
 				com.sun.star.view.XPrintable.class, xModel );
-		this.xStorable = (com.sun.star.frame.XStorable)
+		this.xStorable =
 			UnoRuntime.queryInterface(
 				com.sun.star.frame.XStorable.class, xModel );
 	}
diff --git a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Wrapper.java b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Wrapper.java
index 6d3f5aefe9..97f3395680 100644
--- a/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Wrapper.java
+++ b/main/bean/java/officebean/src/main/java/com/sun/star/comp/beans/Wrapper.java
@@ -56,7 +56,7 @@ class Wrapper
 	public Wrapper( com.sun.star.uno.XInterface xProxy )
 	{
 		xQueryInterface = (com.sun.star.uno.IQueryInterface) xProxy;
-		xComponent = (com.sun.star.lang.XComponent)
+		xComponent =
 			UnoRuntime.queryInterface(
 				com.sun.star.lang.XComponent.class, xProxy );
 	}
diff --git a/main/chart2/qa/complex/chart2/TestCaseOldAPI.java b/main/chart2/qa/complex/chart2/TestCaseOldAPI.java
index 53b30db410..9e4c352824 100644
--- a/main/chart2/qa/complex/chart2/TestCaseOldAPI.java
+++ b/main/chart2/qa/complex/chart2/TestCaseOldAPI.java
@@ -95,7 +95,7 @@ public class TestCaseOldAPI {
         else
             mxChartModel = createChartModel();
 
-        mxOldDoc = (XChartDocument) UnoRuntime.queryInterface(
+        mxOldDoc = UnoRuntime.queryInterface(
             XChartDocument.class, mxChartModel );
     }
 
@@ -103,7 +103,7 @@ public class TestCaseOldAPI {
 
     public void after()
     {
-        XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(
+        XCloseable xCloseable = UnoRuntime.queryInterface(
             XCloseable.class, mxChartModel );
         assertTrue( "document is no XCloseable", xCloseable != null );
 
@@ -128,7 +128,7 @@ public class TestCaseOldAPI {
     {
         try
         {
-            XPropertySet xDocProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xDocProp = UnoRuntime.queryInterface(
                 XPropertySet.class, mxOldDoc );
             assertTrue( "Chart Document is no XPropertySet", xDocProp != null );
             xDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
@@ -136,7 +136,7 @@ public class TestCaseOldAPI {
                         xDocProp.getPropertyValue( "HasMainTitle" )));
 
             XShape xTitleShape = mxOldDoc.getTitle();
-            XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xTitleProp = UnoRuntime.queryInterface(
                 XPropertySet.class, xTitleShape );
 
             // set property via old API
@@ -178,7 +178,7 @@ public class TestCaseOldAPI {
     {
         try
         {
-            XPropertySet xDocProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xDocProp = UnoRuntime.queryInterface(
                 XPropertySet.class, mxOldDoc );
             assertTrue( "Chart Document is no XPropertySet", xDocProp != null );
             xDocProp.setPropertyValue( "HasSubTitle", new Boolean( true ));
@@ -186,7 +186,7 @@ public class TestCaseOldAPI {
                         xDocProp.getPropertyValue( "HasSubTitle" )));
 
             XShape xTitleShape = mxOldDoc.getSubTitle();
-            XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xTitleProp = UnoRuntime.queryInterface(
                 XPropertySet.class, xTitleShape );
 
             // set Property via old API
@@ -227,7 +227,7 @@ public class TestCaseOldAPI {
             XDiagram xDia = mxOldDoc.getDiagram();
             if( xDia != null )
             {
-                X3DDisplay xDisp = (X3DDisplay) UnoRuntime.queryInterface(
+                X3DDisplay xDisp = UnoRuntime.queryInterface(
                     X3DDisplay.class, xDia );
                 assertTrue( "X3DDisplay not supported", xDisp != null );
 
@@ -245,7 +245,7 @@ public class TestCaseOldAPI {
                             "com.sun.star.chart.BarDiagram" ));
 
                 // Diagram properties
-                xProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xDia );
+                xProp = UnoRuntime.queryInterface( XPropertySet.class, xDia );
                 assertTrue( "Diagram is no property set", xProp != null );
 
                 // y-axis
@@ -262,10 +262,10 @@ public class TestCaseOldAPI {
 //                 assertTrue( "Adding y-axis title", bNewYAxisTitle == bYAxisTitle );
 
                 // set title text
-//                 XAxisYSupplier xYAxisSuppl = (XAxisYSupplier) UnoRuntime.queryInterface(
+//                 XAxisYSupplier xYAxisSuppl = UnoRuntime.queryInterface(
 //                     XAxisYSupplier.class, mxOldDoc.getDiagram() );
 //                 assertTrue( "Diagram is no y-axis supplier", xYAxisSuppl != null );
-//                 XPropertySet xAxisTitleProp = (XPropertySet) UnoRuntime.queryInterface(
+//                 XPropertySet xAxisTitleProp = UnoRuntime.queryInterface(
 //                     XPropertySet.class, xYAxisSuppl.getYAxisTitle() );
 //                 assertTrue( "Y-Axis Title is no XPropertySet", xAxisTitleProp != null );
 //                 xAxisTitleProp.setPropertyValue( "String", "New y axis title" );
@@ -277,7 +277,7 @@ public class TestCaseOldAPI {
                     xProp.getPropertyValue( "HasSecondaryYAxis" ));
                 assertTrue( "Adding a second y-axis does not work", bNewSecYAxisValue == bSecondaryYAxis );
 
-                XTwoAxisYSupplier xSecYAxisSuppl = (XTwoAxisYSupplier) UnoRuntime.queryInterface(
+                XTwoAxisYSupplier xSecYAxisSuppl = UnoRuntime.queryInterface(
                     XTwoAxisYSupplier.class, xDia );
                 assertTrue( "XTwoAxisYSupplier not implemented", xSecYAxisSuppl != null );
                 assertTrue( "No second y-axis found", xSecYAxisSuppl.getSecondaryYAxis() != null );
@@ -285,7 +285,7 @@ public class TestCaseOldAPI {
 
             // move diagram
             {
-                XShape xDiagramShape = (XShape) UnoRuntime.queryInterface(
+                XShape xDiagramShape = UnoRuntime.queryInterface(
                     XShape.class, xDia );
 
                 Point aOldPos = xDiagramShape.getPosition();
@@ -305,7 +305,7 @@ public class TestCaseOldAPI {
 
             // size diagram
             {
-                XShape xDiagramShape = (XShape) UnoRuntime.queryInterface(
+                XShape xDiagramShape = UnoRuntime.queryInterface(
                     XShape.class, xDia );
 
                 Size aOldSize = xDiagramShape.getSize();
@@ -336,7 +336,7 @@ public class TestCaseOldAPI {
     {
         try
         {
-            XAxisYSupplier xYAxisSuppl = (XAxisYSupplier) UnoRuntime.queryInterface(
+            XAxisYSupplier xYAxisSuppl = UnoRuntime.queryInterface(
                 XAxisYSupplier.class, mxOldDoc.getDiagram() );
             assertTrue( "Diagram is no y-axis supplier", xYAxisSuppl != null );
 
@@ -434,7 +434,7 @@ public class TestCaseOldAPI {
         XShape xLegend = mxOldDoc.getLegend();
         assertTrue( "No Legend returned", xLegend != null );
 
-        XPropertySet xLegendProp = (XPropertySet) UnoRuntime.queryInterface(
+        XPropertySet xLegendProp = UnoRuntime.queryInterface(
             XPropertySet.class, xLegend );
         assertTrue( "Legend is no property set", xLegendProp != null );
 
@@ -514,7 +514,7 @@ public class TestCaseOldAPI {
     @Test
     public void testChartType()
     {
-        XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+        XMultiServiceFactory xFact = UnoRuntime.queryInterface(
             XMultiServiceFactory.class, mxOldDoc );
         assertTrue( "document is no factory", xFact != null );
 
@@ -535,13 +535,13 @@ public class TestCaseOldAPI {
 
             if( bServiceFound )
             {
-                XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
+                XDiagram xDia = UnoRuntime.queryInterface(
                     XDiagram.class, xFact.createInstance( aMyServiceName ));
                 assertTrue( aMyServiceName + " could not be created", xDia != null );
 
                 mxOldDoc.setDiagram( xDia );
 
-                XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet xDiaProp = UnoRuntime.queryInterface(
                     XPropertySet.class, xDia );
                 assertTrue( "Diagram is no XPropertySet", xDiaProp != null );
 
@@ -563,7 +563,7 @@ public class TestCaseOldAPI {
 
             // reset to bar-chart
 //             aMyServiceName = new String( "com.sun.star.chart.BarDiagram" );
-//             XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
+//             XDiagram xDia = UnoRuntime.queryInterface(
 //                 XDiagram.class, xFact.createInstance( aMyServiceName ));
 //             assertTrue( aMyServiceName + " could not be created", xDia != null );
 
@@ -581,11 +581,11 @@ public class TestCaseOldAPI {
     public void testAggregation()
     {
         // query to new type
-        XChartDocument xDiaProv = (XChartDocument) UnoRuntime.queryInterface(
+        XChartDocument xDiaProv = UnoRuntime.queryInterface(
             XChartDocument.class, mxOldDoc );
         assertTrue( "query to new interface failed", xDiaProv != null );
 
-        com.sun.star.chart.XChartDocument xDoc = (com.sun.star.chart.XChartDocument) UnoRuntime.queryInterface(
+        com.sun.star.chart.XChartDocument xDoc = UnoRuntime.queryInterface(
             com.sun.star.chart.XChartDocument.class, xDiaProv );
         assertTrue( "querying back to old interface failed", xDoc != null );
     }
@@ -598,7 +598,7 @@ public class TestCaseOldAPI {
         {
             XDiagram xDia = mxOldDoc.getDiagram();
             assertTrue( "Invalid Diagram", xDia != null );
-            XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+            XMultiServiceFactory xFact = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, mxOldDoc );
             assertTrue( "document is no factory", xFact != null );
 
@@ -614,7 +614,7 @@ public class TestCaseOldAPI {
 
             // note: the FillGradient property is optional, however it was
             // supported in the old chart's API
-            XNameContainer xGradientTable = (XNameContainer) UnoRuntime.queryInterface(
+            XNameContainer xGradientTable = UnoRuntime.queryInterface(
                 XNameContainer.class,
                 xFact.createInstance( "com.sun.star.drawing.GradientTable" ));
             assertTrue( "no gradient table", xGradientTable != null );
@@ -656,7 +656,7 @@ public class TestCaseOldAPI {
 
             // note: the FillHatch property is optional, however it was
             // supported in the old chart's API
-            XNameContainer xHatchTable = (XNameContainer) UnoRuntime.queryInterface(
+            XNameContainer xHatchTable = UnoRuntime.queryInterface(
                 XNameContainer.class,
                 xFact.createInstance( "com.sun.star.drawing.HatchTable" ));
             assertTrue( "no hatch table", xHatchTable != null );
@@ -717,7 +717,7 @@ public class TestCaseOldAPI {
     {
         try
         {
-            XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xDiaProp = UnoRuntime.queryInterface(
                 XPropertySet.class, mxOldDoc.getDiagram() );
 
             ChartDataRowSource eNewSource = ChartDataRowSource.ROWS;
@@ -748,7 +748,7 @@ public class TestCaseOldAPI {
 
 
             XChartData xData = mxOldDoc.getData();
-            XChartDataArray xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+            XChartDataArray xDataArray = UnoRuntime.queryInterface(
                 XChartDataArray.class, xData );
             assertTrue( "document has no XChartDataArray", xDataArray != null );
 
@@ -773,18 +773,18 @@ public class TestCaseOldAPI {
         {
             setStockData_Type4();
 
-            XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+            XMultiServiceFactory xFact = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, mxOldDoc );
             assertTrue( "document is no factory", xFact != null );
 
             String aMyServiceName = new String( "com.sun.star.chart.StockDiagram" );
-            XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
+            XDiagram xDia = UnoRuntime.queryInterface(
                 XDiagram.class, xFact.createInstance( aMyServiceName ));
             assertTrue( aMyServiceName + " could not be created", xDia != null );
 
             mxOldDoc.setDiagram( xDia );
 
-            XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xDiaProp = UnoRuntime.queryInterface(
                 XPropertySet.class, xDia );
             assertTrue( "Diagram is no XPropertySet", xDiaProp != null );
 
@@ -795,7 +795,7 @@ public class TestCaseOldAPI {
             assertTrue( "Has UpDown", AnyConverter.toBoolean( xDiaProp.getPropertyValue( "UpDown" )));
 
             // MinMaxLine
-            XStatisticDisplay xMinMaxProvider = (XStatisticDisplay) UnoRuntime.queryInterface(
+            XStatisticDisplay xMinMaxProvider = UnoRuntime.queryInterface(
                 XStatisticDisplay.class, xDia );
             assertTrue( "Diagram is no XStatisticDisplay", xMinMaxProvider != null );
             XPropertySet xMinMaxProp = xMinMaxProvider.getMinMaxLine();
@@ -819,7 +819,7 @@ public class TestCaseOldAPI {
     {
         try
         {
-            XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+            XMultiServiceFactory xFact = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, mxOldDoc );
             assertTrue( "document is no factory", xFact != null );
 
@@ -855,7 +855,7 @@ public class TestCaseOldAPI {
                 "First Row", "Second Row", "Third Row"
             };
 
-            XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xDiaProp = UnoRuntime.queryInterface(
                     XPropertySet.class, mxOldDoc.getDiagram() );
             ChartDataRowSource eNewSource = ChartDataRowSource.ROWS;
             xDiaProp.setPropertyValue( "DataRowSource", eNewSource );
@@ -865,7 +865,7 @@ public class TestCaseOldAPI {
                         xDiaProp.getPropertyValue( "DataRowSource" )) == eNewSource );
 
             XChartData xData = mxOldDoc.getData();
-            XChartDataArray xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+            XChartDataArray xDataArray = UnoRuntime.queryInterface(
                 XChartDataArray.class, xData );
             assertTrue( "document has no XChartDataArray", xDataArray != null );
 
@@ -882,7 +882,7 @@ public class TestCaseOldAPI {
 
             // refetch data
             xData = mxOldDoc.getData();
-            xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+            xDataArray = UnoRuntime.queryInterface(
                 XChartDataArray.class, xData );
             assertTrue( "document has no XChartDataArray", xDataArray != null );
 
@@ -923,11 +923,11 @@ public class TestCaseOldAPI {
         XModel aResult = null;
         try
         {
-            XComponentLoader aLoader = (XComponentLoader) UnoRuntime.queryInterface(
+            XComponentLoader aLoader = UnoRuntime.queryInterface(
                 XComponentLoader.class,
                 xMSF.createInstance( "com.sun.star.frame.Desktop" ) );
 
-            aResult = (XModel) UnoRuntime.queryInterface(
+            aResult = UnoRuntime.queryInterface(
                 XModel.class,
                 aLoader.loadComponentFromURL( "private:factory/" + sDocType,
                                               "_blank",
@@ -950,7 +950,7 @@ public class TestCaseOldAPI {
         XModel aResult = null;
         try
         {
-            aResult = (XModel) UnoRuntime.queryInterface(
+            aResult = UnoRuntime.queryInterface(
                 XModel.class,
                 xMSF.createInstance( "com.sun.star.comp.chart2.ChartModel" ) );
         }
@@ -969,7 +969,7 @@ public class TestCaseOldAPI {
     {
         XComponentContext xResult = null;
 
-        XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+        XPropertySet xProp = UnoRuntime.queryInterface(
             XPropertySet.class, xFact );
         if( xProp != null )
             try
diff --git a/main/connectivity/qa/complex/connectivity/HsqlDriverTest.java b/main/connectivity/qa/complex/connectivity/HsqlDriverTest.java
index 863c83d298..e3370a665b 100644
--- a/main/connectivity/qa/complex/connectivity/HsqlDriverTest.java
+++ b/main/connectivity/qa/complex/connectivity/HsqlDriverTest.java
@@ -73,7 +73,7 @@ public class HsqlDriverTest {
         }
 
         try{
-            XDocumentSubStorageSupplier doc = (XDocumentSubStorageSupplier)UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class,ds);
+            XDocumentSubStorageSupplier doc = UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class,ds);
             XStorage stor = doc.getDocumentSubStorage("database",4);
             try{
             if ( stor.isStreamElement("db.log") )
@@ -91,9 +91,9 @@ public class HsqlDriverTest {
             if ( stor.isStreamElement("db.script.new") )
                 stor.removeElement("db.script.new");
             } catch(Exception e){}
-            XStorable mod = (XStorable)UnoRuntime.queryInterface(XStorable.class,ds);
+            XStorable mod = UnoRuntime.queryInterface(XStorable.class,ds);
             mod.store();
-            XComponent xComp = (XComponent)UnoRuntime.queryInterface(XComponent.class,stor);
+            XComponent xComp = UnoRuntime.queryInterface(XComponent.class,stor);
             if ( xComp != null )
                 xComp.dispose();
         } catch(Exception e){}
@@ -101,14 +101,14 @@ public class HsqlDriverTest {
         com.sun.star.beans.PropertyValue[] info = null;
         XDriver drv = null;
         try{
-            XDocumentSubStorageSupplier doc = (XDocumentSubStorageSupplier)UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class,ds);
-            XModel mod = (XModel)UnoRuntime.queryInterface(XModel.class,ds);
+            XDocumentSubStorageSupplier doc = UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class,ds);
+            XModel mod = UnoRuntime.queryInterface(XModel.class,ds);
             XStorage stor = doc.getDocumentSubStorage("database",4);
             info = new com.sun.star.beans.PropertyValue[]{
                 new com.sun.star.beans.PropertyValue("Storage",0,stor,PropertyState.DIRECT_VALUE)
                 ,new com.sun.star.beans.PropertyValue("URL",0,mod.getURL(),PropertyState.DIRECT_VALUE)
             };
-            drv = (XDriver)UnoRuntime.queryInterface(XDriver.class, xMSF.createInstance("com.sun.star.sdbcx.comp.hsqldb.Driver"));
+            drv = UnoRuntime.queryInterface(XDriver.class, xMSF.createInstance("com.sun.star.sdbcx.comp.hsqldb.Driver"));
 
 
             TestCacheSize test = new TestCacheSize(xMSF,info,drv);
@@ -124,7 +124,7 @@ public class HsqlDriverTest {
             } catch(Exception e){}
 
             try{
-                XStorable mod2 = (XStorable)UnoRuntime.queryInterface(XStorable.class,ds);
+                XStorable mod2 = UnoRuntime.queryInterface(XStorable.class,ds);
                 mod2.store();
             } catch(Exception e){}
         }catch(Exception e){}
@@ -140,7 +140,7 @@ public class HsqlDriverTest {
                 new com.sun.star.beans.PropertyValue("JavaDriverClass",0,"org.hsqldb.jdbcDriver",PropertyState.DIRECT_VALUE)
                 ,new com.sun.star.beans.PropertyValue("ParameterNameSubstitution",0, false,PropertyState.DIRECT_VALUE)
             };
-            drv = (XDriver)UnoRuntime.queryInterface(XDriver.class,xMSF.createInstance("com.sun.star.comp.sdbc.JDBCDriver"));
+            drv = UnoRuntime.queryInterface(XDriver.class,xMSF.createInstance("com.sun.star.comp.sdbc.JDBCDriver"));
             TestCacheSize test = new TestCacheSize(xMSF,info,drv);
             test.setURL("jdbc:hsqldb:g:\\hsql\\db");
 
diff --git a/main/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java b/main/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
index 213cf4a22b..b4cb859b22 100644
--- a/main/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
+++ b/main/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
@@ -77,18 +77,18 @@ public class JdbcLongVarCharTest
             // get the remote office component context
             XMultiServiceFactory xServiceManager = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
             Object x = xServiceManager.createInstance("com.sun.star.sdbc.DriverManager");
-            com.sun.star.sdbc.XDriverAccess xDriverAccess = (XDriverAccess) UnoRuntime.queryInterface(XDriverAccess.class, x);
+            com.sun.star.sdbc.XDriverAccess xDriverAccess = UnoRuntime.queryInterface(XDriverAccess.class, x);
             com.sun.star.sdbc.XDriver xDriver = xDriverAccess.getDriverByURL(url);
             xConnection = xDriver.connect(url, prop);
 
             //Object prepStmnt = xConnection.prepareStatement("SELECT * FROM t1 WHERE t1.c1 = ?");
             Object prepStmnt = xConnection.prepareStatement("SELECT * FROM i90114 WHERE i90114.c1 = ?");
-            ((XParameters) UnoRuntime.queryInterface(XParameters.class, prepStmnt)).clearParameters();
-            ((XParameters) UnoRuntime.queryInterface(XParameters.class, prepStmnt)).setInt(1, 1);
+            (UnoRuntime.queryInterface(XParameters.class, prepStmnt)).clearParameters();
+            (UnoRuntime.queryInterface(XParameters.class, prepStmnt)).setInt(1, 1);
             XResultSet xResultSet = ((XPreparedStatement) prepStmnt).executeQuery();
-            XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, xResultSet);
+            XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet);
 
-            XResultSetMetaDataSupplier xRsMetaSup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, xResultSet);
+            XResultSetMetaDataSupplier xRsMetaSup = UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, xResultSet);
             XResultSetMetaData xRsMetaData = xRsMetaSup.getMetaData();
             int nColumnCount = xRsMetaData.getColumnCount();
 
diff --git a/main/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java b/main/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java
index 2b5117cec2..19083373a7 100644
--- a/main/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java
+++ b/main/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java
@@ -42,12 +42,12 @@ public class DBaseDateFunctions
 
     public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+        final XRowSet xRowRes = UnoRuntime.queryInterface(XRowSet.class,
                 m_xORB.createInstance("com.sun.star.sdb.RowSet"));
 
         System.out.println("starting DateTime function test!");
         // set the properties needed to connect to a database
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("DataSourceName", "Bibliography");
 
         xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
@@ -71,13 +71,13 @@ public class DBaseDateFunctions
 
     private XRow execute(final XRowSet xRowRes, final String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("Command", "SELECT " + sql + where);
         xRowRes.execute();
-        final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+        final XResultSet xRes = UnoRuntime.queryInterface(XResultSet.class, xRowRes);
         assertTrue("No valid row! ", xRes.next());
 
-        return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
+        return UnoRuntime.queryInterface(XRow.class, xRes);
     }
 
     private void dayofweek(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
diff --git a/main/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java b/main/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java
index 59a356316a..8176ba0d61 100644
--- a/main/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java
+++ b/main/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java
@@ -41,12 +41,12 @@ public class DBaseNumericFunctions
 
     public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+        final XRowSet xRowRes = UnoRuntime.queryInterface(XRowSet.class,
                 m_xORB.createInstance("com.sun.star.sdb.RowSet"));
 
         System.out.println("starting Numeric function test");
         // set the properties needed to connect to a database
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("DataSourceName", "Bibliography");
 
         xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
@@ -76,13 +76,13 @@ public class DBaseNumericFunctions
 
     private XRow execute(final XRowSet xRowRes,final  String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("Command", "SELECT " + sql + where);
         xRowRes.execute();
-        final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+        final XResultSet xRes = UnoRuntime.queryInterface(XResultSet.class, xRowRes);
         assertTrue("No valid row! ", xRes.next());
 
-        return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
+        return UnoRuntime.queryInterface(XRow.class, xRes);
     }
 
     private void abs(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
diff --git a/main/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java b/main/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java
index 44f511064b..1f2fba2ad4 100644
--- a/main/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java
+++ b/main/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java
@@ -38,12 +38,12 @@ public class DBaseSqlTests
 
     public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+        final XRowSet xRowRes = UnoRuntime.queryInterface(XRowSet.class,
                 m_xORB.createInstance("com.sun.star.sdb.RowSet"));
 
         System.out.println("starting SQL test");
         // set the properties needed to connect to a database
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("DataSourceName", "Bibliography");
         xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
 
@@ -71,7 +71,7 @@ public class DBaseSqlTests
     {
         try
         {
-            final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+            final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
             xProp.setPropertyValue("Command", "SELECT " + sql);
             xRowRes.execute();
         }
diff --git a/main/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java b/main/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java
index 37de1ab6a1..3ec78d60fc 100644
--- a/main/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java
+++ b/main/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java
@@ -41,12 +41,12 @@ public class DBaseStringFunctions
 
     public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
+        final XRowSet xRowRes = UnoRuntime.queryInterface(XRowSet.class,
                 m_xORB.createInstance("com.sun.star.sdb.RowSet"));
 
         System.out.println("starting String function test");
         // set the properties needed to connect to a database
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("DataSourceName", "Bibliography");
 
         xProp.setPropertyValue("CommandType", Integer.valueOf(com.sun.star.sdb.CommandType.COMMAND));
@@ -71,13 +71,13 @@ public class DBaseStringFunctions
 
     private XRow execute(final XRowSet xRowRes, String sql) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
     {
-        final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
+        final XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
         xProp.setPropertyValue("Command", "SELECT " + sql + where);
         xRowRes.execute();
-        final XResultSet xRes = (XResultSet) UnoRuntime.queryInterface(XResultSet.class, xRowRes);
+        final XResultSet xRes = UnoRuntime.queryInterface(XResultSet.class, xRowRes);
         assertTrue("No valid row! ", xRes.next());
 
-        return (XRow) UnoRuntime.queryInterface(XRow.class, xRes);
+        return UnoRuntime.queryInterface(XRow.class, xRes);
     }
 
     private void upper(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
diff --git a/main/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java b/main/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
index 6c4db8bdee..4b763b16ce 100644
--- a/main/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
+++ b/main/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
@@ -290,7 +290,7 @@ public class TestCacheSize {
         XPreparedStatement ps = cConnection.prepareStatement(
             "INSERT INTO test (firstname,lastname,zip,filler) VALUES (?,?,?,?)");
 
-        XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+        XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
         para.setString(1, "Julia");
         para.setString(2, "Clancy");
 
@@ -319,12 +319,12 @@ public class TestCacheSize {
                     && i % deleteWhileInsertInterval == 0) {
                 sStatement.execute("CALL IDENTITY();");
 
-                XMultipleResults mrs = (XMultipleResults)UnoRuntime.queryInterface(XMultipleResults.class,sStatement);
+                XMultipleResults mrs = UnoRuntime.queryInterface(XMultipleResults.class,sStatement);
                 XResultSet rs = mrs.getResultSet();
 
                 rs.next();
 
-                XRow row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
+                XRow row = UnoRuntime.queryInterface(XRow.class,rs);
                 int lastId = row.getInt(1);
 
                 sStatement.execute(
@@ -353,7 +353,7 @@ public class TestCacheSize {
         XPreparedStatement ps = cConnection.prepareStatement(
             "INSERT INTO test2 (id1, id2, firstname,lastname,zip,filler) VALUES (?,?,?,?,?,?)");
 
-        XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+        XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
         para.setString(3, "Julia");
         para.setString(4, "Clancy");
 
@@ -419,9 +419,9 @@ public class TestCacheSize {
             // use primary index
             sStatement.execute("SELECT count(*) from TEST");
 
-            XMultipleResults mrs = (XMultipleResults)UnoRuntime.queryInterface(XMultipleResults.class,sStatement);
+            XMultipleResults mrs = UnoRuntime.queryInterface(XMultipleResults.class,sStatement);
             rs = mrs.getResultSet();
-            XRow row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
+            XRow row = UnoRuntime.queryInterface(XRow.class,rs);
 
             rs.next();
             System.out.println("Row Count: " + row.getInt(1));
@@ -471,7 +471,7 @@ public class TestCacheSize {
         try {
             XPreparedStatement ps = cConnection.prepareStatement(
                 "SELECT TOP 1 firstname,lastname,zip,filler FROM test WHERE zip = ?");
-            XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+            XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
 
             for (; i < bigrows; i++) {
                 para.setInt(1, randomgen.nextInt(smallrows));
@@ -500,7 +500,7 @@ public class TestCacheSize {
         try {
             XPreparedStatement ps = cConnection.prepareStatement(
                 "SELECT firstname,lastname,zip,filler FROM test WHERE id = ?");
-            XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+            XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
 
             for (i = 0; i < bigrows; i++) {
                 para.setInt(1, randomgen.nextInt(bigrows - 1));
@@ -524,7 +524,7 @@ public class TestCacheSize {
         try {
             XPreparedStatement ps = cConnection.prepareStatement(
                 "SELECT zip FROM zip WHERE zip = ?");
-            XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+            XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
 
             for (i = 0; i < bigrows; i++) {
                 para.setInt(1, randomgen.nextInt(smallrows - 1));
@@ -556,7 +556,7 @@ public class TestCacheSize {
         try {
             XPreparedStatement ps = cConnection.prepareStatement(
                 "UPDATE test SET filler = filler || zip WHERE zip = ?");
-            XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+            XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
 
             for (; i < smallrows; i++) {
                 int random = randomgen.nextInt(smallrows - 1);
@@ -583,7 +583,7 @@ public class TestCacheSize {
         try {
             XPreparedStatement ps = cConnection.prepareStatement(
                 "UPDATE test SET zip = zip + 1 WHERE id = ?");
-            XParameters para = (XParameters)UnoRuntime.queryInterface(XParameters.class,ps);
+            XParameters para = UnoRuntime.queryInterface(XParameters.class,ps);
 
             for (i = 0; i < bigrows; i++) {
                 int random = randomgen.nextInt(bigrows - 1);
diff --git a/main/connectivity/qa/connectivity/tools/HsqlDatabase.java b/main/connectivity/qa/connectivity/tools/HsqlDatabase.java
index 83107e2ec5..7b9b062a78 100644
--- a/main/connectivity/qa/connectivity/tools/HsqlDatabase.java
+++ b/main/connectivity/qa/connectivity/tools/HsqlDatabase.java
@@ -69,14 +69,14 @@ public class HsqlDatabase extends AbstractDatabase
             documentFile.delete();
         m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
 
-        m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+        m_databaseDocument = UnoRuntime.queryInterface(
                 XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
         m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
 
-        final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
+        final XPropertySet dsProperties = UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
         dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb");
 
-        final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
+        final XStorable storable = UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
         storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]
 			{	new PropertyValue( "PickListEntry", 0, false, PropertyState.DIRECT_VALUE )
 			} );
diff --git a/main/connectivity/qa/connectivity/tools/RowSet.java b/main/connectivity/qa/connectivity/tools/RowSet.java
index 3885368da9..6ee64cc22f 100644
--- a/main/connectivity/qa/connectivity/tools/RowSet.java
+++ b/main/connectivity/qa/connectivity/tools/RowSet.java
@@ -71,9 +71,9 @@ public class RowSet implements XRowSet, XRow
     // misc
     public int getColumnCount()
     {
-        XColumnsSupplier suppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+        XColumnsSupplier suppCols = UnoRuntime.queryInterface(
             XColumnsSupplier.class, m_rowSet );
-        XIndexAccess columns = (XIndexAccess)UnoRuntime.queryInterface(
+        XIndexAccess columns = UnoRuntime.queryInterface(
             XIndexAccess.class, suppCols.getColumns() );
         return columns.getCount();
     }
diff --git a/main/dbaccess/qa/complex/dbaccess/RowSet.java b/main/dbaccess/qa/complex/dbaccess/RowSet.java
index 2da991832f..2122d78ad1 100644
--- a/main/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/main/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -354,7 +354,7 @@ public class RowSet extends TestCase
         System.out.println("testing Thread");
         try
         {
-            // final XRow _row = (XRow)UnoRuntime.queryInterface(XRow.class,_resultSet);
+            // final XRow _row = UnoRuntime.queryInterface(XRow.class,_resultSet);
             _resultSet.beforeFirst();
 
             final int numberOfThreads = 10;
diff --git a/main/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java b/main/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
index 138adc5502..3130716d42 100644
--- a/main/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
+++ b/main/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
@@ -90,7 +90,7 @@ public class OptionsEventHandler {
             //pages.
             XMultiServiceFactory xConfig;
             try {
-                xConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(
+                xConfig = UnoRuntime.queryInterface(
                     XMultiServiceFactory.class,
                     m_cmpCtx.getServiceManager().createInstanceWithContext(
                         "com.sun.star.configuration.ConfigurationProvider", m_cmpCtx));
@@ -110,7 +110,7 @@ public class OptionsEventHandler {
             //We get the com.sun.star.container.XNameAccess from the instance of
             //ConfigurationUpdateAccess and save it for later use.
             try {
-                m_xAccessLeaves = (XNameAccess) UnoRuntime.queryInterface(
+                m_xAccessLeaves = UnoRuntime.queryInterface(
                     XNameAccess.class, xConfig.createInstanceWithArguments(
                         "com.sun.star.configuration.ConfigurationUpdateAccess", args));
 
@@ -206,7 +206,7 @@ public class OptionsEventHandler {
 
             //To access the separate controls of the window we need to obtain the
             //XControlContainer from the window implementation
-            XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
+            XControlContainer xContainer = UnoRuntime.queryInterface(
                 XControlContainer.class, aWindow);
             if (xContainer == null)
                 throw new com.sun.star.uno.Exception(
@@ -230,7 +230,7 @@ public class OptionsEventHandler {
                 //From the control we get the model, which in turn supports the
                 //XPropertySet interface, which we finally use to get the data from
                 //the control.
-                XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet xProp = UnoRuntime.queryInterface(
                     XPropertySet.class, xControl.getModel());
 
                 if (xProp == null)
@@ -256,7 +256,7 @@ public class OptionsEventHandler {
                 //com.sun.star.container.XNameAccess. The XNameAccess is used to get the
                 //particular registry node which represents this options page.
                 //Fortunately the name of the window is the same as the registry node.
-                XPropertySet xLeaf = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet xLeaf = UnoRuntime.queryInterface(
                     XPropertySet.class, m_xAccessLeaves.getByName(sWindowName));
                 if (xLeaf == null)
                     throw new  com.sun.star.uno.Exception(
@@ -268,7 +268,7 @@ public class OptionsEventHandler {
 
             //Committing the changes will cause or changes to be written to the registry.
             XChangesBatch xUpdateCommit =
-                (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, m_xAccessLeaves);
+                UnoRuntime.queryInterface(XChangesBatch.class, m_xAccessLeaves);
             xUpdateCommit.commitChanges();
         }
 
@@ -285,7 +285,7 @@ public class OptionsEventHandler {
 
             //To access the separate controls of the window we need to obtain the
             //XControlContainer from window implementation
-            XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
+            XControlContainer xContainer = UnoRuntime.queryInterface(
                 XControlContainer.class, aWindow);
             if (xContainer == null)
                 throw new com.sun.star.uno.Exception(
@@ -301,7 +301,7 @@ public class OptionsEventHandler {
                 //of com.sun.star.configuration.ConfigurationUpdateAccess which supports
                 //com.sun.star.container.XNameAccess. We obtain now the section
                 //of the registry which is assigned to this options page.
-                XPropertySet xLeaf = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet xLeaf = UnoRuntime.queryInterface(
                     XPropertySet.class, m_xAccessLeaves.getByName(sWindowName));
                 if (xLeaf == null)
                     throw new  com.sun.star.uno.Exception(
@@ -325,7 +325,7 @@ public class OptionsEventHandler {
                 //From the control we get the model, which in turn supports the
                 //XPropertySet interface, which we finally use to set the data at the
                 //control
-                XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet xProp = UnoRuntime.queryInterface(
                     XPropertySet.class, xControl.getModel());
 
                 if (xProp == null)
@@ -350,7 +350,7 @@ public class OptionsEventHandler {
 
             //We need to get the control model of the window. Therefore the first step is
             //to query for it.
-            XControl xControlDlg = (XControl) UnoRuntime.queryInterface(
+            XControl xControlDlg = UnoRuntime.queryInterface(
                 XControl.class, aWindow);
 
             if (xControlDlg == null)
@@ -364,7 +364,7 @@ public class OptionsEventHandler {
                     "Cannot obtain XControlModel from XWindow in method external_event.", this);
             //The model itself does not provide any information except that its
             //implementation supports XPropertySet which is used to access the data.
-            XPropertySet xPropDlg = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet xPropDlg = UnoRuntime.queryInterface(
                 XPropertySet.class, xModelDlg);
             if (xPropDlg == null)
                 throw new com.sun.star.uno.Exception(
diff --git a/main/embeddedobj/qa/complex/embedding/Test01.java b/main/embeddedobj/qa/complex/embedding/Test01.java
index db97fb5c8b..980f10141f 100644
--- a/main/embeddedobj/qa/complex/embedding/Test01.java
+++ b/main/embeddedobj/qa/complex/embedding/Test01.java
@@ -56,7 +56,7 @@ public class Test01 {
         try
         {
             Object oDoc = m_xMSF.createInstance( "com.sun.star.comp.Draw.DrawingDocument" );
-            XLoadable xLoad = (XLoadable) UnoRuntime.queryInterface( XLoadable.class, oDoc );
+            XLoadable xLoad = UnoRuntime.queryInterface( XLoadable.class, oDoc );
             if ( xLoad == null )
             {
                 m_aTestHelper.Error( "Can not get XLoadable!" );
@@ -65,7 +65,7 @@ public class Test01 {
 
             xLoad.initNew();
 
-            XDrawPagesSupplier xDPSupply = (XDrawPagesSupplier) UnoRuntime.queryInterface( XDrawPagesSupplier.class, oDoc );
+            XDrawPagesSupplier xDPSupply = UnoRuntime.queryInterface( XDrawPagesSupplier.class, oDoc );
             if ( xDPSupply == null )
             {
                 m_aTestHelper.Error( "Can not get XDrawPagesSupplier!" );
@@ -86,14 +86,14 @@ public class Test01 {
             }
 
             Object oPage = xDrawPages.getByIndex( 0 );
-            XDrawPage xPage = (XDrawPage) UnoRuntime.queryInterface( XDrawPage.class, oPage );
+            XDrawPage xPage = UnoRuntime.queryInterface( XDrawPage.class, oPage );
             if ( xPage == null )
             {
                 m_aTestHelper.Error( "Can not get access to drawing page!" );
                 return false;
             }
 
-            XMultiServiceFactory xDrFactory = ( XMultiServiceFactory ) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc );
+            XMultiServiceFactory xDrFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc );
             if ( xDrFactory == null )
             {
                 m_aTestHelper.Error( "Can not get drawing factory!" );
@@ -101,14 +101,14 @@ public class Test01 {
             }
 
             Object oShape = xDrFactory.createInstance( "com.sun.star.drawing.OLE2Shape" );
-            XShape xShape = ( XShape ) UnoRuntime.queryInterface( XShape.class, oShape );
+            XShape xShape = UnoRuntime.queryInterface( XShape.class, oShape );
             if ( xShape == null )
             {
                 m_aTestHelper.Error( "Can not create new shape!" );
                 return false;
             }
 
-            XPropertySet xShapeProps = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, oShape );
+            XPropertySet xShapeProps = UnoRuntime.queryInterface( XPropertySet.class, oShape );
             if ( xShapeProps == null )
             {
                 m_aTestHelper.Error( "Can not get access to shapes properties!" );
@@ -119,7 +119,7 @@ public class Test01 {
             xShapeProps.setPropertyValue( "CLSID", "078B7ABA-54FC-457F-8551-6147e776a997" );
 
             Object oEmbObj = xShapeProps.getPropertyValue( "EmbeddedObject" );
-            XEmbeddedObject xEmbObj = ( XEmbeddedObject ) UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
+            XEmbeddedObject xEmbObj = UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
             if ( xEmbObj == null )
             {
                 m_aTestHelper.Error( "Embedded object can not be accessed!" );
@@ -134,7 +134,7 @@ public class Test01 {
             }
 
             Object oReplacement = xShapeProps.getPropertyValue( "Graphic" );
-            XGraphic xReplGraph = ( XGraphic ) UnoRuntime.queryInterface( XGraphic.class, oReplacement );
+            XGraphic xReplGraph = UnoRuntime.queryInterface( XGraphic.class, oReplacement );
             if ( xReplGraph == null )
             {
                 m_aTestHelper.Error( "The replacement graphic should be available!" );
diff --git a/main/embeddedobj/test/Container1/BitmapPainter.java b/main/embeddedobj/test/Container1/BitmapPainter.java
index 75a76acf6f..8cf3256a83 100644
--- a/main/embeddedobj/test/Container1/BitmapPainter.java
+++ b/main/embeddedobj/test/Container1/BitmapPainter.java
@@ -263,7 +263,7 @@ class BitmapPainter implements XPaintListener, XMouseListener, XMouseMotionListe
 		System.out.println( "The bitmap is going to be painted!" );
 
 		try {
-			XDevice xDevice = (XDevice)UnoRuntime.queryInterface( XDevice.class, m_xWindow );
+			XDevice xDevice = UnoRuntime.queryInterface( XDevice.class, m_xWindow );
 			if ( xDevice != null )
 			{
 				System.out.println( "Step1" );
diff --git a/main/embeddedobj/test/Container1/EmbedContApp.java b/main/embeddedobj/test/Container1/EmbedContApp.java
index f8be1a693e..a9ab378bb2 100644
--- a/main/embeddedobj/test/Container1/EmbedContApp.java
+++ b/main/embeddedobj/test/Container1/EmbedContApp.java
@@ -176,7 +176,7 @@ public class EmbedContApp extends Applet
 
 		try {
 			Object oTransformer = m_xServiceFactory.createInstance( "com.sun.star.util.URLTransformer" );
-			m_xTransformer = (XURLTransformer)UnoRuntime.queryInterface( XURLTransformer.class, oTransformer );
+			m_xTransformer = UnoRuntime.queryInterface( XURLTransformer.class, oTransformer );
 		} catch( Exception e ) { System.exit( 0 ); }
 
 		m_oActionsNumberLock = new Object();
@@ -187,7 +187,7 @@ public class EmbedContApp extends Applet
 
 		try {
 			Object oJob = m_xServiceFactory.createInstance( "com.sun.star.comp.thread.MainThreadExecutor" );
-			m_xMainThreadExecutor = (XJob)UnoRuntime.queryInterface( XJob.class, oJob );
+			m_xMainThreadExecutor = UnoRuntime.queryInterface( XJob.class, oJob );
 		} catch( Exception e ) {}
 
 		if ( m_xMainThreadExecutor == null )
@@ -314,7 +314,7 @@ public class EmbedContApp extends Applet
 		if ( m_xEmbedObj != null )
 		{
 			try {
-				XEmbedPersist xPersist = (XEmbedPersist)UnoRuntime.queryInterface( XEmbedPersist.class, m_xEmbedObj );
+				XEmbedPersist xPersist = UnoRuntime.queryInterface( XEmbedPersist.class, m_xEmbedObj );
 				if ( xPersist != null )
 				{
 					xPersist.storeOwn();
@@ -464,7 +464,7 @@ public class EmbedContApp extends Applet
 				if ( nState == EmbedStates.EMBED_INPLACE_ACTIVE
 				|| nState == EmbedStates.EMBED_UI_ACTIVE )
 			 	{
-					XInplaceObject xInplObj = (XInplaceObject)UnoRuntime.queryInterface( XInplaceObject.class, m_xEmbedObj );
+					XInplaceObject xInplObj = UnoRuntime.queryInterface( XInplaceObject.class, m_xEmbedObj );
 			 		if ( xInplObj != null )
 					{
 						xInplObj.setObjectRects( aPosRect, aPosRect ); // show the whole object
@@ -579,7 +579,7 @@ public class EmbedContApp extends Applet
 									if ( m_bLinkObj )
 										storeLinkToStorage();
 
-									XTransactedObject xTransact = (XTransactedObject)UnoRuntime.queryInterface( XTransactedObject.class,
+									XTransactedObject xTransact = UnoRuntime.queryInterface( XTransactedObject.class,
 																												m_xStorage );
 									if ( xTransact != null )
 										xTransact.commit();
@@ -694,12 +694,12 @@ public class EmbedContApp extends Applet
 						if ( m_xStorage != null )
 						{
 							try {
-								XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+								XNameAccess xNameAccess = UnoRuntime.queryInterface( XNameAccess.class,
 																								m_xStorage );
 								if ( xNameAccess != null && xNameAccess.hasByName( "LinkName" ) )
 									m_xStorage.removeElement( "LinkName" );
 
-								XLinkageSupport xLinkage = (XLinkageSupport)UnoRuntime.queryInterface( XLinkageSupport.class,
+								XLinkageSupport xLinkage = UnoRuntime.queryInterface( XLinkageSupport.class,
 																										m_xEmbedObj );
 								if ( xLinkage != null )
 								{
@@ -868,7 +868,7 @@ public class EmbedContApp extends Applet
 
 				com.sun.star.awt.Size aBitmapSize = new com.sun.star.awt.Size( 200, 100 );
 
-				XVisualObject xVisObj = (XVisualObject)UnoRuntime.queryInterface( XVisualObject.class, m_xEmbedObj );
+				XVisualObject xVisObj = UnoRuntime.queryInterface( XVisualObject.class, m_xEmbedObj );
 				try {
 					com.sun.star.awt.Size aVisSize = xVisObj.getVisAreaSize( Aspects.MSASPECT_CONTENT );
 					m_nXPixelSize = aVisSize.Width / aBitmapSize.Width;
@@ -910,13 +910,13 @@ public class EmbedContApp extends Applet
 				if ( nState == EmbedStates.EMBED_UI_ACTIVE || nState == EmbedStates.EMBED_INPLACE_ACTIVE
 				  || nState == EmbedStates.EMBED_ACTIVE || nState == EmbedStates.EMBED_RUNNING )
 				{
-					XComponentSupplier xCompProv = (XComponentSupplier)UnoRuntime.queryInterface(
+					XComponentSupplier xCompProv = UnoRuntime.queryInterface(
 																					XComponentSupplier.class,
 																					m_xEmbedObj );
 					if ( xCompProv != null )
 					{
 						XCloseable xCloseable = xCompProv.getComponent();
-						XTransferable xTransfer = (XTransferable)UnoRuntime.queryInterface(
+						XTransferable xTransfer = UnoRuntime.queryInterface(
 																					XTransferable.class,
 																					xCloseable );
 						if ( xTransfer != null )
@@ -1282,7 +1282,7 @@ public class EmbedContApp extends Applet
 			// create embedded object based on the class ID
 			try {
 				Object oEmbedCreator = m_xServiceFactory.createInstance( "com.sun.star.embed.EmbeddedObjectCreator" );
-				XEmbedObjectCreator xEmbedCreator = (XEmbedObjectCreator)UnoRuntime.queryInterface(
+				XEmbedObjectCreator xEmbedCreator = UnoRuntime.queryInterface(
 																						XEmbedObjectCreator.class,
 																						oEmbedCreator );
 				if ( xEmbedCreator != null )
@@ -1292,7 +1292,7 @@ public class EmbedContApp extends Applet
 																		m_xStorage,
 																		"EmbedSub",
 																		new PropertyValue[0] );
-					xEmbObj = (XEmbeddedObject)UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
+					xEmbObj = UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
 				}
 				else
 					JOptionPane.showMessageDialog( m_aFrame,
@@ -1317,7 +1317,7 @@ public class EmbedContApp extends Applet
 
 		try {
 			Object oLinkCreator = m_xServiceFactory.createInstance( "com.sun.star.embed.EmbeddedObjectCreator" );
-			XLinkCreator xLinkCreator = (XLinkCreator)UnoRuntime.queryInterface(
+			XLinkCreator xLinkCreator = UnoRuntime.queryInterface(
 																					XLinkCreator.class,
 																					oLinkCreator );
 			if ( xLinkCreator != null )
@@ -1328,7 +1328,7 @@ public class EmbedContApp extends Applet
 				aMedDescr[1].Name = "ReadOnly";
 				aMedDescr[1].Value = (Object) new Boolean( false );
 				Object oEmbObj = xLinkCreator.createInstanceLink( m_xStorage, "EmbedSub", aMedDescr, new PropertyValue[0] );
-				xEmbObj = (XEmbeddedObject)UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
+				xEmbObj = UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
 			}
 			else
 				JOptionPane.showMessageDialog( m_aFrame,
@@ -1351,7 +1351,7 @@ public class EmbedContApp extends Applet
 		XEmbeddedObject xEmbObj = null;
 		try {
 			Object oEmbedCreator = m_xServiceFactory.createInstance( "com.sun.star.embed.EmbeddedObjectCreator" );
-			XEmbedObjectCreator xEmbedCreator = (XEmbedObjectCreator)UnoRuntime.queryInterface(
+			XEmbedObjectCreator xEmbedCreator = UnoRuntime.queryInterface(
 																					XEmbedObjectCreator.class,
 																					oEmbedCreator );
 			if ( xEmbedCreator != null )
@@ -1365,7 +1365,7 @@ public class EmbedContApp extends Applet
 																					"EmbedSub",
 																					aMedDescr,
 																					new PropertyValue[0] );
-				xEmbObj = (XEmbeddedObject)UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
+				xEmbObj = UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
 			}
 			else
 				JOptionPane.showMessageDialog( m_aFrame,
@@ -1401,7 +1401,7 @@ public class EmbedContApp extends Applet
 		if ( m_xEmbedObj != null )
 		{
 			try {
-				XCloseable xClose = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, m_xEmbedObj );
+				XCloseable xClose = UnoRuntime.queryInterface( XCloseable.class, m_xEmbedObj );
 				if ( xClose != null )
 					xClose.close( true );
 			}
@@ -1413,7 +1413,7 @@ public class EmbedContApp extends Applet
 		if ( m_xStorage != null )
 		{
 			try {
-				XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class, m_xStorage );
+				XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, m_xStorage );
 				if ( xComponent != null )
 					xComponent.dispose();
 			}
@@ -1429,13 +1429,13 @@ public class EmbedContApp extends Applet
 
 		try {
 			Object oStorageFactory = m_xServiceFactory.createInstance( "com.sun.star.embed.StorageFactory" );
-			XSingleServiceFactory xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(
+			XSingleServiceFactory xStorageFactory = UnoRuntime.queryInterface(
 																						XSingleServiceFactory.class,
 																						oStorageFactory );
 			if ( xStorageFactory != null )
 			{
 				Object oStorage = xStorageFactory.createInstance();
-				xTempStorage = (XStorage)UnoRuntime.queryInterface( XStorage.class, oStorage );
+				xTempStorage = UnoRuntime.queryInterface( XStorage.class, oStorage );
 			}
 			else
 				JOptionPane.showMessageDialog( m_aFrame,
@@ -1455,12 +1455,12 @@ public class EmbedContApp extends Applet
 	{
 		try {
 			Object oStorageFactory = m_xServiceFactory.createInstance( "com.sun.star.embed.StorageFactory" );
-			XSingleServiceFactory xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(
+			XSingleServiceFactory xStorageFactory = UnoRuntime.queryInterface(
 																						XSingleServiceFactory.class,
 																						oStorageFactory );
 			if ( xStorageFactory != null )
 			{
-				XEmbedPersist xPersist = (XEmbedPersist)UnoRuntime.queryInterface( XEmbedPersist.class, m_xEmbedObj );
+				XEmbedPersist xPersist = UnoRuntime.queryInterface( XEmbedPersist.class, m_xEmbedObj );
 				if ( xPersist != null )
 				{
 					Object aArgs[] = new Object[2];
@@ -1468,7 +1468,7 @@ public class EmbedContApp extends Applet
 					aArgs[1] = new Integer( ElementModes.ELEMENT_READWRITE );
 
 					Object oStorage = xStorageFactory.createInstanceWithArguments( aArgs );
-					XStorage xTargetStorage = (XStorage)UnoRuntime.queryInterface( XStorage.class, oStorage );
+					XStorage xTargetStorage = UnoRuntime.queryInterface( XStorage.class, oStorage );
 
 					PropertyValue aProps[] = { new PropertyValue() };
 					aProps[0].Name = "StoreVisualReplacement";
@@ -1478,13 +1478,13 @@ public class EmbedContApp extends Applet
 					xPersist.saveCompleted( true );
 
 					// the object must be already based on new storage
-					XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class, m_xStorage );
+					XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, m_xStorage );
 					xComponent.dispose();
 
 					m_xStorage = xTargetStorage;
 					m_bOwnFile = true;
 
-					XTransactedObject xTransact = (XTransactedObject)UnoRuntime.queryInterface( XTransactedObject.class,
+					XTransactedObject xTransact = UnoRuntime.queryInterface( XTransactedObject.class,
 																							m_xStorage );
 					if ( xTransact != null )
 						xTransact.commit();
@@ -1510,7 +1510,7 @@ public class EmbedContApp extends Applet
 		try
 		{
 			Object oStorageFactory = m_xServiceFactory.createInstance( "com.sun.star.embed.StorageFactory" );
-			XSingleServiceFactory xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(
+			XSingleServiceFactory xStorageFactory = UnoRuntime.queryInterface(
 																						XSingleServiceFactory.class,
 																						oStorageFactory );
 			Object aArgs[] = new Object[2];
@@ -1518,14 +1518,14 @@ public class EmbedContApp extends Applet
 			aArgs[1] = new Integer( ElementModes.ELEMENT_READWRITE );
 
 			Object oStorage = xStorageFactory.createInstanceWithArguments( aArgs );
-			XStorage xTargetStorage = (XStorage)UnoRuntime.queryInterface( XStorage.class, oStorage );
+			XStorage xTargetStorage = UnoRuntime.queryInterface( XStorage.class, oStorage );
 
 			Object oEmbedCreator = m_xServiceFactory.createInstance( "com.sun.star.embed.EmbeddedObjectCreator" );
-			XEmbedObjectCreator xEmbedCreator = (XEmbedObjectCreator)UnoRuntime.queryInterface(
+			XEmbedObjectCreator xEmbedCreator = UnoRuntime.queryInterface(
 																					XEmbedObjectCreator.class,
 																					oEmbedCreator );
 
-			XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+			XNameAccess xNameAccess = UnoRuntime.queryInterface( XNameAccess.class,
 																			xTargetStorage );
 			if ( xNameAccess == null )
 			{
@@ -1560,7 +1560,7 @@ public class EmbedContApp extends Applet
 																	false,
 																	new PropertyValue[0] );
 
-			m_xEmbedObj = (XEmbeddedObject)UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
+			m_xEmbedObj = UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
 
 			if ( m_xEmbedObj != null )
 			{
@@ -1589,7 +1589,7 @@ public class EmbedContApp extends Applet
 				if ( xLinkStream != null )
 				{
 					XOutputStream xLinkOutStream = xLinkStream.getOutputStream();
-					XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class,
+					XTruncate xTruncate = UnoRuntime.queryInterface( XTruncate.class,
 																			 	xLinkOutStream );
 					if ( xLinkOutStream != null && xTruncate != null )
 					{
@@ -1603,7 +1603,7 @@ public class EmbedContApp extends Applet
 						xLinkOutStream.writeBytes( aLinkBytes );
 						xLinkOutStream.closeOutput();
 
-						XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class,
+						XComponent xComponent = UnoRuntime.queryInterface( XComponent.class,
 																						xLinkStream );
 						if ( xComponent != null )
 							xComponent.dispose();
@@ -1636,7 +1636,7 @@ public class EmbedContApp extends Applet
 	{
 		try {
 			Object oStorageFactory = m_xServiceFactory.createInstance( "com.sun.star.embed.StorageFactory" );
-			XSingleServiceFactory xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(
+			XSingleServiceFactory xStorageFactory = UnoRuntime.queryInterface(
 																						XSingleServiceFactory.class,
 																						oStorageFactory );
 			if ( xStorageFactory != null )
@@ -1646,9 +1646,9 @@ public class EmbedContApp extends Applet
 				aArgs[1] = new Integer( ElementModes.ELEMENT_READWRITE );
 
 				Object oStorage = xStorageFactory.createInstanceWithArguments( aArgs );
-				XStorage xTargetStorage = (XStorage)UnoRuntime.queryInterface( XStorage.class, oStorage );
+				XStorage xTargetStorage = UnoRuntime.queryInterface( XStorage.class, oStorage );
 
-				XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class, m_xStorage );
+				XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, m_xStorage );
 				xComponent.dispose();
 
 				m_xStorage = xTargetStorage;
@@ -1656,7 +1656,7 @@ public class EmbedContApp extends Applet
 
 				storeLinkToStorage();
 
-				XTransactedObject xTransact = (XTransactedObject)UnoRuntime.queryInterface( XTransactedObject.class,
+				XTransactedObject xTransact = UnoRuntime.queryInterface( XTransactedObject.class,
 																							m_xStorage );
 				if ( xTransact != null )
 					xTransact.commit();
diff --git a/main/embeddedobj/test/Container1/EmbedContFrame.java b/main/embeddedobj/test/Container1/EmbedContFrame.java
index 20774357d8..12be421d1c 100644
--- a/main/embeddedobj/test/Container1/EmbedContFrame.java
+++ b/main/embeddedobj/test/Container1/EmbedContFrame.java
@@ -120,15 +120,15 @@ public class EmbedContFrame extends Frame
         // create a connector, so that it can contact the office
         Object  oUrlResolver  = xLocalServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver",
 																				xComponentContext );
-        XUnoUrlResolver xUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface( XUnoUrlResolver.class, oUrlResolver );
+        XUnoUrlResolver xUrlResolver = UnoRuntime.queryInterface( XUnoUrlResolver.class, oUrlResolver );
 
         Object oInitialObject = xUrlResolver.resolve( sConnectionString );
-        XNamingService xName = (XNamingService)UnoRuntime.queryInterface( XNamingService.class, oInitialObject );
+        XNamingService xName = UnoRuntime.queryInterface( XNamingService.class, oInitialObject );
 
         XMultiServiceFactory xMSF = null;
         if( xName != null ) {
             Object oMSF = xName.getRegisteredObject( "StarOffice.ServiceManager" );
-            xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class, oMSF );
+            xMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oMSF );
         }
 		else
 			System.out.println( "Error: Can't get XNamingService interface from url resolver!" );
diff --git a/main/embeddedobj/test/Container1/PaintThread.java b/main/embeddedobj/test/Container1/PaintThread.java
index 00beaf18cf..d6d9ce47b1 100644
--- a/main/embeddedobj/test/Container1/PaintThread.java
+++ b/main/embeddedobj/test/Container1/PaintThread.java
@@ -130,7 +130,7 @@ class PaintThread extends java.lang.Thread
 			if ( bPaint )
 			{
 				// System.out.println( "The bitmap is going to be painted!" );
-				XDevice xDevice = (XDevice)UnoRuntime.queryInterface( XDevice.class, m_xWindow );
+				XDevice xDevice = UnoRuntime.queryInterface( XDevice.class, m_xWindow );
 				if ( xDevice != null )
 				{
 				 	// System.out.println( "Step1" );
diff --git a/main/embeddedobj/test/Container1/WindowHelper.java b/main/embeddedobj/test/Container1/WindowHelper.java
index 88578a90bb..0bc5d1db6c 100644
--- a/main/embeddedobj/test/Container1/WindowHelper.java
+++ b/main/embeddedobj/test/Container1/WindowHelper.java
@@ -53,7 +53,7 @@ class WindowHelper {
 
 		// get access to toolkit of remote office to create the container window of new target frame
 		try{
-			xToolkit = (XToolkit)UnoRuntime.queryInterface( XToolkit.class,
+			xToolkit = UnoRuntime.queryInterface( XToolkit.class,
 															xFactory.createInstance("com.sun.star.awt.Toolkit") );
 		}
 		catch( Exception ex )
@@ -61,7 +61,7 @@ class WindowHelper {
 			return null;
 		}
 
-		XSystemChildFactory xChildFactory = (XSystemChildFactory)UnoRuntime.queryInterface(
+		XSystemChildFactory xChildFactory = UnoRuntime.queryInterface(
 				XSystemChildFactory.class,
 				xToolkit);
 
@@ -82,7 +82,7 @@ class WindowHelper {
 			{
 				JavaWindowPeerFake aWrapper = new JavaWindowPeerFake(aParent);
 
-				XWindowPeer xParentPeer = (XWindowPeer)UnoRuntime.queryInterface(
+				XWindowPeer xParentPeer = UnoRuntime.queryInterface(
 						XWindowPeer.class,
 						aWrapper);
 
@@ -111,7 +111,7 @@ class WindowHelper {
 				xPeer = xToolkit.createWindow( aDescriptor );
 			}
 
-			xWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class, xPeer);
+			xWindow = UnoRuntime.queryInterface( XWindow.class, xPeer);
 			if ( xWindow != null )
 				xWindow.setPosSize( (int)aBounds.getX(),
 									(int)aBounds.getY(),
@@ -138,11 +138,11 @@ class WindowHelper {
 		XBitmap xResult = null;
 
 		try {
-			XSingleServiceFactory xBitmapFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(
+			XSingleServiceFactory xBitmapFactory = UnoRuntime.queryInterface(
 					XSingleServiceFactory.class,
 					xFactory.createInstance( "com.sun.star.embed.BitmapCreator" ) );
 
-			xResult = (XBitmap)UnoRuntime.queryInterface(
+			xResult = UnoRuntime.queryInterface(
 					XBitmap.class,
 					xBitmapFactory.createInstanceWithArguments( aArgs ) );
 		}
diff --git a/main/extensions/qa/integration/extensions/ConsoleWait.java b/main/extensions/qa/integration/extensions/ConsoleWait.java
index ed9aaa526c..8f4e1ed284 100644
--- a/main/extensions/qa/integration/extensions/ConsoleWait.java
+++ b/main/extensions/qa/integration/extensions/ConsoleWait.java
@@ -80,7 +80,7 @@ public class ConsoleWait implements com.sun.star.lang.XEventListener
     public ConsoleWait( Object _disposable )
     {
         m_disposable = _disposable;
-        XComponent component = (XComponent)UnoRuntime.queryInterface( XComponent.class, _disposable );
+        XComponent component = UnoRuntime.queryInterface( XComponent.class, _disposable );
         if ( component != null )
             component.addEventListener( this );
     }
diff --git a/main/extensions/qa/integration/extensions/Frame.java b/main/extensions/qa/integration/extensions/Frame.java
index 9c70e038b3..c20b1c3424 100644
--- a/main/extensions/qa/integration/extensions/Frame.java
+++ b/main/extensions/qa/integration/extensions/Frame.java
@@ -51,12 +51,12 @@ public class Frame implements   XFrame,
     {
         if ( _frameComponent != null )
         {
-            m_frame = (XFrame)UnoRuntime.queryInterface( XFrame.class, _frameComponent );
-            m_dispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
-            m_dispatchProviderInterception = (XDispatchProviderInterception)UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
-            m_framesSupplier = (XFramesSupplier)UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
-            m_statusIndicatorFactory = (XStatusIndicatorFactory)UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
-            m_closeable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
+            m_frame = UnoRuntime.queryInterface( XFrame.class, _frameComponent );
+            m_dispatchProvider = UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
+            m_dispatchProviderInterception = UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
+            m_framesSupplier = UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
+            m_statusIndicatorFactory = UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
+            m_closeable = UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
         }
     }
 
diff --git a/main/extensions/qa/integration/extensions/MethodHandler.java b/main/extensions/qa/integration/extensions/MethodHandler.java
index 3094d4dca8..9ca9dd2b07 100644
--- a/main/extensions/qa/integration/extensions/MethodHandler.java
+++ b/main/extensions/qa/integration/extensions/MethodHandler.java
@@ -50,7 +50,7 @@ public class MethodHandler implements XPropertyHandler
 
         try
         {
-            m_introspection = (XIntrospection)UnoRuntime.queryInterface( XIntrospection.class,
+            m_introspection = UnoRuntime.queryInterface( XIntrospection.class,
                 m_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", m_context )
             );
         }
@@ -101,7 +101,7 @@ public class MethodHandler implements XPropertyHandler
         descriptor.IndentLevel = 0;
         try
         {
-            XPropertyControl control = (XPropertyControl)UnoRuntime.queryInterface(
+            XPropertyControl control = UnoRuntime.queryInterface(
                     XPropertyControl.class, _propertyControlFactory.createPropertyControl(
                     PropertyControlType.TextField, true ) );
 
diff --git a/main/extensions/qa/integration/extensions/ObjectInspector.java b/main/extensions/qa/integration/extensions/ObjectInspector.java
index b095b183a8..d6c0ecbb2f 100644
--- a/main/extensions/qa/integration/extensions/ObjectInspector.java
+++ b/main/extensions/qa/integration/extensions/ObjectInspector.java
@@ -72,8 +72,8 @@ public class ObjectInspector
     public void before() throws com.sun.star.uno.Exception, java.lang.Exception
     {
         m_orb = UnoRuntime.queryInterface(XMultiServiceFactory.class, officeConnection.getComponentContext().getServiceManager());
-        m_context = (XComponentContext)UnoRuntime.queryInterface( XComponentContext.class,
-                ((XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_orb )).getPropertyValue( "DefaultContext" ) );
+        m_context = UnoRuntime.queryInterface( XComponentContext.class,
+                (UnoRuntime.queryInterface( XPropertySet.class, m_orb )).getPropertyValue( "DefaultContext" ) );
         m_desktop = new Frame( m_orb.createInstance( "com.sun.star.frame.Desktop" ) );
     }
 
@@ -160,7 +160,7 @@ public class ObjectInspector
     /* ------------------------------------------------------------------ */
     private com.sun.star.awt.XWindow createFloatingWindow() throws com.sun.star.uno.Exception
     {
-        com.sun.star.awt.XToolkit toolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
+        com.sun.star.awt.XToolkit toolkit = UnoRuntime.queryInterface(
                 com.sun.star.awt.XToolkit.class, m_orb.createInstance( "com.sun.star.awt.Toolkit" ) );
 
         com.sun.star.awt.WindowDescriptor windowDescriptor = new com.sun.star.awt.WindowDescriptor();
@@ -176,7 +176,7 @@ public class ObjectInspector
                                             +   com.sun.star.awt.WindowAttribute.CLOSEABLE
                                             +   com.sun.star.awt.VclWindowPeerAttribute.CLIPCHILDREN;
 
-	return (com.sun.star.awt.XWindow)UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
+	return UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
                 toolkit.createWindow( windowDescriptor ) );
     }
 }
diff --git a/main/extensions/qa/integration/extensions/ServicesHandler.java b/main/extensions/qa/integration/extensions/ServicesHandler.java
index e61886fd3b..2c3d99ef94 100644
--- a/main/extensions/qa/integration/extensions/ServicesHandler.java
+++ b/main/extensions/qa/integration/extensions/ServicesHandler.java
@@ -68,7 +68,7 @@ public class ServicesHandler implements XPropertyHandler
                 // the OpenHyperlink command, to be dispatched to the Desktop
                 com.sun.star.util.URL dispatchURL[] = { new com.sun.star.util.URL() };
                 dispatchURL[0].Complete = ".uno:OpenHyperlink";
-                com.sun.star.util.XURLTransformer transformer = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
+                com.sun.star.util.XURLTransformer transformer = UnoRuntime.queryInterface(
                         com.sun.star.util.XURLTransformer.class,
                         m_context.getServiceManager().createInstanceWithContext( "com.sun.star.util.URLTransformer", m_context ) );
                 transformer.parseStrict( dispatchURL );
@@ -135,7 +135,7 @@ public class ServicesHandler implements XPropertyHandler
         descriptor.IndentLevel = 0;
         try
         {
-            XHyperlinkControl hyperlinkControl = (XHyperlinkControl)UnoRuntime.queryInterface(
+            XHyperlinkControl hyperlinkControl = UnoRuntime.queryInterface(
                     XHyperlinkControl.class, _propertyControlFactory.createPropertyControl( PropertyControlType.HyperlinkField, true ) );
             hyperlinkControl.addActionListener( new ClickHandler( m_context,  _propertyName ) );
 
@@ -186,7 +186,7 @@ public class ServicesHandler implements XPropertyHandler
 
     public void inspect(Object _component) throws com.sun.star.lang.NullPointerException
     {
-        XServiceInfo serviceInfo = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, _component );
+        XServiceInfo serviceInfo = UnoRuntime.queryInterface( XServiceInfo.class, _component );
         if ( serviceInfo != null )
             m_supportedServices = serviceInfo.getSupportedServiceNames();
     }
diff --git a/main/extensions/test/pgp/TestPGP.java b/main/extensions/test/pgp/TestPGP.java
index 98add4e582..07a68f7dbe 100644
--- a/main/extensions/test/pgp/TestPGP.java
+++ b/main/extensions/test/pgp/TestPGP.java
@@ -66,18 +66,18 @@ public class TestPGP {
 
 
 	static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException, Exception {
-		XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r);
+		XNamingService rName = UnoRuntime.queryInterface(XNamingService.class, r);
 
 		if(rName != null) {
 			System.err.println("got the remote naming service !");
 			Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
 
-			XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
+			XMultiServiceFactory rSmgr = UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
 			if(rSmgr != null) {
 				System.err.println("got the remote service manager !");
 			}
 
-			XSet set= (XSet)UnoRuntime.queryInterface(XSet.class, rSmgr);
+			XSet set= UnoRuntime.queryInterface(XSet.class, rSmgr);
 			if( set == null) {
 				System.err.println(" couldn't get XSet from ServiceFactory");
 				return;
diff --git a/main/filter/qa/complex/filter/detection/typeDetection/TypeDetection.java b/main/filter/qa/complex/filter/detection/typeDetection/TypeDetection.java
index 0cd279069b..1a16cc1e3e 100644
--- a/main/filter/qa/complex/filter/detection/typeDetection/TypeDetection.java
+++ b/main/filter/qa/complex/filter/detection/typeDetection/TypeDetection.java
@@ -214,7 +214,7 @@ public class TypeDetection {
         XInterface oObj = (XInterface) oInterface ;
         System.out.println("ImplName: "+utils.getImplName(oObj));
 
-        m_xDetection = (XTypeDetection)
+        m_xDetection =
                 UnoRuntime.queryInterface(XTypeDetection.class, oInterface);
         // create instance of helper class
         helper = new Helper(xMSF);
diff --git a/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java b/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java
index d43b54438c..4c472e4492 100644
--- a/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java
+++ b/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTFilterOLEExtracter.java
@@ -109,7 +109,7 @@ public class XSLTFilterOLEExtracter {
         if (aName.equals("oledata.mso")) {
             try {
                 //get the length and seek to 0
-                XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, m_RootStream);
+                XSeekable xSeek = UnoRuntime.queryInterface(XSeekable.class, m_RootStream);
                 int oleLength = (int) xSeek.getLength();
                 xSeek.seek(0);
                 xSeek = null;
@@ -138,14 +138,14 @@ public class XSLTFilterOLEExtracter {
             if (oSubStream == null) {
                 return "Not Found:" + aName;
             }
-            XInputStream xSubStream = (XInputStream) UnoRuntime.queryInterface(XInputStream.class,
+            XInputStream xSubStream = UnoRuntime.queryInterface(XInputStream.class,
                     oSubStream);
             if (xSubStream == null) {
                 return "Not Found:" + aName;
             }
             //The first four byte are the length of the uncompressed data
             byte pLength[][] = new byte[1][4];
-            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xSubStream);
+            XSeekable xSeek = UnoRuntime.queryInterface(XSeekable.class, xSubStream);
             xSeek.seek(0);
             xSeek = null;
             //Get the uncompressed length
@@ -182,7 +182,7 @@ public class XSLTFilterOLEExtracter {
         XStream xTempFileStream = null;
         try {
             Object oTempFile = xMSF.createInstance("com.sun.star.io.TempFile");
-            xTempFileStream = (XStream) UnoRuntime.queryInterface(XStream.class, oTempFile);
+            xTempFileStream = UnoRuntime.queryInterface(XStream.class, oTempFile);
         } catch (Exception e) {
         }
 
@@ -203,7 +203,7 @@ public class XSLTFilterOLEExtracter {
             xOutput.flush();
             //Get the input stream and seek to begin
             XInputStream xInput = m_RootStream.getInputStream();
-            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
+            XSeekable xSeek = UnoRuntime.queryInterface(XSeekable.class, xInput);
             xSeek.seek(0);
             oledata = null;
             xSeek = null;
@@ -214,7 +214,7 @@ public class XSLTFilterOLEExtracter {
             Object oTempStorage = m_xMSF.createInstanceWithArguments("com.sun.star.embed.OLESimpleStorage", pArgs);
             pArgs = null;
 
-            m_Storage = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oTempStorage);
+            m_Storage = UnoRuntime.queryInterface(XNameContainer.class, oTempStorage);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -230,7 +230,7 @@ public class XSLTFilterOLEExtracter {
                 Object oTempStorage = m_xMSF.createInstanceWithArguments("com.sun.star.embed.OLESimpleStorage", pArgs);
                 pArgs = null;
 
-                m_Storage = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oTempStorage);
+                m_Storage = UnoRuntime.queryInterface(XNameContainer.class, oTempStorage);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -269,13 +269,13 @@ public class XSLTFilterOLEExtracter {
             //write the compressed data to the temp stream
             xOutput.writeBytes(compressedBytes);
             //seek to 0
-            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
+            XSeekable xSeek = UnoRuntime.queryInterface(XSeekable.class, xInput);
             xSeek.seek(0);
             xSeek = null;
             oledata = null;
 
             //insert the temp stream as a sub stream and use an XTransactedObject to commit it immediately
-            XTransactedObject xTransact = (XTransactedObject) UnoRuntime.queryInterface(XTransactedObject.class, m_Storage);
+            XTransactedObject xTransact = UnoRuntime.queryInterface(XTransactedObject.class, m_Storage);
             m_Storage.insertByName(aName, xInput);
             xTransact.commit();
             xTransact = null;
@@ -323,7 +323,7 @@ public class XSLTFilterOLEExtracter {
         Object x = xComponentContext.getServiceManager().createInstanceWithContext(
                 "com.sun.star.connection.Connector", xComponentContext);
 
-        XConnector xConnector = (XConnector) UnoRuntime.queryInterface(XConnector.class, x);
+        XConnector xConnector = UnoRuntime.queryInterface(XConnector.class, x);
 
         String a[] = parseUnoUrl(sConnectionString);
         if (null == a) {
@@ -336,7 +336,7 @@ public class XSLTFilterOLEExtracter {
         x = xComponentContext.getServiceManager().createInstanceWithContext(
                 "com.sun.star.bridge.BridgeFactory", xComponentContext);
 
-        XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
+        XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(
                 XBridgeFactory.class, x);
 
         // create a nameless bridge with no instance provider
@@ -344,7 +344,7 @@ public class XSLTFilterOLEExtracter {
         XBridge bridge = xBridgeFactory.createBridge("", a[1], m_Connection, null);
 
         // query for the XComponent interface and add this as event listener
-        XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
+        XComponent xComponent = UnoRuntime.queryInterface(
                 XComponent.class, bridge);
 
         // get the remote instance
@@ -356,7 +356,7 @@ public class XSLTFilterOLEExtracter {
                     "Server didn't provide an instance for" + a[2], null);
         }
 
-        XMultiServiceFactory xFac = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, x);
+        XMultiServiceFactory xFac = UnoRuntime.queryInterface(XMultiServiceFactory.class, x);
         return xFac;
     }
     protected static boolean DEBUG = false;
diff --git a/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java b/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
index d0cedc96ab..ac88ffc35a 100644
--- a/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
+++ b/main/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
@@ -237,7 +237,7 @@ public class XSLTransformer
                         l.started();
                     }
 
-                    XSeekable xseek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, m_xis);
+                    XSeekable xseek = UnoRuntime.queryInterface(XSeekable.class, m_xis);
                     if (xseek != null) {
                         xseek.seek(0);
                     }
diff --git a/main/forms/qa/integration/complex/forms/tools/ResultSet.java b/main/forms/qa/integration/complex/forms/tools/ResultSet.java
index a45f7355c5..ef6bdfe8e0 100644
--- a/main/forms/qa/integration/complex/forms/tools/ResultSet.java
+++ b/main/forms/qa/integration/complex/forms/tools/ResultSet.java
@@ -51,8 +51,8 @@ public class ResultSet implements XResultSet, XRow
 
     public ResultSet( final Object _resultSet )
     {
-        m_resultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, _resultSet );
-        m_row = (XRow)UnoRuntime.queryInterface( XRow.class, _resultSet );
+        m_resultSet = UnoRuntime.queryInterface( XResultSet.class, _resultSet );
+        m_row = UnoRuntime.queryInterface( XRow.class, _resultSet );
     }
 
     public
diff --git a/main/forms/qa/integration/forms/CellBinding.java b/main/forms/qa/integration/forms/CellBinding.java
index d14aaf3a4c..12a86ab7f2 100644
--- a/main/forms/qa/integration/forms/CellBinding.java
+++ b/main/forms/qa/integration/forms/CellBinding.java
@@ -90,7 +90,7 @@ public class CellBinding
             // close our document
             if ( m_document != null )
             {
-                XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+                XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
                     m_document.getDocument() );
                 closeDoc.close( true );
             }
@@ -404,7 +404,7 @@ public class CellBinding
     */
     private boolean verifyVoidCell( short col, short row, String failErrorMessage ) throws com.sun.star.uno.Exception
     {
-        XCellRangeData cell = (XCellRangeData)UnoRuntime.queryInterface( XCellRangeData.class,
+        XCellRangeData cell = UnoRuntime.queryInterface( XCellRangeData.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         Object cellContent = cell.getDataArray()[0][0];
@@ -421,7 +421,7 @@ public class CellBinding
     */
     private boolean verifyNumericCellContent( short col, short row, double value, String failErrorMessage ) throws com.sun.star.uno.Exception
     {
-        XCell cell = (XCell)UnoRuntime.queryInterface( XCell.class,
+        XCell cell = UnoRuntime.queryInterface( XCell.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         if ( cell.getValue() != value )
@@ -437,7 +437,7 @@ public class CellBinding
     */
     private boolean verifyStringCellContent( short col, short row, String text, String failErrorMessage ) throws com.sun.star.uno.Exception
     {
-        XTextRange cell = (XTextRange)UnoRuntime.queryInterface( XTextRange.class,
+        XTextRange cell = UnoRuntime.queryInterface( XTextRange.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         if ( !cell.getString().equals( text ) )
@@ -453,7 +453,7 @@ public class CellBinding
     */
     private void setCellText( short col, short row, String text ) throws com.sun.star.uno.Exception
     {
-        XTextRange cell = (XTextRange)UnoRuntime.queryInterface( XTextRange.class,
+        XTextRange cell = UnoRuntime.queryInterface( XTextRange.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         cell.setString( text );
@@ -464,7 +464,7 @@ public class CellBinding
     */
     private void setCellValue( short col, short row, double value ) throws com.sun.star.uno.Exception
     {
-        XCell cell = (XCell)UnoRuntime.queryInterface( XCell.class,
+        XCell cell = UnoRuntime.queryInterface( XCell.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         cell.setValue( value );
@@ -477,7 +477,7 @@ public class CellBinding
     {
         // as long as #i29130# is not fixed, we do not set the cell to "empty", but to
         // an invalid formular, which serves well for our purpose
-        XCellRangeFormula cell = (XCellRangeFormula)UnoRuntime.queryInterface( XCellRangeFormula.class,
+        XCellRangeFormula cell = UnoRuntime.queryInterface( XCellRangeFormula.class,
             m_document.getSheet( 0 ).getCellByPosition( col, row )
         );
         String[][] args = new String[][] { new String[] { "=INVALID_FUNCTION()" } };
@@ -490,7 +490,7 @@ public class CellBinding
      */
     private void bindToCell( XPropertySet controlModel, short column, short row, String _bindingServiceName ) throws com.sun.star.uno.Exception
     {
-        XBindableValue bindableModel = (XBindableValue)UnoRuntime.queryInterface( XBindableValue.class,
+        XBindableValue bindableModel = UnoRuntime.queryInterface( XBindableValue.class,
             controlModel
         );
 
@@ -503,7 +503,7 @@ public class CellBinding
         parameters[0].Name = "BoundCell";
         parameters[0].Value = address;
 
-        XValueBinding cellBinding = (XValueBinding)UnoRuntime.queryInterface( XValueBinding.class,
+        XValueBinding cellBinding = UnoRuntime.queryInterface( XValueBinding.class,
             m_document.createInstanceWithArguments( _bindingServiceName, parameters )
         );
 
@@ -526,10 +526,10 @@ public class CellBinding
         CellRangeAddress listSourceAddress = new CellRangeAddress( (short)0, (int)_sourceCol, (int)_rowStart, (int)_sourceCol, (int)_rowEnd );
         NamedValue addressParameter = new NamedValue( "CellRange", listSourceAddress );
 
-        XListEntrySource listSource = (XListEntrySource)UnoRuntime.queryInterface( XListEntrySource.class,
+        XListEntrySource listSource = UnoRuntime.queryInterface( XListEntrySource.class,
             m_document.createInstanceWithArguments( "com.sun.star.table.CellRangeListSource", new NamedValue[]{ addressParameter } )
         );
-        XListEntrySink listSink = (XListEntrySink)UnoRuntime.queryInterface( XListEntrySink.class,
+        XListEntrySink listSink = UnoRuntime.queryInterface( XListEntrySink.class,
             _listSink );
         listSink.setListEntrySource( listSource );
     }
@@ -539,10 +539,10 @@ public class CellBinding
     */
     private void simulateUserRadioCheck( XPropertySet radioModel ) throws com.sun.star.uno.Exception
     {
-        XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+        XAccessible accessible = UnoRuntime.queryInterface(
             XAccessible.class, m_document.getCurrentView().getControl( radioModel ) );
 
-        XAccessibleValue xValue = (XAccessibleValue)UnoRuntime.queryInterface(
+        XAccessibleValue xValue = UnoRuntime.queryInterface(
             XAccessibleValue.class, accessible.getAccessibleContext() );
 
         Integer newValue = new Integer( 1 );
@@ -554,10 +554,10 @@ public class CellBinding
     */
     private void simulateUserCheckBoxCheck( XPropertySet checkBox, short state ) throws com.sun.star.uno.Exception
     {
-        XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+        XAccessible accessible = UnoRuntime.queryInterface(
             XAccessible.class, m_document.getCurrentView().getControl( checkBox ) );
 
-        XAccessibleValue xValue = (XAccessibleValue)UnoRuntime.queryInterface(
+        XAccessibleValue xValue = UnoRuntime.queryInterface(
             XAccessibleValue.class, accessible.getAccessibleContext() );
 
         xValue.setCurrentValue( new Short( state ) );
@@ -568,7 +568,7 @@ public class CellBinding
     */
     private void simulateUserListBoxSelection( XPropertySet _listBox, String _selectEntry ) throws com.sun.star.uno.Exception
     {
-        XListBox listBoxControl = (XListBox)UnoRuntime.queryInterface(
+        XListBox listBoxControl = UnoRuntime.queryInterface(
             XListBox.class, m_document.getCurrentView().getControl( _listBox ) );
         listBoxControl.selectItem( _selectEntry, true );
     }
@@ -578,14 +578,14 @@ public class CellBinding
     */
     private void simulateUserTextInput( XPropertySet controlModel, String text ) throws com.sun.star.uno.Exception
     {
-        XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+        XAccessible accessible = UnoRuntime.queryInterface(
             XAccessible.class, m_document.getCurrentView().getControl( controlModel ) );
 
         XAccessibleContext context = accessible.getAccessibleContext();
-        XServiceInfo si = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class,
+        XServiceInfo si = UnoRuntime.queryInterface( XServiceInfo.class,
             accessible.getAccessibleContext() );
 
-        XAccessibleEditableText textAccess = (XAccessibleEditableText)UnoRuntime.queryInterface(
+        XAccessibleEditableText textAccess = UnoRuntime.queryInterface(
             XAccessibleEditableText.class, accessible.getAccessibleContext() );
 
         textAccess.setText( text );
diff --git a/main/forms/qa/integration/forms/ControlValidation.java b/main/forms/qa/integration/forms/ControlValidation.java
index 1f56c29a1f..53754907c9 100644
--- a/main/forms/qa/integration/forms/ControlValidation.java
+++ b/main/forms/qa/integration/forms/ControlValidation.java
@@ -105,7 +105,7 @@ public class ControlValidation implements com.sun.star.lang.XEventListener
             // close our document
             if ( m_document != null )
             {
-                XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+                XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
                     m_document.getDocument() );
                 closeDoc.close( true );
             }
diff --git a/main/forms/qa/integration/forms/DocumentHelper.java b/main/forms/qa/integration/forms/DocumentHelper.java
index cccd47c51b..1cd2a98c02 100644
--- a/main/forms/qa/integration/forms/DocumentHelper.java
+++ b/main/forms/qa/integration/forms/DocumentHelper.java
@@ -72,7 +72,7 @@ public class DocumentHelper
     /* ------------------------------------------------------------------ */
     protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception
     {
-        XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(
+        XComponentLoader aLoader = UnoRuntime.queryInterface(
             XComponentLoader.class,
             orb.createInstance( "com.sun.star.frame.Desktop" )
         );
@@ -94,7 +94,7 @@ public class DocumentHelper
     {
         XComponent document = implLoadAsComponent( orb, documentOrFactoryURL, i_args );
 
-        XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class,
+        XServiceInfo xSI = UnoRuntime.queryInterface( XServiceInfo.class,
             document );
         if ( xSI.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
             return new SpreadsheetDocument( orb, document );
@@ -162,7 +162,7 @@ public class DocumentHelper
     public DocumentViewHelper getCurrentView( )
     {
         // get the model interface for the document
-        XModel xDocModel = (XModel)UnoRuntime.queryInterface(XModel.class, m_documentComponent );
+        XModel xDocModel = UnoRuntime.queryInterface(XModel.class, m_documentComponent );
         // get the current controller for the document - as a controller is tied to a view,
         // this gives us the currently active view for the document.
         XController xController = xDocModel.getCurrentController();
@@ -193,7 +193,7 @@ public class DocumentHelper
 
         getCurrentView().dispatch( ".uno:Reload" );
 
-        m_documentComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class,
+        m_documentComponent = UnoRuntime.queryInterface( XComponent.class,
             frame.getController().getModel() );
 
         XModel newModel = getCurrentView().getController().getModel();
@@ -227,7 +227,7 @@ public class DocumentHelper
         }
 
         // outta here
-        return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
+        return UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
     }
 
     /* ------------------------------------------------------------------ */
@@ -242,7 +242,7 @@ public class DocumentHelper
     public XIndexContainer createSubForm( Object aParentContainer, String sInitialName )
         throws com.sun.star.uno.Exception
     {
-        XIndexContainer xParentContainer = (XIndexContainer)UnoRuntime.queryInterface(
+        XIndexContainer xParentContainer = UnoRuntime.queryInterface(
             XIndexContainer.class, aParentContainer );
         return createSubForm( xParentContainer, sInitialName );
     }
@@ -270,13 +270,13 @@ public class DocumentHelper
     */
     static public DocumentHelper getDocumentForComponent( Object aFormComponent, XMultiServiceFactory orb )
     {
-        XChild xChild = (XChild)UnoRuntime.queryInterface( XChild.class, aFormComponent );
+        XChild xChild = UnoRuntime.queryInterface( XChild.class, aFormComponent );
         XModel xModel = null;
         while ( ( null != xChild ) && ( null == xModel ) )
         {
             XInterface xParent = (XInterface)xChild.getParent();
-            xModel = (XModel)UnoRuntime.queryInterface( XModel.class, xParent );
-            xChild = (XChild)UnoRuntime.queryInterface( XChild.class, xParent );
+            xModel = UnoRuntime.queryInterface( XModel.class, xParent );
+            xChild = UnoRuntime.queryInterface( XChild.class, xParent );
         }
 
         return new DocumentHelper( orb, xModel );
@@ -303,7 +303,7 @@ public class DocumentHelper
     */
     public DocumentType classify( )
     {
-        XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo xSI = UnoRuntime.queryInterface(
             XServiceInfo.class, m_documentComponent );
 
         if ( xSI.supportsService( "com.sun.star.text.TextDocument" ) )
@@ -326,11 +326,11 @@ public class DocumentHelper
      */
     protected XDrawPage getDrawPage( int index ) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException
     {
-        XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+        XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
             XDrawPagesSupplier.class, getDocument() );
         XDrawPages xPages = xSuppPages.getDrawPages();
 
-        return (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
+        return UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
     }
 
     /* ------------------------------------------------------------------ */
@@ -341,18 +341,18 @@ public class DocumentHelper
         XDrawPage xReturn;
 
         // in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
-        XDrawPageSupplier xSuppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+        XDrawPageSupplier xSuppPage = UnoRuntime.queryInterface(
             XDrawPageSupplier.class, getDocument() );
         if ( null != xSuppPage )
             xReturn = xSuppPage.getDrawPage();
         else
         {   // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
             // (or any other multi-page document)
-            XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+            XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
                 XDrawPagesSupplier.class, getDocument() );
             XDrawPages xPages = xSuppPages.getDrawPages();
 
-            xReturn = (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
+            xReturn = UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
 
             // Note that this is no really error-proof code: If the document model does not support the
             // XDrawPagesSupplier interface, or if the pages collection returned is empty, this will break.
@@ -366,7 +366,7 @@ public class DocumentHelper
     */
     protected XNameContainer getFormComponentTreeRoot( ) throws com.sun.star.uno.Exception
     {
-        XFormsSupplier xSuppForms = (XFormsSupplier)UnoRuntime.queryInterface(
+        XFormsSupplier xSuppForms = UnoRuntime.queryInterface(
             XFormsSupplier.class, getMainDrawPage( ) );
 
         XNameContainer xFormsCollection = null;
@@ -382,7 +382,7 @@ public class DocumentHelper
     */
     public XInterface createInstance( String serviceSpecifier ) throws com.sun.star.uno.Exception
     {
-        XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+        XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
             m_documentComponent );
         return (XInterface)xORB.createInstance( serviceSpecifier );
     }
@@ -392,7 +392,7 @@ public class DocumentHelper
     */
     public XInterface createInstanceWithArguments( String serviceSpecifier, Object[] arguments ) throws com.sun.star.uno.Exception
     {
-        XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+        XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
             m_documentComponent );
         return (XInterface) xORB.createInstanceWithArguments( serviceSpecifier, arguments );
     }
diff --git a/main/forms/qa/integration/forms/DocumentViewHelper.java b/main/forms/qa/integration/forms/DocumentViewHelper.java
index 1ec55a5250..19570c4f8a 100644
--- a/main/forms/qa/integration/forms/DocumentViewHelper.java
+++ b/main/forms/qa/integration/forms/DocumentViewHelper.java
@@ -99,12 +99,12 @@ public class DocumentViewHelper
         // go get the current view
         XController xController = (XController)query( XController.class );
         // go get the dispatch provider of it's frame
-        XDispatchProvider xProvider = (XDispatchProvider)UnoRuntime.queryInterface(
+        XDispatchProvider xProvider = UnoRuntime.queryInterface(
             XDispatchProvider.class, xController.getFrame() );
         if ( null != xProvider )
         {
             // need an URLTransformer
-            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+            XURLTransformer xTransformer = UnoRuntime.queryInterface(
                     XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
             xTransformer.parseStrict( aURL );
 
@@ -160,14 +160,14 @@ public class DocumentViewHelper
     /* ------------------------------------------------------------------ */
     public XControl getControl( Object aModel ) throws com.sun.star.uno.Exception
     {
-        XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+        XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
         return getControl( xModel );
     }
 
     /* ------------------------------------------------------------------ */
     public Object getControl( Object aModel, Class aInterfaceClass ) throws com.sun.star.uno.Exception
     {
-        XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+        XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
         return UnoRuntime.queryInterface( aInterfaceClass, getControl( xModel ) );
     }
 
@@ -211,7 +211,7 @@ public class DocumentViewHelper
         XControl xControl = getControl( xModel );
 
         // the focus can be set to an XWindow only
-        XWindow xControlWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class,
+        XWindow xControlWindow = UnoRuntime.queryInterface( XWindow.class,
             xControl );
 
         // grab the focus
@@ -234,7 +234,7 @@ public class DocumentViewHelper
             XPropertySet xControlProps = dbfTools.queryPropertySet( xForm.getByIndex( i ) );
             if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() )
             {
-                XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
+                XControlModel xControlModel = UnoRuntime.queryInterface(
                     XControlModel.class, xControlProps );
                 // set the focus to this control
                 grabControlFocus( xControlModel );
diff --git a/main/forms/qa/integration/forms/FormComponent.java b/main/forms/qa/integration/forms/FormComponent.java
index b8eb6ead84..affba70d41 100644
--- a/main/forms/qa/integration/forms/FormComponent.java
+++ b/main/forms/qa/integration/forms/FormComponent.java
@@ -52,16 +52,16 @@ public class FormComponent
     /* ------------------------------------------------------------------ */
     public FormComponent( XDrawPage drawPage )
     {
-        XFormsSupplier supp = (XFormsSupplier)UnoRuntime.queryInterface(
+        XFormsSupplier supp = UnoRuntime.queryInterface(
             XFormsSupplier.class, drawPage );
         m_component = supp.getForms();
 
         m_nameAccess = (XNameAccess)m_component;
-        m_indexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+        m_indexAccess = UnoRuntime.queryInterface(
             XIndexAccess.class, m_component );
-        m_child = (XChild)UnoRuntime.queryInterface(
+        m_child = UnoRuntime.queryInterface(
             XChild.class, m_component );
-        m_named = (XNamed)UnoRuntime.queryInterface(
+        m_named = UnoRuntime.queryInterface(
             XNamed.class, m_component );
     }
 
@@ -69,13 +69,13 @@ public class FormComponent
     public FormComponent( Object element )
     {
         m_component = element;
-        m_nameAccess = (XNameAccess)UnoRuntime.queryInterface(
+        m_nameAccess = UnoRuntime.queryInterface(
             XNameAccess.class, m_component );
-        m_indexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+        m_indexAccess = UnoRuntime.queryInterface(
             XIndexAccess.class, m_component );
-        m_child = (XChild)UnoRuntime.queryInterface(
+        m_child = UnoRuntime.queryInterface(
             XChild.class, m_component );
-        m_named = (XNamed)UnoRuntime.queryInterface(
+        m_named = UnoRuntime.queryInterface(
             XNamed.class, m_component );
     }
 
@@ -184,7 +184,7 @@ public class FormComponent
     /* ------------------------------------------------------------------ */
     public String getImplementationName()
     {
-        XServiceInfo si = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo si = UnoRuntime.queryInterface(
             XServiceInfo.class, m_component );
         if ( si != null )
             return si.getImplementationName();
diff --git a/main/forms/qa/integration/forms/FormControlTest.java b/main/forms/qa/integration/forms/FormControlTest.java
index f230de4c1f..590ae66861 100644
--- a/main/forms/qa/integration/forms/FormControlTest.java
+++ b/main/forms/qa/integration/forms/FormControlTest.java
@@ -471,7 +471,7 @@ public class FormControlTest implements XSQLErrorListener
         // close our document
         if ( m_document != null )
         {
-            XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+            XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
                 m_document.getDocument() );
             closeDoc.close( true );
         }
@@ -483,9 +483,9 @@ public class FormControlTest implements XSQLErrorListener
     {
         m_orb = UnoRuntime.queryInterface(XMultiServiceFactory.class, officeConnection.getComponentContext().getServiceManager());
 
-        XNameAccess databaseContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+        XNameAccess databaseContext = UnoRuntime.queryInterface( XNameAccess.class,
             m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) );
-        XNamingService namingService = (XNamingService)UnoRuntime.queryInterface( XNamingService.class,
+        XNamingService namingService = UnoRuntime.queryInterface( XNamingService.class,
             databaseContext );
 
         // revoke the data source, if it previously existed
@@ -497,11 +497,11 @@ public class FormControlTest implements XSQLErrorListener
         String documentURL = m_databaseDocument.getDocumentURL();
         namingService.registerObject( m_dataSourceName, databaseContext.getByName( documentURL ) );
 
-        m_dataSource = (XDataSource)UnoRuntime.queryInterface( XDataSource.class,
+        m_dataSource = UnoRuntime.queryInterface( XDataSource.class,
             databaseContext.getByName( m_dataSourceName ) );
         m_dataSourceProps = dbfTools.queryPropertySet( m_dataSource );
 
-        XPropertySet dataSourceSettings = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+        XPropertySet dataSourceSettings = UnoRuntime.queryInterface( XPropertySet.class,
             m_dataSourceProps.getPropertyValue( "Settings" ) );
         dataSourceSettings.setPropertyValue( "FormsCheckRequiredFields", new Boolean( false ) );
 
@@ -513,9 +513,9 @@ public class FormControlTest implements XSQLErrorListener
     */
     private XPropertySet getControlModel( String name ) throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XNameAccess nameAccess = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+        XNameAccess nameAccess = UnoRuntime.queryInterface( XNameAccess.class,
             m_masterForm );
-        return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+        return UnoRuntime.queryInterface( XPropertySet.class,
             nameAccess.getByName( name ) );
     }
 
@@ -565,7 +565,7 @@ public class FormControlTest implements XSQLErrorListener
         m_document.getCurrentView( ).toggleFormDesignMode( );
 
         m_masterFormController = m_document.getCurrentView().getFormController( m_masterForm );
-        XSQLErrorBroadcaster errorBroadcaster = (XSQLErrorBroadcaster)UnoRuntime.queryInterface( XSQLErrorBroadcaster.class,
+        XSQLErrorBroadcaster errorBroadcaster = UnoRuntime.queryInterface( XSQLErrorBroadcaster.class,
             m_masterFormController );
         errorBroadcaster.addSQLErrorListener( this );
 
@@ -812,21 +812,21 @@ public class FormControlTest implements XSQLErrorListener
     /* ------------------------------------------------------------------ */
     private void moveToInsertRow() throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XResultSetUpdate xResultSet = (XResultSetUpdate)UnoRuntime.queryInterface( XResultSetUpdate.class, m_masterForm );
+        XResultSetUpdate xResultSet = UnoRuntime.queryInterface( XResultSetUpdate.class, m_masterForm );
         xResultSet.moveToInsertRow( );
     }
 
     /* ------------------------------------------------------------------ */
     private void moveToFirst() throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
+        XResultSet xResultSet = UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
         xResultSet.first( );
     }
 
     /* ------------------------------------------------------------------ */
     private void moveToNext() throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
+        XResultSet xResultSet = UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
         xResultSet.next( );
     }
 
@@ -839,7 +839,7 @@ public class FormControlTest implements XSQLErrorListener
 
         URL[] url = new URL[] { new URL() };
         url[0].Complete = slotURL;
-        XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+        XURLTransformer xTransformer = UnoRuntime.queryInterface(
                 XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
         xTransformer.parseStrict( url );
 
@@ -929,7 +929,7 @@ public class FormControlTest implements XSQLErrorListener
         XPropertySet xImageModel = getControlModel( "f_blob" );
 
         // check if the image control properly says that there currently is no image on the first record
-        XImageProducerSupplier xSuppProducer = (XImageProducerSupplier)UnoRuntime.queryInterface( XImageProducerSupplier.class,
+        XImageProducerSupplier xSuppProducer = UnoRuntime.queryInterface( XImageProducerSupplier.class,
             xImageModel );
         XImageProducer xProducer = xSuppProducer.getImageProducer();
 
diff --git a/main/forms/qa/integration/forms/FormLayer.java b/main/forms/qa/integration/forms/FormLayer.java
index 82b89844dc..49efea73c5 100644
--- a/main/forms/qa/integration/forms/FormLayer.java
+++ b/main/forms/qa/integration/forms/FormLayer.java
@@ -319,15 +319,15 @@ public class FormLayer
      */
     public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception
     {
-        XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+        XIndexAccess indexAcc = UnoRuntime.queryInterface( XIndexAccess.class,
             m_document.getFormComponentTreeRoot() );
         XPropertySet controlModel = null;
         int i=0;
         while ( ( indexAcc != null ) && ( i < _accessPath.length ) )
         {
-            controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+            controlModel = UnoRuntime.queryInterface( XPropertySet.class,
                 indexAcc.getByIndex( _accessPath[i] ) );
-            indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+            indexAcc = UnoRuntime.queryInterface( XIndexAccess.class,
                 controlModel );
             ++i;
         }
@@ -344,9 +344,9 @@ public class FormLayer
         int i=0;
         while ( ( nameAcc != null ) && ( i < _accessPath.length ) )
         {
-            controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+            controlModel = UnoRuntime.queryInterface( XPropertySet.class,
                 nameAcc.getByName( _accessPath[i] ) );
-            nameAcc = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+            nameAcc = UnoRuntime.queryInterface( XNameAccess.class,
                 controlModel );
             ++i;
         }
diff --git a/main/forms/qa/integration/forms/ListSelection.java b/main/forms/qa/integration/forms/ListSelection.java
index 2c8695984f..bfdd4561bd 100644
--- a/main/forms/qa/integration/forms/ListSelection.java
+++ b/main/forms/qa/integration/forms/ListSelection.java
@@ -134,12 +134,12 @@ public class ListSelection extends integration.forms.TestCase
                 XSpreadsheet activeSheet = view.getActiveSheet();
 
                 // Accessibility access to the list box control in this sheet
-                XAccessible accessibleListBox = (XAccessible)UnoRuntime.queryInterface(
+                XAccessible accessibleListBox = UnoRuntime.queryInterface(
                     XAccessible.class, getListBoxControl( activeSheet ) );
                 XAccessibleContext context = accessibleListBox.getAccessibleContext();
 
                 // the first "accessible child" of a list box is its list
-                XAccessibleSelection accessibleList = (XAccessibleSelection)UnoRuntime.queryInterface(
+                XAccessibleSelection accessibleList = UnoRuntime.queryInterface(
                     XAccessibleSelection.class, context.getAccessibleChild( 1 ) );
 
                 int selectPosition = generator.nextInt( 5 );
@@ -154,7 +154,7 @@ public class ListSelection extends integration.forms.TestCase
                 }
                 catch( java.lang.InterruptedException e ) { }
 
-                XNamed sheetName = (XNamed)UnoRuntime.queryInterface( XNamed.class, view.getActiveSheet() );
+                XNamed sheetName = UnoRuntime.queryInterface( XNamed.class, view.getActiveSheet() );
                 assertTrue( "sheet was not selected as expected!", sheetName.getName().equals( selectSheetName ) );
             }
         }
@@ -171,7 +171,7 @@ public class ListSelection extends integration.forms.TestCase
         try
         {
             XPropertySet docProps = dbfTools.queryPropertySet( m_document.getDocument() );
-            XLibraryContainer basicLibs = (XLibraryContainer)UnoRuntime.queryInterface(
+            XLibraryContainer basicLibs = UnoRuntime.queryInterface(
                 XLibraryContainer.class, docProps.getPropertyValue( "BasicLibraries" ) );
             XNameContainer basicLib = basicLibs.createLibrary( "default" );
 
@@ -218,7 +218,7 @@ public class ListSelection extends integration.forms.TestCase
         {
             XIndexContainer parentForm = (XIndexContainer)dbfTools.getParent( controlModel, XIndexContainer.class );
 
-            XEventAttacherManager manager = (XEventAttacherManager)UnoRuntime.queryInterface(
+            XEventAttacherManager manager = UnoRuntime.queryInterface(
                 XEventAttacherManager.class, parentForm );
 
             int containerPosition = -1;
@@ -264,7 +264,7 @@ public class ListSelection extends integration.forms.TestCase
         String[] newSheetNames = new String[] { "first", "second", "third", "forth", "fifth" };
 
         // give the first one the right name
-        XNamed sheet = (XNamed)UnoRuntime.queryInterface( XNamed.class,
+        XNamed sheet = UnoRuntime.queryInterface( XNamed.class,
             sheets.getByName( sheetNames[ 0 ] )
         );
         sheet.setName( newSheetNames[ 0 ] );
@@ -308,7 +308,7 @@ public class ListSelection extends integration.forms.TestCase
     /* ------------------------------------------------------------------ */
     protected XControlModel getListBoxModel( XSpreadsheet sheet )
     {
-        XDrawPageSupplier suppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+        XDrawPageSupplier suppPage = UnoRuntime.queryInterface(
             XDrawPageSupplier.class, sheet );
         FormComponent formsRoot = new FormComponent( suppPage.getDrawPage() );
         XControlModel listBoxModel = (XControlModel)formsRoot.getByIndex( 0 ).
@@ -319,7 +319,7 @@ public class ListSelection extends integration.forms.TestCase
     /* ------------------------------------------------------------------ */
     protected XListBox getListBoxControl( XSpreadsheet sheet ) throws com.sun.star.uno.Exception
     {
-        return (XListBox)UnoRuntime.queryInterface(
+        return UnoRuntime.queryInterface(
             XListBox.class, m_document.getCurrentView().getControl( getListBoxModel( sheet ) ) );
     }
  }
diff --git a/main/forms/qa/integration/forms/RadioButtons.java b/main/forms/qa/integration/forms/RadioButtons.java
index 7c723b1d31..c71a42f716 100644
--- a/main/forms/qa/integration/forms/RadioButtons.java
+++ b/main/forms/qa/integration/forms/RadioButtons.java
@@ -280,7 +280,7 @@ public class RadioButtons
             // close our document
             if ( m_document != null )
             {
-                XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+                XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
                     m_document.getDocument() );
                 closeDoc.close( true );
             }
@@ -320,7 +320,7 @@ public class RadioButtons
     {
         XPropertySet xRadio = getRadioModel( groupName, refValue, form );
 
-		XRadioButton radioButton = (XRadioButton)UnoRuntime.queryInterface(
+		XRadioButton radioButton = UnoRuntime.queryInterface(
 			XRadioButton.class, m_document.getCurrentView().getControl( xRadio ) );
 		radioButton.setState( true );
     }
diff --git a/main/forms/qa/integration/forms/SingleControlValidation.java b/main/forms/qa/integration/forms/SingleControlValidation.java
index 471dc0505f..1cc4f6f622 100644
--- a/main/forms/qa/integration/forms/SingleControlValidation.java
+++ b/main/forms/qa/integration/forms/SingleControlValidation.java
@@ -113,7 +113,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
                 if ( controls[ i ].getPropertySetInfo().hasPropertyByName( "Border" ) )
                     controls[ i ].setPropertyValue( "Border", new Short( (short)2 ) );
 
-                XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+                XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
                     controls[ i ] );
                 xComp.addFormComponentValidityListener( this );
             }
@@ -135,7 +135,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
             m_explanationField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null );
             m_explanationField.setPropertyValue( "Label", new String( "" ) );
 
-            XValidatable xValidatable = (XValidatable)UnoRuntime.queryInterface( XValidatable.class, m_inputField );
+            XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, m_inputField );
             xValidatable.setValidator( m_validator );
         }
         catch( java.lang.Exception e  )
@@ -161,7 +161,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
         {
             if ( m_inputField.equals( eventObject.Source ) )
             {
-                XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+                XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
                     eventObject.Source );
                 // the current value
                 Object value = xComp.getCurrentValue();
diff --git a/main/forms/qa/integration/forms/SpreadsheetDocument.java b/main/forms/qa/integration/forms/SpreadsheetDocument.java
index c1642a84d3..9336ee0c96 100644
--- a/main/forms/qa/integration/forms/SpreadsheetDocument.java
+++ b/main/forms/qa/integration/forms/SpreadsheetDocument.java
@@ -58,7 +58,7 @@ public class SpreadsheetDocument extends DocumentHelper
     */
     public XSpreadsheets getSheets() throws com.sun.star.uno.Exception
     {
-        XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
+        XSpreadsheetDocument spreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,
             getDocument()
         );
         return spreadsheetDoc.getSheets();
@@ -69,10 +69,10 @@ public class SpreadsheetDocument extends DocumentHelper
     */
     public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
     {
-        XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+        XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class,
             getSheets()
         );
-        return (XCellRange)UnoRuntime.queryInterface( XCellRange.class,
+        return UnoRuntime.queryInterface( XCellRange.class,
             sheets.getByIndex( index )
         );
     }
@@ -103,7 +103,7 @@ public class SpreadsheetDocument extends DocumentHelper
         {
             CellAddress address = new CellAddress( sheet, column, row );
             Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
-            cellBinding = (com.sun.star.form.binding.XValueBinding)UnoRuntime.queryInterface(
+            cellBinding = UnoRuntime.queryInterface(
                 com.sun.star.form.binding.XValueBinding.class,
                 createInstanceWithArguments(
                     supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
@@ -132,7 +132,7 @@ public class SpreadsheetDocument extends DocumentHelper
             CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
                 topRow, column, bottomRow );
             Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
-            entrySource = (com.sun.star.form.binding.XListEntrySource)UnoRuntime.queryInterface(
+            entrySource = UnoRuntime.queryInterface(
                 com.sun.star.form.binding.XListEntrySource.class,
                 createInstanceWithArguments(
                     "com.sun.star.table.CellRangeListSource", initParam ) );
diff --git a/main/forms/qa/integration/forms/SpreadsheetView.java b/main/forms/qa/integration/forms/SpreadsheetView.java
index ac167374d7..c4971c2a07 100644
--- a/main/forms/qa/integration/forms/SpreadsheetView.java
+++ b/main/forms/qa/integration/forms/SpreadsheetView.java
@@ -57,16 +57,16 @@ public class SpreadsheetView extends integration.forms.DocumentViewHelper
         try
         {
             // get the sheet to activate
-            XSpreadsheetDocument doc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+            XSpreadsheetDocument doc = UnoRuntime.queryInterface(
                 XSpreadsheetDocument.class, getDocument().getDocument() );
-            XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface(
+            XIndexAccess sheets = UnoRuntime.queryInterface(
                 XIndexAccess.class, doc.getSheets() );
 
-            XSpreadsheet sheet = (XSpreadsheet)UnoRuntime.queryInterface(
+            XSpreadsheet sheet = UnoRuntime.queryInterface(
                 XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );
 
             // activate
-            XSpreadsheetView view = (XSpreadsheetView)UnoRuntime.queryInterface(
+            XSpreadsheetView view = UnoRuntime.queryInterface(
                 XSpreadsheetView.class, getController() );
             view.setActiveSheet( sheet );
         }
diff --git a/main/forms/qa/integration/forms/TableCellTextBinding.java b/main/forms/qa/integration/forms/TableCellTextBinding.java
index bf36da5b91..fae698a90b 100644
--- a/main/forms/qa/integration/forms/TableCellTextBinding.java
+++ b/main/forms/qa/integration/forms/TableCellTextBinding.java
@@ -60,7 +60,7 @@ public class TableCellTextBinding
     /** Creates a new instance of TableCellTextBinding */
     public TableCellTextBinding( XCell cell )
     {
-        m_cellText = (XTextRange)UnoRuntime.queryInterface( XTextRange.class, cell );
+        m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell );
 
         m_newCellText = new String();
         m_listeners = new java.util.LinkedList();
diff --git a/main/forms/qa/integration/forms/ValueBinding.java b/main/forms/qa/integration/forms/ValueBinding.java
index d467d3b527..73df57cc89 100644
--- a/main/forms/qa/integration/forms/ValueBinding.java
+++ b/main/forms/qa/integration/forms/ValueBinding.java
@@ -97,11 +97,11 @@ public class ValueBinding extends integration.forms.TestCase
 
         // insert a table with exactly one cell. The content of this table will be synced with
         // the content of a form control
-        XTextDocument textDoc = (XTextDocument)UnoRuntime.queryInterface( XTextDocument.class,  m_document.getDocument() );
+        XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class,  m_document.getDocument() );
         XText documentText = textDoc.getText();
         XTextCursor textCursor = documentText.createTextCursor();
 
-        XTextTable table = (XTextTable)UnoRuntime.queryInterface( XTextTable.class,
+        XTextTable table = UnoRuntime.queryInterface( XTextTable.class,
             m_document.createInstance( "com.sun.star.text.TextTable" )
         );
         table.initialize( 1, 1 );
@@ -113,7 +113,7 @@ public class ValueBinding extends integration.forms.TestCase
         // create a value binding for the first cell of the table
         XValueBinding cellBinding = new TableCellTextBinding( table.getCellByName( "A1" ) );
         // and bind it to the control
-        XBindableValue bindable = (XBindableValue)UnoRuntime.queryInterface(
+        XBindableValue bindable = UnoRuntime.queryInterface(
             XBindableValue.class, textControl
         );
         bindable.setValueBinding( cellBinding );
diff --git a/main/forms/qa/integration/forms/XMLFormSettings.java b/main/forms/qa/integration/forms/XMLFormSettings.java
index 454fc8c9f9..e104bee310 100644
--- a/main/forms/qa/integration/forms/XMLFormSettings.java
+++ b/main/forms/qa/integration/forms/XMLFormSettings.java
@@ -115,7 +115,7 @@ public class XMLFormSettings
         File tempFile = File.createTempFile( "xmlforms", ".odt" );
         tempFile.deleteOnExit();
         String fileURL = tempFile.toURL().toExternalForm();
-        XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+        XStorable store = UnoRuntime.queryInterface( XStorable.class,
             m_document.getDocument() );
         store.storeAsURL( fileURL, new PropertyValue[] {} );
         assertTrue( "document still modified after saving it", !m_document.isModified() );
@@ -133,7 +133,7 @@ public class XMLFormSettings
     {
         if ( m_document != null )
         {
-            XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+            XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
                 m_document.getDocument() );
             closeDoc.close( true );
         }
@@ -142,9 +142,9 @@ public class XMLFormSettings
     /* ------------------------------------------------------------------ */
     private static void impl_bind( XPropertySet _control, XPropertySet _binding ) throws IncompatibleTypesException
     {
-        XBindableValue bindableControl = (XBindableValue)UnoRuntime.queryInterface(
+        XBindableValue bindableControl = UnoRuntime.queryInterface(
             XBindableValue.class, _control );
-        XValueBinding binding = (XValueBinding)UnoRuntime.queryInterface(
+        XValueBinding binding = UnoRuntime.queryInterface(
             XValueBinding.class, _binding );
         bindableControl.setValueBinding( binding );
     }
@@ -225,7 +225,7 @@ public class XMLFormSettings
      */
     private void impl_storeDocument() throws IOException
     {
-        XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+        XStorable store = UnoRuntime.queryInterface( XStorable.class,
             m_document.getDocument() );
         store.store();
         assertTrue( "document still modified after saving it", !m_document.isModified() );
diff --git a/main/forms/qa/integration/xforms/Model.java b/main/forms/qa/integration/xforms/Model.java
index edf7088515..82d9512f2a 100644
--- a/main/forms/qa/integration/xforms/Model.java
+++ b/main/forms/qa/integration/xforms/Model.java
@@ -48,9 +48,9 @@ public class Model
 
     protected Model( Object _model )
     {
-        m_model = (XModel)UnoRuntime.queryInterface( XModel.class, _model );
-        m_modelProps = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, _model );
-        m_helper = (XFormsUIHelper1)UnoRuntime.queryInterface( XFormsUIHelper1.class,
+        m_model = UnoRuntime.queryInterface( XModel.class, _model );
+        m_modelProps = UnoRuntime.queryInterface( XPropertySet.class, _model );
+        m_helper = UnoRuntime.queryInterface( XFormsUIHelper1.class,
             m_model );
     }
 
diff --git a/main/forms/qa/integration/xforms/XMLDocument.java b/main/forms/qa/integration/xforms/XMLDocument.java
index 63f94297cc..c0bcdc2f3f 100644
--- a/main/forms/qa/integration/xforms/XMLDocument.java
+++ b/main/forms/qa/integration/xforms/XMLDocument.java
@@ -64,7 +64,7 @@ public class XMLDocument extends integration.forms.DocumentHelper
     /* ------------------------------------------------------------------ */
     private void impl_initialize( XComponent _document )
     {
-        m_formsSupplier = (XFormsSupplier)UnoRuntime.queryInterface( XFormsSupplier.class,
+        m_formsSupplier = UnoRuntime.queryInterface( XFormsSupplier.class,
             _document );
 
         if ( m_formsSupplier == null )
@@ -98,10 +98,10 @@ public class XMLDocument extends integration.forms.DocumentHelper
         XModel newModel = null;
         try
         {
-            newModel = (XModel) UnoRuntime.queryInterface( XModel.class,
+            newModel = UnoRuntime.queryInterface( XModel.class,
                 getOrb().createInstance( "com.sun.star.xforms.Model" ) );
             newModel.setID(_modelName);
-            XFormsUIHelper1 modelHelper = (XFormsUIHelper1) UnoRuntime.queryInterface(
+            XFormsUIHelper1 modelHelper = UnoRuntime.queryInterface(
                 XFormsUIHelper1.class, newModel );
             modelHelper.newInstance( "Instance 1", new String(), true );
             newModel.initialize();
diff --git a/main/framework/qa/complex/api_internal/CheckAPI.java b/main/framework/qa/complex/api_internal/CheckAPI.java
index b709f5d5ef..70ac32a232 100644
--- a/main/framework/qa/complex/api_internal/CheckAPI.java
+++ b/main/framework/qa/complex/api_internal/CheckAPI.java
@@ -128,7 +128,7 @@ public class CheckAPI  {
             if ( param.get("job1")==null )
             {
                 // get all test jobs from runner service
-                XPropertyAccess xPropAcc = (XPropertyAccess)UnoRuntime.queryInterface(XPropertyAccess.class, oObj);
+                XPropertyAccess xPropAcc = UnoRuntime.queryInterface(XPropertyAccess.class, oObj);
                 props = xPropAcc.getPropertyValues();
             }
             else  {
diff --git a/main/framework/qa/complex/framework/recovery/CrashThread.java b/main/framework/qa/complex/framework/recovery/CrashThread.java
index cd907435f7..5eb444db7f 100644
--- a/main/framework/qa/complex/framework/recovery/CrashThread.java
+++ b/main/framework/qa/complex/framework/recovery/CrashThread.java
@@ -48,13 +48,13 @@ public class CrashThread extends Thread {
 
     public void run() {
         try{
-            XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc);
+            XModel xModel = UnoRuntime.queryInterface(XModel.class, xDoc);
 
             XController xController = xModel.getCurrentController();
-            XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+            XDispatchProvider xDispProv = UnoRuntime.queryInterface(
                                                   XDispatchProvider.class,
                                                   xController);
-            XURLTransformer xParser = (XURLTransformer) UnoRuntime.queryInterface(
+            XURLTransformer xParser = UnoRuntime.queryInterface(
                                               XURLTransformer.class,
                                               msf.createInstance(
                                                       "com.sun.star.util.URLTransformer"));
diff --git a/main/framework/qa/complex/framework/recovery/RecoveryTest.java b/main/framework/qa/complex/framework/recovery/RecoveryTest.java
index f040355901..e39f203e27 100644
--- a/main/framework/qa/complex/framework/recovery/RecoveryTest.java
+++ b/main/framework/qa/complex/framework/recovery/RecoveryTest.java
@@ -258,10 +258,10 @@ public class RecoveryTest {
         while (allComp.hasMoreElements()){
             try{
                 // get all components from the desktop
-                XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
+                XComponent xComponent = UnoRuntime.queryInterface(
                                        XComponent.class, allComp.nextElement());
 
-                XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);
+                XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent);
 
                 String frameName = xModel.getCurrentController().getFrame().getName();
 
@@ -340,7 +340,7 @@ public class RecoveryTest {
 
             assertTrue("could not get Recovery Window",(oDialog != null));
 
-            XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oDialog);
+            XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, oDialog);
 
             UITools oUITools = new UITools(xMSF, xWindow);
 
@@ -377,7 +377,7 @@ public class RecoveryTest {
             XDialog oDialog = rt.getActiveDialog(xMSF);
             assertTrue("could not get CrashReporter Dialog", oDialog != null);
 
-            XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oDialog);
+            XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, oDialog);
 
             System.out.println(oDialog.getTitle());
 
@@ -442,7 +442,7 @@ public class RecoveryTest {
 
             assertTrue("could not get Recovery Dialog at start of office", (oDialog != null));
 
-            XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oDialog);
+            XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, oDialog);
             System.out.println("got the following dialog: '" +oDialog.getTitle() + "'");
 
             UITools oUITools = new UITools(xMSF, xWindow);
@@ -644,7 +644,7 @@ public class RecoveryTest {
         System.out.println("creating Impress document '" + frameName + "'");
         XComponent xImpressDoc = createNewImpressDoc(frameName);
         if (withContent) fillImpressDocWithContent(xImpressDoc);
-        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
+        positioningDocument(UnoRuntime.queryInterface(XModel.class,
                                                                xImpressDoc));
     }
 
@@ -652,7 +652,7 @@ public class RecoveryTest {
         System.out.println("creating Draw document '" + frameName + "'");
         XComponent xDrawDoc = createNewDrawDoc(frameName);
         if (withContent) fillDrawDocWithContent(xDrawDoc);
-        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
+        positioningDocument(UnoRuntime.queryInterface(XModel.class,
                                                                  xDrawDoc));
     }
 
@@ -660,7 +660,7 @@ public class RecoveryTest {
         System.out.println("creating Calc document '" + frameName + "'");
         XSpreadsheetDocument xSpreadsheetDoc = createNewCalcDoc(frameName);
         if (withContent) fillCalcDocWithContent(xSpreadsheetDoc);
-        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
+        positioningDocument(UnoRuntime.queryInterface(XModel.class,
                                                            xSpreadsheetDoc));
     }
 
@@ -706,7 +706,7 @@ public class RecoveryTest {
         System.out.println("creating Math document '" + frameName + "'");
         XComponent xMathDoc = createNewMathDoc(frameName);
         if (withContent) fillMathDocWithContent(xMathDoc);
-        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
+        positioningDocument(UnoRuntime.queryInterface(XModel.class,
                                                                xMathDoc));
     }
 
@@ -724,7 +724,7 @@ public class RecoveryTest {
     private void fillMathDocWithContent(XComponent xMathDoc){
         // setting a formula in document
         final String expFormula = "sum a cdot b";
-        final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+        final XPropertySet xPS = UnoRuntime.queryInterface
             (XPropertySet.class, xMathDoc);
         try {
             xPS.setPropertyValue("Formula", expFormula);
@@ -758,19 +758,19 @@ public class RecoveryTest {
     private void fillImpressDocWithContent(XComponent xImpressDoc){
 
         System.out.println( "get presentation" );
-        XPresentationSupplier oPS = (XPresentationSupplier)
+        XPresentationSupplier oPS =
             UnoRuntime.queryInterface(XPresentationSupplier.class, xImpressDoc);
         XInterface oObj = oPS.getPresentation();
 
         System.out.println( "get custom presentation" );
-        XCustomPresentationSupplier oCPS = (XCustomPresentationSupplier)
+        XCustomPresentationSupplier oCPS =
             UnoRuntime.queryInterface(
                 XCustomPresentationSupplier.class, xImpressDoc);
         XNameContainer xCP = oCPS.getCustomPresentations();
 
         XInterface oInstance = null;
 
-        XSingleServiceFactory oSingleMSF = (XSingleServiceFactory)
+        XSingleServiceFactory oSingleMSF =
             UnoRuntime.queryInterface(XSingleServiceFactory.class, xCP);
 
         try{
@@ -806,10 +806,10 @@ public class RecoveryTest {
     }
 
     private void fillDrawDocWithContent(XComponent xDrawDoc){
-        XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+        XDrawPagesSupplier oDPS =
             UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
         XDrawPages oDPn = oDPS.getDrawPages();
-        XIndexAccess oDPi = (XIndexAccess)
+        XIndexAccess oDPi =
             UnoRuntime.queryInterface(XIndexAccess.class, oDPn);
         XDrawPage oDP = null;
         try {
@@ -828,7 +828,7 @@ public class RecoveryTest {
 
         // get a Shape
         System.out.println( "getting Shape" );
-        XShapes oShapes = (XShapes) UnoRuntime.queryInterface
+        XShapes oShapes = UnoRuntime.queryInterface
             (XShapes.class, oDP);
         XInterface oObj = SOF.createShape
             (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
@@ -843,7 +843,7 @@ public class RecoveryTest {
         oShapes.add((XShape) oShape);
 
 
-        XPropertySet oShapeProps = (XPropertySet)
+        XPropertySet oShapeProps =
             UnoRuntime.queryInterface(XPropertySet.class, oObj);
         XStyle aStyle = null;
         try {
@@ -869,7 +869,7 @@ public class RecoveryTest {
         System.out.println("creating Writer document '" + frameName + "'");
         XTextDocument xTextDoc = createNewWriterDoc(frameName);
         if (withContent) fillWriterDocWithContent(xTextDoc);
-        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
+        positioningDocument(UnoRuntime.queryInterface(XModel.class,
                                                                  xTextDoc));
     }
 
@@ -938,7 +938,7 @@ public class RecoveryTest {
 
             XCellRange testRange = oSheet.getCellRangeByName("$A$1:$D$4");
 
-            XSheetCellRange testSheetRange = (XSheetCellRange) UnoRuntime.queryInterface(
+            XSheetCellRange testSheetRange = UnoRuntime.queryInterface(
                                                      XSheetCellRange.class,
                                                      testRange);
             oSheet.getCellByPosition(1, 1).setValue(1);
diff --git a/main/framework/qa/complex/framework/recovery/RecoveryTools.java b/main/framework/qa/complex/framework/recovery/RecoveryTools.java
index 3623485e6a..0aca7be42e 100644
--- a/main/framework/qa/complex/framework/recovery/RecoveryTools.java
+++ b/main/framework/qa/complex/framework/recovery/RecoveryTools.java
@@ -76,7 +76,7 @@ public class RecoveryTools {
      */
     public XDialog getActiveDialog( XMultiServiceFactory xMSF){
         XWindow xWin = getActiveWindow(xMSF);
-        return (XDialog) UnoRuntime.queryInterface(XDialog.class, xWin);
+        return UnoRuntime.queryInterface(XDialog.class, xWin);
     }
 
     public XWindow getActiveWindow( XMultiServiceFactory xMSF){
@@ -87,10 +87,10 @@ public class RecoveryTools {
           return null;
         }
 
-        XExtendedToolkit tk = (XExtendedToolkit)
+        XExtendedToolkit tk =
             UnoRuntime.queryInterface(XExtendedToolkit.class, xToolKit);
         Object atw = tk.getActiveTopWindow();
-        return (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
+        return UnoRuntime.queryInterface(XWindow.class, atw);
     }
 
     /**
@@ -214,7 +214,7 @@ public class RecoveryTools {
      */
     public boolean closeOffice(XMultiServiceFactory xMSF) {
         try {
-            XDesktop desk = (XDesktop) UnoRuntime.queryInterface(
+            XDesktop desk = UnoRuntime.queryInterface(
                     XDesktop.class, xMSF.createInstance(
                     "com.sun.star.frame.Desktop"));
             xMSF = null;
diff --git a/main/framework/qa/complex/imageManager/CheckImageManager.java b/main/framework/qa/complex/imageManager/CheckImageManager.java
index 475da8cacc..f54f967dd0 100644
--- a/main/framework/qa/complex/imageManager/CheckImageManager.java
+++ b/main/framework/qa/complex/imageManager/CheckImageManager.java
@@ -131,7 +131,7 @@ public class CheckImageManager  {
         assertTrue(testObjectName + "::XUIConfig.addConfigurationListener", _xUIConfig._addConfigurationListener());
         assertTrue(testObjectName + "::XUIConfig.removeConfigurationListener", _xUIConfig._removeConfigurationListener());
 
-        XUIConfigurationPersistence xUIConfigPersistence = (XUIConfigurationPersistence)UnoRuntime.queryInterface(XUIConfiguration.class, xImageManager);
+        XUIConfigurationPersistence xUIConfigPersistence = UnoRuntime.queryInterface(XUIConfigurationPersistence.class, xImageManager);
         _XUIConfigurationPersistence _xUIConfigPersistence = new _XUIConfigurationPersistence(param, xUIConfigPersistence);
         _xUIConfigPersistence.before();
         assertTrue(testObjectName + "::XUIConfigPersistence.isModified", _xUIConfigPersistence._isModified());
diff --git a/main/framework/qa/complex/loadAllDocuments/StreamSimulator.java b/main/framework/qa/complex/loadAllDocuments/StreamSimulator.java
index a61445f955..db465ef04f 100644
--- a/main/framework/qa/complex/loadAllDocuments/StreamSimulator.java
+++ b/main/framework/qa/complex/loadAllDocuments/StreamSimulator.java
@@ -88,7 +88,7 @@ public class StreamSimulator implements com.sun.star.io.XInputStream    ,
 
         try
         {
-            XSimpleFileAccess xHelper = (XSimpleFileAccess)
+            XSimpleFileAccess xHelper =
                 UnoRuntime.queryInterface(XSimpleFileAccess.class,
                 xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));
 
@@ -99,14 +99,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream    ,
             if (bInput)
             {
                 m_xInStream = xHelper.openFileRead(m_sFileName);
-                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+                m_xSeek = UnoRuntime.queryInterface(
                             com.sun.star.io.XSeekable.class,
                             m_xInStream);
             }
             else
             {
                 m_xOutStream = xHelper.openFileWrite(m_sFileName);
-                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+                m_xSeek = UnoRuntime.queryInterface(
                             com.sun.star.io.XSeekable.class,
                             m_xOutStream);
             }
diff --git a/main/framework/source/services/backingcomp.cxx b/main/framework/source/services/backingcomp.cxx
index c45ef1720d..6bc092de01 100644
--- a/main/framework/source/services/backingcomp.cxx
+++ b/main/framework/source/services/backingcomp.cxx
@@ -402,12 +402,12 @@ css::uno::Reference< css::lang::XSingleServiceFactory > BackingComp::impl_create
     May he will do the following things:
 
     <listing>
-        XController xBackingComp = (XController)UnoRuntime.queryInterface(
+        XController xBackingComp = UnoRuntime.queryInterface(
             XController.class,
             xSMGR.createInstance(SERVICENAME_STARTMODULE));
 
         // at this time XWindow isn't present at this instance!
-        XWindow xBackingComp = (XWindow)UnoRuntime.queryInterface(
+        XWindow xBackingComp = UnoRuntime.queryInterface(
             XWindow.class,
             xBackingComp);
 
@@ -416,7 +416,7 @@ css::uno::Reference< css::lang::XSingleServiceFactory > BackingComp::impl_create
         // the component window. From now we offer the window interfaces!
         xBackingComp.attachFrame(xFrame);
 
-        XWindow xBackingComp = (XWindow)UnoRuntime.queryInterface(
+        XWindow xBackingComp = UnoRuntime.queryInterface(
             XWindow.class,
             xBackingComp);
 
@@ -425,7 +425,7 @@ css::uno::Reference< css::lang::XSingleServiceFactory > BackingComp::impl_create
 
         // But that had no effect to our view state.
         // We must be started to create our UI elements like e.g. menu, title, background ...
-        XInitialization xBackingInit = (XInitialization)UnoRuntime.queryInterface(
+        XInitialization xBackingInit = UnoRuntime.queryInterface(
             XInitialization.class,
             xBackingComp);
 
diff --git a/main/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java b/main/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java
index 471ada3c75..00932deb10 100644
--- a/main/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java
+++ b/main/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java
@@ -91,7 +91,7 @@ class ConnectionTask
                 com.sun.star.lang.EventObject aEvent = new com.sun.star.lang.EventObject();
                 for (int i=0; i<nTopWindowCount; i++)
                 {
-                    XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface(
+                    XAccessible xAccessible = UnoRuntime.queryInterface(
                         XAccessible.class,
                         xToolkit.getTopWindow(i));
                     XAccessibleContext xContext = xAccessible.getAccessibleContext();
@@ -132,7 +132,7 @@ class ConnectionTask
         {
             if (xFactory != null)
             {
-                xToolkit = (XExtendedToolkit) UnoRuntime.queryInterface(
+                xToolkit = UnoRuntime.queryInterface(
                     XExtendedToolkit.class,
                     xFactory.createInstance ("stardiv.Toolkit.VCLXToolkit"));
             }
@@ -167,7 +167,7 @@ class ConnectionTask
             com.sun.star.lang.XMultiComponentFactory xMCF =
                 xCmpContext.getServiceManager();
 
-            return (XMultiServiceFactory) UnoRuntime.queryInterface (
+            return UnoRuntime.queryInterface (
                 XMultiServiceFactory.class, xMCF);
         }
 
diff --git a/main/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java b/main/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java
index b6d2ff6922..07f1c06e6d 100644
--- a/main/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java
+++ b/main/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java
@@ -163,7 +163,7 @@ class EventListenerProxy
                 public void run()
                 {
                     maListener.windowOpened (
-                        (XAccessible) UnoRuntime.queryInterface(
+                        UnoRuntime.queryInterface(
                             XAccessible.class,
                             aEvent.Source));
                 }
@@ -181,7 +181,7 @@ class EventListenerProxy
                 public void run()
                 {
                     maListener.windowClosed (
-                        (XAccessible) UnoRuntime.queryInterface(
+                        UnoRuntime.queryInterface(
                             XAccessible.class,
                             aEvent.Source));
                 }
diff --git a/main/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java b/main/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java
index 27a75e820b..f51942791d 100644
--- a/main/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java
+++ b/main/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java
@@ -105,7 +105,7 @@ public class GraphicalDisplay
             // When the context supports the XAccessibleComponent interface
             // then draw its outline.
             XAccessibleComponent xComponent =
-                (XAccessibleComponent)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XAccessibleComponent.class, xContext);
             if (xComponent != null)
             {
diff --git a/main/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java b/main/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java
index aa5f667e5e..4f0e5b4fe5 100644
--- a/main/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java
+++ b/main/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java
@@ -99,7 +99,7 @@ public class RegistrationThread
         {
             // Register the root node.
             XAccessibleEventBroadcaster xBroadcaster =
-                (XAccessibleEventBroadcaster) UnoRuntime.queryInterface (
+                UnoRuntime.queryInterface (
                     XAccessibleEventBroadcaster.class,
                     xRoot);
             if (xBroadcaster != null)
diff --git a/main/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java b/main/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java
index a4669d7160..8fe091fc23 100644
--- a/main/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java
+++ b/main/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java
@@ -145,7 +145,7 @@ class TextualDisplay
         // Try to cast the given accessible context to the
         // XAccessibleComponent interface.
         XAccessibleComponent xComponent =
-            (XAccessibleComponent)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 XAccessibleComponent.class, xContext);
         if (xComponent != null)
         {
diff --git a/main/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java b/main/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java
index 8b0eb9e802..ed6366a04b 100644
--- a/main/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java
+++ b/main/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java
@@ -134,7 +134,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         // create the dialog model and set the properties
         Object dialogModel = xMultiComponentFactory.createInstanceWithContext(
             "com.sun.star.awt.UnoControlDialogModel", _xComponentContext );
-        XPropertySet xPSetDialog = ( XPropertySet )UnoRuntime.queryInterface(
+        XPropertySet xPSetDialog = UnoRuntime.queryInterface(
             XPropertySet.class, dialogModel );
         xPSetDialog.setPropertyValue( "PositionX", new Integer( 100 ) );
         xPSetDialog.setPropertyValue( "PositionY", new Integer( 100 ) );
@@ -143,13 +143,13 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         xPSetDialog.setPropertyValue( "Title", new String( "Runtime Dialog Demo" ) );
 
         // get the service manager from the dialog model
-        XMultiServiceFactory xMultiServiceFactory = ( XMultiServiceFactory )UnoRuntime.queryInterface(
+        XMultiServiceFactory xMultiServiceFactory = UnoRuntime.queryInterface(
             XMultiServiceFactory.class, dialogModel );
 
         // create the button model and set the properties
         Object buttonModel = xMultiServiceFactory.createInstance(
             "com.sun.star.awt.UnoControlButtonModel" );
-        XPropertySet xPSetButton = ( XPropertySet )UnoRuntime.queryInterface(
+        XPropertySet xPSetButton = UnoRuntime.queryInterface(
             XPropertySet.class, buttonModel );
         xPSetButton.setPropertyValue( "PositionX", new Integer( 20 ) );
         xPSetButton.setPropertyValue( "PositionY", new Integer( 70 ) );
@@ -162,7 +162,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         // create the label model and set the properties
         Object labelModel = xMultiServiceFactory.createInstance(
             "com.sun.star.awt.UnoControlFixedTextModel" );
-        XPropertySet xPSetLabel = ( XPropertySet )UnoRuntime.queryInterface(
+        XPropertySet xPSetLabel = UnoRuntime.queryInterface(
             XPropertySet.class, labelModel );
         xPSetLabel.setPropertyValue( "PositionX", new Integer( 40 ) );
         xPSetLabel.setPropertyValue( "PositionY", new Integer( 30 ) );
@@ -175,7 +175,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         // create a Cancel button model and set the properties
         Object cancelButtonModel = xMultiServiceFactory.createInstance(
             "com.sun.star.awt.UnoControlButtonModel" );
-        XPropertySet xPSetCancelButton = ( XPropertySet )UnoRuntime.queryInterface(
+        XPropertySet xPSetCancelButton = UnoRuntime.queryInterface(
             XPropertySet.class, cancelButtonModel );
         xPSetCancelButton.setPropertyValue( "PositionX", new Integer( 80 ) );
         xPSetCancelButton.setPropertyValue( "PositionY", new Integer( 70 ) );
@@ -187,7 +187,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         xPSetCancelButton.setPropertyValue( "Label", new String( "Cancel" ) );
 
         // insert the control models into the dialog model
-        XNameContainer xNameCont = ( XNameContainer )UnoRuntime.queryInterface(
+        XNameContainer xNameCont = UnoRuntime.queryInterface(
             XNameContainer.class, dialogModel );
         xNameCont.insertByName( _buttonName, buttonModel );
         xNameCont.insertByName( _labelName, labelModel );
@@ -196,37 +196,37 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
         // create the dialog control and set the model
         Object dialog = xMultiComponentFactory.createInstanceWithContext(
             "com.sun.star.awt.UnoControlDialog", _xComponentContext );
-        XControl xControl = ( XControl )UnoRuntime.queryInterface(
+        XControl xControl = UnoRuntime.queryInterface(
             XControl.class, dialog );
-        XControlModel xControlModel = ( XControlModel )UnoRuntime.queryInterface(
+        XControlModel xControlModel = UnoRuntime.queryInterface(
             XControlModel.class, dialogModel );
         xControl.setModel( xControlModel );
 
         // add an action listener to the button control
-        XControlContainer xControlCont = ( XControlContainer )UnoRuntime.queryInterface(
+        XControlContainer xControlCont = UnoRuntime.queryInterface(
             XControlContainer.class, dialog );
         Object objectButton = xControlCont.getControl( "Button1" );
-        XButton xButton = ( XButton )UnoRuntime.queryInterface(
+        XButton xButton = UnoRuntime.queryInterface(
             XButton.class, objectButton );
         xButton.addActionListener( new ActionListenerImpl( xControlCont ) );
 
         // create a peer
         Object toolkit = xMultiComponentFactory.createInstanceWithContext(
             "com.sun.star.awt.ExtToolkit", _xComponentContext );
-        XToolkit xToolkit = ( XToolkit )UnoRuntime.queryInterface(
+        XToolkit xToolkit = UnoRuntime.queryInterface(
             XToolkit.class, toolkit );
-        XWindow xWindow = ( XWindow )UnoRuntime.queryInterface(
+        XWindow xWindow = UnoRuntime.queryInterface(
             XWindow.class, xControl );
         xWindow.setVisible( false );
         xControl.createPeer( xToolkit, null );
 
         // execute the dialog
-        XDialog xDialog = ( XDialog )UnoRuntime.queryInterface(
+        XDialog xDialog = UnoRuntime.queryInterface(
             XDialog.class, dialog );
         xDialog.execute();
 
         // dispose the dialog
-        XComponent xComponent = ( XComponent )UnoRuntime.queryInterface(
+        XComponent xComponent = UnoRuntime.queryInterface(
             XComponent.class, dialog );
         xComponent.dispose();
     }
@@ -256,7 +256,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
 
             // set label text
             Object label = _xControlCont.getControl( "Label1" );
-            XFixedText xLabel = ( XFixedText )UnoRuntime.queryInterface(
+            XFixedText xLabel = UnoRuntime.queryInterface(
                 XFixedText.class, label );
             xLabel.setText( _labelPrefix + _nCounts );
         }
diff --git a/main/odk/examples/DevelopersGuide/Charts/CalcHelper.java b/main/odk/examples/DevelopersGuide/Charts/CalcHelper.java
index 08751ac009..bb1f2b2493 100644
--- a/main/odk/examples/DevelopersGuide/Charts/CalcHelper.java
+++ b/main/odk/examples/DevelopersGuide/Charts/CalcHelper.java
@@ -82,13 +82,13 @@ public class CalcHelper
 
     public XSpreadsheet getChartSheet() throws RuntimeException
     {
-        XNameAccess aSheetsNA = (XNameAccess) UnoRuntime.queryInterface(
+        XNameAccess aSheetsNA = UnoRuntime.queryInterface(
             XNameAccess.class, maSpreadSheetDoc.getSheets() );
 
         XSpreadsheet aSheet = null;
         try
         {
-            aSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+            aSheet = UnoRuntime.queryInterface(
                 XSpreadsheet.class, aSheetsNA.getByName( msChartSheetName ) );
         }
         catch( NoSuchElementException ex )
@@ -105,7 +105,7 @@ public class CalcHelper
 
     public XSpreadsheet getDataSheet() throws RuntimeException
     {
-        XNameAccess aSheetsNA = (XNameAccess) UnoRuntime.queryInterface(
+        XNameAccess aSheetsNA = UnoRuntime.queryInterface(
             XNameAccess.class, maSpreadSheetDoc.getSheets() );
 
         XSpreadsheet aSheet = null;
@@ -113,7 +113,7 @@ public class CalcHelper
         {
             try
             {
-                aSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+                aSheet = UnoRuntime.queryInterface(
                     XSpreadsheet.class, aSheetsNA.getByName( msDataSheetName ) );
             }
             catch( NoSuchElementException ex )
@@ -149,7 +149,7 @@ public class CalcHelper
         // get the sheet to insert the chart
         try
         {
-            aSheet = (XTableChartsSupplier) UnoRuntime.queryInterface(
+            aSheet = UnoRuntime.queryInterface(
                 XTableChartsSupplier.class, getChartSheet() );
         }
         catch( Exception ex )
@@ -159,7 +159,7 @@ public class CalcHelper
         }
 
         XTableCharts aChartCollection = aSheet.getCharts();
-        XNameAccess  aChartCollectionNA = (XNameAccess) UnoRuntime.queryInterface(
+        XNameAccess  aChartCollectionNA = UnoRuntime.queryInterface(
             XNameAccess.class, aChartCollection );
 
         if( aChartCollectionNA != null &&
@@ -176,21 +176,21 @@ public class CalcHelper
 
             try
             {
-                XTableChart aTableChart = (XTableChart) UnoRuntime.queryInterface(
+                XTableChart aTableChart = UnoRuntime.queryInterface(
                     XTableChart.class, aChartCollectionNA.getByName( sChartName ));
 
                 // the table chart is an embedded object which contains the chart document
-                aResult = (XChartDocument) UnoRuntime.queryInterface(
+                aResult = UnoRuntime.queryInterface(
                     XChartDocument.class,
-                    ((XEmbeddedObjectSupplier) UnoRuntime.queryInterface(
+                    (UnoRuntime.queryInterface(
                         XEmbeddedObjectSupplier.class,
                         aTableChart )).getEmbeddedObject());
 
                 // create a diagram via the factory and set this as new diagram
                 aResult.setDiagram(
-                    (XDiagram) UnoRuntime.queryInterface(
+                    UnoRuntime.queryInterface(
                         XDiagram.class,
-                        ((XMultiServiceFactory) UnoRuntime.queryInterface(
+                        (UnoRuntime.queryInterface(
                             XMultiServiceFactory.class,
                             aResult )).createInstance( sChartServiceName )));
             }
@@ -218,7 +218,7 @@ public class CalcHelper
         try
         {
             XSpreadsheet aSheet = getDataSheet();
-            XCellRange aSheetRange = (XCellRange) UnoRuntime.queryInterface( XCellRange.class, aSheet );
+            XCellRange aSheetRange = UnoRuntime.queryInterface( XCellRange.class, aSheet );
 
             aRange = aSheetRange.getCellRangeByPosition(
                 0, 0,
@@ -281,7 +281,7 @@ public class CalcHelper
         try
         {
             XSpreadsheet aSheet = getDataSheet();
-            XCellRange aSheetRange = (XCellRange) UnoRuntime.queryInterface( XCellRange.class, aSheet );
+            XCellRange aSheetRange = UnoRuntime.queryInterface( XCellRange.class, aSheet );
 
             aRange = aSheetRange.getCellRangeByPosition(
                 0, 0,
@@ -296,7 +296,7 @@ public class CalcHelper
             int nFactorCol = nColumnCount + 2;
             (aSheet.getCellByPosition( nFactorCol - 1, 0 )).setValue( 0.2 );
 
-            XText xCellText = (XText) UnoRuntime.queryInterface( XText.class, aSheet.getCellByPosition( nFactorCol - 1, 1 ) );
+            XText xCellText = UnoRuntime.queryInterface( XText.class, aSheet.getCellByPosition( nFactorCol - 1, 1 ) );
             xCellText.setString( "Change the factor above and\nwatch the changes in the chart" );
 
             for( nCol = 0; nCol < nColumnCount; nCol++ )
@@ -337,9 +337,9 @@ public class CalcHelper
      */
     public void raiseChartSheet()
     {
-        ((XSpreadsheetView) UnoRuntime.queryInterface(
+        (UnoRuntime.queryInterface(
             XSpreadsheetView.class,
-            ((XModel) UnoRuntime.queryInterface(
+            (UnoRuntime.queryInterface(
                 XModel.class,
                 maSpreadSheetDoc )).getCurrentController()) ).setActiveSheet( getChartSheet() );
     }
@@ -362,9 +362,9 @@ public class CalcHelper
         if( maSpreadSheetDoc != null )
         {
             XSpreadsheets  aSheets    = maSpreadSheetDoc.getSheets();
-            XNameContainer aSheetsNC  = (XNameContainer)  UnoRuntime.queryInterface(
+            XNameContainer aSheetsNC  = UnoRuntime.queryInterface(
                 XNameContainer.class, aSheets );
-            XIndexAccess   aSheetsIA  = (XIndexAccess)    UnoRuntime.queryInterface(
+            XIndexAccess   aSheetsIA  = UnoRuntime.queryInterface(
                 XIndexAccess.class, aSheets );
 
             if( aSheets   != null &&
@@ -377,11 +377,11 @@ public class CalcHelper
                     for( int i = aSheetsIA.getCount() - 1; i > 0; i-- )
                     {
                         aSheetsNC.removeByName(
-                            ( (XNamed) UnoRuntime.queryInterface(
+                            ( UnoRuntime.queryInterface(
                                 XNamed.class, aSheetsIA.getByIndex( i ) )).getName() );
                     }
 
-                    XNamed aFirstSheet = (XNamed) UnoRuntime.queryInterface(
+                    XNamed aFirstSheet = UnoRuntime.queryInterface(
                         XNamed.class,
                         aSheetsIA.getByIndex( 0 ));
 
diff --git a/main/odk/examples/DevelopersGuide/Charts/ChartHelper.java b/main/odk/examples/DevelopersGuide/Charts/ChartHelper.java
index be869c6dbc..b6eeac7e85 100644
--- a/main/odk/examples/DevelopersGuide/Charts/ChartHelper.java
+++ b/main/odk/examples/DevelopersGuide/Charts/ChartHelper.java
@@ -77,7 +77,7 @@ public class ChartHelper
     {
         XChartDocument aResult = null;
 
-        XMultiServiceFactory aFact = (XMultiServiceFactory)
+        XMultiServiceFactory aFact =
             UnoRuntime.queryInterface(XMultiServiceFactory.class,
                                       maContainerDocument );
 
@@ -85,19 +85,19 @@ public class ChartHelper
         {
             try
             {
-                XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(
+                XTextContent xTextContent = UnoRuntime.queryInterface(
                 XTextContent.class,
                 aFact.createInstance("com.sun.star.text.TextEmbeddedObject"));
 
                 if ( xTextContent != null )
                 {
-                    XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(
+                    XPropertySet xPropSet = UnoRuntime.queryInterface(
                         XPropertySet.class, xTextContent);
 
                     Any aAny = new Any(String.class, msChartClassID);
                     xPropSet.setPropertyValue("CLSID", aAny );
 
-                    XTextDocument xTextDoc = (XTextDocument)
+                    XTextDocument xTextDoc =
                         UnoRuntime.queryInterface(XTextDocument.class,
                                                   maContainerDocument);
                     XText xText = xTextDoc.getText();
@@ -107,7 +107,7 @@ public class ChartHelper
                     xText.insertTextContent( xCursor, xTextContent, true );
 
                     // set size and position
-                    XShape xShape = (XShape)UnoRuntime.queryInterface(
+                    XShape xShape = UnoRuntime.queryInterface(
                         XShape.class, xTextContent);
                     xShape.setSize( aExtent );
 
@@ -123,16 +123,16 @@ public class ChartHelper
                     xPropSet.setPropertyValue("HoriOrientPosition", aAny );
 
                     // retrieve the chart document as model of the OLE shape
-                    aResult = (XChartDocument) UnoRuntime.queryInterface(
+                    aResult = UnoRuntime.queryInterface(
                             XChartDocument.class,
                             xPropSet.getPropertyValue( "Model" ));
 
                     // create a diagram via the factory and set this as
                     // new diagram
                     aResult.setDiagram(
-                        (XDiagram) UnoRuntime.queryInterface(
+                        UnoRuntime.queryInterface(
                             XDiagram.class,
-                            ((XMultiServiceFactory) UnoRuntime.queryInterface(
+                            (UnoRuntime.queryInterface(
                                 XMultiServiceFactory.class,
                                 aResult )).createInstance(sChartServiceName )));
                 }
@@ -156,7 +156,7 @@ public class ChartHelper
         XShapes aPage = null;
 
         // try interface for multiple pages in a document
-        XDrawPagesSupplier aSupplier = (XDrawPagesSupplier)
+        XDrawPagesSupplier aSupplier =
             UnoRuntime.queryInterface(XDrawPagesSupplier.class,
                                       maContainerDocument );
 
@@ -165,7 +165,7 @@ public class ChartHelper
             try
             {
                 // get first page
-                aPage = (XShapes) UnoRuntime.queryInterface(
+                aPage = UnoRuntime.queryInterface(
                     XShapes.class, aSupplier.getDrawPages().getByIndex( 0 ) );
             }
             catch( Exception ex )
@@ -177,20 +177,20 @@ public class ChartHelper
         else
         {
             // try interface for single draw page (e.g. spreadsheet)
-            XDrawPageSupplier aOnePageSupplier = (XDrawPageSupplier)
+            XDrawPageSupplier aOnePageSupplier =
                 UnoRuntime.queryInterface(XDrawPageSupplier.class,
                                           maContainerDocument );
 
             if( aOnePageSupplier != null )
             {
-                aPage = (XShapes) UnoRuntime.queryInterface(
+                aPage = UnoRuntime.queryInterface(
                     XShapes.class, aOnePageSupplier.getDrawPage());
             }
         }
 
         if( aPage != null )
         {
-            XMultiServiceFactory aFact = (XMultiServiceFactory)
+            XMultiServiceFactory aFact =
                 UnoRuntime.queryInterface(XMultiServiceFactory.class,
                                           maContainerDocument );
 
@@ -199,7 +199,7 @@ public class ChartHelper
                 try
                 {
                     // create an OLE shape
-                    XShape aShape = (XShape) UnoRuntime.queryInterface(
+                    XShape aShape = UnoRuntime.queryInterface(
                         XShape.class,
                         aFact.createInstance( "com.sun.star.drawing.OLE2Shape" ));
 
@@ -209,7 +209,7 @@ public class ChartHelper
                     aShape.setSize( aExtent );
 
                     // make the OLE shape a chart
-                    XPropertySet aShapeProp = (XPropertySet)
+                    XPropertySet aShapeProp =
                         UnoRuntime.queryInterface(XPropertySet.class, aShape );
                     if( aShapeProp != null )
                     {
@@ -217,16 +217,16 @@ public class ChartHelper
                         aShapeProp.setPropertyValue( "CLSID", msChartClassID );
 
                         // retrieve the chart document as model of the OLE shape
-                        aResult = (XChartDocument) UnoRuntime.queryInterface(
+                        aResult = UnoRuntime.queryInterface(
                             XChartDocument.class,
                             aShapeProp.getPropertyValue( "Model" ));
 
                         // create a diagram via the factory and set this as
                         // new diagram
                         aResult.setDiagram(
-                            (XDiagram) UnoRuntime.queryInterface(
+                            UnoRuntime.queryInterface(
                                 XDiagram.class,
-                                ((XMultiServiceFactory) UnoRuntime.queryInterface(
+                                (UnoRuntime.queryInterface(
                                     XMultiServiceFactory.class,
                                     aResult )).createInstance(sChartServiceName )));
                     }
diff --git a/main/odk/examples/DevelopersGuide/Charts/ChartInCalc.java b/main/odk/examples/DevelopersGuide/Charts/ChartInCalc.java
index 74e919dc87..169b7fa8b8 100644
--- a/main/odk/examples/DevelopersGuide/Charts/ChartInCalc.java
+++ b/main/odk/examples/DevelopersGuide/Charts/ChartInCalc.java
@@ -77,7 +77,7 @@ public class ChartInCalc
 
         // insert a cell range with 4 columns and 24 rows filled with random numbers
         XCellRange aRange = aCalcHelper.insertRandomRange( 4, 24 );
-        CellRangeAddress aRangeAddress = ((XCellRangeAddressable) UnoRuntime.queryInterface(
+        CellRangeAddress aRangeAddress = (UnoRuntime.queryInterface(
             XCellRangeAddressable.class, aRange)).getRangeAddress();
 
         // change view to sheet containing the chart
@@ -147,7 +147,7 @@ public class ChartInCalc
     public void lockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
     }
 
     // ____________________
@@ -155,7 +155,7 @@ public class ChartInCalc
     public void unlockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
     }
 
     // ____________________
@@ -164,7 +164,7 @@ public class ChartInCalc
         throws RuntimeException, UnknownPropertyException, PropertyVetoException,
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
-        XPropertySet aDiaProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, maDiagram );
+        XPropertySet aDiaProp = UnoRuntime.queryInterface( XPropertySet.class, maDiagram );
 
         if( aDiaProp != null )
         {
@@ -234,7 +234,7 @@ public class ChartInCalc
             // determine the maximum value of the first series
             int nMaxIndex = 0;
 
-            XChartDataArray aDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+            XChartDataArray aDataArray = UnoRuntime.queryInterface(
                 XChartDataArray.class, maChartDocument.getData());
             double aData[][] = aDataArray.getData();
 
@@ -290,7 +290,7 @@ public class ChartInCalc
         throws RuntimeException, UnknownPropertyException, PropertyVetoException,
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
-        XPropertySet aWall = ((X3DDisplay) UnoRuntime.queryInterface(
+        XPropertySet aWall = (UnoRuntime.queryInterface(
                                   X3DDisplay.class, maDiagram )).getWall();
 
         // change background color of area
@@ -305,12 +305,12 @@ public class ChartInCalc
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
         // change main title
-        XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
+        XPropertySet aDocProp = UnoRuntime.queryInterface(
             XPropertySet.class, maChartDocument );
         aDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
 
         XShape aTitle = maChartDocument.getTitle();
-        XPropertySet aTitleProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aTitle );
+        XPropertySet aTitleProp = UnoRuntime.queryInterface( XPropertySet.class, aTitle );
 
         // set new text
         if( aTitleProp != null )
@@ -320,8 +320,8 @@ public class ChartInCalc
         }
 
         // align title with y axis
-        XShape aAxis = (XShape) UnoRuntime.queryInterface(
-            XShape.class, ((XAxisYSupplier) UnoRuntime.queryInterface(
+        XShape aAxis = UnoRuntime.queryInterface(
+            XShape.class, (UnoRuntime.queryInterface(
                 XAxisYSupplier.class, maDiagram )).getYAxis() );
 
         if( aAxis != null &&
@@ -341,7 +341,7 @@ public class ChartInCalc
                MalformedNumberFormatException
     {
         // x axis
-        XPropertySet aAxisProp = ((XAxisXSupplier) UnoRuntime.queryInterface(
+        XPropertySet aAxisProp = (UnoRuntime.queryInterface(
                                       XAxisXSupplier.class, maDiagram )).getXAxis();
         if( aAxisProp != null )
         {
@@ -350,12 +350,12 @@ public class ChartInCalc
         }
 
         // change number format for y axis
-        aAxisProp = ((XAxisYSupplier) UnoRuntime.queryInterface(
+        aAxisProp = (UnoRuntime.queryInterface(
                          XAxisYSupplier.class, maDiagram )).getYAxis();
 
         // add a new custom number format and get the new key
         int nNewNumberFormat = 0;
-        XNumberFormatsSupplier aNumFmtSupp = (XNumberFormatsSupplier) UnoRuntime.queryInterface(
+        XNumberFormatsSupplier aNumFmtSupp = UnoRuntime.queryInterface(
             XNumberFormatsSupplier.class, maChartDocument );
 
         if( aNumFmtSupp != null )
@@ -380,9 +380,9 @@ public class ChartInCalc
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
         // y major grid
-        XPropertySet aGridProp = (XPropertySet) UnoRuntime.queryInterface(
+        XPropertySet aGridProp = UnoRuntime.queryInterface(
             XPropertySet.class,
-            ( (XAxisYSupplier) UnoRuntime.queryInterface(
+            ( UnoRuntime.queryInterface(
                 XAxisYSupplier.class, maDiagram )).getYMainGrid());
 
         if( aGridProp != null )
diff --git a/main/odk/examples/DevelopersGuide/Charts/ChartInDraw.java b/main/odk/examples/DevelopersGuide/Charts/ChartInDraw.java
index c04bd55985..716dc61fba 100644
--- a/main/odk/examples/DevelopersGuide/Charts/ChartInDraw.java
+++ b/main/odk/examples/DevelopersGuide/Charts/ChartInDraw.java
@@ -125,7 +125,7 @@ public class ChartInDraw
     public void lockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
     }
 
     // ____________________
@@ -133,7 +133,7 @@ public class ChartInDraw
     public void unlockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
     }
 
     // ____________________
@@ -158,7 +158,7 @@ public class ChartInDraw
         throws RuntimeException, UnknownPropertyException, PropertyVetoException,
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
-        XPropertySet aWall = ((X3DDisplay) UnoRuntime.queryInterface(
+        XPropertySet aWall = (UnoRuntime.queryInterface(
                                   X3DDisplay.class, maDiagram )).getWall();
 
         // change background color of area
@@ -173,12 +173,12 @@ public class ChartInDraw
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
         // change main title
-        XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
+        XPropertySet aDocProp = UnoRuntime.queryInterface(
             XPropertySet.class, maChartDocument );
         aDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
 
         XShape aTitle = maChartDocument.getTitle();
-        XPropertySet aTitleProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aTitle );
+        XPropertySet aTitleProp = UnoRuntime.queryInterface( XPropertySet.class, aTitle );
 
         // set new text
         if( aTitleProp != null )
@@ -194,7 +194,7 @@ public class ChartInDraw
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
         XShape aLegend = maChartDocument.getLegend();
-        XPropertySet aLegendProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aLegend );
+        XPropertySet aLegendProp = UnoRuntime.queryInterface( XPropertySet.class, aLegend );
 
         aLegendProp.setPropertyValue( "Alignment", ChartLegendPosition.LEFT );
         aLegendProp.setPropertyValue( "FillStyle", FillStyle.SOLID );
@@ -208,7 +208,7 @@ public class ChartInDraw
         com.sun.star.lang.IllegalArgumentException, WrappedTargetException,
         com.sun.star.lang.IndexOutOfBoundsException
     {
-        XPropertySet aDiaProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, maDiagram );
+        XPropertySet aDiaProp = UnoRuntime.queryInterface( XPropertySet.class, maDiagram );
         Boolean aTrue = new Boolean( true );
 
         aDiaProp.setPropertyValue( "Dim3D", aTrue );
@@ -217,7 +217,7 @@ public class ChartInDraw
         aDiaProp.setPropertyValue( "SolidType", new Integer( ChartSolidType.CYLINDER ));
 
         // change floor color to Magenta6
-        XPropertySet aFloor = ((X3DDisplay) UnoRuntime.queryInterface(
+        XPropertySet aFloor = (UnoRuntime.queryInterface(
                                    X3DDisplay.class, maDiagram )).getFloor();
         aFloor.setPropertyValue( "FillColor", new Integer( 0x6b2394 ));
 
diff --git a/main/odk/examples/DevelopersGuide/Charts/ChartInWriter.java b/main/odk/examples/DevelopersGuide/Charts/ChartInWriter.java
index 2ae62d2fdf..fba45ed30f 100644
--- a/main/odk/examples/DevelopersGuide/Charts/ChartInWriter.java
+++ b/main/odk/examples/DevelopersGuide/Charts/ChartInWriter.java
@@ -79,7 +79,7 @@ public class ChartInWriter
         Helper aHelper = new Helper( args );
 
         ChartHelper aChartHelper = new ChartHelper(
-            (XModel) UnoRuntime.queryInterface( XModel.class,
+            UnoRuntime.queryInterface( XModel.class,
                                                 aHelper.createTextDocument()));
 
         // the unit for measures is 1/100th of a millimeter
@@ -132,7 +132,7 @@ public class ChartInWriter
     public void lockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).lockControllers();
     }
 
     // ____________________
@@ -140,7 +140,7 @@ public class ChartInWriter
     public void unlockControllers()
         throws RuntimeException
     {
-        ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+        (UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
     }
 
     // ____________________
@@ -149,7 +149,7 @@ public class ChartInWriter
         throws RuntimeException, UnknownPropertyException, PropertyVetoException,
                com.sun.star.lang.IllegalArgumentException, WrappedTargetException
     {
-        XPropertySet aWall = ((X3DDisplay) UnoRuntime.queryInterface(
+        XPropertySet aWall = (UnoRuntime.queryInterface(
                                   X3DDisplay.class, maDiagram )).getWall();
 
         // change background color of area
diff --git a/main/odk/examples/DevelopersGuide/Charts/Helper.java b/main/odk/examples/DevelopersGuide/Charts/Helper.java
index e8e8283bf2..a4854b9043 100644
--- a/main/odk/examples/DevelopersGuide/Charts/Helper.java
+++ b/main/odk/examples/DevelopersGuide/Charts/Helper.java
@@ -88,7 +88,7 @@ public class Helper
 
     public XSpreadsheetDocument createSpreadsheetDocument()
     {
-        return (XSpreadsheetDocument) UnoRuntime.queryInterface(
+        return UnoRuntime.queryInterface(
             XSpreadsheetDocument.class, createDocument( "scalc" ));
     }
 
@@ -120,12 +120,12 @@ public class Helper
         XModel aResult = null;
         try
         {
-            XComponentLoader aLoader = (XComponentLoader)
+            XComponentLoader aLoader =
                 UnoRuntime.queryInterface(XComponentLoader.class,
                 maMCFactory.createInstanceWithContext("com.sun.star.frame.Desktop",
                                                       maContext) );
 
-            aResult = (XModel) UnoRuntime.queryInterface(
+            aResult = UnoRuntime.queryInterface(
                 XModel.class,
                 aLoader.loadComponentFromURL( "private:factory/" + sDocType,
                                               "_blank",
diff --git a/main/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java b/main/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
index 1fb7606547..cc441188d1 100644
--- a/main/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
+++ b/main/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
@@ -75,10 +75,10 @@ public class JavaSampleChartAddIn extends WeakBase implements
     {
         if( aArguments.length > 0 )
         {
-            maChartDocument = (XChartDocument) UnoRuntime.queryInterface(
+            maChartDocument = UnoRuntime.queryInterface(
                 XChartDocument.class, aArguments[ 0 ]);
 
-            XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet aDocProp = UnoRuntime.queryInterface(
                 XPropertySet.class, maChartDocument );
             if( aDocProp != null )
             {
@@ -87,14 +87,14 @@ public class JavaSampleChartAddIn extends WeakBase implements
             }
 
             // get the draw page
-            XDrawPageSupplier aPageSupp = (XDrawPageSupplier) UnoRuntime.queryInterface(
+            XDrawPageSupplier aPageSupp = UnoRuntime.queryInterface(
                 XDrawPageSupplier.class, maChartDocument );
             if( aPageSupp != null )
-                maDrawPage = (XDrawPage) UnoRuntime.queryInterface(
+                maDrawPage = UnoRuntime.queryInterface(
                     XDrawPage.class, aPageSupp.getDrawPage() );
 
             // get a factory for creating shapes
-            maShapeFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(
+            maShapeFactory = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, maChartDocument );
         }
     }
@@ -107,13 +107,13 @@ public class JavaSampleChartAddIn extends WeakBase implements
             maTopLine == null )
         {
             // try to recycle loaded shapes
-            XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet aDocProp = UnoRuntime.queryInterface(
                 XPropertySet.class, maChartDocument );
             if( aDocProp != null )
             {
                 try
                 {
-                    XIndexAccess aShapesIA = (XIndexAccess) UnoRuntime.queryInterface(
+                    XIndexAccess aShapesIA = UnoRuntime.queryInterface(
                         XIndexAccess.class, aDocProp.getPropertyValue( "AdditionalShapes" ));
                     if( aShapesIA != null &&
                         aShapesIA.getCount() > 0 )
@@ -122,11 +122,11 @@ public class JavaSampleChartAddIn extends WeakBase implements
                         String aName;
                         for( int i = aShapesIA.getCount() - 1; i >= 0; --i )
                         {
-                            aShape = (XShape) UnoRuntime.queryInterface(
+                            aShape = UnoRuntime.queryInterface(
                                 XShape.class, aShapesIA.getByIndex( i ));
                             if( aShape != null )
                             {
-                                XPropertySet aProp = (XPropertySet) UnoRuntime.queryInterface(
+                                XPropertySet aProp = UnoRuntime.queryInterface(
                                     XPropertySet.class, aShape );
                                 aName = (String) aProp.getPropertyValue( "Name" );
 
@@ -154,12 +154,12 @@ public class JavaSampleChartAddIn extends WeakBase implements
         {
             if( maTopLine == null )
             {
-                maTopLine = (XShape) UnoRuntime.queryInterface(
+                maTopLine = UnoRuntime.queryInterface(
                     XShape.class, maShapeFactory.createInstance( "com.sun.star.drawing.LineShape" ));
                 maDrawPage.add( maTopLine );
 
                 // make line red and thicker
-                XPropertySet aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet aShapeProp = UnoRuntime.queryInterface(
                     XPropertySet.class, maTopLine );
 
                 aShapeProp.setPropertyValue( "LineColor", new Integer( 0xe01010 ));
@@ -177,12 +177,12 @@ public class JavaSampleChartAddIn extends WeakBase implements
         {
             if( maBottomLine == null )
             {
-                maBottomLine = (XShape) UnoRuntime.queryInterface(
+                maBottomLine = UnoRuntime.queryInterface(
                     XShape.class, maShapeFactory.createInstance( "com.sun.star.drawing.LineShape" ));
                 maDrawPage.add( maBottomLine );
 
                 // make line green and thicker
-                XPropertySet aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
+                XPropertySet aShapeProp = UnoRuntime.queryInterface(
                     XPropertySet.class, maBottomLine );
 
                 aShapeProp.setPropertyValue( "LineColor", new Integer( 0x10e010 ));
@@ -206,17 +206,17 @@ public class JavaSampleChartAddIn extends WeakBase implements
         // --------------
 
         // get data
-        XChartDataArray aDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+        XChartDataArray aDataArray = UnoRuntime.queryInterface(
             XChartDataArray.class, maChartDocument.getData());
         double aData[][] = aDataArray.getData();
 
         // get axes
         XDiagram aDiagram = maChartDocument.getDiagram();
-        XShape aXAxis = (XShape) UnoRuntime.queryInterface(
-            XShape.class, ((XAxisXSupplier) UnoRuntime.queryInterface(
+        XShape aXAxis = UnoRuntime.queryInterface(
+            XShape.class, (UnoRuntime.queryInterface(
                                XAxisXSupplier.class, aDiagram )).getXAxis() );
-        XShape aYAxis = (XShape) UnoRuntime.queryInterface(
-            XShape.class, ((XAxisYSupplier) UnoRuntime.queryInterface(
+        XShape aYAxis = UnoRuntime.queryInterface(
+            XShape.class, (UnoRuntime.queryInterface(
                                XAxisYSupplier.class, aDiagram )).getYAxis() );
 
         // calculate points for hull
@@ -248,11 +248,11 @@ public class JavaSampleChartAddIn extends WeakBase implements
         // apply point sequences to lines
         try
         {
-            XPropertySet aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet aShapeProp = UnoRuntime.queryInterface(
                 XPropertySet.class, maTopLine );
             aShapeProp.setPropertyValue( "PolyPolygon", aMaxPtSeq );
 
-            aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
+            aShapeProp = UnoRuntime.queryInterface(
                 XPropertySet.class, maBottomLine );
             aShapeProp.setPropertyValue( "PolyPolygon", aMinPtSeq );
         }
@@ -325,20 +325,20 @@ public class JavaSampleChartAddIn extends WeakBase implements
     // XShape : XDiagram
     public Size getSize() throws RuntimeException
     {
-        return ((XShape) UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).getSize();
+        return (UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).getSize();
     }
     public void setSize( Size aSize ) throws RuntimeException, PropertyVetoException
     {
-        ((XShape) UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).setSize( aSize );
+        (UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).setSize( aSize );
     }
 
     public Point getPosition() throws RuntimeException
     {
-        return ((XShape) UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).getPosition();
+        return (UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).getPosition();
     }
     public void setPosition( Point aPos ) throws RuntimeException
     {
-        ((XShape) UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).setPosition( aPos );
+        (UnoRuntime.queryInterface( XShape.class, maChartDocument.getDiagram())).setPosition( aPos );
     }
 
     // XShapeDescriptor : XShape : XDiagram
@@ -365,7 +365,7 @@ public class JavaSampleChartAddIn extends WeakBase implements
 
         if( aAxis != null )
         {
-            XPropertySet aAxisProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet aAxisProp = UnoRuntime.queryInterface(
                 XPropertySet.class, aAxis );
 
             try
diff --git a/main/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java b/main/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
index d0c4ab110b..a04d0b15bf 100644
--- a/main/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
+++ b/main/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
@@ -103,7 +103,7 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
             "com.sun.star.chart.XYDiagram" );
 
         // attach the data coming from the cell range to the chart
-        maChartData = (XChartData) UnoRuntime.queryInterface( XChartData.class, aRange );
+        maChartData = UnoRuntime.queryInterface( XChartData.class, aRange );
         maChartDocument.attachData( maChartData );
     }
 
@@ -113,16 +113,16 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
     {
         try
         {
-            ((XPropertySet) UnoRuntime.queryInterface(
+            (UnoRuntime.queryInterface(
                 XPropertySet.class, maChartDocument )).setPropertyValue(
                 "HasSubTitle", new Boolean( true ));
 
             // start listening for death of spreadsheet
-            ((XComponent) UnoRuntime.queryInterface(
+            (UnoRuntime.queryInterface(
                 XComponent.class, maSheetDoc )).addEventListener( this );
 
             // start listening for death of chart
-            ((XComponent) UnoRuntime.queryInterface(
+            (UnoRuntime.queryInterface(
                 XComponent.class, maChartDocument )).addEventListener( this );
 
             //start listening for change of data
@@ -154,9 +154,9 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
         maChartData.removeChartDataChangeEventListener( this );
 
         // remove dispose listeners
-        ((XComponent) UnoRuntime.queryInterface(
+        (UnoRuntime.queryInterface(
             XComponent.class, maSheetDoc )).removeEventListener( this );
-        ((XComponent) UnoRuntime.queryInterface(
+        (UnoRuntime.queryInterface(
             XComponent.class, maChartDocument )).removeEventListener( this );
 
         System.exit( 0 );
@@ -172,11 +172,11 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
 
         try
         {
-            XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
+            XPropertySet aDocProp = UnoRuntime.queryInterface(
                 XPropertySet.class, maChartDocument );
             aDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
 
-            ((XPropertySet) UnoRuntime.queryInterface(
+            (UnoRuntime.queryInterface(
                 XPropertySet.class, maChartDocument.getSubTitle())).setPropertyValue(
                 "String", aTitle );
 
diff --git a/main/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java b/main/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
index cfefee0f14..6d83d0ac2c 100644
--- a/main/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
+++ b/main/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
@@ -75,7 +75,7 @@ public class SelectionChangeListener implements XSelectionChangeListener {
 
         // insert a cell range with 4 columns and 12 rows filled with random numbers
         XCellRange aRange = aCalcHelper.insertRandomRange( 4, 12 );
-        CellRangeAddress aRangeAddress = ((XCellRangeAddressable) UnoRuntime.queryInterface(
+        CellRangeAddress aRangeAddress = (UnoRuntime.queryInterface(
             XCellRangeAddressable.class, aRange)).getRangeAddress();
 
         // change view to sheet containing the chart
@@ -105,9 +105,9 @@ public class SelectionChangeListener implements XSelectionChangeListener {
 
         while( bTrying ) {
             // start listening for selection changes
-            XSelectionSupplier aSelSupp = (XSelectionSupplier) UnoRuntime.queryInterface(
+            XSelectionSupplier aSelSupp = UnoRuntime.queryInterface(
                 XSelectionSupplier.class,
-                (((XModel) UnoRuntime.queryInterface(
+                ((UnoRuntime.queryInterface(
                 XModel.class, maChartDocument )).getCurrentController()) );
             if( aSelSupp != null ) {
                 aSelSupp.addSelectionChangeListener( this );
@@ -116,7 +116,7 @@ public class SelectionChangeListener implements XSelectionChangeListener {
             }
 
             // start listening for death of Controller
-            XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSelSupp );
+            XComponent aComp = UnoRuntime.queryInterface( XComponent.class, aSelSupp );
             if( aComp != null ) {
                 aComp.addEventListener( this );
                 System.out.println( "Successfully attached as dispose listener" );
@@ -136,13 +136,13 @@ public class SelectionChangeListener implements XSelectionChangeListener {
         System.out.println( "disposing called.  detaching as listener" );
 
         // stop listening for selection changes
-        XSelectionSupplier aCtrl = (XSelectionSupplier) UnoRuntime.queryInterface(
+        XSelectionSupplier aCtrl = UnoRuntime.queryInterface(
             XSelectionSupplier.class, aSourceObj );
         if( aCtrl != null )
             aCtrl.removeSelectionChangeListener( this );
 
         // remove as dispose listener
-        XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSourceObj );
+        XComponent aComp = UnoRuntime.queryInterface( XComponent.class, aSourceObj );
         if( aComp != null )
             aComp.removeEventListener( this );
 
@@ -154,7 +154,7 @@ public class SelectionChangeListener implements XSelectionChangeListener {
 
     // XSelectionChangeListener
     public void selectionChanged( EventObject aEvent ) {
-        XController aCtrl = (XController) UnoRuntime.queryInterface( XController.class, aEvent.Source );
+        XController aCtrl = UnoRuntime.queryInterface( XController.class, aEvent.Source );
         if( aCtrl != null ) {
             XMultiComponentFactory mMCF = maContext.getServiceManager();
 
@@ -187,17 +187,17 @@ public class SelectionChangeListener implements XSelectionChangeListener {
                 Object oDesktop = mMCF.createInstanceWithContext("com.sun.star.frame.Desktop", maContext);
                 Object oToolKit = mMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", maContext);
 
-                aDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, oDesktop);
-                aToolKit = (XInterface) UnoRuntime.queryInterface(XInterface.class, oToolKit);
+                aDesktop = UnoRuntime.queryInterface(XDesktop.class, oDesktop);
+                aToolKit = UnoRuntime.queryInterface(XInterface.class, oToolKit);
             } catch (Exception ex) {
                 ex.printStackTrace();
             }
 
             XWindow xWin = aDesktop.getCurrentFrame().getContainerWindow();
-            XWindowPeer aWinPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xWin);
+            XWindowPeer aWinPeer = UnoRuntime.queryInterface(XWindowPeer.class, xWin);
 
             int button = com.sun.star.awt.MessageBoxButtons.BUTTONS_OK;
-            XMessageBoxFactory aMBF = (XMessageBoxFactory) UnoRuntime.queryInterface(XMessageBoxFactory.class, aToolKit);
+            XMessageBoxFactory aMBF = UnoRuntime.queryInterface(XMessageBoxFactory.class, aToolKit);
             XMessageBox xMB = aMBF.createMessageBox(aWinPeer, MessageBoxType.INFOBOX, button, "Event-Notify", "Listener was called, selection has changed");
             xMB.execute();
         }
diff --git a/main/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java b/main/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
index ed47b26474..be04745052 100644
--- a/main/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
+++ b/main/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java
@@ -253,7 +253,7 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob
         try
         {
             // get access to the office toolkit environment
-            com.sun.star.awt.XToolkit xKit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
+            com.sun.star.awt.XToolkit xKit = UnoRuntime.queryInterface(
                  com.sun.star.awt.XToolkit.class,
                  m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
                                                                          m_xCmpCtx));
@@ -267,13 +267,13 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob
                                             com.sun.star.awt.WindowAttribute.CLOSEABLE;
             aDescriptor.Type              = com.sun.star.awt.WindowClass.MODALTOP;
             aDescriptor.ParentIndex       = 1;
-            aDescriptor.Parent            = (com.sun.star.awt.XWindowPeer)UnoRuntime.queryInterface(
+            aDescriptor.Parent            = UnoRuntime.queryInterface(
                                                 com.sun.star.awt.XWindowPeer.class,
                                                 xParent);
 
             // create the info box window
             com.sun.star.awt.XWindowPeer xPeer    = xKit.createWindow(aDescriptor);
-            com.sun.star.awt.XMessageBox xInfoBox = (com.sun.star.awt.XMessageBox)UnoRuntime.queryInterface(
+            com.sun.star.awt.XMessageBox xInfoBox = UnoRuntime.queryInterface(
                                                         com.sun.star.awt.XMessageBox.class,
                                                         xPeer);
             if (xInfoBox == null)
diff --git a/main/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/main/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
index 65d89ab8a4..06f70a6519 100644
--- a/main/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
+++ b/main/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
@@ -93,12 +93,12 @@ public class ProtocolHandlerAddon {
 
             if ( object.length > 0 )
             {
-                m_xFrame = ( XFrame ) UnoRuntime.queryInterface(
+                m_xFrame = UnoRuntime.queryInterface(
                     XFrame.class, object[ 0 ] );
             }
 
             // Create the toolkit to have access to it later
-            m_xToolkit = (XToolkit) UnoRuntime.queryInterface(
+            m_xToolkit = UnoRuntime.queryInterface(
                 XToolkit.class,
                 m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
                                                                         m_xCmpCtx));
@@ -204,7 +204,7 @@ public class ProtocolHandlerAddon {
                     aDescriptor.Type              = WindowClass.MODALTOP;
                     aDescriptor.WindowServiceName = new String( "infobox" );
                     aDescriptor.ParentIndex       = -1;
-                    aDescriptor.Parent            = (XWindowPeer)UnoRuntime.queryInterface(
+                    aDescriptor.Parent            = UnoRuntime.queryInterface(
                         XWindowPeer.class, m_xFrame.getContainerWindow());
                     aDescriptor.Bounds            = new Rectangle(0,0,300,200);
                     aDescriptor.WindowAttributes  = WindowAttribute.BORDER |
@@ -213,7 +213,7 @@ public class ProtocolHandlerAddon {
 
                     XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
                     if ( null != xPeer ) {
-                        XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
+                        XMessageBox xMsgBox = UnoRuntime.queryInterface(
                             XMessageBox.class, xPeer);
                         if ( null != xMsgBox )
                         {
diff --git a/main/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java b/main/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
index 0979a94db3..1dfd00c48c 100644
--- a/main/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
+++ b/main/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
@@ -43,7 +43,7 @@ public class TestJavaComponent
         XMultiComponentFactory serviceManager, Object singleFactory )
         throws com.sun.star.uno.Exception
     {
-        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
+        XSet set = UnoRuntime.queryInterface( XSet.class, serviceManager );
         set.insert( singleFactory );
     }
 
@@ -51,7 +51,7 @@ public class TestJavaComponent
         XMultiComponentFactory serviceManager, Object singleFactory )
         throws com.sun.star.uno.Exception
     {
-        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
+        XSet set = UnoRuntime.queryInterface( XSet.class, serviceManager );
         set.remove( singleFactory );
 
     }
diff --git a/main/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/main/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index 45874bbf04..18c5caf312 100644
--- a/main/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/main/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
@@ -75,7 +75,7 @@ public class DialogComponent {
 
 			try {
 				// Create the toolkit to have access to it later
-				m_xToolkit = (XToolkit) UnoRuntime.queryInterface(
+				m_xToolkit = UnoRuntime.queryInterface(
 					XToolkit.class,
 					m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
 																			m_xCmpCtx));
@@ -106,7 +106,7 @@ public class DialogComponent {
 						"com.sun.star.awt.DialogProvider2", m_xCmpCtx );
 				}
 
-				XDialogProvider2 xDialogProvider = (XDialogProvider2)
+				XDialogProvider2 xDialogProvider =
 					UnoRuntime.queryInterface( XDialogProvider2.class, obj );
 
 				XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );
@@ -120,13 +120,13 @@ public class DialogComponent {
 		}
 
 		public void copyText( XDialog xDialog, Object aEventObject ) {
-			XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(
+			XControlContainer xControlContainer = UnoRuntime.queryInterface(
 				XControlContainer.class, xDialog );
 			String aTextPropertyStr = "Text";
 			String aText = "";
 			XControl xTextField1Control = xControlContainer.getControl( "TextField1" );
 			XControlModel xControlModel1 = xTextField1Control.getModel();
-			XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(
+			XPropertySet xPropertySet1 = UnoRuntime.queryInterface(
 				XPropertySet.class, xControlModel1 );
 			try
 			{
@@ -138,7 +138,7 @@ public class DialogComponent {
 
 			XControl xTextField2Control = xControlContainer.getControl( "TextField2" );
 			XControlModel xControlModel2 = xTextField2Control.getModel();
-			XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(
+			XPropertySet xPropertySet2 = UnoRuntime.queryInterface(
 				XPropertySet.class, xControlModel2 );
 			try
 			{
@@ -251,7 +251,7 @@ public class DialogComponent {
 					aDescriptor.Type              = WindowClass.MODALTOP;
 					aDescriptor.WindowServiceName = new String( "infobox" );
 					aDescriptor.ParentIndex       = -1;
-					aDescriptor.Parent            = (XWindowPeer)UnoRuntime.queryInterface(
+					aDescriptor.Parent            = UnoRuntime.queryInterface(
 						XWindowPeer.class, m_xFrame.getContainerWindow());
 					aDescriptor.Bounds            = new Rectangle(0,0,300,200);
 					aDescriptor.WindowAttributes  = WindowAttribute.BORDER |
@@ -260,7 +260,7 @@ public class DialogComponent {
 
 					XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
 					if ( null != xPeer ) {
-						XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
+						XMessageBox xMsgBox = UnoRuntime.queryInterface(
 							XMessageBox.class, xPeer);
 						if ( null != xMsgBox )
 						{
diff --git a/main/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/main/odk/examples/DevelopersGuide/Config/ConfigExamples.java
index aacad47857..82e6ef6f42 100644
--- a/main/odk/examples/DevelopersGuide/Config/ConfigExamples.java
+++ b/main/odk/examples/DevelopersGuide/Config/ConfigExamples.java
@@ -174,7 +174,7 @@ public class ConfigExamples
         {
             // check the provider implementation
             XServiceInfo xProviderServices =
-                (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, xProvider );
+                UnoRuntime.queryInterface( XServiceInfo.class, xProvider );
 
             if (xProviderServices == null ||
                 !xProviderServices.supportsService("com.sun.star.configuration.ConfigurationProvider"))
@@ -212,7 +212,7 @@ public class ConfigExamples
         final String sProviderService = "com.sun.star.configuration.ConfigurationProvider";
 
         // create the provider and return it as a XMultiServiceFactory
-        XMultiServiceFactory xProvider = (XMultiServiceFactory)
+        XMultiServiceFactory xProvider =
             UnoRuntime.queryInterface(XMultiServiceFactory.class,
                 mxServiceManager.createInstanceWithContext(sProviderService,
                                                            mxContext));
@@ -384,7 +384,7 @@ public class ConfigExamples
 
       // accessing a single nested value
         XHierarchicalPropertySet xProperties =
-            (XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, xViewRoot);
+            UnoRuntime.queryInterface(XHierarchicalPropertySet.class, xViewRoot);
 
         Object aVisible = xProperties.getHierarchicalPropertyValue("Option/VisibleGrid");
         options.visible = ((Boolean) aVisible).booleanValue();
@@ -393,7 +393,7 @@ public class ConfigExamples
         Object xSubdivision = xProperties.getHierarchicalPropertyValue("Subdivision");
 
         XMultiPropertySet xSubdivProperties =
-            (XMultiPropertySet)UnoRuntime.queryInterface(XMultiPropertySet.class, xSubdivision);
+            UnoRuntime.queryInterface(XMultiPropertySet.class, xSubdivision);
 
         // variables for multi-element access
         String[] aElementNames = new String[2];
@@ -410,7 +410,7 @@ public class ConfigExamples
         Object xResolution = xProperties.getHierarchicalPropertyValue("Resolution");
 
         XMultiHierarchicalPropertySet xResolutionProperties =
-            (XMultiHierarchicalPropertySet)
+
                 UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, xResolution);
 
         aElementNames[0] = "XAxis/Metric";
@@ -424,7 +424,7 @@ public class ConfigExamples
       // all options have been retrieved - clean up and return
         // we are done with the view - dispose it
 
-        ((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
+        (UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
 
         return options;
     }
@@ -445,7 +445,7 @@ public class ConfigExamples
     {
         // First process this as an element (preorder traversal)
         XHierarchicalName xElementPath =
-            (XHierarchicalName) UnoRuntime.queryInterface(XHierarchicalName.class, xElement);
+            UnoRuntime.queryInterface(XHierarchicalName.class, xElement);
 
         String sPath = xElementPath.getHierarchicalName();
 
@@ -453,7 +453,7 @@ public class ConfigExamples
 
         // now process this as a container
         XNameAccess xChildAccess =
-            (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement);
+            UnoRuntime.queryInterface(XNameAccess.class, xElement);
 
         // get a list of child elements
         String[] aElementNames = xChildAccess.getElementNames();
@@ -467,7 +467,7 @@ public class ConfigExamples
             if ( aAnyConv.isObject(aChild) && !aAnyConv.isArray(aChild) )
             {
                 // then get an interface
-                XInterface xChildElement = (XInterface)UnoRuntime.queryInterface(XInterface.class, aChild);
+                XInterface xChildElement = UnoRuntime.queryInterface(XInterface.class, aChild);
 
                 // and continue processing child elements recursively
                 browseElementRecursively( xChildElement, aProcessor );
@@ -505,7 +505,7 @@ public class ConfigExamples
         //   This assumes that the processor
         //   does not keep a reference to the elements in processStructuralElement
 
-        ((XComponent) UnoRuntime.queryInterface(XComponent.class,xViewRoot)).dispose();
+        (UnoRuntime.queryInterface(XComponent.class,xViewRoot)).dispose();
         xViewRoot = null;
     }
 
@@ -544,11 +544,11 @@ public class ConfigExamples
                public void processStructuralElement( String sPath_, XInterface xElement_) {
                    // get template information, to detect instances of the 'Filter' template
                    XTemplateInstance xInstance =
-                       ( XTemplateInstance )UnoRuntime.queryInterface( XTemplateInstance .class,xElement_);
+                       UnoRuntime.queryInterface( XTemplateInstance .class,xElement_);
 
                    // only select the Filter entries
                    if (xInstance != null && xInstance.getTemplateName().endsWith("Filter")) {
-                        XNamed xNamed = (XNamed)UnoRuntime.queryInterface(XNamed.class,xElement_);
+                        XNamed xNamed = UnoRuntime.queryInterface(XNamed.class,xElement_);
                         System.out.println("Filter " + xNamed.getName() + " (" + sPath_ + ")");
                    }
                }
@@ -574,7 +574,7 @@ public class ConfigExamples
       // set up the initial values and register listeners
         // get a data access interface, to supply the view with a model
         XMultiHierarchicalPropertySet xProperties =
-            (XMultiHierarchicalPropertySet)
+
                 UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, xViewRoot);
 
         dialog.setModel( xProperties );
@@ -584,7 +584,7 @@ public class ConfigExamples
         XChangesListener xListener = dialog.createChangesListener( );
 
         XChangesNotifier xNotifier =
-            (XChangesNotifier)UnoRuntime.queryInterface(XChangesNotifier.class, xViewRoot);
+            UnoRuntime.queryInterface(XChangesNotifier.class, xViewRoot);
 
         xNotifier.addChangesListener( xListener );
 
@@ -595,7 +595,7 @@ public class ConfigExamples
         {
             // changes have been applied to the view here
             XChangesBatch xUpdateControl =
-                (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
+                UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
 
             try
             {
@@ -612,7 +612,7 @@ public class ConfigExamples
         xNotifier.removeChangesListener( xListener );
 
         // we are done with the view - dispose it
-        ((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
+        (UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
     }
 
     /** A class that changes some grid options settings
@@ -716,7 +716,7 @@ public class ConfigExamples
             try
             {
                 XHierarchicalPropertySet xHPS =
-                    (XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, mxModel);
+                    UnoRuntime.queryInterface(XHierarchicalPropertySet.class, mxModel);
 
                 final String sSetting = "Option/VisibleGrid";
 
@@ -744,7 +744,7 @@ public class ConfigExamples
         {
             Object xOtherViewRoot = createUpdatableView(xKey);
 
-            XNameReplace aReplace = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, xOtherViewRoot);
+            XNameReplace aReplace = UnoRuntime.queryInterface(XNameReplace.class, xOtherViewRoot);
 
             String aItemNames [] = aReplace.getElementNames();
             for (int i=0; i < aItemNames.length; ++i) {
@@ -773,12 +773,12 @@ public class ConfigExamples
 
             // commit the changes
             XChangesBatch xUpdateControl =
-                (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xOtherViewRoot);
+                UnoRuntime.queryInterface(XChangesBatch.class,xOtherViewRoot);
 
             xUpdateControl.commitChanges();
 
             // we are done with the view - dispose it
-            ((XComponent)UnoRuntime.queryInterface(XComponent.class, xOtherViewRoot)).dispose();
+            (UnoRuntime.queryInterface(XComponent.class, xOtherViewRoot)).dispose();
         }
         catch (Exception e)
         {
@@ -800,13 +800,13 @@ public class ConfigExamples
 
      // resetting a single nested value
         XHierarchicalNameAccess xHierarchicalAccess =
-            (XHierarchicalNameAccess)UnoRuntime.queryInterface(XHierarchicalNameAccess.class, xViewRoot);
+            UnoRuntime.queryInterface(XHierarchicalNameAccess.class, xViewRoot);
 
         // get using absolute name
         Object xOptions = xHierarchicalAccess.getByHierarchicalName(cGridOptionsPath + "/Option");
 
         XPropertyState xOptionState =
-            (XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xOptions);
+            UnoRuntime.queryInterface(XPropertyState.class, xOptions);
 
         xOptionState.setPropertyToDefault("VisibleGrid");
 
@@ -815,9 +815,9 @@ public class ConfigExamples
         Object xResolutionY = xHierarchicalAccess.getByHierarchicalName("Resolution/YAxis");
 
         XPropertyState xResolutionStateX =
-            (XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionX);
+            UnoRuntime.queryInterface(XPropertyState.class, xResolutionX);
         XPropertyState xResolutionStateY =
-            (XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionY);
+            UnoRuntime.queryInterface(XPropertyState.class, xResolutionY);
 
         xResolutionStateX.setPropertyToDefault("Metric");
         xResolutionStateY.setPropertyToDefault("Metric");
@@ -826,18 +826,18 @@ public class ConfigExamples
         Object xSubdivision = xHierarchicalAccess.getByHierarchicalName("Subdivision");
 
         XMultiPropertyStates xSubdivisionStates =
-            (XMultiPropertyStates)UnoRuntime.queryInterface(XMultiPropertyStates.class, xSubdivision);
+            UnoRuntime.queryInterface(XMultiPropertyStates.class, xSubdivision);
 
         xSubdivisionStates.setAllPropertiesToDefault();
 
         // commit the changes
         XChangesBatch xUpdateControl =
-            (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
+            UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
 
         xUpdateControl.commitChanges();
 
        // we are done with the view - dispose it
-        ((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
+        (UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
     }
 
 
@@ -895,7 +895,7 @@ public class ConfigExamples
 
       // set the values
         XPropertySet xDataSourceProperties =
-            (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
+            UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
 
         xDataSourceProperties.setPropertyValue("URL",  sDataSourceURL  );
         xDataSourceProperties.setPropertyValue("User", sUser  );
@@ -918,12 +918,12 @@ public class ConfigExamples
 
         // commit the changes
         XChangesBatch xUpdateControl =
-            (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
+            UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
 
         xUpdateControl.commitChanges();
 
         // now clean up
-        ((XComponent) UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
+        (UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
     }
 
     /** This method gets the DataSourceDescription for a data source.
@@ -951,7 +951,7 @@ public class ConfigExamples
             xProvider.createInstanceWithArguments(cUpdatableView, aArguments);
 
         XNameAccess xSetOfDataSources =
-            (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,xViewRoot);
+            UnoRuntime.queryInterface(XNameAccess.class,xViewRoot);
 
         Object xDataSourceDescriptor = null; // the result
         if ( xSetOfDataSources .hasByName( sDataSourceName ))
@@ -960,7 +960,7 @@ public class ConfigExamples
             try
             {
                 // the view should point to the element directly, so we need to extend the path
-                XHierarchicalName xComposePath = (XHierarchicalName)
+                XHierarchicalName xComposePath =
                     UnoRuntime.queryInterface(XHierarchicalName.class, xSetOfDataSources );
 
                 String sElementPath = xComposePath.composeHierarchicalName( sDataSourceName );
@@ -979,7 +979,7 @@ public class ConfigExamples
                 if ( xDataSourceDescriptor != null) // all went fine
                 {
                     // dispose the other view
-                    ((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
+                    (UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
                     xViewRoot = null;
                 }
             }
@@ -996,11 +996,11 @@ public class ConfigExamples
         {
             // get the container
             XNameContainer xSetUpdate =
-                (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, xViewRoot);
+                UnoRuntime.queryInterface(XNameContainer.class, xViewRoot);
 
             // create a new detached set element (instance of DataSourceDescription)
             XSingleServiceFactory xElementFactory =
-                (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class, xSetUpdate);
+                UnoRuntime.queryInterface(XSingleServiceFactory.class, xSetUpdate);
 
             // the new element is the result !
              xDataSourceDescriptor = xElementFactory.createInstance();
@@ -1021,16 +1021,16 @@ public class ConfigExamples
 
         // get the settings set as a container
         XNameContainer xSettingsContainer =
-            (XNameContainer) UnoRuntime.queryInterface( XNameContainer.class, xSettingsSet);
+            UnoRuntime.queryInterface( XNameContainer.class, xSettingsSet);
 
         // and get a factory interface for creating the entries
         XSingleServiceFactory xSettingsFactory =
-            (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, xSettingsSet);
+            UnoRuntime.queryInterface(XSingleServiceFactory.class, xSettingsSet);
 
         // now insert the individual settings
         for (int i = 0; i < aSettings.length; ++i) {
             // create a DataSourceSetting object
-            XPropertySet xSetting = (XPropertySet)
+            XPropertySet xSetting =
                 UnoRuntime.queryInterface( XPropertySet.class, xSettingsFactory.createInstance() );
 
             // can set the value before inserting
@@ -1056,7 +1056,7 @@ public class ConfigExamples
         do
         {
             XChild xParentAccess =
-                (XChild) UnoRuntime.queryInterface(XChild.class,xResult);
+                UnoRuntime.queryInterface(XChild.class,xResult);
 
             if (xParentAccess != null)
                 xParent = xParentAccess.getParent();
@@ -1077,10 +1077,10 @@ public class ConfigExamples
     void renameSetItem(XNamed xNamedItem, String sNewName)
 		throws com.sun.star.uno.Exception
     {
-        XChild xChildItem = (XChild)
+        XChild xChildItem =
             UnoRuntime.queryInterface(XChild.class, xNamedItem);
 
-        XNameContainer xParentSet = (XNameContainer)
+        XNameContainer xParentSet =
             UnoRuntime.queryInterface( XNameContainer.class, xChildItem.getParent() );
 
         String sOldName = xNamedItem.getName();
@@ -1094,10 +1094,10 @@ public class ConfigExamples
     void moveSetItem(XChild xChildItem, XNameContainer xNewParent)
 		throws com.sun.star.uno.Exception
     {
-        XNamed xNamedItem = (XNamed)
+        XNamed xNamedItem =
             UnoRuntime.queryInterface(XNamed.class, xChildItem);
 
-        XNameContainer xOldParent = (XNameContainer)
+        XNameContainer xOldParent =
             UnoRuntime.queryInterface( XNameContainer.class, xChildItem.getParent() );
 
         String sItemName = xNamedItem.getName();
diff --git a/main/odk/examples/DevelopersGuide/Database/CodeSamples.java b/main/odk/examples/DevelopersGuide/Database/CodeSamples.java
index 732b40ace8..dd7ffbbfb8 100644
--- a/main/odk/examples/DevelopersGuide/Database/CodeSamples.java
+++ b/main/odk/examples/DevelopersGuide/Database/CodeSamples.java
@@ -114,7 +114,7 @@ public class CodeSamples
 		{
 			System.out.println("Connection was created!");
 			// now we dispose the connection to close it
-			XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class,con);
+			XComponent xComponent = UnoRuntime.queryInterface(XComponent.class,con);
 			if(xComponent != null)
 			{
 				// connections must be disposed
@@ -136,7 +136,7 @@ public class CodeSamples
                                            xContext);
 		// query for the interface
 		com.sun.star.sdbc.XDriverManager xDriverManager;
-		xDriverManager = (XDriverManager)UnoRuntime.queryInterface(XDriverManager.class,driverManager);
+		xDriverManager = UnoRuntime.queryInterface(XDriverManager.class,driverManager);
 		if(xDriverManager != null)
 		{
 			// first create the needed url
@@ -164,7 +164,7 @@ public class CodeSamples
                                            xContext);
 		// query for the interface
 		com.sun.star.sdbc.XDriver xDriver;
-		xDriver = (XDriver)UnoRuntime.queryInterface(XDriver.class,aDriver);
+		xDriver = UnoRuntime.queryInterface(XDriver.class,aDriver);
 		if(xDriver != null)
 		{
 			// first create the needed url
@@ -186,7 +186,7 @@ public class CodeSamples
 	public static void printDataSources() throws com.sun.star.uno.Exception
 	{
 		// create a DatabaseContext and print all DataSource names
-		XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+		XNameAccess xNameAccess = UnoRuntime.queryInterface(
             XNameAccess.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.DatabaseContext",
                                            xContext));
@@ -200,7 +200,7 @@ public class CodeSamples
 	{
 		XDatabaseMetaData dm = con.getMetaData();
 		XResultSet rsTables = dm.getTables(null,"%","SALES",null);
-		XRow       rowTB = (XRow)UnoRuntime.queryInterface(XRow.class, rsTables);
+		XRow       rowTB = UnoRuntime.queryInterface(XRow.class, rsTables);
 		while ( rsTables.next() )
 		{
 			String catalog = rowTB.getString( 1 );
@@ -216,7 +216,7 @@ public class CodeSamples
 			System.out.println("Catalog: " + catalog + " Schema: " + schema + " Table: " + table + " Type: " + type);
 			System.out.println("------------------ Columns ------------------");
 			XResultSet rsColumns = dm.getColumns(catalog,schema,table,"%");
-			XRow       rowCL = (XRow)UnoRuntime.queryInterface(XRow.class, rsColumns);
+			XRow       rowCL = UnoRuntime.queryInterface(XRow.class, rsColumns);
 			while ( rsColumns.next() )
 			{
 				System.out.println("Column: " + rowCL.getString( 4 ) + " Type: " + rowCL.getInt( 5 ) + " TypeName: " + rowCL.getString( 6 ) );
@@ -259,25 +259,25 @@ public class CodeSamples
 	// creates a new query definition
 	public static void createQuerydefinition() throws com.sun.star.uno.Exception
 	{
-		XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+		XNameAccess xNameAccess = UnoRuntime.queryInterface(
             XNameAccess.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.DatabaseContext",
                                            xContext));
 		// we use the first datasource
-		XQueryDefinitionsSupplier xQuerySup = (XQueryDefinitionsSupplier)
+		XQueryDefinitionsSupplier xQuerySup =
 											UnoRuntime.queryInterface(XQueryDefinitionsSupplier.class,
 											xNameAccess.getByName( "Bibliography" ));
 		XNameAccess xQDefs = xQuerySup.getQueryDefinitions();
 		// create new query definition
-		XSingleServiceFactory xSingleFac =	(XSingleServiceFactory)
+		XSingleServiceFactory xSingleFac =
 											UnoRuntime.queryInterface(XSingleServiceFactory.class, xQDefs);
 
-		XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+		XPropertySet xProp = UnoRuntime.queryInterface(
             XPropertySet.class,xSingleFac.createInstance());
 		xProp.setPropertyValue("Command","SELECT * FROM biblio");
 		xProp.setPropertyValue("EscapeProcessing",new Boolean(true));
 
-		XNameContainer xCont = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, xQDefs);
+		XNameContainer xCont = UnoRuntime.queryInterface(XNameContainer.class, xQDefs);
                 try
                 {
                     if ( xCont.hasByName("Query1") )
@@ -286,29 +286,29 @@ public class CodeSamples
                 catch(com.sun.star.uno.Exception e)
                 {}
 		xCont.insertByName("Query1",xProp);
-		XDocumentDataSource xDs = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, xQuerySup);
+		XDocumentDataSource xDs = UnoRuntime.queryInterface(XDocumentDataSource.class, xQuerySup);
 
-        XStorable xStore = (XStorable)UnoRuntime.queryInterface(XStorable.class,xDs.getDatabaseDocument());
+        XStorable xStore = UnoRuntime.queryInterface(XStorable.class,xDs.getDatabaseDocument());
         xStore.store();
 	}
 
 	// prints all column names from Query1
 	public static void printQueryColumnNames() throws com.sun.star.uno.Exception
 	{
-		XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+		XNameAccess xNameAccess = UnoRuntime.queryInterface(
             XNameAccess.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.DatabaseContext",
                                            xContext));
 		// we use the first datasource
-		XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
+		XDataSource xDS = UnoRuntime.queryInterface(
             XDataSource.class, xNameAccess.getByName( "Bibliography" ));
 		XConnection con = xDS.getConnection("","");
-		XQueriesSupplier xQuerySup = (XQueriesSupplier)
+		XQueriesSupplier xQuerySup =
 											UnoRuntime.queryInterface(XQueriesSupplier.class, con);
 
 		XNameAccess xQDefs = xQuerySup.getQueries();
 
-		XColumnsSupplier xColsSup = (XColumnsSupplier) UnoRuntime.queryInterface(
+		XColumnsSupplier xColsSup = UnoRuntime.queryInterface(
             XColumnsSupplier.class,xQDefs.getByName("Query1"));
 		XNameAccess xCols = xColsSup.getColumns();
 		String aNames [] = xCols.getElementNames();
diff --git a/main/odk/examples/DevelopersGuide/Database/OpenQuery.java b/main/odk/examples/DevelopersGuide/Database/OpenQuery.java
index fc0ef6492e..31a40b5b1b 100644
--- a/main/odk/examples/DevelopersGuide/Database/OpenQuery.java
+++ b/main/odk/examples/DevelopersGuide/Database/OpenQuery.java
@@ -81,11 +81,11 @@ public class OpenQuery {
         Object rowSet = xMCF.createInstanceWithContext(
             "com.sun.star.sdb.RowSet", xContext);
 
-        com.sun.star.sdbc.XRowSet xRowSet = (com.sun.star.sdbc.XRowSet)
+        com.sun.star.sdbc.XRowSet xRowSet =
             UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class, rowSet);
 
         // set the properties needed to connect to a database
-        XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xRowSet);
+        XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xRowSet);
 
         // the DataSourceName can be a data source registered with [PRODUCTNAME], among other possibilities
         xProp.setPropertyValue("DataSourceName","Bibliography");
@@ -104,10 +104,10 @@ public class OpenQuery {
 
         // prepare the XRow and XColumnLocate interface for column access
         // XRow gets column values
-        com.sun.star.sdbc.XRow xRow = (com.sun.star.sdbc.XRow)UnoRuntime.queryInterface(
+        com.sun.star.sdbc.XRow xRow = UnoRuntime.queryInterface(
             com.sun.star.sdbc.XRow.class, xRowSet);
         // XColumnLocate finds columns by name
-        com.sun.star.sdbc.XColumnLocate xLoc = (com.sun.star.sdbc.XColumnLocate)
+        com.sun.star.sdbc.XColumnLocate xLoc =
             UnoRuntime.queryInterface(
                 com.sun.star.sdbc.XColumnLocate.class, xRowSet);
 
@@ -123,12 +123,12 @@ public class OpenQuery {
         }
 
         // XResultSetUpdate for insertRow handling
-        com.sun.star.sdbc.XResultSetUpdate xResultSetUpdate = (com.sun.star.sdbc.XResultSetUpdate)
+        com.sun.star.sdbc.XResultSetUpdate xResultSetUpdate =
             UnoRuntime.queryInterface(
                 com.sun.star.sdbc.XResultSetUpdate.class, xRowSet);
 
         // XRowUpdate for row updates
-        com.sun.star.sdbc.XRowUpdate xRowUpdate = (com.sun.star.sdbc.XRowUpdate)
+        com.sun.star.sdbc.XRowUpdate xRowUpdate =
             UnoRuntime.queryInterface(
                 com.sun.star.sdbc.XRowUpdate.class, xRowSet);
 
@@ -143,7 +143,7 @@ public class OpenQuery {
         xResultSetUpdate.insertRow();
 
         // throw away the row set
-        com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
+        com.sun.star.lang.XComponent xComp = UnoRuntime.queryInterface(
             com.sun.star.lang.XComponent.class, xRowSet);
         xComp.dispose();
     }
diff --git a/main/odk/examples/DevelopersGuide/Database/RowSet.java b/main/odk/examples/DevelopersGuide/Database/RowSet.java
index f02c1ee89b..c43a6693c5 100644
--- a/main/odk/examples/DevelopersGuide/Database/RowSet.java
+++ b/main/odk/examples/DevelopersGuide/Database/RowSet.java
@@ -73,7 +73,7 @@ public class RowSet
 	public static void printDataSources() throws com.sun.star.uno.Exception
 	{
 		// create a DatabaseContext and print all DataSource names
-		XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+		XNameAccess xNameAccess = UnoRuntime.queryInterface(
             XNameAccess.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.DatabaseContext",
                                            xContext));
@@ -85,13 +85,13 @@ public class RowSet
 	public static void useRowSet() throws com.sun.star.uno.Exception
 	{
 		// first we create our RowSet object
-		XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(
+		XRowSet xRowRes = UnoRuntime.queryInterface(
             XRowSet.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.RowSet", xContext));
 
 		System.out.println("RowSet created!");
 		// set the properties needed to connect to a database
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
 		xProp.setPropertyValue("DataSourceName","Bibliography");
 		xProp.setPropertyValue("Command","biblio");
 		xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE));
@@ -100,7 +100,7 @@ public class RowSet
 		System.out.println("RowSet executed!");
 
 
-		XComponent xComp = (XComponent)UnoRuntime.queryInterface(XComponent.class,xRowRes);
+		XComponent xComp = UnoRuntime.queryInterface(XComponent.class,xRowRes);
 		xComp.dispose();
 		System.out.println("RowSet destroyed!");
 	}
@@ -108,13 +108,13 @@ public class RowSet
 	public static void showRowSetPrivileges() throws com.sun.star.uno.Exception
 	{
 		// first we create our RowSet object
-		XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(
+		XRowSet xRowRes = UnoRuntime.queryInterface(
             XRowSet.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.RowSet", xContext));
 
 		System.out.println("RowSet created!");
 		// set the properties needed to connect to a database
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
 		xProp.setPropertyValue("DataSourceName","Bibliography");
 		xProp.setPropertyValue("Command","biblio");
 		xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE));
@@ -134,7 +134,7 @@ public class RowSet
 			System.out.println("DELETE");
 
 		// now destroy the RowSet
-		XComponent xComp = (XComponent)UnoRuntime.queryInterface(XComponent.class,xRowRes);
+		XComponent xComp = UnoRuntime.queryInterface(XComponent.class,xRowRes);
 		xComp.dispose();
 		System.out.println("RowSet destroyed!");
 	}
@@ -142,13 +142,13 @@ public class RowSet
 	public static void showRowSetRowCount() throws com.sun.star.uno.Exception
 	{
 		// first we create our RowSet object
-		XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(
+		XRowSet xRowRes = UnoRuntime.queryInterface(
             XRowSet.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.RowSet", xContext));
 
 		System.out.println("RowSet created!");
 		// set the properties needed to connect to a database
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
 		xProp.setPropertyValue("DataSourceName","Bibliography");
 		xProp.setPropertyValue("Command","biblio");
 		xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE));
@@ -159,14 +159,14 @@ public class RowSet
 		// now look if the RowCount is already final
 		System.out.println("The RowCount is final: " + xProp.getPropertyValue("IsRowCountFinal"));
 
-		XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
+		XResultSet xRes = UnoRuntime.queryInterface(XResultSet.class,xRowRes);
 		xRes.last();
 
 		System.out.println("The RowCount is final: " + xProp.getPropertyValue("IsRowCountFinal"));
 		System.out.println("There are " + xProp.getPropertyValue("RowCount") + " rows!");
 
 		// now destroy the RowSet
-		XComponent xComp = (XComponent)UnoRuntime.queryInterface(XComponent.class,xRowRes);
+		XComponent xComp = UnoRuntime.queryInterface(XComponent.class,xRowRes);
 		xComp.dispose();
 		System.out.println("RowSet destroyed!");
 	}
@@ -174,7 +174,7 @@ public class RowSet
 	public static void showRowSetEvents() throws com.sun.star.uno.Exception
 	{
 		// first we create our RowSet object
-		XRowSet xRowRes = (XRowSet)UnoRuntime.queryInterface(
+		XRowSet xRowRes = UnoRuntime.queryInterface(
             XRowSet.class,
             xMCF.createInstanceWithContext("com.sun.star.sdb.RowSet", xContext));
 
@@ -182,12 +182,12 @@ public class RowSet
 		// add our Listener
 		System.out.println("Append our Listener!");
 		RowSetEventListener pRow = new RowSetEventListener();
-		XRowSetApproveBroadcaster xApBroad = (XRowSetApproveBroadcaster)UnoRuntime.queryInterface(XRowSetApproveBroadcaster.class,xRowRes);
+		XRowSetApproveBroadcaster xApBroad = UnoRuntime.queryInterface(XRowSetApproveBroadcaster.class,xRowRes);
 		xApBroad.addRowSetApproveListener(pRow);
 		xRowRes.addRowSetListener(pRow);
 
 		// set the properties needed to connect to a database
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,xRowRes);
 		xProp.setPropertyValue("DataSourceName","Bibliography");
 		xProp.setPropertyValue("Command","biblio");
 		xProp.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE));
@@ -196,7 +196,7 @@ public class RowSet
 		System.out.println("RowSet executed!");
 
 		// do some movements to check if we got all notifications
-		XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
+		XResultSet xRes = UnoRuntime.queryInterface(XResultSet.class,xRowRes);
 		System.out.println("beforeFirst");
 		xRes.beforeFirst();
 		// this should lead to no notifications because
@@ -222,7 +222,7 @@ public class RowSet
 		System.out.println("We stand after the last row: " + xRes.isAfterLast());
 
 		// now destroy the RowSet
-		XComponent xComp = (XComponent)UnoRuntime.queryInterface(XComponent.class,xRowRes);
+		XComponent xComp = UnoRuntime.queryInterface(XComponent.class,xRowRes);
 		xComp.dispose();
 		System.out.println("RowSet destroyed!");
 	}
diff --git a/main/odk/examples/DevelopersGuide/Database/Sales.java b/main/odk/examples/DevelopersGuide/Database/Sales.java
index a4a8ac88d1..7eb2a007e6 100644
--- a/main/odk/examples/DevelopersGuide/Database/Sales.java
+++ b/main/odk/examples/DevelopersGuide/Database/Sales.java
@@ -96,7 +96,7 @@ public class Sales
 		String query =	"SELECT NAME, PRICE FROM SALES " +
 						"WHERE SALENR = 1";
 		XResultSet rs = stmt.executeQuery(query);
-		XRow      row = (XRow)UnoRuntime.queryInterface(XRow.class, rs);
+		XRow      row = UnoRuntime.queryInterface(XRow.class, rs);
 		while (rs.next()) {
 				String s = row.getString(1);
 				float  n = row.getFloat(2);
@@ -109,13 +109,13 @@ public class Sales
 	{
 		// example for a programmatic way to do updates. This doesn't work with adabas.
 		XStatement stmt = con.createStatement();
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
 
 		xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
 		xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
 
 		XResultSet srs = stmt.executeQuery("SELECT NAME, PRICE FROM SALES");
-		XRow       row = (XRow)UnoRuntime.queryInterface(XRow.class,srs);
+		XRow       row = UnoRuntime.queryInterface(XRow.class,srs);
 
 		srs.afterLast();
 		while (srs.previous()) {
@@ -125,10 +125,10 @@ public class Sales
 		}
 
 		srs.last();
-		XRowUpdate updateRow = (XRowUpdate)UnoRuntime.queryInterface(XRowUpdate.class,srs);
+		XRowUpdate updateRow = UnoRuntime.queryInterface(XRowUpdate.class,srs);
 		updateRow.updateFloat(2, (float)0.69);
 
-		XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime.queryInterface(
+		XResultSetUpdate updateRs = UnoRuntime.queryInterface(
             XResultSetUpdate.class,srs);
 		updateRs.updateRow(); // this call updates the data in DBMS
 
@@ -148,14 +148,14 @@ public class Sales
 //                   "VALUES (4, 102, 5, 'FTOP Darjeeling tea', '2002-01-02',150)");
 //
 //		stmt = con.createStatement();
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
 		xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
 		xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
 		XResultSet rs = stmt.executeQuery("SELECT * FROM SALES");
-		XRow       row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
+		XRow       row = UnoRuntime.queryInterface(XRow.class,rs);
 
 		// insert a new row
-		XRowUpdate updateRow = (XRowUpdate)UnoRuntime.queryInterface(XRowUpdate.class,rs);
+		XRowUpdate updateRow = UnoRuntime.queryInterface(XRowUpdate.class,rs);
 		XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime.	queryInterface(XResultSetUpdate.class,rs);
 		updateRs.moveToInsertRow();
 		updateRow.updateInt(1, 4);
@@ -172,11 +172,11 @@ public class Sales
 	{
 		// example for a programmatic way to do updates. This doesn't work with adabas.
 		XStatement stmt = con.createStatement();
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
 		xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
 		xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
 		XResultSet rs = stmt.executeQuery("SELECT * FROM SALES");
-		XRow       row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
+		XRow       row = UnoRuntime.queryInterface(XRow.class,rs);
 
 		XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime.	queryInterface(XResultSetUpdate.class,rs);
 		// move to the inserted row
@@ -192,16 +192,16 @@ public class Sales
 		insertRow();
 
 		XStatement stmt = con.createStatement();
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
 		xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
 		xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.READ_ONLY));
 		XResultSet rs = stmt.executeQuery("SELECT NAME, PRICE FROM SALES");
-		XRow       row = (XRow)UnoRuntime.queryInterface(XRow.class, rs);
+		XRow       row = UnoRuntime.queryInterface(XRow.class, rs);
 		rs.absolute(4);
 		float price1 = row.getFloat(2);
 
 		// modify the 4 row
-		XRowUpdate updateRow = (XRowUpdate)UnoRuntime.queryInterface(XRowUpdate.class,rs);
+		XRowUpdate updateRow = UnoRuntime.queryInterface(XRowUpdate.class,rs);
 		XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime.	queryInterface(XResultSetUpdate.class,rs);
 		updateRow.updateFloat(2, 150);
 		updateRs.updateRow();
@@ -221,11 +221,11 @@ public class Sales
 	public void displayColumnNames() throws com.sun.star.uno.Exception
 	{
 		XStatement stmt = con.createStatement();
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
 		xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
 		xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.READ_ONLY));
 		XResultSet rs = stmt.executeQuery("SELECT NAME, PRICE FROM SALES");
-		XResultSetMetaDataSupplier xRsMetaSup = (XResultSetMetaDataSupplier)
+		XResultSetMetaDataSupplier xRsMetaSup =
             UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class,rs);
 		XResultSetMetaData xRsMetaData =  xRsMetaSup.getMetaData();
 		int nColumnCount =  xRsMetaData.getColumnCount();
diff --git a/main/odk/examples/DevelopersGuide/Database/SalesMan.java b/main/odk/examples/DevelopersGuide/Database/SalesMan.java
index ece01cfcb7..5e07530309 100644
--- a/main/odk/examples/DevelopersGuide/Database/SalesMan.java
+++ b/main/odk/examples/DevelopersGuide/Database/SalesMan.java
@@ -94,7 +94,7 @@ public class SalesMan
 	{
 		XPreparedStatement updateStreet = con.prepareStatement(
 			"UPDATE SALESMAN SET STREET = ? WHERE SNR = ?");
-		XParameters setPara = (XParameters)UnoRuntime.queryInterface(XParameters.class,updateStreet);
+		XParameters setPara = UnoRuntime.queryInterface(XParameters.class,updateStreet);
 		setPara.setString(1, "34 Main Road");
 		setPara.setInt(2, 1);
 		updateStreet.executeUpdate();
@@ -122,7 +122,7 @@ public class SalesMan
 	{
 		XStatement stmt = con.createStatement();
 		XResultSet rs	= stmt.executeQuery("SELECT FIRSTNAME, LASTNAME, BIRTHDATE FROM SALESMAN");
-		XRow row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
+		XRow row = UnoRuntime.queryInterface(XRow.class,rs);
 		while ( rs != null && rs.next() ) {
 			String fn = row.getString( 1 );
 			String ln = row.getString( 2 );
diff --git a/main/odk/examples/DevelopersGuide/Database/sdbcx.java b/main/odk/examples/DevelopersGuide/Database/sdbcx.java
index 3b1382a34d..8a98d9d913 100644
--- a/main/odk/examples/DevelopersGuide/Database/sdbcx.java
+++ b/main/odk/examples/DevelopersGuide/Database/sdbcx.java
@@ -46,7 +46,7 @@ public class sdbcx
 					test.createConnection();
 					test.displayTableProperties();
 					// now we dispose the connection to close it
-					XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class,con);
+					XComponent xComponent = UnoRuntime.queryInterface(XComponent.class,con);
 					if(xComponent != null)
 				{
 					xComponent.dispose();
@@ -70,12 +70,12 @@ public class sdbcx
 
 		// create a connector, so that it can contact the office
 		Object xUrlResolver = xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" );
-		XUnoUrlResolver urlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
+		XUnoUrlResolver urlResolver = UnoRuntime.queryInterface(
 			XUnoUrlResolver.class, xUrlResolver );
 
 		Object rInitialObject = urlResolver.resolve( "uno:" + connectStr + ";urp;StarOffice.NamingService" );
 
-		XNamingService rName = (XNamingService)UnoRuntime.queryInterface(
+		XNamingService rName = UnoRuntime.queryInterface(
 			XNamingService.class, rInitialObject );
 
 		XMultiServiceFactory xMSF = null;
@@ -83,7 +83,7 @@ public class sdbcx
 			System.err.println( "got the remote naming service !" );
 			Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager" );
 
-			xMSF = (XMultiServiceFactory)
+			xMSF =
 				UnoRuntime.queryInterface( XMultiServiceFactory.class, rXsmgr );
 		}
 
@@ -102,7 +102,7 @@ public class sdbcx
 		Object aDriver = xORB.createInstance("com.sun.star.comp.sdbcx.adabas.ODriver");
 		// query for the interface
 		com.sun.star.sdbc.XDriver xDriver;
-		xDriver = (XDriver)UnoRuntime.queryInterface(XDriver.class,aDriver);
+		xDriver = UnoRuntime.queryInterface(XDriver.class,aDriver);
 		if(xDriver != null)
 		{
 			// first create the needed URL
@@ -120,7 +120,7 @@ public class sdbcx
 			{
 				System.out.println("Connection could be created!");
 				// we the XDatabaseDefinitionSupplier interface from the driver to get the XTablesSupplier
-				XDataDefinitionSupplier xDDSup = (XDataDefinitionSupplier)UnoRuntime.queryInterface(
+				XDataDefinitionSupplier xDDSup = UnoRuntime.queryInterface(
 						XDataDefinitionSupplier.class,xDriver);
 				if(xDDSup != null)
 				{
@@ -150,7 +150,7 @@ public class sdbcx
 		if(0 != aTableNames.length)
 		{
 			Object table = xTables.getByName(aTableNames[0]);
-			XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,table);
+			XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,table);
 			System.out.println("Name:          " + xProp.getPropertyValue("Name"));
 			System.out.println("CatalogName:   " + xProp.getPropertyValue("CatalogName"));
 			System.out.println("SchemaName:    " + xProp.getPropertyValue("SchemaName"));
@@ -182,7 +182,7 @@ public class sdbcx
 	public static void printKeys(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printKeys");
-		XKeysSupplier xKeysSup = (XKeysSupplier)UnoRuntime.queryInterface(XKeysSupplier.class,xColumnsSup);
+		XKeysSupplier xKeysSup = UnoRuntime.queryInterface(XKeysSupplier.class,xColumnsSup);
 		if(xKeysSup != null)
 		{
 			System.out.println("--- Keys ---");
@@ -190,9 +190,9 @@ public class sdbcx
 			for ( int i =0; i < xKeys.getCount(); i++)
 			{
 				Object key = xKeys.getByIndex(i);
-				XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,key);
+				XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,key);
 				System.out.println("    " + xProp.getPropertyValue("Name"));
-				XColumnsSupplier xKeyColumnsSup = ( XColumnsSupplier ) UnoRuntime.queryInterface(XColumnsSupplier.class,xProp);
+				XColumnsSupplier xKeyColumnsSup = UnoRuntime.queryInterface(XColumnsSupplier.class,xProp);
 				printColumns(xKeyColumnsSup);
 			}
 		}
@@ -204,7 +204,7 @@ public class sdbcx
 	public static void printIndexes(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printIndexes");
-		XIndexesSupplier xIndexesSup = (XIndexesSupplier)UnoRuntime.queryInterface(XIndexesSupplier.class,xColumnsSup);
+		XIndexesSupplier xIndexesSup = UnoRuntime.queryInterface(XIndexesSupplier.class,xColumnsSup);
 		if(xIndexesSup != null)
 		{
 			System.out.println("--- Indexes ---");
@@ -214,7 +214,7 @@ public class sdbcx
 			{
 				System.out.println("    " + aIndexNames[i]);
 				Object index = xIndexs.getByName(aIndexNames[i]);
-				XColumnsSupplier xIndexColumnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class,index);
+				XColumnsSupplier xIndexColumnsSup = UnoRuntime.queryInterface(XColumnsSupplier.class,index);
 				printColumns(xIndexColumnsSup);
 			}
 		}
@@ -227,7 +227,7 @@ public class sdbcx
 	public static void printColumnProperties(Object column) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printColumnProperties");
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,column);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,column);
 		System.out.println("Name:            " + xProp.getPropertyValue("Name"));
 		System.out.println("Type:            " + xProp.getPropertyValue("Type"));
 		System.out.println("TypeName:        " + xProp.getPropertyValue("TypeName"));
@@ -252,7 +252,7 @@ public class sdbcx
 	public static void printIndexProperties(Object index) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printIndexProperties");
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,index);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,index);
 		System.out.println("Name:              " + xProp.getPropertyValue("Name"));
 		System.out.println("Catalog:           " + xProp.getPropertyValue("Catalog"));
 		System.out.println("IsUnique:          " + xProp.getPropertyValue("IsUnique"));
@@ -267,7 +267,7 @@ public class sdbcx
 	public static void printKeyProperties(Object key) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printKeyProperties");
-		XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,key);
+		XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,key);
 		System.out.println("Name:            " + xProp.getPropertyValue("Name"));
 		System.out.println("Type:            " + xProp.getPropertyValue("Type"));
 		System.out.println("ReferencedTable: " + xProp.getPropertyValue("ReferencedTable"));
@@ -282,7 +282,7 @@ public class sdbcx
 	public static void printGroups(XTablesSupplier xTabSup) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example printGroups");
-		XGroupsSupplier xGroupsSup = (XGroupsSupplier)UnoRuntime.queryInterface(XGroupsSupplier.class,xTabSup);
+		XGroupsSupplier xGroupsSup = UnoRuntime.queryInterface(XGroupsSupplier.class,xTabSup);
 		if(xGroupsSup != null)
 		{
 			// the table must be at least support a XColumnsSupplier interface
@@ -292,10 +292,10 @@ public class sdbcx
 			for ( int i =0; i < aGroupNames.length; i++)
 			{
 				System.out.println("    " + aGroupNames[i]);
-				XUsersSupplier xUsersSup = (XUsersSupplier)UnoRuntime.queryInterface(XUsersSupplier.class,xGroups.getByName(aGroupNames[i]));
+				XUsersSupplier xUsersSup = UnoRuntime.queryInterface(XUsersSupplier.class,xGroups.getByName(aGroupNames[i]));
 				if(xUsersSup != null)
 				{
-					XAuthorizable xAuth = (XAuthorizable)UnoRuntime.queryInterface(XAuthorizable.class,xUsersSup);
+					XAuthorizable xAuth = UnoRuntime.queryInterface(XAuthorizable.class,xUsersSup);
 					// the table must be at least support a XColumnsSupplier interface
 					System.out.println("\t--- Users ---");
 					XNameAccess xUsers = xUsersSup.getUsers();
@@ -316,7 +316,7 @@ public class sdbcx
 	public static void createTableSalesMen(XNameAccess xTables) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example createTableSalesMen");
-		XDataDescriptorFactory xTabFac = (XDataDescriptorFactory)UnoRuntime.queryInterface(XDataDescriptorFactory.class,xTables);
+		XDataDescriptorFactory xTabFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class,xTables);
 		if(xTabFac != null)
 		{
 			// create the new table
@@ -324,9 +324,9 @@ public class sdbcx
 			// set the name of the new table
 			xTable.setPropertyValue("Name","SALESMAN");
 			// append the columns
-			XColumnsSupplier xColumSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class,xTable);
-			XDataDescriptorFactory xColFac = (XDataDescriptorFactory)UnoRuntime.queryInterface(XDataDescriptorFactory.class,xColumSup.getColumns());
-			XAppend xAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xColFac);
+			XColumnsSupplier xColumSup = UnoRuntime.queryInterface(XColumnsSupplier.class,xTable);
+			XDataDescriptorFactory xColFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class,xColumSup.getColumns());
+			XAppend xAppend = UnoRuntime.queryInterface(XAppend.class,xColFac);
 			// we only need one descriptor
 			XPropertySet xCol = xColFac.createDataDescriptor();
 			// create first column and append
@@ -362,15 +362,15 @@ public class sdbcx
 			xCol.setPropertyValue("Precision",new Integer(10)); // default value integer
 			xAppend.appendByDescriptor(xCol);
 			// now we create the primary key
-			XKeysSupplier xKeySup = (XKeysSupplier)UnoRuntime.queryInterface(XKeysSupplier.class,xTable);
-			XDataDescriptorFactory xKeyFac = (XDataDescriptorFactory)UnoRuntime.queryInterface(XDataDescriptorFactory.class,xKeySup.getKeys());
-			XAppend xKeyAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xKeyFac);
+			XKeysSupplier xKeySup = UnoRuntime.queryInterface(XKeysSupplier.class,xTable);
+			XDataDescriptorFactory xKeyFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class,xKeySup.getKeys());
+			XAppend xKeyAppend = UnoRuntime.queryInterface(XAppend.class,xKeyFac);
 			XPropertySet xKey = xKeyFac.createDataDescriptor();
 			xKey.setPropertyValue("Type",new Integer(KeyType.PRIMARY));
 			// now append the columns to key
-			XColumnsSupplier xKeyColumSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class,xKey);
-			XDataDescriptorFactory xKeyColFac = (XDataDescriptorFactory)UnoRuntime.queryInterface(XDataDescriptorFactory.class,xKeyColumSup.getColumns());
-			XAppend xKeyColAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xKeyColFac);
+			XColumnsSupplier xKeyColumSup = UnoRuntime.queryInterface(XColumnsSupplier.class,xKey);
+			XDataDescriptorFactory xKeyColFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class,xKeyColumSup.getColumns());
+			XAppend xKeyColAppend = UnoRuntime.queryInterface(XAppend.class,xKeyColFac);
 			// we only need one descriptor
 			XPropertySet xKeyCol = xKeyColFac.createDataDescriptor();
 			xKeyCol.setPropertyValue("Name","SNR");
@@ -379,7 +379,7 @@ public class sdbcx
 			// append the key
 			xKeyAppend.appendByDescriptor(xKey);
 			// the last step is to append the new table to the tables collection
-			 XAppend xTableAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xTabFac);
+			 XAppend xTableAppend = UnoRuntime.queryInterface(XAppend.class,xTabFac);
 			 xTableAppend.appendByDescriptor(xTable);
 		}
 	}
@@ -391,7 +391,7 @@ public class sdbcx
 	public static void createUser(XNameAccess xUsers) throws com.sun.star.uno.Exception,SQLException
 	{
 		System.out.println("Example createUser");
-		XDataDescriptorFactory xUserFac = (XDataDescriptorFactory)UnoRuntime.queryInterface(XDataDescriptorFactory.class,xUsers);
+		XDataDescriptorFactory xUserFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class,xUsers);
 		if(xUserFac != null)
 		{
 			// create the new table
@@ -399,7 +399,7 @@ public class sdbcx
 			// set the name of the new table
 			xUser.setPropertyValue("Name","BOSS");
 			xUser.setPropertyValue("Password","BOSSWIFENAME");
-			XAppend xAppend = (XAppend)UnoRuntime.queryInterface(XAppend.class,xUserFac);
+			XAppend xAppend = UnoRuntime.queryInterface(XAppend.class,xUserFac);
 			xAppend.appendByDescriptor(xUser);
 		}
 	}
diff --git a/main/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java b/main/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
index 773584ae6c..1e9466830a 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
@@ -68,7 +68,7 @@ public class ChangeOrderDemo
 
 			// create two rectangles
 			XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 
 			XShape xShape1 = ShapeHelper.createShape( xDrawDoc,
@@ -84,9 +84,9 @@ public class ChangeOrderDemo
 			ShapeHelper.addPortion( xShape1, "by changing the ZOrder it lie now on top", true );
 			xShapes.add( xShape2 );
 
-			XPropertySet xPropSet1 = (XPropertySet)
+			XPropertySet xPropSet1 =
 					UnoRuntime.queryInterface( XPropertySet.class, xShape1 );
-			XPropertySet xPropSet2 = (XPropertySet)
+			XPropertySet xPropSet2 =
 					UnoRuntime.queryInterface( XPropertySet.class, xShape2 );
 
 			int nOrderOfShape1 = ((Integer)xPropSet1.getPropertyValue( "ZOrder" )).intValue();
diff --git a/main/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java b/main/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
index 13e1fe3511..bf9c2bd4eb 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
@@ -78,46 +78,46 @@ public class ControlAndSelectDemo
 				"private:factory/sdraw", "_blank", 0, pPropValues );
 
 			XMultiServiceFactory xFactory =
-				(XMultiServiceFactory )UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XMultiServiceFactory.class, xComponent );
 
 			XDrawPagesSupplier xDrawPagesSupplier =
-				(XDrawPagesSupplier)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XDrawPagesSupplier.class, xComponent );
 			XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
-			XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
+			XDrawPage xDrawPage = UnoRuntime.queryInterface(
                 XDrawPage.class, xDrawPages.getByIndex( 0 ));
-			XShapes xShapes = (XShapes)UnoRuntime.queryInterface(XShapes.class,
+			XShapes xShapes = UnoRuntime.queryInterface(XShapes.class,
                                                                  xDrawPage );
 
 
 			// create and insert the ControlShape
 			Object xObj = xFactory.createInstance(
                 "com.sun.star.drawing.ControlShape" );
-			XShape xShape = (XShape)UnoRuntime.queryInterface( XShape.class, xObj );
+			XShape xShape = UnoRuntime.queryInterface( XShape.class, xObj );
 			xShape.setPosition( new Point( 1000, 1000 ) );
 			xShape.setSize( new Size( 2000, 2000 ) );
 			xShapes.add( xShape );
 
 			// create and set the control
-			XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
+			XControlModel xControlModel = UnoRuntime.queryInterface(
                 XControlModel.class,
 				xFactory.createInstance( "com.sun.star.form.component.GroupBox" ) );
-			XControlShape xControlShape = (XControlShape)UnoRuntime.queryInterface(
+			XControlShape xControlShape = UnoRuntime.queryInterface(
                 XControlShape.class, xShape );
 			xControlShape.setControl( xControlModel );
 
 
 			// the following code will demonstrate how to
 			// make a selection that contains our new created ControlShape
-			XModel xModel = (XModel)UnoRuntime.queryInterface( XModel.class,
+			XModel xModel = UnoRuntime.queryInterface( XModel.class,
                                                                xComponent );
 			XController xController = xModel.getCurrentController();
-			XSelectionSupplier xSelectionSupplier =(XSelectionSupplier)
+			XSelectionSupplier xSelectionSupplier =
 				UnoRuntime.queryInterface( XSelectionSupplier.class, xController );
 			// take care to use the global service factory only and not the one
 			// that is provided by the component if you create the ShapeCollection
-			XShapes xSelection = (XShapes)UnoRuntime.queryInterface( XShapes.class,
+			XShapes xSelection = UnoRuntime.queryInterface( XShapes.class,
 				xOfficeContext.getServiceManager().createInstanceWithContext(
                     "com.sun.star.drawing.ShapeCollection", xOfficeContext ) );
 			xSelection.add( xShape );
diff --git a/main/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java b/main/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
index 7108daee85..83ff9202d2 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
@@ -83,7 +83,7 @@ public class CustomShowDemo
 				"private:factory/simpress", "_blank", 0, pPropValues );
 
 			XDrawPagesSupplier xDrawPagesSupplier =
-				(XDrawPagesSupplier)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XDrawPagesSupplier.class, xDrawDoc );
 			XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
 
@@ -97,9 +97,9 @@ public class CustomShowDemo
 			int i;
 			for ( i = 0; i < 10; i++ )
 			{
-				XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
+				XDrawPage xDrawPage = UnoRuntime.queryInterface(
 					XDrawPage.class, xDrawPages.getByIndex( i ));
-				XNamed xPageName = (XNamed)UnoRuntime.queryInterface(
+				XNamed xPageName = UnoRuntime.queryInterface(
 					XNamed.class, xDrawPage );
 				xPageName.setName( aNameArray[ i ] );
 
@@ -107,7 +107,7 @@ public class CustomShowDemo
 				XShape xTextObj = ShapeHelper.createShape( xDrawDoc, new Point( 10000, 9000 ),
 					new Size( 10000, 5000 ),
 						"com.sun.star.drawing.TextShape" );
-				XShapes xShapes = (XShapes)
+				XShapes xShapes =
 						UnoRuntime.queryInterface( XShapes.class, xDrawPage );
 				xShapes.add( xTextObj );
 				ShapeHelper.addPortion( xTextObj, aNameArray[ i ], true );
@@ -115,13 +115,13 @@ public class CustomShowDemo
 
 			/* create two custom shows, one will play slide 6 to 10 and is named "ShortVersion"
 			   the other one will play slide 2 til 10 and is named "LongVersion" */
-			XCustomPresentationSupplier xCustPresSupplier = (XCustomPresentationSupplier)
+			XCustomPresentationSupplier xCustPresSupplier =
 				UnoRuntime.queryInterface( XCustomPresentationSupplier.class, xDrawDoc );
 
 			/* the following container is a container for further container
 			   which concludes the list of pages that are to play within a custom show */
 			XNameContainer xNameContainer = xCustPresSupplier.getCustomPresentations();
-			XSingleServiceFactory xFactory = (XSingleServiceFactory)
+			XSingleServiceFactory xFactory =
 				UnoRuntime.queryInterface( XSingleServiceFactory.class, xNameContainer );
 
 			Object			xObj;
@@ -130,7 +130,7 @@ public class CustomShowDemo
 			/* instantiate an IndexContainer that will take
 			   a list of draw pages for the first custom show */
 			xObj = xFactory.createInstance();
-		    xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
+		    xContainer = UnoRuntime.queryInterface( XIndexContainer.class, xObj );
 			for ( i = 5; i < 10; i++ )
 				xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
 			xNameContainer.insertByName( "ShortVersion", xContainer );
@@ -138,7 +138,7 @@ public class CustomShowDemo
 			/* instantiate an IndexContainer that will take
 			   a list of draw page for the second custom show */
 			xObj = xFactory.createInstance();
-		    xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
+		    xContainer = UnoRuntime.queryInterface( XIndexContainer.class, xObj );
 			for ( i = 1; i < 10; i++ )
 				xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
 			xNameContainer.insertByName( "LongVersion", xContainer );
@@ -146,10 +146,10 @@ public class CustomShowDemo
 			/* which custom show is to use
 			   can been set in the presentation settings */
 
-			XPresentationSupplier xPresSupplier = (XPresentationSupplier)
+			XPresentationSupplier xPresSupplier =
 				UnoRuntime.queryInterface( XPresentationSupplier.class, xDrawDoc );
 			XPresentation xPresentation = xPresSupplier.getPresentation();
-			XPropertySet xPresPropSet = (XPropertySet)
+			XPropertySet xPresPropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xPresentation );
 			xPresPropSet.setPropertyValue( "CustomShow", "ShortVersion" );
 		}
diff --git a/main/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java b/main/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
index e608d98b63..728b222361 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
@@ -79,14 +79,14 @@ public class DrawViewDemo
                                                 sUrl.toString(), "_blank", 0,
                                                 pPropValues );
             XModel xModel =
-                (XModel)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XModel.class, xComponent );
 
 
             // print all available properties of first view
             System.out.println("*** print all available properties of first view");
             XViewDataSupplier xViewDataSupplier =
-                (XViewDataSupplier)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XViewDataSupplier.class, xModel );
             XIndexAccess xIndexAccess = xViewDataSupplier.getViewData();
             if ( xIndexAccess.getCount() != 0 )
@@ -107,7 +107,7 @@ public class DrawViewDemo
             System.out.println("*** print all properties that are supported by the controller");
             XController xController = xModel.getCurrentController();
             XPropertySet xPropSet =
-                (XPropertySet)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XPropertySet.class, xController );
             XPropertySetInfo xPropSetInfo = xPropSet.getPropertySetInfo();
             Property[] aPropSeq = xPropSetInfo.getProperties();
diff --git a/main/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java b/main/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
index 3faedff3d7..544a82a13a 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
@@ -157,7 +157,7 @@ public class DrawingDemo
 				PageHelper.getDrawPageCount( xDrawDoc ) - 1 );
 
 			// each drawpage is supporting an XNamed interface
-			XNamed xNamed = (XNamed)UnoRuntime.queryInterface(
+			XNamed xNamed = UnoRuntime.queryInterface(
 				XNamed.class, xLastPage );
 
 			// beware, the page must have an unique name
@@ -240,7 +240,7 @@ public class DrawingDemo
 				int nRndObjPosY = aRndGen.nextInt( nHalfHeight - nRndObjHeight )
                     + nHalfHeight;
 
-				XShapes xShapes = (XShapes)
+				XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, pPages[ i ] );
 				ShapeHelper.createAndInsertShape( xDrawDoc, xShapes,
 					new Point( nRndObjPosX, nRndObjPosY ),
@@ -274,15 +274,15 @@ public class DrawingDemo
 				xDrawPage = PageHelper.getMasterPageByIndex( xDrawDoc, 0 );
 			else
 				xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 				UnoRuntime.queryInterface( XShapes.class, xDrawPage );
 			xShapes.add( xPolyPolygonBezier );
 
-			XPropertySet xShapeProperties = (XPropertySet)
+			XPropertySet xShapeProperties =
 				UnoRuntime.queryInterface( XPropertySet.class, xPolyPolygonBezier );
 
 			// get pagesize
-			XPropertySet xPageProperties = (XPropertySet)
+			XPropertySet xPageProperties =
 				UnoRuntime.queryInterface( XPropertySet.class, xDrawPage );
 			int nPageWidth = ((Integer)xPageProperties.getPropertyValue( "Width" )).intValue() / 2;
 			int nPageHeight = ((Integer)xPageProperties.getPropertyValue( "Height" )).intValue() / 2;
@@ -360,11 +360,11 @@ public class DrawingDemo
 			// before it is possible to insert shapes,
 			// the group must have been added to the page
 			XDrawPage xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 				UnoRuntime.queryInterface( XShapes.class, xDrawPage );
 			xShapes.add( xGroup );
 
-			XShapes xShapesGroup = (XShapes)
+			XShapes xShapesGroup =
 				UnoRuntime.queryInterface( XShapes.class, xGroup );
 
 			Size aPageSize = PageHelper.getPageSize( xDrawPage );
@@ -399,10 +399,10 @@ public class DrawingDemo
 		try
 		{
 			XDrawPage xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapeGrouper xShapeGrouper = (XShapeGrouper)
+			XShapeGrouper xShapeGrouper =
 				UnoRuntime.queryInterface( XShapeGrouper.class, xDrawPage );
 
-			XShapes xShapesPage = (XShapes)
+			XShapes xShapesPage =
 				UnoRuntime.queryInterface( XShapes.class, xDrawPage );
 
 			xShapeGrouper.group( xShapesPage );
diff --git a/main/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java b/main/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
index e6660f4345..2d880c328b 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
@@ -75,11 +75,11 @@ public class FillAndLineStyleDemo
 					new Size( 15000, 12000 ),
 						"com.sun.star.drawing.RectangleShape" );
 
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 			xShapes.add( xRectangle );
 
-			XPropertySet xPropSet = (XPropertySet)
+			XPropertySet xPropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xRectangle );
 
 			/* apply a gradient fill style that goes from top left to bottom
diff --git a/main/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java b/main/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
index 4888cf6d5f..6ec529ee4a 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
@@ -75,7 +75,7 @@ public class GluePointDemo
 
 
 			XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 
 			// create two rectangles
@@ -97,7 +97,7 @@ public class GluePointDemo
 			xShapes.add( xShape2 );
 			xShapes.add( xConnector );
 
-			XPropertySet xConnectorPropSet = (XPropertySet)
+			XPropertySet xConnectorPropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xConnector );
 
 //			Index value of 0 : the shape is connected at the top
@@ -131,19 +131,19 @@ public class GluePointDemo
 			aGluePoint.Position.Y = 0;
 
 			// create and insert a glue point at shape1
-			xGluePointsSupplier = (XGluePointsSupplier)
+			xGluePointsSupplier =
 				UnoRuntime.queryInterface( XGluePointsSupplier.class, xShape1 );
 			xIndexContainer = xGluePointsSupplier.getGluePoints();
-			xIdentifierContainer = (XIdentifierContainer)
+			xIdentifierContainer =
 				UnoRuntime.queryInterface( XIdentifierContainer.class,
                                            xIndexContainer );
 			int nIndexOfGluePoint1 = xIdentifierContainer.insert( aGluePoint );
 
 			// create and insert a glue point at shape2
-			xGluePointsSupplier = (XGluePointsSupplier)
+			xGluePointsSupplier =
 				UnoRuntime.queryInterface( XGluePointsSupplier.class, xShape2 );
 			xIndexContainer = xGluePointsSupplier.getGluePoints();
-			xIdentifierContainer = (XIdentifierContainer)
+			xIdentifierContainer =
 				UnoRuntime.queryInterface( XIdentifierContainer.class,
                                            xIndexContainer );
 			int nIndexOfGluePoint2 = xIdentifierContainer.insert( aGluePoint );
@@ -155,7 +155,7 @@ public class GluePointDemo
 						"com.sun.star.drawing.ConnectorShape" );
 			xShapes.add( xConnector2 );
 
-			XPropertySet xConnector2PropSet = (XPropertySet)
+			XPropertySet xConnector2PropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xConnector2 );
 
 			xConnector2PropSet.setPropertyValue( "StartShape", xShape1 );
diff --git a/main/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java b/main/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
index e7930881cc..72b3087e8b 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
@@ -75,7 +75,7 @@ public class GraphicExportDemo
             Object GraphicExportFilter =
                 xOfficeContext.getServiceManager().createInstanceWithContext(
                     "com.sun.star.drawing.GraphicExportFilter", xOfficeContext);
-            XExporter xExporter = (XExporter)
+            XExporter xExporter =
                 UnoRuntime.queryInterface( XExporter.class, GraphicExportFilter );
 
             PropertyValue aProps[] = new PropertyValue[2];
@@ -101,10 +101,10 @@ public class GraphicExportDemo
 			{
                 XDrawPage xPage = PageHelper.getDrawPageByIndex( xComponent,
                                                                  nPageIndex );
-                XComponent xComp = (XComponent)
+                XComponent xComp =
                     UnoRuntime.queryInterface( XComponent.class, xPage );
                 xExporter.setSourceDocument( xComp );
-                XFilter xFilter = (XFilter)
+                XFilter xFilter =
                     UnoRuntime.queryInterface( XFilter.class, xExporter );
                 xFilter.filter( aProps );
                 System.out.println( "*** graphics on page \"" + nPageIndex
@@ -118,7 +118,7 @@ public class GraphicExportDemo
 
 
             // close the document
-            com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
+            com.sun.star.util.XCloseable xCloseable =
                 UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
                                           xComponent);
 
diff --git a/main/odk/examples/DevelopersGuide/Drawing/Helper.java b/main/odk/examples/DevelopersGuide/Drawing/Helper.java
index 416a945250..e1904eaa83 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/Helper.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/Helper.java
@@ -56,12 +56,12 @@ public class Helper
 	{
 		com.sun.star.lang.XComponent xComponent = null;
 		com.sun.star.frame.XComponentLoader aLoader =
-            (com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 com.sun.star.frame.XComponentLoader.class,
 				xOfficeContext.getServiceManager().createInstanceWithContext(
                     "com.sun.star.frame.Desktop", xOfficeContext));
 
-		xComponent = (com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
+		xComponent = UnoRuntime.queryInterface(
             com.sun.star.lang.XComponent.class, aLoader.loadComponentFromURL(
 				sURL, sTargetFrame, nSearchFlags, aArgs ) );
 
diff --git a/main/odk/examples/DevelopersGuide/Drawing/LayerDemo.java b/main/odk/examples/DevelopersGuide/Drawing/LayerDemo.java
index f8ade5dc45..f17b54a307 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/LayerDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/LayerDemo.java
@@ -75,7 +75,7 @@ public class LayerDemo
 
 			// create two rectangles
 			XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 
 			XShape xRect1 = ShapeHelper.createShape( xDrawDoc,
@@ -101,11 +101,11 @@ public class LayerDemo
 
 			// query for the XLayerManager
 			XLayerSupplier xLayerSupplier = (XLayerSupplier)
-				(XLayerSupplier)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XLayerSupplier.class, xDrawDoc );
 			XNameAccess xNameAccess = xLayerSupplier.getLayerManager();
 			XLayerManager xLayerManager = (XLayerManager)
-				(XLayerManager)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XLayerManager.class, xNameAccess );
 
 			// create a layer and set its properties
@@ -114,7 +114,7 @@ public class LayerDemo
                 xLayerManager.getCount() );
 
 			xLayerPropSet = (XPropertySet)
-				(XPropertySet)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XPropertySet.class, xNotVisibleAndEditable );
 			xLayerPropSet.setPropertyValue( "Name", "NotVisibleAndEditable" );
 			xLayerPropSet.setPropertyValue( "IsVisible", new Boolean( false ) );
@@ -125,7 +125,7 @@ public class LayerDemo
                 xLayerManager.getCount() );
 
 			xLayerPropSet = (XPropertySet)
-				(XPropertySet)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XPropertySet.class, xNotEditable );
 			xLayerPropSet.setPropertyValue( "Name", "NotEditable" );
 			xLayerPropSet.setPropertyValue( "IsVisible", new Boolean( true ) );
diff --git a/main/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java b/main/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
index 3e61a0ae7e..a9b3761ad3 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
@@ -68,10 +68,10 @@ public class ObjectTransformationDemo
 				"private:factory/simpress", "_blank", 0, pPropValues );
 
 			XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XPropertySet xPagePropSet= (XPropertySet)
+			XPropertySet xPagePropSet=
 					UnoRuntime.queryInterface( XPropertySet.class, xPage );
 
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 
 
@@ -80,7 +80,7 @@ public class ObjectTransformationDemo
 					"com.sun.star.drawing.RectangleShape" );
 			xShapes.add( xShape );
 
-			XPropertySet xPropSet = (XPropertySet)
+			XPropertySet xPropSet =
 					UnoRuntime.queryInterface( XPropertySet.class, xShape );
 
 			HomogenMatrix3 aHomogenMatrix3 = (HomogenMatrix3)
diff --git a/main/odk/examples/DevelopersGuide/Drawing/Organigram.java b/main/odk/examples/DevelopersGuide/Drawing/Organigram.java
index 8caa1b8408..a1af880074 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/Organigram.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/Organigram.java
@@ -79,7 +79,7 @@ public class Organigram {
 
         Object desktop = xRemoteServiceManager.createInstanceWithContext(
             "com.sun.star.frame.Desktop", xRemoteContext);
-        XComponentLoader xComponentLoader = (XComponentLoader)
+        XComponentLoader xComponentLoader =
             UnoRuntime.queryInterface(XComponentLoader.class, desktop);
 
         PropertyValue[] loadProps = new PropertyValue[0];
@@ -88,21 +88,21 @@ public class Organigram {
 
         // get draw page by index
         com.sun.star.drawing.XDrawPagesSupplier xDrawPagesSupplier =
-            (com.sun.star.drawing.XDrawPagesSupplier)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 com.sun.star.drawing.XDrawPagesSupplier.class, xDrawComponent );
         com.sun.star.drawing.XDrawPages xDrawPages =
             xDrawPagesSupplier.getDrawPages();
         Object drawPage = xDrawPages.getByIndex(0);
-        com.sun.star.drawing.XDrawPage xDrawPage = (com.sun.star.drawing.XDrawPage)
+        com.sun.star.drawing.XDrawPage xDrawPage =
             UnoRuntime.queryInterface(com.sun.star.drawing.XDrawPage.class,
                                       drawPage);
 
         com.sun.star.lang.XMultiServiceFactory xDocumentFactory =
-            (com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 com.sun.star.lang.XMultiServiceFactory.class, xDrawComponent);
 
         com.sun.star.beans.XPropertySet xPageProps =
-            (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
+            UnoRuntime.queryInterface(
                 com.sun.star.beans.XPropertySet.class, xDrawPage);
 
         int pageWidth = AnyConverter.toInt(xPageProps.getPropertyValue("Width"));
@@ -141,14 +141,14 @@ public class Organigram {
                          (levelCount[level] - 1) * horSpace) / 2
                          + i * shapeWidth + i * horSpace;
                 Object shape = xDocumentFactory.createInstance("com.sun.star.drawing.RectangleShape");
-                com.sun.star.drawing.XShape xShape = (com.sun.star.drawing.XShape)
+                com.sun.star.drawing.XShape xShape =
                     UnoRuntime.queryInterface(
                         com.sun.star.drawing.XShape.class, shape);
                 xShape.setPosition(new com.sun.star.awt.Point(shapeX, levelY));
                 xShape.setSize(new com.sun.star.awt.Size(shapeWidth, shapeHeight));
                 xDrawPage.add(xShape);
 
-                com.sun.star.text.XText xText = (com.sun.star.text.XText)
+                com.sun.star.text.XText xText =
                     UnoRuntime.queryInterface(
                         com.sun.star.text.XText.class, xShape);
 
@@ -161,10 +161,10 @@ public class Organigram {
                 if (level == 1) {
                     Object connector = xDocumentFactory.createInstance("com.sun.star.drawing.ConnectorShape");
                     com.sun.star.beans.XPropertySet xConnectorProps =
-                        (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
+                        UnoRuntime.queryInterface(
                             com.sun.star.beans.XPropertySet.class, connector);
                 com.sun.star.drawing.XShape xConnector =
-                    (com.sun.star.drawing.XShape)UnoRuntime.queryInterface(
+                    UnoRuntime.queryInterface(
                         com.sun.star.drawing.XShape.class, connector);
                     xDrawPage.add(xConnector);
                     xConnectorProps.setPropertyValue("StartShape", xStartShape);
diff --git a/main/odk/examples/DevelopersGuide/Drawing/PageHelper.java b/main/odk/examples/DevelopersGuide/Drawing/PageHelper.java
index 7df652e73a..0b777a9b78 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/PageHelper.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/PageHelper.java
@@ -52,7 +52,7 @@ public class PageHelper
 	static public int getDrawPageCount( XComponent xComponent )
 	{
 		XDrawPagesSupplier xDrawPagesSupplier =
-			(XDrawPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XDrawPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
 		return xDrawPages.getCount();
@@ -65,10 +65,10 @@ public class PageHelper
 			com.sun.star.lang.WrappedTargetException
 	{
 		XDrawPagesSupplier xDrawPagesSupplier =
-			(XDrawPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XDrawPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
-		return (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex( nIndex ));
+		return UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex( nIndex ));
 	}
 
     /** creates and inserts a draw page into the giving position,
@@ -78,7 +78,7 @@ public class PageHelper
 		throws Exception
 	{
 		XDrawPagesSupplier xDrawPagesSupplier =
-			(XDrawPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XDrawPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
 		return xDrawPages.insertNewByIndex( nIndex );
@@ -89,7 +89,7 @@ public class PageHelper
 	static public void removeDrawPage( XComponent xComponent, XDrawPage xDrawPage )
 	{
 		XDrawPagesSupplier xDrawPagesSupplier =
-			(XDrawPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XDrawPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
 		xDrawPages.remove( xDrawPage );
@@ -101,7 +101,7 @@ public class PageHelper
 		throws com.sun.star.beans.UnknownPropertyException,
 			com.sun.star.lang.WrappedTargetException
 	{
-		XPropertySet xPageProperties = (XPropertySet)
+		XPropertySet xPageProperties =
 			UnoRuntime.queryInterface( XPropertySet.class, xDrawPage );
 		return new Size(
 			((Integer)xPageProperties.getPropertyValue( "Width" )).intValue(),
@@ -115,7 +115,7 @@ public class PageHelper
 	static public int getMasterPageCount( XComponent xComponent )
 	{
 		XMasterPagesSupplier xMasterPagesSupplier =
-			(XMasterPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
 		return xDrawPages.getCount();
@@ -128,10 +128,10 @@ public class PageHelper
 			com.sun.star.lang.WrappedTargetException
 	{
 		XMasterPagesSupplier xMasterPagesSupplier =
-			(XMasterPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
-		return (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex( nIndex ));
+		return UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex( nIndex ));
 	}
 
     /** creates and inserts a new master page into the giving position,
@@ -140,7 +140,7 @@ public class PageHelper
 	static public XDrawPage insertNewMasterPageByIndex( XComponent xComponent, int nIndex )
 	{
 		XMasterPagesSupplier xMasterPagesSupplier =
-			(XMasterPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
 		return xDrawPages.insertNewByIndex( nIndex );
@@ -151,7 +151,7 @@ public class PageHelper
 	static public void removeMasterPage( XComponent xComponent, XDrawPage xDrawPage )
 	{
 		XMasterPagesSupplier xMasterPagesSupplier =
-			(XMasterPagesSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPagesSupplier.class, xComponent );
 		XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
 		xDrawPages.remove( xDrawPage );
@@ -162,7 +162,7 @@ public class PageHelper
 	static public XDrawPage getMasterPage( XDrawPage xDrawPage )
 	{
 		XMasterPageTarget xMasterPageTarget =
-			(XMasterPageTarget)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPageTarget.class, xDrawPage );
 		return xMasterPageTarget.getMasterPage();
 	}
@@ -172,7 +172,7 @@ public class PageHelper
 	static public void setMasterPage( XDrawPage xDrawPage, XDrawPage xMasterPage )
 	{
 		XMasterPageTarget xMasterPageTarget =
-			(XMasterPageTarget)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMasterPageTarget.class, xDrawPage );
 		xMasterPageTarget.setMasterPage( xMasterPage );
 	}
@@ -185,7 +185,7 @@ public class PageHelper
 	*/
 	static public boolean isImpressDocument( XComponent xComponent )
 	{
-		XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(
+		XServiceInfo xInfo = UnoRuntime.queryInterface(
 				XServiceInfo.class, xComponent );
 		return xInfo.supportsService( "com.sun.star.presentation.PresentationDocument" );
 	}
@@ -195,7 +195,7 @@ public class PageHelper
 	static public XDrawPage getNotesPage( XDrawPage xDrawPage )
 	{
 		XPresentationPage aPresentationPage =
-			(XPresentationPage)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XPresentationPage.class, xDrawPage );
 		return aPresentationPage.getNotesPage();
 	}
@@ -205,7 +205,7 @@ public class PageHelper
 	static public XDrawPage getHandoutMasterPage( XComponent xComponent )
 	{
 		XHandoutMasterSupplier aHandoutMasterSupplier =
-			(XHandoutMasterSupplier)UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XHandoutMasterSupplier.class, xComponent );
 		return aHandoutMasterSupplier.getHandoutMasterPage();
 	}
diff --git a/main/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java b/main/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
index 154380fc12..58169c09ef 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
@@ -90,7 +90,7 @@ public class PresentationDemo
 
 			// set the slide transition for the first page
 			xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			xShapes = (XShapes)
+			xShapes =
 				UnoRuntime.queryInterface( XShapes.class, xPage );
 			// set slide transition effect
 			setSlideTransition( xPage,
@@ -115,7 +115,7 @@ public class PresentationDemo
 
 			// set the slide transition for the second page
 			xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 1 );
-			xShapes = (XShapes)
+			xShapes =
 				UnoRuntime.queryInterface( XShapes.class, xPage );
 			setSlideTransition( xPage,
 				com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
@@ -136,7 +136,7 @@ public class PresentationDemo
 			// the second object lets the presentation jump to page two
 			// by using a ClickAction.BOOKMARK;
 			xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 2 );
-			xShapes = (XShapes)
+			xShapes =
 				UnoRuntime.queryInterface( XShapes.class, xPage );
 			setSlideTransition( xPage,
 				com.sun.star.presentation.FadeEffect.ROLL_FROM_LEFT,
@@ -148,7 +148,7 @@ public class PresentationDemo
 			xShapes.add( xShape );
 			ShapeHelper.addPortion( xShape, "click to go", false );
 			ShapeHelper.addPortion( xShape, "to first page", true );
-			xShapePropSet = (XPropertySet)
+			xShapePropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xShape );
 			xShapePropSet.setPropertyValue("Effect",
                 com.sun.star.presentation.AnimationEffect.FADE_FROM_BOTTOM );
@@ -162,7 +162,7 @@ public class PresentationDemo
 			xShapes.add( xShape );
 			ShapeHelper.addPortion( xShape, "click to go", false );
 			ShapeHelper.addPortion( xShape, "to the second page", true );
-			xShapePropSet = (XPropertySet)
+			xShapePropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xShape );
 			xShapePropSet.setPropertyValue("Effect",
                 com.sun.star.presentation.AnimationEffect.FADE_FROM_BOTTOM );
@@ -170,7 +170,7 @@ public class PresentationDemo
 			xShapePropSet.setPropertyValue(
 				"OnClick", com.sun.star.presentation.ClickAction.BOOKMARK );
 			// set the name of page two, and use it with the bookmark action
-			XNamed xPageName = (XNamed)UnoRuntime.queryInterface(
+			XNamed xPageName = UnoRuntime.queryInterface(
 				XNamed.class, PageHelper.getDrawPageByIndex( xDrawDoc, 1 ) );
 			xPageName.setName( "page two" );
 			xShapePropSet.setPropertyValue(
@@ -180,10 +180,10 @@ public class PresentationDemo
 			/* start an endless presentation which is displayed in
 			   full-screen mode and placed on top */
 
-			XPresentationSupplier xPresSupplier = (XPresentationSupplier)
+			XPresentationSupplier xPresSupplier =
 				UnoRuntime.queryInterface( XPresentationSupplier.class, xDrawDoc );
 			XPresentation xPresentation = xPresSupplier.getPresentation();
-			XPropertySet xPresPropSet = (XPropertySet)
+			XPropertySet xPresPropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xPresentation );
 			xPresPropSet.setPropertyValue( "IsEndless", new Boolean( true ) );
 			xPresPropSet.setPropertyValue( "IsAlwaysOnTop", new Boolean( true ) );
@@ -207,13 +207,13 @@ public class PresentationDemo
 		// the following test is only sensible if you do not exactly know
 		// what type of page xPage is, for this purpose it can been tested
 		// if the com.sun.star.presentation.DrawPage service is supported
-		XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(
+		XServiceInfo xInfo = UnoRuntime.queryInterface(
 				XServiceInfo.class, xPage );
 		if ( xInfo.supportsService( "com.sun.star.presentation.DrawPage" ) == true )
 		{
 			try
 			{
-				XPropertySet xPropSet = (XPropertySet)
+				XPropertySet xPropSet =
 					UnoRuntime.queryInterface( XPropertySet.class, xPage );
 				xPropSet.setPropertyValue( "Effect",   eEffect );
 				xPropSet.setPropertyValue( "Speed",    eSpeed );
diff --git a/main/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java b/main/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
index 58d0ae14bc..cbcdf25f06 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
@@ -55,7 +55,7 @@ public class ShapeHelper
 	{
 		XShape xShape = createShape( xDrawDoc, aPos, aSize, sShapeType );
 		xShapes.add( xShape );
-		XPropertySet xPropSet = (XPropertySet)
+		XPropertySet xPropSet =
 			UnoRuntime.queryInterface( XPropertySet.class, xShape );
 		return xPropSet;
 	}
@@ -68,10 +68,10 @@ public class ShapeHelper
 	{
 		XShape xShape = null;
 		XMultiServiceFactory xFactory =
-			(XMultiServiceFactory )UnoRuntime.queryInterface(
+			UnoRuntime.queryInterface(
 				XMultiServiceFactory.class, xDrawDoc );
 		Object xObj = xFactory.createInstance( sShapeType );
-		xShape = (XShape)UnoRuntime.queryInterface(
+		xShape = UnoRuntime.queryInterface(
 			XShape.class, xObj );
 		xShape.setPosition( aPos );
 		xShape.setSize( aSize );
@@ -85,7 +85,7 @@ public class ShapeHelper
 	public static XPropertySet addPortion( XShape xShape, String sText, boolean bNewParagraph )
 		throws com.sun.star.lang.IllegalArgumentException
 	{
-		XText xText = (XText)
+		XText xText =
 			UnoRuntime.queryInterface( XText.class, xShape );
 
 		XTextCursor xTextCursor = xText.createTextCursor();
@@ -95,11 +95,11 @@ public class ShapeHelper
 			xText.insertControlCharacter( xTextCursor, ControlCharacter.PARAGRAPH_BREAK, false );
 			xTextCursor.gotoEnd( false );
 		}
-		XTextRange xTextRange = (XTextRange)
+		XTextRange xTextRange =
 			UnoRuntime.queryInterface( XTextRange.class, xTextCursor );
 		xTextRange.setString( sText );
 		xTextCursor.gotoEnd( true );
-		XPropertySet xPropSet = (XPropertySet)
+		XPropertySet xPropSet =
 			UnoRuntime.queryInterface( XPropertySet.class, xTextRange );
 		return xPropSet;
 	}
@@ -112,7 +112,7 @@ public class ShapeHelper
 						com.sun.star.lang.WrappedTargetException,
 							com.sun.star.container.NoSuchElementException
 	{
-		XEnumerationAccess xEnumerationAccess = (XEnumerationAccess)
+		XEnumerationAccess xEnumerationAccess =
 			UnoRuntime.queryInterface( XEnumerationAccess.class, xText );
 		if ( xEnumerationAccess.hasElements() )
 		{
@@ -122,9 +122,9 @@ public class ShapeHelper
 				Object xObj = xEnumeration.nextElement();
 				if ( xEnumeration.hasMoreElements() == false )
 				{
-					XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(
+					XTextContent xTextContent = UnoRuntime.queryInterface(
 						XTextContent.class, xObj );
-					XPropertySet xParaPropSet = (XPropertySet)
+					XPropertySet xParaPropSet =
 						UnoRuntime.queryInterface( XPropertySet.class, xTextContent );
 					xParaPropSet.setPropertyValue( sPropName, aValue );
 				}
diff --git a/main/odk/examples/DevelopersGuide/Drawing/StyleDemo.java b/main/odk/examples/DevelopersGuide/Drawing/StyleDemo.java
index 5f3cc06311..c55c8a9f0a 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/StyleDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/StyleDemo.java
@@ -80,10 +80,10 @@ public class StyleDemo
 			   that is available within the styles of the document to red. It
 			   will also print each family and style name to the standard output */
 			XModel xModel =
-				(XModel)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XModel.class, xComponent );
 			com.sun.star.style.XStyleFamiliesSupplier xSFS =
-                (com.sun.star.style.XStyleFamiliesSupplier)
+
 				UnoRuntime.queryInterface(
                     com.sun.star.style.XStyleFamiliesSupplier.class, xModel );
 
@@ -100,7 +100,7 @@ public class StyleDemo
 				// and now all available styles
 				Object aFamilyObj = xFamilies.getByName( Families[ i ] );
 				com.sun.star.container.XNameAccess xStyles =
-                    (com.sun.star.container.XNameAccess)
+
 					UnoRuntime.queryInterface(
                         com.sun.star.container.XNameAccess.class, aFamilyObj );
 				String[] Styles = xStyles.getElementNames();
@@ -108,12 +108,12 @@ public class StyleDemo
 				{
 					System.out.println( "   " + Styles[ j ] );
 					Object aStyleObj = xStyles.getByName( Styles[ j ] );
-					com.sun.star.style.XStyle xStyle = (com.sun.star.style.XStyle)
+					com.sun.star.style.XStyle xStyle =
 						UnoRuntime.queryInterface(
                             com.sun.star.style.XStyle.class, aStyleObj );
 					// now we have the XStyle Interface and the CharColor for
 					// all styles is exemplary be set to red.
-					XPropertySet xStylePropSet = (XPropertySet)
+					XPropertySet xStylePropSet =
 						UnoRuntime.queryInterface( XPropertySet.class, xStyle );
 					XPropertySetInfo xStylePropSetInfo =
                         xStylePropSet.getPropertySetInfo();
@@ -131,25 +131,25 @@ public class StyleDemo
 			   the "graphics" family */
 
 			Object obj = xFamilies.getByName( "graphics" );
-			com.sun.star.container.XNameAccess xStyles = (XNameAccess)
+			com.sun.star.container.XNameAccess xStyles =
 				UnoRuntime.queryInterface(com.sun.star.container.XNameAccess.class,
                                           obj );
 			obj = xStyles.getByName( "title1" );
-			com.sun.star.style.XStyle xTitle1Style = (com.sun.star.style.XStyle)
+			com.sun.star.style.XStyle xTitle1Style =
 				UnoRuntime.queryInterface( com.sun.star.style.XStyle.class, obj );
 
 			XDrawPagesSupplier xDrawPagesSupplier =
-				(XDrawPagesSupplier)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XDrawPagesSupplier.class, xComponent );
 			XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
-			XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
+			XDrawPage xDrawPage = UnoRuntime.queryInterface(
                 XDrawPage.class, xDrawPages.getByIndex( 0 ));
-			XShapes xShapes = (XShapes)UnoRuntime.queryInterface(XShapes.class,
+			XShapes xShapes = UnoRuntime.queryInterface(XShapes.class,
                                                                  xDrawPage );
 			XShape xShape = ShapeHelper.createShape( xComponent, new Point( 0, 0 ),
 				new Size( 5000, 5000 ), "com.sun.star.drawing.RectangleShape" );
 			xShapes.add( xShape );
-			XPropertySet xPropSet = (XPropertySet)
+			XPropertySet xPropSet =
 				UnoRuntime.queryInterface( XPropertySet.class, xShape );
 			xPropSet.setPropertyValue( "Style", xTitle1Style );
 
diff --git a/main/odk/examples/DevelopersGuide/Drawing/TextDemo.java b/main/odk/examples/DevelopersGuide/Drawing/TextDemo.java
index ed14809e63..9363eb8029 100644
--- a/main/odk/examples/DevelopersGuide/Drawing/TextDemo.java
+++ b/main/odk/examples/DevelopersGuide/Drawing/TextDemo.java
@@ -72,7 +72,7 @@ public class TextDemo
 				"private:factory/sdraw", "_blank", 0, pPropValues );
 
 			XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-			XShapes xShapes = (XShapes)
+			XShapes xShapes =
 					UnoRuntime.queryInterface( XShapes.class, xPage );
 
 
@@ -89,7 +89,7 @@ public class TextDemo
 					new Size( 15000, 7500 ),
 						"com.sun.star.drawing.RectangleShape" );
 			xShapes.add( xRectangle );
-			xShapePropSet = (XPropertySet)
+			xShapePropSet =
 					UnoRuntime.queryInterface( XPropertySet.class, xRectangle );
 
 
@@ -117,7 +117,7 @@ public class TextDemo
 					new Size( 21000, 12500 ),
 						"com.sun.star.drawing.RectangleShape" );
 			xShapes.add( xRectangle );
-			xShapePropSet = (XPropertySet)
+			xShapePropSet =
 					UnoRuntime.queryInterface( XPropertySet.class, xRectangle );
 			xShapePropSet.setPropertyValue( "TextFitToSize",
                                             TextFitToSizeType.PROPORTIONAL );
diff --git a/main/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java b/main/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
index 649ca63529..578a9d0c90 100644
--- a/main/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
+++ b/main/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
@@ -62,13 +62,13 @@ public class FirstLoadComponent {
 
             Object desktop = xRemoteServiceManager.createInstanceWithContext(
                 "com.sun.star.frame.Desktop", xRemoteContext);
-            XComponentLoader xComponentLoader = (XComponentLoader)
+            XComponentLoader xComponentLoader =
                 UnoRuntime.queryInterface(XComponentLoader.class, desktop);
 
             PropertyValue[] loadProps = new PropertyValue[0];
             XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
 
-            XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
+            XSpreadsheetDocument xSpreadsheetDocument =
                 UnoRuntime.queryInterface(XSpreadsheetDocument.class,
                                           xSpreadsheetComponent);
 
@@ -78,7 +78,7 @@ public class FirstLoadComponent {
 
             System.out.println(elemType.getTypeName());
             Object sheet = xSpreadsheets.getByName("MySheet");
-            XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
+            XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(
                 XSpreadsheet.class, sheet);
 
             XCell xCell = xSpreadsheet.getCellByPosition(0, 0);
@@ -88,14 +88,14 @@ public class FirstLoadComponent {
             xCell = xSpreadsheet.getCellByPosition(0, 2);
             xCell.setFormula("=sum(A1:A2)");
 
-            XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
+            XPropertySet xCellProps = UnoRuntime.queryInterface(
                 XPropertySet.class, xCell);
             xCellProps.setPropertyValue("CellStyle", "Result");
 
-            XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface(
+            XModel xSpreadsheetModel = UnoRuntime.queryInterface(
                 XModel.class, xSpreadsheetComponent);
             XController xSpreadsheetController = xSpreadsheetModel.getCurrentController();
-            XSpreadsheetView xSpreadsheetView = (XSpreadsheetView)
+            XSpreadsheetView xSpreadsheetView =
                 UnoRuntime.queryInterface(XSpreadsheetView.class,
                                           xSpreadsheetController);
             xSpreadsheetView.setActiveSheet(xSpreadsheet);
@@ -127,7 +127,7 @@ public class FirstLoadComponent {
 
             // *********************************************************
             // example for use of XEnumerationAccess
-            XCellRangesQuery xCellQuery = (XCellRangesQuery)
+            XCellRangesQuery xCellQuery =
                 UnoRuntime.queryInterface(XCellRangesQuery.class, sheet);
             XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells(
                 (short)com.sun.star.sheet.CellFlags.FORMULA);
@@ -136,8 +136,8 @@ public class FirstLoadComponent {
 
             while (xFormulaEnum.hasMoreElements()) {
                 Object formulaCell = xFormulaEnum.nextElement();
-                xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
-                XCellAddressable xCellAddress = (XCellAddressable)
+                xCell = UnoRuntime.queryInterface(XCell.class, formulaCell);
+                XCellAddressable xCellAddress =
                     UnoRuntime.queryInterface(XCellAddressable.class, xCell);
                 System.out.println("Formula cell in column " +
                                    xCellAddress.getCellAddress().Column
@@ -226,13 +226,13 @@ public class FirstLoadComponent {
 //         try {
 //             Object desktop = xRemoteServiceManager.createInstanceWithContext(
 //                 "com.sun.star.frame.Desktop", xRemoteContext);
-//             XComponentLoader xComponentLoader = (XComponentLoader)
+//             XComponentLoader xComponentLoader =
 //                 UnoRuntime.queryInterface(XComponentLoader.class, desktop);
 
 //             PropertyValue[] loadProps = new PropertyValue[0];
 //             XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
 
-//             XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
+//             XSpreadsheetDocument xSpreadsheetDocument =
 //                 UnoRuntime.queryInterface(XSpreadsheetDocument.class,
 //                                           xSpreadsheetComponent);
 
@@ -242,7 +242,7 @@ public class FirstLoadComponent {
 
 //             System.out.println(elemType.getTypeName());
 //             Object sheet = xSpreadsheets.getByName("MySheet");
-//             XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
+//             XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(
 //                 XSpreadsheet.class, sheet);
 
 //             XCell xCell = xSpreadsheet.getCellByPosition(0, 0);
@@ -252,14 +252,14 @@ public class FirstLoadComponent {
 //             xCell = xSpreadsheet.getCellByPosition(0, 2);
 //             xCell.setFormula("=sum(A1:A2)");
 
-//             XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
+//             XPropertySet xCellProps = UnoRuntime.queryInterface(
 //                 XPropertySet.class, xCell);
 //             xCellProps.setPropertyValue("CellStyle", "Result");
 
-//             XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface(
+//             XModel xSpreadsheetModel = UnoRuntime.queryInterface(
 //                 XModel.class, xSpreadsheetComponent);
 //             XController xSpreadsheetController = xSpreadsheetModel.getCurrentController();
-//             XSpreadsheetView xSpreadsheetView = (XSpreadsheetView)
+//             XSpreadsheetView xSpreadsheetView =
 //                 UnoRuntime.queryInterface(XSpreadsheetView.class,
 //                                           xSpreadsheetController);
 //             xSpreadsheetView.setActiveSheet(xSpreadsheet);
@@ -291,7 +291,7 @@ public class FirstLoadComponent {
 
 //             // *********************************************************
 //             // example for use of XEnumerationAccess
-//             XCellRangesQuery xCellQuery = (XCellRangesQuery)
+//             XCellRangesQuery xCellQuery =
 //                 UnoRuntime.queryInterface(XCellRangesQuery.class, sheet);
 //             XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells(
 //                 (short)com.sun.star.sheet.CellFlags.FORMULA);
@@ -300,8 +300,8 @@ public class FirstLoadComponent {
 
 //             while (xFormulaEnum.hasMoreElements()) {
 //                 Object formulaCell = xFormulaEnum.nextElement();
-//                 xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
-//                 XCellAddressable xCellAddress = (XCellAddressable)
+//                 xCell = UnoRuntime.queryInterface(XCell.class, formulaCell);
+//                 XCellAddressable xCellAddress =
 //                     UnoRuntime.queryInterface(XCellAddressable.class, xCell);
 //                 System.out.println("Formula cell in column " +
 //                                    xCellAddress.getCellAddress().Column
diff --git a/main/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java b/main/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
index d8f46fcd54..3357aab0f6 100644
--- a/main/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
+++ b/main/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
@@ -106,27 +106,27 @@ public class HelloTextTableShape {
         try {
             // create new writer document and get text, then manipulate text
             XComponent xWriterComponent = newDocComponent("swriter");
-            XTextDocument xTextDocument = (XTextDocument)UnoRuntime.queryInterface(
+            XTextDocument xTextDocument = UnoRuntime.queryInterface(
                 XTextDocument.class, xWriterComponent);
             XText xText = xTextDocument.getText();
 
             manipulateText(xText);
 
             // get internal service factory of the document
-            XMultiServiceFactory xWriterFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+            XMultiServiceFactory xWriterFactory = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, xWriterComponent);
 
             // insert TextTable and get cell text, then manipulate text in cell
             Object table = xWriterFactory.createInstance("com.sun.star.text.TextTable");
-            XTextContent xTextContentTable = (XTextContent)UnoRuntime.queryInterface(
+            XTextContent xTextContentTable = UnoRuntime.queryInterface(
                 XTextContent.class, table);
 
             xText.insertTextContent(xText.getEnd(), xTextContentTable, false);
 
-            XCellRange xCellRange = (XCellRange)UnoRuntime.queryInterface(
+            XCellRange xCellRange = UnoRuntime.queryInterface(
                 XCellRange.class, table);
             XCell xCell = xCellRange.getCellByPosition(0, 1);
-            XText xCellText = (XText)UnoRuntime.queryInterface(XText.class, xCell);
+            XText xCellText = UnoRuntime.queryInterface(XText.class, xCell);
 
             manipulateText(xCellText);
             manipulateTable(xCellRange);
@@ -134,21 +134,21 @@ public class HelloTextTableShape {
             // insert RectangleShape and get shape text, then manipulate text
             Object writerShape = xWriterFactory.createInstance(
                 "com.sun.star.drawing.RectangleShape");
-            XShape xWriterShape = (XShape)UnoRuntime.queryInterface(
+            XShape xWriterShape = UnoRuntime.queryInterface(
                 XShape.class, writerShape);
             xWriterShape.setSize(new Size(10000, 10000));
-            XTextContent xTextContentShape = (XTextContent)UnoRuntime.queryInterface(
+            XTextContent xTextContentShape = UnoRuntime.queryInterface(
                 XTextContent.class, writerShape);
 
             xText.insertTextContent(xText.getEnd(), xTextContentShape, false);
 
-            XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(
+            XPropertySet xShapeProps = UnoRuntime.queryInterface(
                 XPropertySet.class, writerShape);
             // wrap text inside shape
             xShapeProps.setPropertyValue("TextContourFrame", new Boolean(true));
 
 
-            XText xShapeText = (XText)UnoRuntime.queryInterface(XText.class, writerShape);
+            XText xShapeText = UnoRuntime.queryInterface(XText.class, writerShape);
 
             manipulateText(xShapeText);
             manipulateShape(xWriterShape);
@@ -157,22 +157,22 @@ public class HelloTextTableShape {
 
             Object bookmark = xWriterFactory.createInstance ( "com.sun.star.text.Bookmark" );
             // name the bookmark
-            XNamed xNamed = (XNamed) UnoRuntime.queryInterface (
+            XNamed xNamed = UnoRuntime.queryInterface (
                     XNamed.class, bookmark );
             xNamed.setName("MyUniqueBookmarkName");
 
             // get XTextContent interface and insert it at the end of the document
-            XTextContent xTextContent = (XTextContent) UnoRuntime.queryInterface (
+            XTextContent xTextContent = UnoRuntime.queryInterface (
                     XTextContent.class, bookmark );
             //mxDocText.insertTextContent ( mxDocText.getEnd(), xTextContent, false );
             xText.insertTextContent ( xText.getEnd(), xTextContent, false );
 
                         //query BookmarksSupplier
-                        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)UnoRuntime.queryInterface(
+                        XBookmarksSupplier xBookmarksSupplier = UnoRuntime.queryInterface(
                             XBookmarksSupplier.class, xWriterComponent);
                         XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
                         Object foundBookmark = xNamedBookmarks.getByName("MyUniqueBookmarkName");
-                        XTextContent xFoundBookmark = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, foundBookmark);
+                        XTextContent xFoundBookmark = UnoRuntime.queryInterface(XTextContent.class, foundBookmark);
                         XTextRange xFound = xFoundBookmark.getAnchor();
                         xFound.setString(" The throat mike, glued to her neck, "
                             + "looked as much as possible like an analgesic dermadisk.");
@@ -181,13 +181,13 @@ public class HelloTextTableShape {
 
 
             // first query the XTextTablesSupplier interface from our document
-            XTextTablesSupplier xTablesSupplier = (XTextTablesSupplier) UnoRuntime.queryInterface(
+            XTextTablesSupplier xTablesSupplier = UnoRuntime.queryInterface(
                     XTextTablesSupplier.class, xWriterComponent);
             // get the tables collection
             XNameAccess xNamedTables = xTablesSupplier.getTextTables();
 
             // now query the XIndexAccess from the tables collection
-            XIndexAccess xIndexedTables = (XIndexAccess) UnoRuntime.queryInterface(
+            XIndexAccess xIndexedTables = UnoRuntime.queryInterface(
                     XIndexAccess.class, xNamedTables);
 
             // we need properties
@@ -197,7 +197,7 @@ public class HelloTextTableShape {
             for (int i = 0; i < xIndexedTables.getCount(); i++) {
                     //Object table = xIndexedTables.getByIndex(i);
                     table = xIndexedTables.getByIndex(i);
-                    xTableProps = (XPropertySet) UnoRuntime.queryInterface(
+                    xTableProps = UnoRuntime.queryInterface(
                             XPropertySet.class, table);
                     xTableProps.setPropertyValue("BackColor", new Integer(0xC8FFB9));
             }
@@ -215,50 +215,50 @@ public class HelloTextTableShape {
             // create new calc document and manipulate cell text
             XComponent xCalcComponent = newDocComponent("scalc");
             XSpreadsheetDocument xSpreadsheetDocument =
-                (XSpreadsheetDocument)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XSpreadsheetDocument .class, xCalcComponent);
             Object sheets = xSpreadsheetDocument.getSheets();
-            XIndexAccess xIndexedSheets = (XIndexAccess)UnoRuntime.queryInterface(
+            XIndexAccess xIndexedSheets = UnoRuntime.queryInterface(
                 XIndexAccess.class, sheets);
             Object sheet = xIndexedSheets.getByIndex(0);
 
             //get cell A2 in first sheet
-            XCellRange xSpreadsheetCells = (XCellRange)UnoRuntime.queryInterface(
+            XCellRange xSpreadsheetCells = UnoRuntime.queryInterface(
                 XCellRange.class, sheet);
             XCell xCell = xSpreadsheetCells.getCellByPosition(0,1);
-            XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
+            XPropertySet xCellProps = UnoRuntime.queryInterface(
                 XPropertySet.class, xCell);
             xCellProps.setPropertyValue("IsTextWrapped", new Boolean(true));
 
-            XText xCellText = (XText)UnoRuntime.queryInterface(XText.class, xCell);
+            XText xCellText = UnoRuntime.queryInterface(XText.class, xCell);
 
             manipulateText(xCellText);
             manipulateTable(xSpreadsheetCells);
 
             // get internal service factory of the document
-            XMultiServiceFactory xCalcFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+            XMultiServiceFactory xCalcFactory = UnoRuntime.queryInterface(
                 XMultiServiceFactory.class, xCalcComponent);
             // get Drawpage
-            XDrawPageSupplier xDrawPageSupplier = (XDrawPageSupplier)UnoRuntime.queryInterface(XDrawPageSupplier.class, sheet);
+            XDrawPageSupplier xDrawPageSupplier = UnoRuntime.queryInterface(XDrawPageSupplier.class, sheet);
             XDrawPage xDrawPage = xDrawPageSupplier.getDrawPage();
 
             // create and insert RectangleShape and get shape text, then manipulate text
             Object calcShape = xCalcFactory.createInstance(
                 "com.sun.star.drawing.RectangleShape");
-            XShape xCalcShape = (XShape)UnoRuntime.queryInterface(
+            XShape xCalcShape = UnoRuntime.queryInterface(
                 XShape.class, calcShape);
             xCalcShape.setSize(new Size(10000, 10000));
             xCalcShape.setPosition(new Point(7000, 3000));
 
             xDrawPage.add(xCalcShape);
 
-            XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(
+            XPropertySet xShapeProps = UnoRuntime.queryInterface(
                 XPropertySet.class, calcShape);
             // wrap text inside shape
             xShapeProps.setPropertyValue("TextContourFrame", new Boolean(true));
 
 
-            XText xShapeText = (XText)UnoRuntime.queryInterface(XText.class, calcShape);
+            XText xShapeText = UnoRuntime.queryInterface(XText.class, calcShape);
 
             manipulateText(xShapeText);
             manipulateShape(xCalcShape);
@@ -276,29 +276,29 @@ public class HelloTextTableShape {
             //create new draw document and insert rectangle shape
             XComponent xDrawComponent = newDocComponent("sdraw");
             XDrawPagesSupplier xDrawPagesSupplier =
-                (XDrawPagesSupplier)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XDrawPagesSupplier.class, xDrawComponent);
 
             Object drawPages = xDrawPagesSupplier.getDrawPages();
-            XIndexAccess xIndexedDrawPages = (XIndexAccess)UnoRuntime.queryInterface(
+            XIndexAccess xIndexedDrawPages = UnoRuntime.queryInterface(
                 XIndexAccess.class, drawPages);
             Object drawPage = xIndexedDrawPages.getByIndex(0);
-            XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, drawPage);
+            XDrawPage xDrawPage = UnoRuntime.queryInterface(XDrawPage.class, drawPage);
 
             // get internal service factory of the document
             XMultiServiceFactory xDrawFactory =
-                (XMultiServiceFactory)UnoRuntime.queryInterface(
+                UnoRuntime.queryInterface(
                     XMultiServiceFactory.class, xDrawComponent);
 
             Object drawShape = xDrawFactory.createInstance(
                 "com.sun.star.drawing.RectangleShape");
-            XShape xDrawShape = (XShape)UnoRuntime.queryInterface(XShape.class, drawShape);
+            XShape xDrawShape = UnoRuntime.queryInterface(XShape.class, drawShape);
             xDrawShape.setSize(new Size(10000, 20000));
             xDrawShape.setPosition(new Point(5000, 5000));
             xDrawPage.add(xDrawShape);
 
-            XText xShapeText = (XText)UnoRuntime.queryInterface(XText.class, drawShape);
-            XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(
+            XText xShapeText = UnoRuntime.queryInterface(XText.class, drawShape);
+            XPropertySet xShapeProps = UnoRuntime.queryInterface(
                 XPropertySet.class, drawShape);
 
             // wrap text inside shape
@@ -323,7 +323,7 @@ public class HelloTextTableShape {
 
         // create text cursor for selecting and formatting
         XTextCursor xTextCursor = xText.createTextCursor();
-        XPropertySet xCursorProps = (XPropertySet)UnoRuntime.queryInterface(
+        XPropertySet xCursorProps = UnoRuntime.queryInterface(
             XPropertySet.class, xTextCursor);
 
         // use cursor to select "He lay" and apply bold italic
@@ -353,32 +353,32 @@ public class HelloTextTableShape {
 
         // enter column titles and a cell value
         XCell xCell = xCellRange.getCellByPosition(0,0);
-        XText xCellText = (XText)UnoRuntime.queryInterface(XText.class, xCell);
+        XText xCellText = UnoRuntime.queryInterface(XText.class, xCell);
         xCellText.setString("Quotation");
         xCell = xCellRange.getCellByPosition(1,0);
-        xCellText = (XText)UnoRuntime.queryInterface(XText.class, xCell);
+        xCellText = UnoRuntime.queryInterface(XText.class, xCell);
         xCellText.setString("Year");
         xCell = xCellRange.getCellByPosition(1,1);
         xCell.setValue(1940);
         XCellRange xSelectedCells = xCellRange.getCellRangeByName("A1:B1");
-        XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
+        XPropertySet xCellProps = UnoRuntime.queryInterface(
             XPropertySet.class, xSelectedCells);
 
         // format table headers and table borders
         // we need to distinguish text and sheet tables:
         // property name for cell colors is different in text and sheet cells
         // we want to apply TableBorder to whole text table, but only to sheet cells with content
-        XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo xServiceInfo = UnoRuntime.queryInterface(
             XServiceInfo.class, xCellRange);
         if (xServiceInfo.supportsService("com.sun.star.sheet.Spreadsheet")) {
             backColorPropertyName = "CellBackColor";
             xSelectedCells = xCellRange.getCellRangeByName("A1:B2");
-            xTableProps = (XPropertySet)UnoRuntime.queryInterface(
+            xTableProps = UnoRuntime.queryInterface(
                 XPropertySet.class, xSelectedCells);
         }
         else if (xServiceInfo.supportsService("com.sun.star.text.TextTable")) {
             backColorPropertyName = "BackColor";
-            xTableProps = (XPropertySet)UnoRuntime.queryInterface(
+            xTableProps = UnoRuntime.queryInterface(
                 XPropertySet.class, xCellRange);
         }
         // set cell background color
@@ -409,7 +409,7 @@ public class HelloTextTableShape {
     }
 
     protected void manipulateShape(XShape xShape) throws com.sun.star.uno.Exception {
-        XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape);
+        XPropertySet xShapeProps = UnoRuntime.queryInterface(XPropertySet.class, xShape);
         xShapeProps.setPropertyValue("FillColor", new Integer(0x99CCFF));
         xShapeProps.setPropertyValue("LineColor", new Integer(0x000099));
         xShapeProps.setPropertyValue("RotateAngle", new Integer(3000));
@@ -426,7 +426,7 @@ public class HelloTextTableShape {
         xRemoteServiceManager = this.getRemoteServiceManager();
         Object desktop = xRemoteServiceManager.createInstanceWithContext(
             "com.sun.star.frame.Desktop", xRemoteContext);
-        XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
+        XComponentLoader xComponentLoader = UnoRuntime.queryInterface(
             XComponentLoader.class, desktop);
         PropertyValue[] loadProps = new PropertyValue[0];
         return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, loadProps);
diff --git a/main/odk/examples/DevelopersGuide/Forms/ButtonOperator.java b/main/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index eeada4d7c6..701b05d572 100644
--- a/main/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/main/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
@@ -108,7 +108,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
 		DocumentViewHelper aCurrentView = m_aDocument.getCurrentView();
 
 		// add a listener so we get noticed if the user presses the button
-		XButton xButtonControl = (XButton)UnoRuntime.queryInterface( XButton.class,
+		XButton xButtonControl = UnoRuntime.queryInterface( XButton.class,
 			aCurrentView.getFormControl( _buttonModel ) );
 		xButtonControl.addActionListener( this );
 
diff --git a/main/odk/examples/DevelopersGuide/Forms/ControlLock.java b/main/odk/examples/DevelopersGuide/Forms/ControlLock.java
index 0ba41bed48..e227185d72 100644
--- a/main/odk/examples/DevelopersGuide/Forms/ControlLock.java
+++ b/main/odk/examples/DevelopersGuide/Forms/ControlLock.java
@@ -55,7 +55,7 @@ class LockControlModels extends ComponentTreeTraversal
 		if ( !super.shouldStepInto( xContainer ) )
 			return false;	// don't try to be more clever than our base class
 
-		XForm xForm = (XForm)UnoRuntime.queryInterface( XForm.class, xContainer );
+		XForm xForm = UnoRuntime.queryInterface( XForm.class, xContainer );
 		if ( ( null != xForm ) && ( m_nLevel > 1 ) )
 			// don't step into sub forms - we only handle the form we were originally
 			// applied to
@@ -159,7 +159,7 @@ class ControlLock implements XRowSetListener
 		m_bLockingEnabled = bLock;
 
 		// add or remove ourself as listener to get notified of cursor moves
-		XRowSet xRowSet = (XRowSet)UnoRuntime.queryInterface(
+		XRowSet xRowSet = UnoRuntime.queryInterface(
 			XRowSet.class, m_xForm );
 		if ( m_bLockingEnabled )
 		{
diff --git a/main/odk/examples/DevelopersGuide/Forms/DataAwareness.java b/main/odk/examples/DevelopersGuide/Forms/DataAwareness.java
index e8abd71132..8bb4051f50 100644
--- a/main/odk/examples/DevelopersGuide/Forms/DataAwareness.java
+++ b/main/odk/examples/DevelopersGuide/Forms/DataAwareness.java
@@ -65,7 +65,7 @@ class PrintComponentTree extends ComponentTreeTraversal
 	public void handle( Object aFormComponent ) throws com.sun.star.uno.Exception
 	{
 		// the name of the child
-		XNamed xName = (XNamed)UnoRuntime.queryInterface( XNamed.class, aFormComponent );
+		XNamed xName = UnoRuntime.queryInterface( XNamed.class, aFormComponent );
 
 		// if it's a form control model, check it's type
 		XPropertySet xProps = UNO.queryPropertySet( aFormComponent );
@@ -172,7 +172,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
 	{
 		String sObjectName;
 
-		XNamed xNameAcc = (XNamed)UnoRuntime.queryInterface( XNamed.class, xContainer );
+		XNamed xNameAcc = UnoRuntime.queryInterface( XNamed.class, xContainer );
 		if ( null == xNameAcc )
 			sObjectName = new String( "<unnamed>" );
 		else
@@ -233,12 +233,12 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
 
 
 						// get the columns of our master form
-						XColumnsSupplier xSuppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+						XColumnsSupplier xSuppCols = UnoRuntime.queryInterface(
 							XColumnsSupplier.class, xFormProps );
 						XNameAccess xCols = xSuppCols.getColumns();
 
 						// and update the date column with a NULL value
-						XColumnUpdate xDateColumn = (XColumnUpdate)UnoRuntime.queryInterface(
+						XColumnUpdate xDateColumn = UnoRuntime.queryInterface(
 							XColumnUpdate.class, xCols.getByName( "SALEDATE" ) );
 						xDateColumn.updateNull();
 
@@ -633,7 +633,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
 		// the container to insert columns into
 		XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel );
 		// the factory for creating column models
-		XGridColumnFactory xColumnFactory = (XGridColumnFactory)UnoRuntime.queryInterface(
+		XGridColumnFactory xColumnFactory = UnoRuntime.queryInterface(
 			XGridColumnFactory.class, aGridModel );
 
 		// (let) create the new col
@@ -902,7 +902,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
 		m_aSalesNameValidator.enableColumnWatch( false );
 
 		// remove our own reset listener from the form
-		XNameAccess xMasterAsNames = (XNameAccess)UnoRuntime.queryInterface(
+		XNameAccess xMasterAsNames = UnoRuntime.queryInterface(
 			XNameAccess.class, m_xMasterForm );
 		XReset xFormReset = UNO.queryReset( xMasterAsNames.getByName( "Sales" ) );
 		xFormReset.removeResetListener( this );
diff --git a/main/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java b/main/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
index ef8b01bb73..f85ef1c9ed 100644
--- a/main/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
+++ b/main/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
@@ -52,14 +52,14 @@ public abstract class DocumentBasedExample implements com.sun.star.lang.XEventLi
                 createInitialComponentContext( null );
             final XMultiComponentFactory localServiceManager = componentContext.getServiceManager();
 
-            final XUnoUrlResolver urlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(
+            final XUnoUrlResolver urlResolver = UnoRuntime.queryInterface(
                 XUnoUrlResolver.class, localServiceManager.createInstanceWithContext(
                     "com.sun.star.bridge.UnoUrlResolver", componentContext) );
 
             final String connectStr = "uno:pipe,name=<pipename>;urp;StarOffice.ComponentContext";
             final Object initialObject = urlResolver.resolve( connectStr );
 
-            m_xCtx = (XComponentContext)UnoRuntime.queryInterface( XComponentContext.class,
+            m_xCtx = UnoRuntime.queryInterface( XComponentContext.class,
                 initialObject );
             */
 
@@ -166,7 +166,7 @@ public abstract class DocumentBasedExample implements com.sun.star.lang.XEventLi
             // close our document
             if ( m_document != null )
             {
-                XCloseable closeDoc = (XCloseable)
+                XCloseable closeDoc =
                     UnoRuntime.queryInterface( XCloseable.class,
                                                m_document.getDocument() );
                 if (closeDoc != null)
diff --git a/main/odk/examples/DevelopersGuide/Forms/DocumentHelper.java b/main/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
index f16a24f267..91417af329 100644
--- a/main/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
+++ b/main/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
@@ -66,7 +66,7 @@ public class DocumentHelper
     public DocumentHelper( XComponentContext xContext, XComponent document )
     {
         m_remoteContext = xContext;
-        m_orb = (XMultiServiceFactory)UnoRuntime.queryInterface(
+        m_orb = UnoRuntime.queryInterface(
             XMultiServiceFactory.class, m_remoteContext.getServiceManager());
         m_documentComponent = document;
     }
@@ -74,7 +74,7 @@ public class DocumentHelper
     /* ------------------------------------------------------------------ */
     protected static XComponent implCreateBlankDocument( XComponentContext xCtx, String factoryURL ) throws com.sun.star.uno.Exception
     {
-        XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(
+        XComponentLoader aLoader = UnoRuntime.queryInterface(
             XComponentLoader.class,
             xCtx.getServiceManager().createInstanceWithContext(
                 "com.sun.star.frame.Desktop", xCtx ));
@@ -108,7 +108,7 @@ public class DocumentHelper
     public DocumentViewHelper getCurrentView( )
     {
         // get the model interface for the document
-        XModel xDocModel = (XModel)UnoRuntime.queryInterface(XModel.class, m_documentComponent );
+        XModel xDocModel = UnoRuntime.queryInterface(XModel.class, m_documentComponent );
         // get the current controller for the document - as a controller is tied to a view,
         // this gives us the currently active view for the document.
         XController xController = xDocModel.getCurrentController();
@@ -145,7 +145,7 @@ public class DocumentHelper
         }
 
         // outta here
-        return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
+        return UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
     }
 
     /* ------------------------------------------------------------------ */
@@ -160,7 +160,7 @@ public class DocumentHelper
     public XIndexContainer createSubForm( Object aParentContainer, String sInitialName )
         throws com.sun.star.uno.Exception
     {
-        XIndexContainer xParentContainer = (XIndexContainer)UnoRuntime.queryInterface(
+        XIndexContainer xParentContainer = UnoRuntime.queryInterface(
             XIndexContainer.class, aParentContainer );
         return createSubForm( xParentContainer, sInitialName );
     }
@@ -177,8 +177,8 @@ public class DocumentHelper
     public XIndexContainer createSiblingForm( Object aForm, String sInitialName ) throws com.sun.star.uno.Exception
     {
         // get the parent
-        XChild xAsChild = (XChild)UnoRuntime.queryInterface( XChild.class, aForm );
-        XIndexContainer xContainer = (XIndexContainer)UnoRuntime.queryInterface(
+        XChild xAsChild = UnoRuntime.queryInterface( XChild.class, aForm );
+        XIndexContainer xContainer = UnoRuntime.queryInterface(
             XIndexContainer.class, xAsChild.getParent() );
         // append a new form to this parent container
         return createSubForm( xContainer, sInitialName );
@@ -189,13 +189,13 @@ public class DocumentHelper
     */
     static public DocumentHelper getDocumentForComponent( Object aFormComponent, XComponentContext xCtx )
     {
-        XChild xChild = (XChild)UnoRuntime.queryInterface( XChild.class, aFormComponent );
+        XChild xChild = UnoRuntime.queryInterface( XChild.class, aFormComponent );
         XModel xModel = null;
         while ( ( null != xChild ) && ( null == xModel ) )
         {
             XInterface xParent = (XInterface)xChild.getParent();
-            xModel = (XModel)UnoRuntime.queryInterface( XModel.class, xParent );
-            xChild = (XChild)UnoRuntime.queryInterface( XChild.class, xParent );
+            xModel = UnoRuntime.queryInterface( XModel.class, xParent );
+            xChild = UnoRuntime.queryInterface( XChild.class, xParent );
         }
 
         return new DocumentHelper( xCtx, xModel );
@@ -220,7 +220,7 @@ public class DocumentHelper
     */
     public DocumentType classify( )
     {
-        XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
+        XServiceInfo xSI = UnoRuntime.queryInterface(
             XServiceInfo.class, m_documentComponent );
 
         if ( xSI.supportsService( "com.sun.star.text.TextDocument" ) )
@@ -242,11 +242,11 @@ public class DocumentHelper
      */
     protected XDrawPage getDrawPage( int index ) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException
     {
-        XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+        XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
             XDrawPagesSupplier.class, getDocument() );
         XDrawPages xPages = xSuppPages.getDrawPages();
 
-        return (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
+        return UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
     }
 
     /* ------------------------------------------------------------------ */
@@ -257,18 +257,18 @@ public class DocumentHelper
         XDrawPage xReturn;
 
         // in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
-        XDrawPageSupplier xSuppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+        XDrawPageSupplier xSuppPage = UnoRuntime.queryInterface(
             XDrawPageSupplier.class, getDocument() );
         if ( null != xSuppPage )
             xReturn = xSuppPage.getDrawPage();
         else
         {   // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
             // (or any other multi-page document)
-            XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+            XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
                 XDrawPagesSupplier.class, getDocument() );
             XDrawPages xPages = xSuppPages.getDrawPages();
 
-            xReturn = (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
+            xReturn = UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
 
             // Note that this is no really error-proof code: If the document model does not support the
             // XDrawPagesSupplier interface, or if the pages collection returned is empty, this will break.
@@ -282,7 +282,7 @@ public class DocumentHelper
     */
     protected XNameContainer getFormComponentTreeRoot( ) throws com.sun.star.uno.Exception
     {
-        XFormsSupplier xSuppForms = (XFormsSupplier)UnoRuntime.queryInterface(
+        XFormsSupplier xSuppForms = UnoRuntime.queryInterface(
             XFormsSupplier.class, getMainDrawPage( ) );
 
         XNameContainer xFormsCollection = null;
@@ -298,7 +298,7 @@ public class DocumentHelper
     */
     public XInterface createInstance( String serviceSpecifier ) throws com.sun.star.uno.Exception
     {
-        XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+        XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
             m_documentComponent );
         return (XInterface)xORB.createInstance( serviceSpecifier );
     }
@@ -308,7 +308,7 @@ public class DocumentHelper
     */
     public XInterface createInstanceWithArguments( String serviceSpecifier, Object[] arguments ) throws com.sun.star.uno.Exception
     {
-        XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+        XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
             m_documentComponent );
         return (XInterface) xORB.createInstanceWithArguments( serviceSpecifier, arguments );
     }
diff --git a/main/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java b/main/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
index 596dfca3b6..52d7fd4186 100644
--- a/main/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
+++ b/main/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
@@ -95,12 +95,12 @@ class DocumentViewHelper
         // go get the current view
         XController xController = (XController)get( XController.class );
         // go get the dispatch provider of it's frame
-        XDispatchProvider xProvider = (XDispatchProvider)UnoRuntime.queryInterface(
+        XDispatchProvider xProvider = UnoRuntime.queryInterface(
             XDispatchProvider.class, xController.getFrame() );
         if ( null != xProvider )
         {
             // need an URLTransformer
-            XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+            XURLTransformer xTransformer = UnoRuntime.queryInterface(
                     XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
             xTransformer.parseStrict( aURL );
 
@@ -125,7 +125,7 @@ class DocumentViewHelper
     public XFormController getFormController( Object _form )
     {
         XFormLayerAccess formLayer = (XFormLayerAccess)get( XFormLayerAccess.class );
-        return formLayer.getFormController( (XForm)UnoRuntime.queryInterface( XForm.class, _form ) );
+        return formLayer.getFormController( UnoRuntime.queryInterface( XForm.class, _form ) );
     }
 
     /* ------------------------------------------------------------------ */
@@ -146,14 +146,14 @@ class DocumentViewHelper
     /* ------------------------------------------------------------------ */
     public XControl getFormControl( Object aModel ) throws com.sun.star.uno.Exception
     {
-        XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+        XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
         return getFormControl( xModel );
     }
 
     /* ------------------------------------------------------------------ */
     public Object getFormControl( Object aModel, Class aInterfaceClass ) throws com.sun.star.uno.Exception
     {
-        XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+        XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
         return UnoRuntime.queryInterface( aInterfaceClass, getFormControl( xModel ) );
     }
 
@@ -184,7 +184,7 @@ class DocumentViewHelper
         XControl xControl = getFormControl( xModel );
 
         // the focus can be set to an XWindow only
-        XWindow xControlWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class,
+        XWindow xControlWindow = UnoRuntime.queryInterface( XWindow.class,
             xControl );
 
         // grab the focus
@@ -207,7 +207,7 @@ class DocumentViewHelper
             XPropertySet xControlProps = UNO.queryPropertySet( xForm.getByIndex( i ) );
             if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() )
             {
-                XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
+                XControlModel xControlModel = UnoRuntime.queryInterface(
                     XControlModel.class, xControlProps );
                 // set the focus to this control
                 grabControlFocus( xControlModel );
diff --git a/main/odk/examples/DevelopersGuide/Forms/FLTools.java b/main/odk/examples/DevelopersGuide/Forms/FLTools.java
index 53fa37b9a1..a9242118b5 100644
--- a/main/odk/examples/DevelopersGuide/Forms/FLTools.java
+++ b/main/odk/examples/DevelopersGuide/Forms/FLTools.java
@@ -53,7 +53,7 @@ public class FLTools
 		URL[] aURL = new URL[] { new URL() };
 		aURL[0].Complete = sURL;
 		// need an URLTransformer
-		XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+		XURLTransformer xTransformer = UnoRuntime.queryInterface(
 			XURLTransformer.class,
             xCtx.getServiceManager().createInstanceWithContext(
                 "com.sun.star.util.URLTransformer", xCtx ) );
@@ -67,7 +67,7 @@ public class FLTools
 	*/
 	public static String getName( Object aFormComponent ) throws com.sun.star.uno.Exception
 	{
-		XNamed xNamed = (XNamed)UnoRuntime.queryInterface( XNamed.class,
+		XNamed xNamed = UnoRuntime.queryInterface( XNamed.class,
 			aFormComponent );
 		String sName = "";
 		if ( null != xNamed )
@@ -119,7 +119,7 @@ public class FLTools
 		int nIndex = -1;
 
 		// norm the element
-		XInterface xElement = (XInterface)UnoRuntime.queryInterface(
+		XInterface xElement = UnoRuntime.queryInterface(
 			XInterface.class, aElement );
 
 		// get the container
@@ -131,7 +131,7 @@ public class FLTools
 			for ( int i = 0; i < nCount; ++i )
 			{
 				// compare with the element
-				XInterface xCurrent = (XInterface)UnoRuntime.queryInterface(
+				XInterface xCurrent = UnoRuntime.queryInterface(
 					XInterface.class, xIndexCont.getByIndex( 0 ) );
 				if ( xCurrent.equals( xElement ) )
 				{	// found
@@ -150,7 +150,7 @@ public class FLTools
 	*/
 	static Object getParent( Object aComponent, Class aInterfaceClass )
 	{
-		XChild xAsChild = (XChild)UnoRuntime.queryInterface( XChild.class, aComponent );
+		XChild xAsChild = UnoRuntime.queryInterface( XChild.class, aComponent );
 
 		return UnoRuntime.queryInterface( aInterfaceClass, xAsChild.getParent() );
 	}
@@ -168,7 +168,7 @@ public class FLTools
 	*/
 	static public void disposeComponent( Object xComp ) throws java.lang.RuntimeException
 	{
-		XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class,
+		XComponent xComponent = UnoRuntime.queryInterface( XComponent.class,
 			xComp );
 		if ( null != xComponent )
 			xComponent.dispose();
@@ -179,7 +179,7 @@ public class FLTools
 	*/
 	static public Object getModel( Object aControl, Class aInterfaceClass )
 	{
-		XControl xControl = (XControl)UnoRuntime.queryInterface(
+		XControl xControl = UnoRuntime.queryInterface(
 			XControl.class, aControl );
 		XControlModel xModel = null;
 		if ( null != xControl )
diff --git a/main/odk/examples/DevelopersGuide/Forms/FormLayer.java b/main/odk/examples/DevelopersGuide/Forms/FormLayer.java
index ecffa47927..63d2cc29cc 100644
--- a/main/odk/examples/DevelopersGuide/Forms/FormLayer.java
+++ b/main/odk/examples/DevelopersGuide/Forms/FormLayer.java
@@ -96,9 +96,9 @@ public class FormLayer
         int nYPos, int nWidth, int nHeight, XIndexContainer xParentForm ) throws java.lang.Exception
     {
         // let the document create a shape
-        XMultiServiceFactory xDocAsFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+        XMultiServiceFactory xDocAsFactory = UnoRuntime.queryInterface(
             XMultiServiceFactory.class, m_document.getDocument() );
-        XControlShape xShape = (XControlShape)UnoRuntime.queryInterface( XControlShape.class,
+        XControlShape xShape = UnoRuntime.queryInterface( XControlShape.class,
             xDocAsFactory.createInstance( "com.sun.star.drawing.ControlShape" ) );
 
         // position and size of the shape
@@ -112,7 +112,7 @@ public class FormLayer
 
         // create the form component (the model of a form control)
         String sQualifiedComponentName = "com.sun.star.form.component." + sFormComponentService;
-        XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class,
+        XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class,
             m_document.getOrb().createInstance( sQualifiedComponentName ) );
 
         // insert the model into the form component hierarchy, if the caller gave us a location
@@ -127,7 +127,7 @@ public class FormLayer
         // add the shape to the shapes collection of the document
         XDrawPage pageWhereToInsert = ( m_insertPage != -1 ) ? m_document.getDrawPage( m_insertPage ) : m_document.getMainDrawPage();
 
-        XShapes xDocShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
+        XShapes xDocShapes = UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
         xDocShapes.add( xShape );
 
         // some initializations which are the same for all controls
@@ -249,7 +249,7 @@ public class FormLayer
     */
     public XPropertySet getRadioModelByRefValue( XPropertySet form, String name, String refValue ) throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XIndexAccess indexAccess = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+        XIndexAccess indexAccess = UnoRuntime.queryInterface( XIndexAccess.class,
             form );
 
         for ( int i=0; i<indexAccess.getCount(); ++i )
@@ -274,7 +274,7 @@ public class FormLayer
     */
     public XPropertySet getRadioModelByTag( XPropertySet form, String name, String tag ) throws com.sun.star.uno.Exception, java.lang.Exception
     {
-        XIndexAccess indexAccess = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+        XIndexAccess indexAccess = UnoRuntime.queryInterface( XIndexAccess.class,
             form );
 
         for ( int i=0; i<indexAccess.getCount(); ++i )
diff --git a/main/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java b/main/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
index 62b781fd93..b6db049160 100644
--- a/main/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
+++ b/main/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
@@ -65,7 +65,7 @@ class GridFieldValidator implements XUpdateListener
 		if ( bEnable == m_bWatching )
 			return;
 
-		XUpdateBroadcaster xUpdate = (XUpdateBroadcaster)UnoRuntime.queryInterface(
+		XUpdateBroadcaster xUpdate = UnoRuntime.queryInterface(
 			XUpdateBroadcaster.class, m_xWatchedColumn );
 
 		if ( bEnable )
@@ -98,7 +98,7 @@ class GridFieldValidator implements XUpdateListener
 			);
 
 			// instantiate an interaction handler who can handle SQLExceptions
-			XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(
+			XInteractionHandler xHandler = UnoRuntime.queryInterface(
 				XInteractionHandler.class,
                 m_xCtx.getServiceManager().createInstanceWithContext(
                     "com.sun.star.task.InteractionHandler", m_xCtx ) );
diff --git a/main/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java b/main/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
index 736486258c..02e6b563a4 100644
--- a/main/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
+++ b/main/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
@@ -75,9 +75,9 @@ public class HsqlDatabase
     {
         m_databaseDocumentFile = _docURL;
 
-        XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+        XNameAccess dbContext = UnoRuntime.queryInterface( XNameAccess.class,
             m_context.getServiceManager().createInstanceWithContext( "com.sun.star.sdb.DatabaseContext", m_context ) );
-        XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
+        XDocumentDataSource dataSource = UnoRuntime.queryInterface( XDocumentDataSource.class,
             dbContext.getByName( _docURL ) );
 
         m_databaseDocument = dataSource.getDatabaseDocument();
@@ -91,14 +91,14 @@ public class HsqlDatabase
         documentFile.deleteOnExit();
         m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath( documentFile );
 
-        m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(
+        m_databaseDocument = UnoRuntime.queryInterface(
             XOfficeDatabaseDocument.class, m_context.getServiceManager().createInstanceWithContext(
                 "com.sun.star.sdb.OfficeDatabaseDocument", m_context ) );
 
-        XPropertySet dsProperties = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
+        XPropertySet dsProperties = UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
         dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb");
 
-        XStorable storable = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
+        XStorable storable = UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
         storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]{} );
     }
 
@@ -130,7 +130,7 @@ public class HsqlDatabase
     {
         if ( m_databaseDocument != null )
         {
-            XStorable storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+            XStorable storeDoc = UnoRuntime.queryInterface( XStorable.class,
                 m_databaseDocument );
             storeDoc.store();
         }
@@ -144,7 +144,7 @@ public class HsqlDatabase
     public void close()
     {
         // close connection
-        XCloseable closeConn = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+        XCloseable closeConn = UnoRuntime.queryInterface( XCloseable.class,
             m_connection );
         if ( closeConn != null )
         {
@@ -159,7 +159,7 @@ public class HsqlDatabase
         m_connection = null;
 
         // close document
-        com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(
+        com.sun.star.util.XCloseable closeDoc = UnoRuntime.queryInterface(
             com.sun.star.util.XCloseable.class, m_databaseDocument );
         if ( closeDoc != null )
         {
@@ -212,7 +212,7 @@ public class HsqlDatabase
     */
     XModel getModel()
     {
-        return (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
+        return UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
     }
 
     /** drops the table with a given name
diff --git a/main/odk/examples/DevelopersGuide/Forms/KeyGenerator.java b/main/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
index f7ef34dbc0..a5b6879786 100644
--- a/main/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
+++ b/main/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
@@ -53,11 +53,11 @@ class UniqueColumnValue
 		if ( CommandType.COMMAND == aCommandType.intValue() )
 		{
 			// get the connection from the form
-            XConnection xFormConn = (XConnection)UnoRuntime.queryInterface( XConnection.class,
+            XConnection xFormConn = UnoRuntime.queryInterface( XConnection.class,
                 xForm.getPropertyValue( "ActiveConnection" ) );
 			// and let it create a composer for us
 			XSQLQueryComposerFactory xComposerFac =
-				(XSQLQueryComposerFactory)UnoRuntime.queryInterface(
+				UnoRuntime.queryInterface(
 					XSQLQueryComposerFactory.class, xFormConn );
 			XSQLQueryComposer xComposer = xComposerFac.createQueryComposer( );
 
@@ -65,7 +65,7 @@ class UniqueColumnValue
 			xComposer.setQuery( sCommand );
 
 			// and ask it for the table(s)
-			XTablesSupplier xSuppTables = (XTablesSupplier)UnoRuntime.queryInterface(
+			XTablesSupplier xSuppTables = UnoRuntime.queryInterface(
 				XTablesSupplier.class, xComposer );
 			XNameAccess xTables = xSuppTables.getTables();
 
@@ -115,7 +115,7 @@ class UniqueColumnValue
 	protected int generatePrimaryKey( XPropertySet xForm, String sFieldName ) throws com.sun.star.uno.Exception
 	{
 		// get the current connection of the form
-		XConnection xConn = (XConnection)UnoRuntime.queryInterface(
+		XConnection xConn = UnoRuntime.queryInterface(
 			XConnection.class, xForm.getPropertyValue( "ActiveConnection" ) );
 		// let it create a new statement
 		XStatement xStatement = xConn.createStatement();
@@ -130,7 +130,7 @@ class UniqueColumnValue
 		xResults.next( );
 
 		// get the value
-		XRow xRow = (XRow)UnoRuntime.queryInterface( XRow.class, xResults );
+		XRow xRow = UnoRuntime.queryInterface( XRow.class, xResults );
 		int nFreeValue = xRow.getInt( 1 );
 
 		// dispose the temporary objects
@@ -154,10 +154,10 @@ class UniqueColumnValue
 		if ( ResultSetConcurrency.READ_ONLY != aConcurrency.intValue() )
 		{
 			// get the column object
-			XColumnsSupplier xSuppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+			XColumnsSupplier xSuppCols = UnoRuntime.queryInterface(
 				XColumnsSupplier.class, xForm );
 			XNameAccess xCols = xSuppCols.getColumns();
-			XColumnUpdate xCol = (XColumnUpdate)UnoRuntime.queryInterface(
+			XColumnUpdate xCol = UnoRuntime.queryInterface(
 				XColumnUpdate.class, xCols.getByName( sFieldName ) );
 
 			xCol.updateInt( generatePrimaryKey( xForm, sFieldName ) );
@@ -193,7 +193,7 @@ class KeyGeneratorForReset extends UniqueColumnValue implements XResetListener
 	*/
 	public void defaultNewRecordFocus( XPropertySet xForm ) throws com.sun.star.uno.Exception
 	{
-		XIndexAccess xFormAsContainer = (XIndexAccess)UnoRuntime.queryInterface(
+		XIndexAccess xFormAsContainer = UnoRuntime.queryInterface(
 			XIndexAccess.class, xForm );
 		for ( int i = 0; i<xFormAsContainer.getCount(); ++i )
 		{
@@ -379,7 +379,7 @@ public class KeyGenerator
 		XReset xFormReset = UNO.queryReset( m_xForm );
 		xFormReset.removeResetListener( m_aResetKeyGenerator );
 
-		XRowSetApproveBroadcaster xFormBroadcaster = (XRowSetApproveBroadcaster)UnoRuntime.queryInterface(
+		XRowSetApproveBroadcaster xFormBroadcaster = UnoRuntime.queryInterface(
 			XRowSetApproveBroadcaster.class, m_xForm );
 		xFormBroadcaster.removeRowSetApproveListener( m_aUpdateKeyGenerator );
 
@@ -394,7 +394,7 @@ public class KeyGenerator
 		// for resets
 		XReset xFormReset = UNO.queryReset( m_xForm );
 		// for approving actions
-		XRowSetApproveBroadcaster xFormBroadcaster = (XRowSetApproveBroadcaster)UnoRuntime.queryInterface(
+		XRowSetApproveBroadcaster xFormBroadcaster = UnoRuntime.queryInterface(
 			XRowSetApproveBroadcaster.class, m_xForm );
 
 		if ( bGenerateOnReset )
diff --git a/main/odk/examples/DevelopersGuide/Forms/RowSet.java b/main/odk/examples/DevelopersGuide/Forms/RowSet.java
index dcbde98d05..e84dd03445 100644
--- a/main/odk/examples/DevelopersGuide/Forms/RowSet.java
+++ b/main/odk/examples/DevelopersGuide/Forms/RowSet.java
@@ -51,14 +51,14 @@ public class RowSet implements XRowSet, XRow
     {
         try
         {
-            m_rowSetProps = (XPropertySet)UnoRuntime.queryInterface(
+            m_rowSetProps = UnoRuntime.queryInterface(
                 XPropertySet.class, _context.getServiceManager().createInstanceWithContext( "com.sun.star.sdb.RowSet", _context ) );
             m_rowSetProps.setPropertyValue( "DataSourceName", _dataSource );
             m_rowSetProps.setPropertyValue( "CommandType", new Integer( _commandType ) );
             m_rowSetProps.setPropertyValue( "Command", _command );
 
-            m_rowSet = (XRowSet)UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
-            m_row = (XRow)UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
+            m_rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
+            m_row = UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
         }
         catch ( Exception e )
         {
@@ -70,9 +70,9 @@ public class RowSet implements XRowSet, XRow
     // misc
     public int getColumnCount()
     {
-        XColumnsSupplier suppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+        XColumnsSupplier suppCols = UnoRuntime.queryInterface(
             XColumnsSupplier.class, m_rowSet );
-        XIndexAccess columns = (XIndexAccess)UnoRuntime.queryInterface(
+        XIndexAccess columns = UnoRuntime.queryInterface(
             XIndexAccess.class, suppCols.getColumns() );
         return columns.getCount();
     }
diff --git a/main/odk/examples/DevelopersGuide/Forms/SalesFilter.java b/main/odk/examples/DevelopersGuide/Forms/SalesFilter.java
index 3bf15176fc..8644ae3429 100644
--- a/main/odk/examples/DevelopersGuide/Forms/SalesFilter.java
+++ b/main/odk/examples/DevelopersGuide/Forms/SalesFilter.java
@@ -427,7 +427,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
 			m_xSalesForm.setPropertyValue( "ApplyFilter", new Boolean( true ) );
 
 			// and reload the form
-			XLoadable xLoad = (XLoadable)UnoRuntime.queryInterface(
+			XLoadable xLoad = UnoRuntime.queryInterface(
 				XLoadable.class, m_xSalesForm );
 			xLoad.reload();
 
diff --git a/main/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java b/main/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
index 0d43067d48..f3c95afbca 100644
--- a/main/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
+++ b/main/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
@@ -109,7 +109,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
                 if ( controls[ i ].getPropertySetInfo().hasPropertyByName( "Border" ) )
                     controls[ i ].setPropertyValue( "Border", new Short( (short)2 ) );
 
-                XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+                XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
                     controls[ i ] );
                 xComp.addFormComponentValidityListener( this );
             }
@@ -131,7 +131,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
             m_explanationField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null );
             m_explanationField.setPropertyValue( "Label", new String( "" ) );
 
-            XValidatable xValidatable = (XValidatable)UnoRuntime.queryInterface( XValidatable.class, m_inputField );
+            XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, m_inputField );
             xValidatable.setValidator( m_validator );
         }
         catch( java.lang.Exception e  )
@@ -157,7 +157,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
         {
             if ( m_inputField.equals( eventObject.Source ) )
             {
-                XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+                XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
                     eventObject.Source );
                 // the current value
                 Object value = xComp.getCurrentValue();
diff --git a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
index 9c0d720752..c5da6e55ae 100644
--- a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
+++ b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
@@ -50,13 +50,13 @@ public class SpreadsheetDocument extends DocumentHelper
 
     public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
     {
-        XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
+        XSpreadsheetDocument spreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,
             m_documentComponent
         );
-        XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+        XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class,
             spreadsheetDoc.getSheets()
         );
-        return (XCellRange)UnoRuntime.queryInterface( XCellRange.class,
+        return UnoRuntime.queryInterface( XCellRange.class,
             sheets.getByIndex( index )
         );
     }
@@ -84,7 +84,7 @@ public class SpreadsheetDocument extends DocumentHelper
         {
             CellAddress address = new CellAddress( sheet, column, row );
             Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
-            cellBinding = (com.sun.star.form.binding.XValueBinding)UnoRuntime.queryInterface(
+            cellBinding = UnoRuntime.queryInterface(
                 com.sun.star.form.binding.XValueBinding.class,
                 createInstanceWithArguments(
                     supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
@@ -112,7 +112,7 @@ public class SpreadsheetDocument extends DocumentHelper
             CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
                 topRow, column, bottomRow );
             Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
-            entrySource = (com.sun.star.form.binding.XListEntrySource)UnoRuntime.queryInterface(
+            entrySource = UnoRuntime.queryInterface(
                 com.sun.star.form.binding.XListEntrySource.class,
                 createInstanceWithArguments(
                     "com.sun.star.table.CellRangeListSource", initParam ) );
diff --git a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
index b59f217706..64247a5313 100644
--- a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
+++ b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
@@ -85,7 +85,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
             listSourceSheet, column, topRow, bottomRow );
 
         // bind it to the list box
-        XListEntrySink consumer = (XListEntrySink)UnoRuntime.queryInterface(
+        XListEntrySink consumer = UnoRuntime.queryInterface(
             XListEntrySink.class, listBox );
         consumer.setListEntrySource( entrySource );
 
@@ -98,7 +98,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
         String[] listContent = new String[] { "first", "second", "third", "forth", "fivth" };
         for ( short row = topRow; row <= bottomRow; ++row )
         {
-            XTextRange cellText = (XTextRange)UnoRuntime.queryInterface(
+            XTextRange cellText = UnoRuntime.queryInterface(
                 XTextRange.class, exchangeSheet.getCellByPosition( column, row ) );
             cellText.setString( listContent[row] );
         }
@@ -115,7 +115,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
     /* ------------------------------------------------------------------ */
     private void implBind( XPropertySet controlModel, XValueBinding binding ) throws com.sun.star.form.binding.IncompatibleTypesException
     {
-        XBindableValue bindable = (XBindableValue)UnoRuntime.queryInterface(
+        XBindableValue bindable = UnoRuntime.queryInterface(
             XBindableValue.class, controlModel
         );
         bindable.setValueBinding( binding );
diff --git a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
index a04a3b0a7f..85ac4de409 100644
--- a/main/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
+++ b/main/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
@@ -52,16 +52,16 @@ public class SpreadsheetView extends DocumentViewHelper
         try
         {
             // get the sheet to activate
-            XSpreadsheetDocument doc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+            XSpreadsheetDocument doc = UnoRuntime.queryInterface(
                 XSpreadsheetDocument.class, getDocument().getDocument() );
-            XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface(
+            XIndexAccess sheets = UnoRuntime.queryInterface(
                 XIndexAccess.class, doc.getSheets() );
 
-            XSpreadsheet sheet = (XSpreadsheet)UnoRuntime.queryInterface(
+            XSpreadsheet sheet = UnoRuntime.queryInterface(
                 XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );
 
             // activate
-            XSpreadsheetView view = (XSpreadsheetView)UnoRuntime.queryInterface(
+            XSpreadsheetView view = UnoRuntime.queryInterface(
                 XSpreadsheetView.class, getController() );
             view.setActiveSheet( sheet );
         }
diff --git a/main/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java b/main/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
index d37877bfc6..245b900dbc 100644
--- a/main/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
+++ b/main/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
@@ -57,7 +57,7 @@ public class TableCellTextBinding
     /** Creates a new instance of TableCellTextBinding */
     public TableCellTextBinding( XCell cell )
     {
-        m_cellText = (XTextRange)UnoRuntime.queryInterface( XTextRange.class, cell );
+        m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell );
 
         m_newCellText = new String();
         m_listeners = new java.util.LinkedList();
diff --git a/main/odk/examples/DevelopersGuide/Forms/UNO.java b/main/odk/examples/DevelopersGuide/Forms/UNO.java
index f966234548..b4e554dcce 100644
--- a/main/odk/examples/DevelopersGuide/Forms/UNO.java
+++ b/main/odk/examples/DevelopersGuide/Forms/UNO.java
@@ -34,37 +34,37 @@ public class UNO
 {
 	public static XPropertySet queryPropertySet( Object aObject )
 	{
-		return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, aObject );
+		return UnoRuntime.queryInterface( XPropertySet.class, aObject );
 	}
 	public static XControlModel queryControlModel( Object aObject )
 	{
-		return (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aObject );
+		return UnoRuntime.queryInterface( XControlModel.class, aObject );
 	}
 	public static XIndexContainer queryIndexContainer( Object aObject )
 	{
-		return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, aObject );
+		return UnoRuntime.queryInterface( XIndexContainer.class, aObject );
 	}
 	public static XReset queryReset( Object aObject )
 	{
-		return (XReset)UnoRuntime.queryInterface( XReset.class, aObject );
+		return UnoRuntime.queryInterface( XReset.class, aObject );
 	}
 	public static XServiceInfo queryServiceInfo( Object aObject )
 	{
-		return (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, aObject );
+		return UnoRuntime.queryInterface( XServiceInfo.class, aObject );
... 54681 lines suppressed ...