Further compensations for STS; binary compat fixes

Defensively catch NoSuchMethodError when calling BDPD.getEnvironment()
and supply a DefaultEnvironment if not available.

Replace the single-arg constructor for BDPD and deprecate, preserving
binary compat particularly for Spring Integration who instantiates
this class directly, which is unusual.
This commit is contained in:
Chris Beams
2011-02-10 00:30:30 +00:00
parent 9cc125531b
commit b7d7fa7b7e
2 changed files with 23 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -58,6 +59,7 @@ import org.springframework.beans.factory.support.ManagedProperties;
import org.springframework.beans.factory.support.ManagedSet;
import org.springframework.beans.factory.support.MethodOverrides;
import org.springframework.beans.factory.support.ReplaceOverride;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@@ -265,6 +267,17 @@ public class BeanDefinitionParserDelegate {
this.environment = environment;
}
/**
* Create a new BeanDefinitionParserDelegate associated with the
* supplied {@link XmlReaderContext} and a new {@link DefaultEnvironment}.
* @deprecated since Spring 3.1 in favor of
* {@link #BeanDefinitionParserDelegate(XmlReaderContext, Environment)}
*/
@Deprecated
public BeanDefinitionParserDelegate(XmlReaderContext readerContext) {
this(readerContext, new DefaultEnvironment());
}
/**
* Get the {@link XmlReaderContext} associated with this helper instance.
*/