Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-12-05 11:28:17 -0500
committerpelder2007-12-05 11:28:17 -0500
commit34bba50b813c5f550572724b688b0f08b8fe046e (patch)
tree2b08a060b361b5eaf1c66eca55676a11fe97b508
parentf48de8b9d8812378f0b512687f4c55e52579df1f (diff)
downloadorg.eclipse.jet-34bba50b813c5f550572724b688b0f08b8fe046e.tar.gz
org.eclipse.jet-34bba50b813c5f550572724b688b0f08b8fe046e.tar.xz
org.eclipse.jet-34bba50b813c5f550572724b688b0f08b8fe046e.zip
[212017] Leak: XPath function instances hold references to JET2Context
-rw-r--r--plugins/org.eclipse.jet-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.jet.sdk-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.jet/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java16
4 files changed, 17 insertions, 5 deletions
diff --git a/plugins/org.eclipse.jet-feature/feature.xml b/plugins/org.eclipse.jet-feature/feature.xml
index 05a11b6..fb31175 100644
--- a/plugins/org.eclipse.jet-feature/feature.xml
+++ b/plugins/org.eclipse.jet-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jet"
label="%featureName"
- version="0.8.1.qualifier"
+ version="0.8.2.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/modeling/m2t">
diff --git a/plugins/org.eclipse.jet.sdk-feature/feature.xml b/plugins/org.eclipse.jet.sdk-feature/feature.xml
index e626535..5c50bc4 100644
--- a/plugins/org.eclipse.jet.sdk-feature/feature.xml
+++ b/plugins/org.eclipse.jet.sdk-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jet.sdk"
label="%featureName"
- version="0.8.1.qualifier"
+ version="0.8.2.qualifier"
provider-name="%providerName">
<description>
diff --git a/plugins/org.eclipse.jet/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
index 04132c7..ffa8aa5 100644
--- a/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jet;singleton:=true
-Bundle-Version: 0.8.1.qualifier
+Bundle-Version: 0.8.2.qualifier
Bundle-Activator: org.eclipse.jet.internal.InternalJET2Platform
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ant.core;bundle-version="[3.1.100,4.0.0)",
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
index 055318f..193f73f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,7 +70,19 @@ public class Function extends ExprNode
ExprNode expr = (ExprNode)i.next();
functionArgValues.add(expr.evalAsObject(context));
}
- return function.evaluate(functionArgValues);
+ try
+ {
+ final Object result = function.evaluate(functionArgValues);
+ return result;
+ }
+ finally
+ {
+ // ensure that cached function implementation doesn't hang on to context.
+ if (requiresContext)
+ {
+ ((XPathFunctionWithContext)function).setContext(null);
+ }
+ }
}
public String toString()

Back to the top