summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-17 15:10:06 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-19 07:52:51 +0000
commit0d8719b0ff9aacb7cdd8a238b8060540d4d00eff (patch)
treed18b78dac7c69da9dfe20c22b0c0c90364cf1278 /odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
parent8d87758d65e4a03271f76e354dfc84c1fcd5fe21 (diff)
Java cleanup, use generics in calls to UnoRuntime#queryInterface
A handful of places wrap the call to queryInterface. With a little generics love, we can reduce the casting required. Change-Id: I9efca2afb1b23fad2359af24e1c273aea96e45fe Reviewed-on: https://gerrit.libreoffice.org/3433 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
index 1efa20c4fc1b..47bf1bb74b04 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
@@ -107,9 +107,9 @@ public class OfficeConnect
* @param sServiceSpecifier name of service which should be created
* @return Description of the Returned Value
*/
- public Object createRemoteInstance(Class aType, String sServiceSpecifier)
+ public <T> T createRemoteInstance(Class<T> aType, String sServiceSpecifier)
{
- Object aResult = null;
+ T aResult = null;
try
{
aResult = UnoRuntime.queryInterface(
@@ -136,9 +136,9 @@ public class OfficeConnect
* @param sServiceSpecifier Description of Parameter
* @return Description of the Returned Value
*/
- public Object createRemoteInstanceWithArguments(Class aType, String sServiceSpecifier, Any[] lArguments)
+ public <T> T createRemoteInstanceWithArguments(Class<T> aType, String sServiceSpecifier, Any[] lArguments)
{
- Object aResult = null;
+ T aResult = null;
try
{
aResult = UnoRuntime.queryInterface(