summaryrefslogtreecommitdiff
path: root/ridljar
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-04 14:02:40 +0200
committerNoel Grandin <noel@peralex.com>2014-08-04 14:50:59 +0200
commit884e1460b9bbed06717cc0404db6652f82001cc7 (patch)
tree1b513b24449573c58a67f8d3adeaba683cbdc3b5 /ridljar
parent0781dad870cb48b8604e84df1750422c91d70f1a (diff)
java: implement optimisation in UnoRuntime#setCurrentContext
which is now available since we started requiring Java 1.5 Change-Id: I9847b89af7f487be7812a5717716900e9a517381
Diffstat (limited to 'ridljar')
-rw-r--r--ridljar/com/sun/star/uno/UnoRuntime.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java b/ridljar/com/sun/star/uno/UnoRuntime.java
index 8178b51a2750..28e79cbb4089 100644
--- a/ridljar/com/sun/star/uno/UnoRuntime.java
+++ b/ridljar/com/sun/star/uno/UnoRuntime.java
@@ -382,8 +382,11 @@ public class UnoRuntime {
* previously set context will be removed
*/
public static void setCurrentContext(XCurrentContext context) {
- // optimize this by using Java 1.5 ThreadLocal.remove if context == null
- currentContext.set(context);
+ if (context == null) {
+ currentContext.remove();
+ } else {
+ currentContext.set(context);
+ }
}
/**