Declare isStatic and releaseTarget as default methods on TargetSource
Closes gh-31820
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -85,7 +85,7 @@ public class ContextAnnotationAutowireCandidateResolver extends QualifierAnnotat
|
||||
}
|
||||
|
||||
private Object buildLazyResolutionProxy(
|
||||
final DependencyDescriptor descriptor, final @Nullable String beanName, boolean classOnly) {
|
||||
final DependencyDescriptor descriptor, @Nullable final String beanName, boolean classOnly) {
|
||||
|
||||
BeanFactory beanFactory = getBeanFactory();
|
||||
Assert.state(beanFactory instanceof DefaultListableBeanFactory,
|
||||
@@ -98,10 +98,6 @@ public class ContextAnnotationAutowireCandidateResolver extends QualifierAnnotat
|
||||
return descriptor.getDependencyType();
|
||||
}
|
||||
@Override
|
||||
public boolean isStatic() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public Object getTarget() {
|
||||
Set<String> autowiredBeanNames = (beanName != null ? new LinkedHashSet<>(1) : null);
|
||||
Object target = dlbf.doResolveDependency(descriptor, beanName, autowiredBeanNames, null);
|
||||
@@ -128,9 +124,6 @@ public class ContextAnnotationAutowireCandidateResolver extends QualifierAnnotat
|
||||
}
|
||||
return target;
|
||||
}
|
||||
@Override
|
||||
public void releaseTarget(Object target) {
|
||||
}
|
||||
};
|
||||
|
||||
ProxyFactory pf = new ProxyFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -148,8 +148,4 @@ public class JndiObjectTargetSource extends JndiObjectLocator implements TargetS
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseTarget(Object target) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user