From 884e1460b9bbed06717cc0404db6652f82001cc7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 4 Aug 2014 14:02:40 +0200 Subject: java: implement optimisation in UnoRuntime#setCurrentContext which is now available since we started requiring Java 1.5 Change-Id: I9847b89af7f487be7812a5717716900e9a517381 --- ridljar/com/sun/star/uno/UnoRuntime.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ridljar/com') 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); + } } /** -- cgit