summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/OfficeDev
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-23 09:18:08 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-23 10:31:15 +0000
commitbc8b419b0dc8bffb70accce443f4f46aa48cbd58 (patch)
treeb360433fe8dfaaa1e58bbdff87b2667cc671a0b5 /odk/examples/DevelopersGuide/OfficeDev
parentada02981672ae74bbdf6c4e5606d78c9211b2317 (diff)
Java cleanup - use generics to reduce casting
More queryInterface related cleanup. Change-Id: I97d064c425389e687c6f0fbc3a962080f46dd511 Reviewed-on: https://gerrit.libreoffice.org/3568 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
index 4af8213ea286..f7cf1d3f07b5 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
@@ -126,10 +126,10 @@ public class OfficeConnect
* @param sServiceSpecifier name of service which should be created
* @return the new created service object
*/
- public static synchronized Object createRemoteInstance(
- Class aType, String sServiceSpecifier)
+ public static synchronized <T> T createRemoteInstance(
+ Class<T> aType, String sServiceSpecifier)
{
- Object aResult = null;
+ T aResult = null;
try
{
aResult = UnoRuntime.queryInterface(aType,
@@ -157,10 +157,10 @@ public class OfficeConnect
* @param sServiceSpecifier Description of Parameter
* @return the new create service object
*/
- public static synchronized Object createRemoteInstanceWithArguments(
- Class aType, String sServiceSpecifier, Any[] lArguments)
+ public static synchronized <T> T createRemoteInstanceWithArguments(
+ Class<T> aType, String sServiceSpecifier, Any[] lArguments)
{
- Object aResult = null;
+ T aResult = null;
try
{
aResult = UnoRuntime.queryInterface(aType,