language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java | @@ -99,6 +99,7 @@ private void init(Object delegate) {
* behaviour in around advice. However, subclasses should invoke this
* method, which handles introduced interfaces and forwarding to the target.
*/
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
if (isMethodOnIntroducedInterface(mi)) {
// Using the following method rather than direct reflection, we | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java | @@ -26,6 +26,7 @@
*/
public abstract class DynamicMethodMatcher implements MethodMatcher {
+ @Override
public final boolean isRuntime() {
return true;
}
@@ -34,6 +35,7 @@ public final boolean isRuntime() {
* Can override to add preconditions for dynamic matching. This implementation
* always returns true.
*/
+ @Override
public boolean matches(Method method, Class<?> targetClass) {
return true;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java | @@ -30,10 +30,12 @@
*/
public abstract class DynamicMethodMatcherPointcut extends DynamicMethodMatcher implements Pointcut {
+ @Override
public ClassFilter getClassFilter() {
return ClassFilter.TRUE;
}
+ @Override
public final MethodMatcher getMethodMatcher() {
return this;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java | @@ -59,6 +59,7 @@ public void suppressInterface(Class intf) {
this.publishedInterfaces.remove(intf);
}
+ @Override
public Class[] getInterfaces() {
return this.publishedInterfaces.toArray(new Class[this.publishedInterfaces.size()]);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java | @@ -112,11 +112,13 @@ public UnionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
this.mm2 = mm2;
}
+ @Override
public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
return (matchesClass1(targetClass) && MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions)) ||
(matchesClass2(targetClass) && MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions));
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) ||
(matchesClass2(targetClass) && this.mm2.matches(method, targetClass));
@@ -130,10 +132,12 @@ protected boolean matchesClass2(Class targetClass) {
return true;
}
+ @Override
public boolean isRuntime() {
return this.mm1.isRuntime() || this.mm2.isRuntime();
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
return this.mm1.matches(method, targetClass, args) || this.mm2.matches(method, targetClass, args);
}
@@ -216,19 +220,23 @@ public IntersectionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
this.mm2 = mm2;
}
+ @Override
public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
return MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) &&
MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions);
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass);
}
+ @Override
public boolean isRuntime() {
return this.mm1.isRuntime() || this.mm2.isRuntime();
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
// Because a dynamic intersection may be composed of a static and dynamic part,
// we must avoid calling the 3-arg matches method on a dynamic matcher, as | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java | @@ -77,6 +77,7 @@ public NameMatchMethodPointcut addMethodName(String name) {
}
+ @Override
public boolean matches(Method method, Class targetClass) {
for (String mappedName : this.mappedNames) {
if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java | @@ -85,6 +85,7 @@ public NameMatchMethodPointcut addMethodName(String name) {
}
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java | @@ -96,6 +96,7 @@ private static class SetterPointcut extends StaticMethodMatcherPointcut implemen
public static SetterPointcut INSTANCE = new SetterPointcut();
+ @Override
public boolean matches(Method method, Class targetClass) {
return method.getName().startsWith("set") &&
method.getParameterTypes().length == 1 &&
@@ -116,6 +117,7 @@ private static class GetterPointcut extends StaticMethodMatcherPointcut implemen
public static GetterPointcut INSTANCE = new GetterPointcut();
+ @Override
public boolean matches(Method method, Class targetClass) {
return method.getName().startsWith("get") &&
method.getParameterTypes().length == 0; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java | @@ -116,6 +116,7 @@ public void setPatterns(String[] patterns) {
/**
* Initialize the singleton Pointcut held within this Advisor.
*/
+ @Override
public Pointcut getPointcut() {
synchronized (this.pointcutMonitor) {
if (this.pointcut == null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java | @@ -35,6 +35,7 @@ public RootClassFilter(Class clazz) {
this.clazz = clazz;
}
+ @Override
public boolean matches(Class candidate) {
return clazz.isAssignableFrom(candidate);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java | @@ -26,10 +26,12 @@
*/
public abstract class StaticMethodMatcher implements MethodMatcher {
+ @Override
public final boolean isRuntime() {
return false;
}
+ @Override
public final boolean matches(Method method, Class<?> targetClass, Object[] args) {
// should never be invoked because isRuntime() returns false
throw new UnsupportedOperationException("Illegal MethodMatcher usage"); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcut.java | @@ -43,11 +43,13 @@ public void setClassFilter(ClassFilter classFilter) {
this.classFilter = classFilter;
}
+ @Override
public ClassFilter getClassFilter() {
return this.classFilter;
}
+ @Override
public final MethodMatcher getMethodMatcher() {
return this;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java | @@ -63,6 +63,7 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
@@ -71,14 +72,17 @@ public void setAdvice(Advice advice) {
this.advice = advice;
}
+ @Override
public Advice getAdvice() {
return this.advice;
}
+ @Override
public boolean isPerInstance() {
return true;
}
+ @Override
public Pointcut getPointcut() {
return this;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java | @@ -59,6 +59,7 @@ public AnnotationClassFilter(Class<? extends Annotation> annotationType, boolean
}
+ @Override
public boolean matches(Class clazz) {
return (this.checkInherited ?
(AnnotationUtils.findAnnotation(clazz, this.annotationType) != null) : | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java | @@ -90,10 +90,12 @@ public AnnotationMatchingPointcut(
}
+ @Override
public ClassFilter getClassFilter() {
return this.classFilter;
}
+ @Override
public MethodMatcher getMethodMatcher() {
return this.methodMatcher;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java | @@ -47,6 +47,7 @@ public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
}
+ @Override
public boolean matches(Method method, Class targetClass) {
if (method.isAnnotationPresent(this.annotationType)) {
return true; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java | @@ -105,6 +105,7 @@ public void setTargetClass(Class targetClass) {
* Set the owning BeanFactory. We need to save a reference so that we can
* use the {@code getBean} method on every invocation.
*/
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (this.targetBeanName == null) {
throw new IllegalStateException("Property'targetBeanName' is required");
@@ -120,6 +121,7 @@ public BeanFactory getBeanFactory() {
}
+ @Override
public synchronized Class<?> getTargetClass() {
if (this.targetClass == null && this.beanFactory != null) {
// Determine type of the target bean.
@@ -137,10 +139,12 @@ public synchronized Class<?> getTargetClass() {
return this.targetClass;
}
+ @Override
public boolean isStatic() {
return false;
}
+ @Override
public void releaseTarget(Object target) throws Exception {
// Nothing to do here.
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java | @@ -64,10 +64,12 @@ public synchronized boolean isInitialized() {
* a meaningful value when the target is still {@code null}.
* @see #isInitialized()
*/
+ @Override
public synchronized Class<?> getTargetClass() {
return (this.lazyTarget != null ? this.lazyTarget.getClass() : null);
}
+ @Override
public boolean isStatic() {
return false;
}
@@ -77,6 +79,7 @@ public boolean isStatic() {
* creating it on-the-fly if it doesn't exist already.
* @see #createObject()
*/
+ @Override
public synchronized Object getTarget() throws Exception {
if (this.lazyTarget == null) {
logger.debug("Initializing lazy target object");
@@ -85,6 +88,7 @@ public synchronized Object getTarget() throws Exception {
return this.lazyTarget;
}
+ @Override
public void releaseTarget(Object target) throws Exception {
// nothing to do
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java | @@ -68,6 +68,7 @@ public void setMaxSize(int maxSize) {
/**
* Return the maximum size of the pool.
*/
+ @Override
public int getMaxSize() {
return this.maxSize;
}
@@ -97,6 +98,7 @@ public final void setBeanFactory(BeanFactory beanFactory) throws BeansException
* @throws Exception we may need to deal with checked exceptions from pool
* APIs, so we're forgiving with our exception signature
*/
+ @Override
public abstract Object getTarget() throws Exception;
/** | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java | @@ -252,10 +252,12 @@ public void releaseTarget(Object target) throws Exception {
this.pool.returnObject(target);
}
+ @Override
public int getActiveCount() throws UnsupportedOperationException {
return this.pool.getNumActive();
}
+ @Override
public int getIdleCount() throws UnsupportedOperationException {
return this.pool.getNumIdle();
}
@@ -264,6 +266,7 @@ public int getIdleCount() throws UnsupportedOperationException {
/**
* Closes the underlying {@code ObjectPool} when destroying this object.
*/
+ @Override
public void destroy() throws Exception {
logger.debug("Closing Commons ObjectPool");
this.pool.close();
@@ -274,21 +277,26 @@ public void destroy() throws Exception {
// Implementation of org.apache.commons.pool.PoolableObjectFactory interface
//----------------------------------------------------------------------------
+ @Override
public Object makeObject() throws BeansException {
return newPrototypeInstance();
}
+ @Override
public void destroyObject(Object obj) throws Exception {
destroyPrototypeInstance(obj);
}
+ @Override
public boolean validateObject(Object obj) {
return true;
}
+ @Override
public void activateObject(Object obj) {
}
+ @Override
public void passivateObject(Object obj) {
}
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java | @@ -89,27 +89,31 @@ private EmptyTargetSource(Class targetClass, boolean isStatic) {
/**
* Always returns the specified target Class, or {@code null} if none.
*/
+ @Override
public Class<?> getTargetClass() {
return this.targetClass;
}
/**
* Always returns {@code true}.
*/
+ @Override
public boolean isStatic() {
return this.isStatic;
}
/**
* Always returns {@code null}.
*/
+ @Override
public Object getTarget() {
return null;
}
/**
* Nothing to release.
*/
+ @Override
public void releaseTarget(Object target) {
}
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/HotSwappableTargetSource.java | @@ -59,18 +59,22 @@ public HotSwappableTargetSource(Object initialTarget) {
* Return the type of the current target object.
* <p>The returned type should usually be constant across all target objects.
*/
+ @Override
public synchronized Class<?> getTargetClass() {
return this.target.getClass();
}
+ @Override
public final boolean isStatic() {
return false;
}
+ @Override
public synchronized Object getTarget() {
return this.target;
}
+ @Override
public void releaseTarget(Object target) {
// nothing to do
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java | @@ -62,6 +62,7 @@ public class LazyInitTargetSource extends AbstractBeanFactoryBasedTargetSource {
private Object target;
+ @Override
public synchronized Object getTarget() throws BeansException {
if (this.target == null) {
this.target = getBeanFactory().getBean(getTargetBeanName()); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java | @@ -37,6 +37,7 @@ public class PrototypeTargetSource extends AbstractPrototypeBasedTargetSource {
* Obtain a new prototype instance for every call.
* @see #newPrototypeInstance()
*/
+ @Override
public Object getTarget() throws BeansException {
return newPrototypeInstance();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java | @@ -30,6 +30,7 @@
@SuppressWarnings("serial")
public class SimpleBeanTargetSource extends AbstractBeanFactoryBasedTargetSource {
+ @Override
public Object getTarget() throws Exception {
return getBeanFactory().getBean(getTargetBeanName());
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java | @@ -55,18 +55,22 @@ public SingletonTargetSource(Object target) {
}
+ @Override
public Class<?> getTargetClass() {
return this.target.getClass();
}
+ @Override
public Object getTarget() {
return this.target;
}
+ @Override
public void releaseTarget(Object target) {
// nothing to do
}
+ @Override
public boolean isStatic() {
return true;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java | @@ -75,6 +75,7 @@ public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
* We look for a target held in a ThreadLocal. If we don't find one,
* we create one and bind it to the thread. No synchronization is required.
*/
+ @Override
public Object getTarget() throws BeansException {
++this.invocationCount;
Object target = this.targetInThread.get();
@@ -102,6 +103,7 @@ public Object getTarget() throws BeansException {
* Dispose of targets if necessary; clear ThreadLocal.
* @see #destroyPrototypeInstance
*/
+ @Override
public void destroy() {
logger.debug("Destroying ThreadLocalTargetSource bindings");
synchronized (this.targetSet) {
@@ -115,14 +117,17 @@ public void destroy() {
}
+ @Override
public int getInvocationCount() {
return this.invocationCount;
}
+ @Override
public int getHitCount() {
return this.hitCount;
}
+ @Override
public int getObjectCount() {
synchronized (this.targetSet) {
return this.targetSet.size(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java | @@ -63,6 +63,7 @@ public void setRefreshCheckDelay(long refreshCheckDelay) {
}
+ @Override
public synchronized Class<?> getTargetClass() {
if (this.targetObject == null) {
refresh();
@@ -73,10 +74,12 @@ public synchronized Class<?> getTargetClass() {
/**
* Not static.
*/
+ @Override
public boolean isStatic() {
return false;
}
+ @Override
public final synchronized Object getTarget() {
if ((refreshCheckDelayElapsed() && requiresRefresh()) || this.targetObject == null) {
refresh();
@@ -87,10 +90,12 @@ public final synchronized Object getTarget() {
/**
* No need to release target.
*/
+ @Override
public void releaseTarget(Object object) {
}
+ @Override
public final synchronized void refresh() {
logger.debug("Attempting to refresh target");
@@ -101,10 +106,12 @@ public final synchronized void refresh() {
logger.debug("Target refreshed successfully");
}
+ @Override
public synchronized long getRefreshCount() {
return this.refreshCount;
}
+ @Override
public synchronized long getLastRefreshTime() {
return this.lastRefreshTime;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java | @@ -36,31 +36,38 @@ public abstract class AbstractPropertyAccessor extends TypeConverterSupport impl
private boolean extractOldValueForEditor = false;
+ @Override
public void setExtractOldValueForEditor(boolean extractOldValueForEditor) {
this.extractOldValueForEditor = extractOldValueForEditor;
}
+ @Override
public boolean isExtractOldValueForEditor() {
return this.extractOldValueForEditor;
}
+ @Override
public void setPropertyValue(PropertyValue pv) throws BeansException {
setPropertyValue(pv.getName(), pv.getValue());
}
+ @Override
public void setPropertyValues(Map<?, ?> map) throws BeansException {
setPropertyValues(new MutablePropertyValues(map));
}
+ @Override
public void setPropertyValues(PropertyValues pvs) throws BeansException {
setPropertyValues(pvs, false, false);
}
+ @Override
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) throws BeansException {
setPropertyValues(pvs, ignoreUnknown, false);
}
+ @Override
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid)
throws BeansException {
@@ -118,6 +125,7 @@ public Class getPropertyType(String propertyPath) {
* @throws PropertyAccessException if the property was valid but the
* accessor method failed
*/
+ @Override
public abstract Object getPropertyValue(String propertyName) throws BeansException;
/**
@@ -129,6 +137,7 @@ public Class getPropertyType(String propertyPath) {
* @throws PropertyAccessException if the property was valid but the
* accessor method failed or a type mismatch occured
*/
+ @Override
public abstract void setPropertyValue(String propertyName, Object value) throws BeansException;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java | @@ -69,6 +69,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java | @@ -40,6 +40,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java | @@ -219,10 +219,12 @@ public void setWrappedInstance(Object object, String nestedPath, Object rootObje
setIntrospectionClass(object.getClass());
}
+ @Override
public final Object getWrappedInstance() {
return this.object;
}
+ @Override
public final Class getWrappedClass() {
return (this.object != null ? this.object.getClass() : null);
}
@@ -257,13 +259,15 @@ public final Class getRootClass() {
* enables auto-growth of collection elements when accessing an out-of-bounds index.
* <p>Default is "false" on a plain BeanWrapper.
*/
+ @Override
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) {
this.autoGrowNestedPaths = autoGrowNestedPaths;
}
/**
* Return whether "auto-growing" of nested paths has been activated.
*/
+ @Override
public boolean isAutoGrowNestedPaths() {
return this.autoGrowNestedPaths;
}
@@ -272,13 +276,15 @@ public boolean isAutoGrowNestedPaths() {
* Specify a limit for array and collection auto-growing.
* <p>Default is unlimited on a plain BeanWrapper.
*/
+ @Override
public void setAutoGrowCollectionLimit(int autoGrowCollectionLimit) {
this.autoGrowCollectionLimit = autoGrowCollectionLimit;
}
/**
* Return the limit for array and collection auto-growing.
*/
+ @Override
public int getAutoGrowCollectionLimit() {
return this.autoGrowCollectionLimit;
}
@@ -324,10 +330,12 @@ private CachedIntrospectionResults getCachedIntrospectionResults() {
}
+ @Override
public PropertyDescriptor[] getPropertyDescriptors() {
return getCachedIntrospectionResults().getPropertyDescriptors();
}
+ @Override
public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException {
PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName);
if (pd == null) {
@@ -378,6 +386,7 @@ public Class getPropertyType(String propertyName) throws BeansException {
return null;
}
+ @Override
public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException {
try {
BeanWrapperImpl nestedBw = getBeanWrapperForPropertyPath(propertyName);
@@ -402,6 +411,7 @@ public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws Bean
return null;
}
+ @Override
public boolean isReadableProperty(String propertyName) {
try {
PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName);
@@ -422,6 +432,7 @@ public boolean isReadableProperty(String propertyName) {
return false;
}
+ @Override
public boolean isWritableProperty(String propertyName) {
try {
PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName);
@@ -711,6 +722,7 @@ private Object getPropertyValue(PropertyTokenHolder tokens) throws BeansExceptio
if (!Modifier.isPublic(readMethod.getDeclaringClass().getModifiers()) && !readMethod.isAccessible()) {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
readMethod.setAccessible(true);
return null;
@@ -726,6 +738,7 @@ public Object run() {
if (System.getSecurityManager() != null) {
try {
value = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
return readMethod.invoke(object, (Object[]) null);
}
@@ -1062,6 +1075,7 @@ else if (propValue instanceof Map) {
!readMethod.isAccessible()) {
if (System.getSecurityManager()!= null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
readMethod.setAccessible(true);
return null;
@@ -1075,6 +1089,7 @@ public Object run() {
try {
if (System.getSecurityManager() != null) {
oldValue = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
return readMethod.invoke(object);
}
@@ -1104,6 +1119,7 @@ public Object run() throws Exception {
if (!Modifier.isPublic(writeMethod.getDeclaringClass().getModifiers()) && !writeMethod.isAccessible()) {
if (System.getSecurityManager()!= null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
writeMethod.setAccessible(true);
return null;
@@ -1118,6 +1134,7 @@ public Object run() {
if (System.getSecurityManager() != null) {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
writeMethod.invoke(object, value);
return null; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/DirectFieldAccessor.java | @@ -59,6 +59,7 @@ public DirectFieldAccessor(final Object target) {
Assert.notNull(target, "Target object must not be null");
this.target = target;
ReflectionUtils.doWithFields(this.target.getClass(), new ReflectionUtils.FieldCallback() {
+ @Override
public void doWith(Field field) {
if (fieldMap.containsKey(field.getName())) {
// ignore superclass declarations of fields already found in a subclass
@@ -74,10 +75,12 @@ public void doWith(Field field) {
}
+ @Override
public boolean isReadableProperty(String propertyName) throws BeansException {
return this.fieldMap.containsKey(propertyName);
}
+ @Override
public boolean isWritableProperty(String propertyName) throws BeansException {
return this.fieldMap.containsKey(propertyName);
}
@@ -91,6 +94,7 @@ public Class<?> getPropertyType(String propertyName) throws BeansException {
return null;
}
+ @Override
public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException {
Field field = this.fieldMap.get(propertyName);
if (field != null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java | @@ -217,35 +217,43 @@ private String propertyNameFor(Method method) {
* method found during construction.
* @see #ExtendedBeanInfo(BeanInfo)
*/
+ @Override
public PropertyDescriptor[] getPropertyDescriptors() {
return this.propertyDescriptors.toArray(
new PropertyDescriptor[this.propertyDescriptors.size()]);
}
+ @Override
public BeanInfo[] getAdditionalBeanInfo() {
return delegate.getAdditionalBeanInfo();
}
+ @Override
public BeanDescriptor getBeanDescriptor() {
return delegate.getBeanDescriptor();
}
+ @Override
public int getDefaultEventIndex() {
return delegate.getDefaultEventIndex();
}
+ @Override
public int getDefaultPropertyIndex() {
return delegate.getDefaultPropertyIndex();
}
+ @Override
public EventSetDescriptor[] getEventSetDescriptors() {
return delegate.getEventSetDescriptors();
}
+ @Override
public Image getIcon(int iconKind) {
return delegate.getIcon(iconKind);
}
+ @Override
public MethodDescriptor[] getMethodDescriptors() {
return delegate.getMethodDescriptors();
}
@@ -655,6 +663,7 @@ public static boolean compareMethods(Method a, Method b) {
*/
class PropertyDescriptorComparator implements Comparator<PropertyDescriptor> {
+ @Override
public int compare(PropertyDescriptor desc1, PropertyDescriptor desc2) {
String left = desc1.getName();
String right = desc2.getName(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java | @@ -40,6 +40,7 @@ public class ExtendedBeanInfoFactory implements Ordered, BeanInfoFactory {
/**
* Return a new {@link ExtendedBeanInfo} for the given bean class.
*/
+ @Override
public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
return supports(beanClass) ?
new ExtendedBeanInfo(Introspector.getBeanInfo(beanClass)) : null;
@@ -58,6 +59,7 @@ private boolean supports(Class<?> beanClass) {
return false;
}
+ @Override
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java | @@ -42,6 +42,7 @@ public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwa
super(propertyChangeEvent, "Property '" + propertyChangeEvent.getPropertyName() + "' threw exception", cause);
}
+ @Override
public String getErrorCode() {
return ERROR_CODE;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java | @@ -244,10 +244,12 @@ public void removePropertyValue(String propertyName) {
}
+ @Override
public PropertyValue[] getPropertyValues() {
return this.propertyValueList.toArray(new PropertyValue[this.propertyValueList.size()]);
}
+ @Override
public PropertyValue getPropertyValue(String propertyName) {
for (PropertyValue pv : this.propertyValueList) {
if (pv.getName().equals(propertyName)) {
@@ -257,6 +259,7 @@ public PropertyValue getPropertyValue(String propertyName) {
return null;
}
+ @Override
public PropertyValues changesSince(PropertyValues old) {
MutablePropertyValues changes = new MutablePropertyValues();
if (old == this) {
@@ -278,11 +281,13 @@ else if (!pvOld.equals(newPv)) {
return changes;
}
+ @Override
public boolean contains(String propertyName) {
return (getPropertyValue(propertyName) != null ||
(this.processedProperties != null && this.processedProperties.contains(propertyName)));
}
+ @Override
public boolean isEmpty() {
return this.propertyValueList.isEmpty();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java | @@ -269,10 +269,12 @@ protected void copyDefaultEditorsTo(PropertyEditorRegistrySupport target) {
// Management of custom editors
//---------------------------------------------------------------------
+ @Override
public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) {
registerCustomEditor(requiredType, null, propertyEditor);
}
+ @Override
public void registerCustomEditor(Class<?> requiredType, String propertyPath, PropertyEditor propertyEditor) {
if (requiredType == null && propertyPath == null) {
throw new IllegalArgumentException("Either requiredType or propertyPath is required");
@@ -319,6 +321,7 @@ public boolean isSharedEditor(PropertyEditor propertyEditor) {
return (this.sharedEditors != null && this.sharedEditors.contains(propertyEditor));
}
+ @Override
public PropertyEditor findCustomEditor(Class<?> requiredType, String propertyPath) {
Class<?> requiredTypeToUse = requiredType;
if (propertyPath != null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/TypeConverterSupport.java | @@ -35,16 +35,19 @@ public abstract class TypeConverterSupport extends PropertyEditorRegistrySupport
TypeConverterDelegate typeConverterDelegate;
+ @Override
public <T> T convertIfNecessary(Object value, Class<T> requiredType) throws TypeMismatchException {
return doConvert(value, requiredType, null, null);
}
+ @Override
public <T> T convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam)
throws TypeMismatchException {
return doConvert(value, requiredType, methodParam, null);
}
+ @Override
public <T> T convertIfNecessary(Object value, Class<T> requiredType, Field field)
throws TypeMismatchException {
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java | @@ -107,6 +107,7 @@ public Class getRequiredType() {
return this.requiredType;
}
+ @Override
public String getErrorCode() {
return ERROR_CODE;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java | @@ -349,6 +349,7 @@ protected SingletonBeanFactoryLocator(String resourceLocation) {
this.resourceLocation = resourceLocation;
}
+ @Override
public BeanFactoryReference useBeanFactory(String factoryKey) throws BeansException {
synchronized (this.bfgInstancesByKey) {
BeanFactoryGroup bfg = this.bfgInstancesByKey.get(this.resourceLocation);
@@ -500,11 +501,13 @@ public CountingBeanFactoryReference(BeanFactory beanFactory, BeanFactory groupCo
this.groupContextRef = groupContext;
}
+ @Override
public BeanFactory getFactory() {
return this.beanFactory;
}
// Note that it's legal to call release more than once!
+ @Override
public void release() throws FatalBeanException {
synchronized (bfgInstancesByKey) {
BeanFactory savedRef = this.groupContextRef; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedGenericBeanDefinition.java | @@ -71,6 +71,7 @@ public AnnotatedGenericBeanDefinition(AnnotationMetadata metadata) {
}
+ @Override
public final AnnotationMetadata getMetadata() {
return this.metadata;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotationBeanWiringInfoResolver.java | @@ -36,6 +36,7 @@
*/
public class AnnotationBeanWiringInfoResolver implements BeanWiringInfoResolver {
+ @Override
public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
Assert.notNull(beanInstance, "Bean instance must not be null");
Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java | @@ -199,10 +199,12 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
if (!(beanFactory instanceof ConfigurableListableBeanFactory)) {
throw new IllegalArgumentException(
@@ -212,6 +214,7 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
}
+ @Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
if (beanType != null) {
InjectionMetadata metadata = findAutowiringMetadata(beanType); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurer.java | @@ -59,10 +59,12 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
@@ -82,6 +84,7 @@ public void setCustomQualifierTypes(Set customQualifierTypes) {
}
+ @Override
@SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.customQualifierTypes != null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java | @@ -112,18 +112,21 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
if (beanType != null) {
LifecycleMetadata metadata = findLifecycleMetadata(beanType);
metadata.checkConfigMembers(beanDefinition);
}
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass());
try {
@@ -138,10 +141,12 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass());
try { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java | @@ -126,6 +126,7 @@ public void setValueAnnotationType(Class<? extends Annotation> valueAnnotationTy
this.valueAnnotationType = valueAnnotationType;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
@@ -143,6 +144,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
* attribute does not match.
* @see Qualifier
*/
+ @Override
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
if (!bdHolder.getBeanDefinition().isAutowireCandidate()) {
// if explicitly false, do not proceed with qualifier check
@@ -293,6 +295,7 @@ protected boolean checkQualifier(
* Determine whether the given dependency carries a value annotation.
* @see Value
*/
+ @Override
public Object getSuggestedValue(DependencyDescriptor descriptor) {
Object value = findValue(descriptor.getAnnotations());
if (value == null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java | @@ -116,6 +116,7 @@ protected Class<? extends Annotation> getRequiredAnnotationType() {
return this.requiredAnnotationType;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (beanFactory instanceof ConfigurableListableBeanFactory) {
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
@@ -126,11 +127,13 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
}
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java | @@ -84,14 +84,17 @@ public void setSingleton(boolean singleton) {
this.singleton = singleton;
}
+ @Override
public boolean isSingleton() {
return this.singleton;
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
@@ -124,6 +127,7 @@ protected TypeConverter getBeanTypeConverter() {
/**
* Eagerly create the singleton instance, if necessary.
*/
+ @Override
public void afterPropertiesSet() throws Exception {
if (isSingleton()) {
this.initialized = true;
@@ -138,6 +142,7 @@ public void afterPropertiesSet() throws Exception {
* @see #createInstance()
* @see #getEarlySingletonInterfaces()
*/
+ @Override
public final T getObject() throws Exception {
if (isSingleton()) {
return (this.initialized ? this.singletonInstance : getEarlySingletonInstance());
@@ -181,6 +186,7 @@ private T getSingletonInstance() throws IllegalStateException {
* Destroy the singleton instance, if any.
* @see #destroyInstance(Object)
*/
+ @Override
public void destroy() throws Exception {
if (isSingleton()) {
destroyInstance(this.singletonInstance);
@@ -193,6 +199,7 @@ public void destroy() throws Exception {
* interface, for a consistent offering of abstract template methods.
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
*/
+ @Override
public abstract Class<?> getObjectType();
/**
@@ -241,6 +248,7 @@ protected void destroyInstance(T instance) throws Exception {
*/
private class EarlySingletonInvocationHandler implements InvocationHandler {
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (ReflectionUtils.isEqualsMethod(method)) {
// Only consider equal when proxies are identical. | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java | @@ -108,6 +108,7 @@ public String[] getAliases() {
* Expose the bean definition's source object.
* @see BeanDefinition#getSource()
*/
+ @Override
public Object getSource() {
return this.beanDefinition.getSource();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java | @@ -65,6 +65,7 @@ public void setTargetBeanName(String targetBeanName) {
this.targetBeanName = targetBeanName;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
if (this.targetBeanName == null) {
@@ -76,34 +77,39 @@ public void setBeanFactory(BeanFactory beanFactory) {
}
+ @Override
public Object getObject() throws BeansException {
if (this.beanFactory == null) {
throw new FactoryBeanNotInitializedException();
}
return this.beanFactory.getBean(this.targetBeanName);
}
+ @Override
public Class getObjectType() {
if (this.beanFactory == null) {
return null;
}
return this.beanFactory.getType(this.targetBeanName);
}
+ @Override
public boolean isSingleton() {
if (this.beanFactory == null) {
throw new FactoryBeanNotInitializedException();
}
return this.beanFactory.isSingleton(this.targetBeanName);
}
+ @Override
public boolean isPrototype() {
if (this.beanFactory == null) {
throw new FactoryBeanNotInitializedException();
}
return this.beanFactory.isPrototype(this.targetBeanName);
}
+ @Override
public boolean isEagerInit() {
return false;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java | @@ -53,20 +53,24 @@ public void setLogName(String logName) {
}
+ @Override
public void afterPropertiesSet() {
if (this.log == null) {
throw new IllegalArgumentException("'logName' is required");
}
}
+ @Override
public Log getObject() {
return this.log;
}
+ @Override
public Class<? extends Log> getObjectType() {
return (this.log != null ? this.log.getClass() : Log.class);
}
+ @Override
public boolean isSingleton() {
return true;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java | @@ -519,6 +519,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java | @@ -119,6 +119,7 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
@@ -161,11 +162,13 @@ public void setIgnoreUnresolvableEditors(boolean ignoreUnresolvableEditors) {
this.ignoreUnresolvableEditors = ignoreUnresolvableEditors;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
+ @Override
@SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.propertyEditorRegistrars != null) {
@@ -234,6 +237,7 @@ public SharedPropertyEditorRegistrar(Class requiredType, PropertyEditor sharedEd
this.sharedEditor = sharedEditor;
}
+ @Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
if (!(registry instanceof PropertyEditorRegistrySupport)) {
throw new IllegalArgumentException("Cannot registered shared editor " + | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java | @@ -65,15 +65,18 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
+ @Override
@SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.scopes != null) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/DeprecatedBeanWarner.java | @@ -52,6 +52,7 @@ public void setLoggerName(String loggerName) {
}
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (isLogEnabled()) {
String[] beanNames = beanFactory.getBeanDefinitionNames(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java | @@ -142,15 +142,18 @@ public void setStaticField(String staticField) {
* nor "targetField" have been specified.
* This allows for concise bean definitions with just an id/name.
*/
+ @Override
public void setBeanName(String beanName) {
this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName));
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}
+ @Override
public void afterPropertiesSet() throws ClassNotFoundException, NoSuchFieldException {
if (this.targetClass != null && this.targetObject != null) {
throw new IllegalArgumentException("Specify either targetClass or targetObject, not both");
@@ -191,6 +194,7 @@ else if (this.targetField == null) {
}
+ @Override
public Object getObject() throws IllegalAccessException {
if (this.fieldObject == null) {
throw new FactoryBeanNotInitializedException();
@@ -206,10 +210,12 @@ public Object getObject() throws IllegalAccessException {
}
}
+ @Override
public Class<?> getObjectType() {
return (this.fieldObject != null ? this.fieldObject.getType() : null);
}
+ @Override
public boolean isSingleton() {
return false;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java | @@ -39,37 +39,45 @@
*/
public abstract class InstantiationAwareBeanPostProcessorAdapter implements SmartInstantiationAwareBeanPostProcessor {
+ @Override
public Class<?> predictBeanType(Class<?> beanClass, String beanName) {
return null;
}
+ @Override
public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException {
return null;
}
+ @Override
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
return null;
}
+ @Override
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
return true;
}
+ @Override
public PropertyValues postProcessPropertyValues(
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
throws BeansException {
return pvs;
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java | @@ -110,10 +110,12 @@ public void setSingleton(boolean singleton) {
this.singleton = singleton;
}
+ @Override
public boolean isSingleton() {
return this.singleton;
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}
@@ -123,6 +125,7 @@ protected Class resolveClassName(String className) throws ClassNotFoundException
return ClassUtils.forName(className, this.beanClassLoader);
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (beanFactory instanceof ConfigurableBeanFactory) {
this.beanFactory = (ConfigurableBeanFactory) beanFactory;
@@ -145,6 +148,7 @@ protected TypeConverter getDefaultTypeConverter() {
}
+ @Override
public void afterPropertiesSet() throws Exception {
prepare();
if (this.singleton) {
@@ -178,6 +182,7 @@ private Object doInvoke() throws Exception {
* to "true", otherwise returns the value returned from invoking the
* specified method on the fly.
*/
+ @Override
public Object getObject() throws Exception {
if (this.singleton) {
if (!this.initialized) {
@@ -196,6 +201,7 @@ public Object getObject() throws Exception {
* Return the type of object that this FactoryBean creates,
* or {@code null} if not known in advance.
*/
+ @Override
public Class<?> getObjectType() {
if (!isPrepared()) {
// Not fully initialized yet -> return null to indicate "not known yet". | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java | @@ -143,6 +143,7 @@ public TargetBeanObjectFactory(BeanFactory beanFactory, String targetBeanName) {
this.targetBeanName = targetBeanName;
}
+ @Override
public Object getObject() throws BeansException {
return this.beanFactory.getBean(this.targetBeanName);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java | @@ -174,6 +174,7 @@ public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlacehol
* @see #setLocations
* @see org.springframework.core.io.ResourceEditor
*/
+ @Override
public void setBeanName(String beanName) {
this.beanName = beanName;
}
@@ -186,6 +187,7 @@ public void setBeanName(String beanName) {
* @see #setLocations
* @see org.springframework.core.io.ResourceEditor
*/
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java | @@ -74,6 +74,7 @@ public void setUserTreePath(String userTreePath) {
* This implementation eagerly fetches the Preferences instances
* for the required system and user tree nodes.
*/
+ @Override
public void afterPropertiesSet() {
this.systemPrefs = (this.systemTreePath != null) ?
Preferences.systemRoot().node(this.systemTreePath) : Preferences.systemRoot(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java | @@ -59,17 +59,20 @@ public final void setSingleton(boolean singleton) {
this.singleton = singleton;
}
+ @Override
public final boolean isSingleton() {
return this.singleton;
}
+ @Override
public final void afterPropertiesSet() throws IOException {
if (this.singleton) {
this.singletonInstance = createProperties();
}
}
+ @Override
public final Properties getObject() throws IOException {
if (this.singleton) {
return this.singletonInstance;
@@ -79,6 +82,7 @@ public final Properties getObject() throws IOException {
}
}
+ @Override
public Class<Properties> getObjectType() {
return Properties.class;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java | @@ -147,11 +147,13 @@ public void setResultType(Class resultType) {
* "targetBeanName" nor "propertyPath" have been specified.
* This allows for concise bean definitions with just an id/name.
*/
+ @Override
public void setBeanName(String beanName) {
this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName));
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
@@ -190,6 +192,7 @@ else if (this.propertyPath == null) {
}
+ @Override
public Object getObject() throws BeansException {
BeanWrapper target = this.targetBeanWrapper;
if (target != null) {
@@ -208,6 +211,7 @@ public Object getObject() throws BeansException {
return target.getPropertyValue(this.propertyPath);
}
+ @Override
public Class<?> getObjectType() {
return this.resultType;
}
@@ -218,6 +222,7 @@ public Class<?> getObjectType() {
* for each call, so we have to assume that we're not returning the
* same object for each {@link #getObject()} call.
*/
+ @Override
public boolean isSingleton() {
return false;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java | @@ -251,6 +251,7 @@ public PlaceholderResolvingStringValueResolver(Properties props) {
this.resolver = new PropertyPlaceholderConfigurerResolver(props);
}
+ @Override
public String resolveStringValue(String strVal) throws BeansException {
String value = this.helper.replacePlaceholders(strVal, this.resolver);
return (value.equals(nullValue) ? null : value);
@@ -266,6 +267,7 @@ private PropertyPlaceholderConfigurerResolver(Properties props) {
this.props = props;
}
+ @Override
public String resolvePlaceholder(String placeholderName) {
return PropertyPlaceholderConfigurer.this.resolvePlaceholder(placeholderName, props, systemPropertiesMode);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java | @@ -63,6 +63,7 @@ public void setOrder(int order) {
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
@@ -73,6 +74,7 @@ public int getOrder() {
* {@linkplain #processProperties process} properties against the given bean factory.
* @throws BeanInitializationException if any properties cannot be loaded
*/
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
try {
Properties mergedProps = mergeProperties(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java | @@ -88,6 +88,7 @@ public TargetBeanProvider(BeanFactory beanFactory, String targetBeanName) {
this.targetBeanName = targetBeanName;
}
+ @Override
public Object get() throws BeansException {
return this.beanFactory.getBean(this.targetBeanName);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java | @@ -44,6 +44,7 @@ public RuntimeBeanNameReference(String beanName) {
this.beanName = beanName;
}
+ @Override
public String getBeanName() {
return this.beanName;
}
@@ -56,6 +57,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java | @@ -61,6 +61,7 @@ public RuntimeBeanReference(String beanName, boolean toParent) {
}
+ @Override
public String getBeanName() {
return this.beanName;
}
@@ -81,6 +82,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java | @@ -246,6 +246,7 @@ public void setServiceMappings(Properties serviceMappings) {
this.serviceMappings = serviceMappings;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
if (!(beanFactory instanceof ListableBeanFactory)) {
throw new FatalBeanException(
@@ -254,6 +255,7 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (ListableBeanFactory) beanFactory;
}
+ @Override
public void afterPropertiesSet() {
if (this.serviceLocatorInterface == null) {
throw new IllegalArgumentException("Property 'serviceLocatorInterface' is required");
@@ -323,14 +325,17 @@ else if (paramTypes[i].isInstance(cause)) {
}
+ @Override
public Object getObject() {
return this.proxy;
}
+ @Override
public Class<?> getObjectType() {
return this.serviceLocatorInterface;
}
+ @Override
public boolean isSingleton() {
return true;
}
@@ -341,6 +346,7 @@ public boolean isSingleton() {
*/
private class ServiceLocatorInvocationHandler implements InvocationHandler {
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (ReflectionUtils.isEqualsMethod(method)) {
// Only consider equal when proxies are identical. | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java | @@ -171,6 +171,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.java | @@ -35,27 +35,31 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Delegates to {@link #getName}.
*/
+ @Override
public String getDescription() {
return getName();
}
/**
* Returns an empty array.
*/
+ @Override
public BeanDefinition[] getBeanDefinitions() {
return new BeanDefinition[0];
}
/**
* Returns an empty array.
*/
+ @Override
public BeanDefinition[] getInnerBeanDefinitions() {
return new BeanDefinition[0];
}
/**
* Returns an empty array.
*/
+ @Override
public BeanReference[] getBeanReferences() {
return new BeanReference[0];
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java | @@ -73,6 +73,7 @@ public final String getAlias() {
return this.alias;
}
+ @Override
public final Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java | @@ -94,22 +94,27 @@ else if (value instanceof BeanReference) {
}
+ @Override
public String getName() {
return getBeanName();
}
+ @Override
public String getDescription() {
return getShortDescription();
}
+ @Override
public BeanDefinition[] getBeanDefinitions() {
return new BeanDefinition[] {getBeanDefinition()};
}
+ @Override
public BeanDefinition[] getInnerBeanDefinitions() {
return this.innerBeanDefinitions;
}
+ @Override
public BeanReference[] getBeanReferences() {
return this.beanReferences;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.java | @@ -51,10 +51,12 @@ public CompositeComponentDefinition(String name, Object source) {
}
+ @Override
public String getName() {
return this.name;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.java | @@ -25,18 +25,22 @@
*/
public class EmptyReaderEventListener implements ReaderEventListener {
+ @Override
public void defaultsRegistered(DefaultsDefinition defaultsDefinition) {
// no-op
}
+ @Override
public void componentRegistered(ComponentDefinition componentDefinition) {
// no-op
}
+ @Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
// no-op
}
+ @Override
public void importProcessed(ImportDefinition importDefinition) {
// no-op
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java | @@ -55,6 +55,7 @@ public void setLogger(Log logger) {
* that has occurred.
* @param problem the source of the error
*/
+ @Override
public void fatal(Problem problem) {
throw new BeanDefinitionParsingException(problem);
}
@@ -64,6 +65,7 @@ public void fatal(Problem problem) {
* that has occurred.
* @param problem the source of the error
*/
+ @Override
public void error(Problem problem) {
throw new BeanDefinitionParsingException(problem);
}
@@ -72,6 +74,7 @@ public void error(Problem problem) {
* Writes the supplied {@link Problem} to the {@link Log} at {@code WARN} level.
* @param problem the source of the warning
*/
+ @Override
public void warning(Problem problem) {
this.logger.warn(problem, problem.getRootCause());
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java | @@ -77,6 +77,7 @@ public final Resource[] getActualResources() {
return this.actualResources;
}
+ @Override
public final Object getSource() {
return this.source;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java | @@ -33,6 +33,7 @@ public class NullSourceExtractor implements SourceExtractor {
/**
* This implementation simply returns {@code null} for any input.
*/
+ @Override
public Object extractSource(Object sourceCandidate, Resource definitionResource) {
return null;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java | @@ -39,6 +39,7 @@ public class PassThroughSourceExtractor implements SourceExtractor {
* @param sourceCandidate the source metadata
* @return the supplied {@code sourceCandidate}
*/
+ @Override
public Object extractSource(Object sourceCandidate, Resource definingResource) {
return sourceCandidate;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java | @@ -280,6 +280,7 @@ public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
// Typical methods for creating and populating external bean instances
//-------------------------------------------------------------------------
+ @Override
@SuppressWarnings("unchecked")
public <T> T createBean(Class<T> beanClass) throws BeansException {
// Use prototype bean definition, to avoid registering bean as dependent bean.
@@ -289,6 +290,7 @@ public <T> T createBean(Class<T> beanClass) throws BeansException {
return (T) createBean(beanClass.getName(), bd, null);
}
+ @Override
public void autowireBean(Object existingBean) {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
RootBeanDefinition bd = new RootBeanDefinition(ClassUtils.getUserClass(existingBean));
@@ -299,6 +301,7 @@ public void autowireBean(Object existingBean) {
populateBean(bd.getBeanClass().getName(), bd, bw);
}
+ @Override
public Object configureBean(Object existingBean, String beanName) throws BeansException {
markBeanAsCreated(beanName);
BeanDefinition mbd = getMergedBeanDefinition(beanName);
@@ -320,6 +323,7 @@ public Object configureBean(Object existingBean, String beanName) throws BeansEx
return initializeBean(beanName, existingBean, bd);
}
+ @Override
public Object resolveDependency(DependencyDescriptor descriptor, String beanName) throws BeansException {
return resolveDependency(descriptor, beanName, null, null);
}
@@ -329,13 +333,15 @@ public Object resolveDependency(DependencyDescriptor descriptor, String beanName
// Specialized methods for fine-grained control over the bean lifecycle
//-------------------------------------------------------------------------
+ @Override
public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck);
bd.setScope(BeanDefinition.SCOPE_PROTOTYPE);
return createBean(beanClass.getName(), bd, null);
}
+ @Override
public Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
final RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck);
@@ -350,6 +356,7 @@ public Object autowire(Class beanClass, int autowireMode, boolean dependencyChec
if (System.getSecurityManager() != null) {
bean = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return getInstantiationStrategy().instantiate(bd, null, parent);
}
@@ -364,6 +371,7 @@ public Object run() {
}
}
+ @Override
public void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
throws BeansException {
@@ -379,6 +387,7 @@ public void autowireBeanProperties(Object existingBean, int autowireMode, boolea
populateBean(bd.getBeanClass().getName(), bd, bw);
}
+ @Override
public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException {
markBeanAsCreated(beanName);
BeanDefinition bd = getMergedBeanDefinition(beanName);
@@ -387,10 +396,12 @@ public void applyBeanPropertyValues(Object existingBean, String beanName) throws
applyPropertyValues(beanName, bd, bw, bd.getPropertyValues());
}
+ @Override
public Object initializeBean(Object existingBean, String beanName) {
return initializeBean(beanName, existingBean, null);
}
+ @Override
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
throws BeansException {
@@ -404,6 +415,7 @@ public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, S
return result;
}
+ @Override
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
throws BeansException {
@@ -510,6 +522,7 @@ protected Object doCreateBean(final String beanName, final RootBeanDefinition mb
"' to allow for resolving potential circular references");
}
addSingletonFactory(beanName, new ObjectFactory() {
+ @Override
public Object getObject() throws BeansException {
return getEarlyBeanReference(beanName, mbd, bean);
}
@@ -695,6 +708,7 @@ class Holder { Class<?> value = null; }
// @Bean methods, there may be parameters present.
ReflectionUtils.doWithMethods(fbClass,
new ReflectionUtils.MethodCallback() {
+ @Override
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
if (method.getName().equals(factoryMethodName) &&
FactoryBean.class.isAssignableFrom(method.getReturnType())) {
@@ -995,6 +1009,7 @@ protected BeanWrapper instantiateBean(final String beanName, final RootBeanDefin
final BeanFactory parent = this;
if (System.getSecurityManager() != null) {
beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return getInstantiationStrategy().instantiate(mbd, beanName, parent);
}
@@ -1464,6 +1479,7 @@ private Object convertForProperty(Object value, String propertyName, BeanWrapper
protected Object initializeBean(final String beanName, final Object bean, RootBeanDefinition mbd) {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
invokeAwareMethods(beanName, bean);
return null;
@@ -1531,6 +1547,7 @@ protected void invokeInitMethods(String beanName, final Object bean, RootBeanDef
if (System.getSecurityManager() != null) {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
((InitializingBean) bean).afterPropertiesSet();
return null;
@@ -1588,13 +1605,15 @@ protected void invokeCustomInitMethod(String beanName, final Object bean, RootBe
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
ReflectionUtils.makeAccessible(initMethod);
return null;
}
});
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
initMethod.invoke(bean);
return null; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java | @@ -386,10 +386,12 @@ public Class<?> getBeanClass() throws IllegalStateException {
return (Class) beanClassObject;
}
+ @Override
public void setBeanClassName(String beanClassName) {
this.beanClass = beanClassName;
}
+ @Override
public String getBeanClassName() {
Object beanClassObject = this.beanClass;
if (beanClassObject instanceof Class) {
@@ -429,6 +431,7 @@ public Class resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundExcep
* @see #SCOPE_SINGLETON
* @see #SCOPE_PROTOTYPE
*/
+ @Override
public void setScope(String scope) {
this.scope = scope;
this.singleton = SCOPE_SINGLETON.equals(scope) || SCOPE_DEFAULT.equals(scope);
@@ -438,6 +441,7 @@ public void setScope(String scope) {
/**
* Return the name of the target scope for the bean.
*/
+ @Override
public String getScope() {
return this.scope;
}
@@ -467,6 +471,7 @@ public void setSingleton(boolean singleton) {
* returned from all calls.
* @see #SCOPE_SINGLETON
*/
+ @Override
public boolean isSingleton() {
return this.singleton;
}
@@ -476,6 +481,7 @@ public boolean isSingleton() {
* returned for each call.
* @see #SCOPE_PROTOTYPE
*/
+ @Override
public boolean isPrototype() {
return this.prototype;
}
@@ -494,6 +500,7 @@ public void setAbstract(boolean abstractFlag) {
* Return whether this bean is "abstract", i.e. not meant to be instantiated
* itself but rather just serving as parent for concrete child bean definitions.
*/
+ @Override
public boolean isAbstract() {
return this.abstractFlag;
}
@@ -503,6 +510,7 @@ public boolean isAbstract() {
* <p>If {@code false}, the bean will get instantiated on startup by bean
* factories that perform eager initialization of singletons.
*/
+ @Override
public void setLazyInit(boolean lazyInit) {
this.lazyInit = lazyInit;
}
@@ -511,6 +519,7 @@ public void setLazyInit(boolean lazyInit) {
* Return whether this bean should be lazily initialized, i.e. not
* eagerly instantiated on startup. Only applicable to a singleton bean.
*/
+ @Override
public boolean isLazyInit() {
return this.lazyInit;
}
@@ -591,27 +600,31 @@ public int getDependencyCheck() {
* constructor arguments. This property should just be necessary for other kinds
* of dependencies like statics (*ugh*) or database preparation on startup.
*/
+ @Override
public void setDependsOn(String[] dependsOn) {
this.dependsOn = dependsOn;
}
/**
* Return the bean names that this bean depends on.
*/
+ @Override
public String[] getDependsOn() {
return this.dependsOn;
}
/**
* Set whether this bean is a candidate for getting autowired into some other bean.
*/
+ @Override
public void setAutowireCandidate(boolean autowireCandidate) {
this.autowireCandidate = autowireCandidate;
}
/**
* Return whether this bean is a candidate for getting autowired into some other bean.
*/
+ @Override
public boolean isAutowireCandidate() {
return this.autowireCandidate;
}
@@ -621,6 +634,7 @@ public boolean isAutowireCandidate() {
* If this value is true for exactly one bean among multiple
* matching candidates, it will serve as a tie-breaker.
*/
+ @Override
public void setPrimary(boolean primary) {
this.primary = primary;
}
@@ -630,6 +644,7 @@ public void setPrimary(boolean primary) {
* If this value is true for exactly one bean among multiple
* matching candidates, it will serve as a tie-breaker.
*/
+ @Override
public boolean isPrimary() {
return this.primary;
}
@@ -724,6 +739,7 @@ public void setConstructorArgumentValues(ConstructorArgumentValues constructorAr
/**
* Return constructor argument values for this bean (never {@code null}).
*/
+ @Override
public ConstructorArgumentValues getConstructorArgumentValues() {
return this.constructorArgumentValues;
}
@@ -745,6 +761,7 @@ public void setPropertyValues(MutablePropertyValues propertyValues) {
/**
* Return property values for this bean (never {@code null}).
*/
+ @Override
public MutablePropertyValues getPropertyValues() {
return this.propertyValues;
}
@@ -766,18 +783,22 @@ public MethodOverrides getMethodOverrides() {
}
+ @Override
public void setFactoryBeanName(String factoryBeanName) {
this.factoryBeanName = factoryBeanName;
}
+ @Override
public String getFactoryBeanName() {
return this.factoryBeanName;
}
+ @Override
public void setFactoryMethodName(String factoryMethodName) {
this.factoryMethodName = factoryMethodName;
}
+ @Override
public String getFactoryMethodName() {
return this.factoryMethodName;
}
@@ -874,6 +895,7 @@ public void setRole(int role) {
/**
* Return the role hint for this {@code BeanDefinition}.
*/
+ @Override
public int getRole() {
return this.role;
}
@@ -886,6 +908,7 @@ public void setDescription(String description) {
this.description = description;
}
+ @Override
public String getDescription() {
return this.description;
}
@@ -913,6 +936,7 @@ public void setResourceDescription(String resourceDescription) {
this.resource = new DescriptiveResource(resourceDescription);
}
+ @Override
public String getResourceDescription() {
return (this.resource != null ? this.resource.getDescription() : null);
}
@@ -924,6 +948,7 @@ public void setOriginatingBeanDefinition(BeanDefinition originatingBd) {
this.resource = new BeanDefinitionResource(originatingBd);
}
+ @Override
public BeanDefinition getOriginatingBeanDefinition() {
return (this.resource instanceof BeanDefinitionResource ?
((BeanDefinitionResource) this.resource).getBeanDefinition() : null); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java | @@ -102,6 +102,7 @@ public final BeanDefinitionRegistry getBeanFactory() {
return this.registry;
}
+ @Override
public final BeanDefinitionRegistry getRegistry() {
return this.registry;
}
@@ -121,6 +122,7 @@ public void setResourceLoader(ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
}
+ @Override
public ResourceLoader getResourceLoader() {
return this.resourceLoader;
}
@@ -136,6 +138,7 @@ public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
+ @Override
public ClassLoader getBeanClassLoader() {
return this.beanClassLoader;
}
@@ -149,6 +152,7 @@ public void setEnvironment(Environment environment) {
this.environment = environment;
}
+ @Override
public Environment getEnvironment() {
return this.environment;
}
@@ -162,11 +166,13 @@ public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
this.beanNameGenerator = (beanNameGenerator != null ? beanNameGenerator : new DefaultBeanNameGenerator());
}
+ @Override
public BeanNameGenerator getBeanNameGenerator() {
return this.beanNameGenerator;
}
+ @Override
public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException {
Assert.notNull(resources, "Resource array must not be null");
int counter = 0;
@@ -176,6 +182,7 @@ public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStore
return counter;
}
+ @Override
public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException {
return loadBeanDefinitions(location, null);
}
@@ -236,6 +243,7 @@ public int loadBeanDefinitions(String location, Set<Resource> actualResources) t
}
}
+ @Override
public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException {
Assert.notNull(locations, "Location array must not be null");
int counter = 0; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | @@ -190,14 +190,17 @@ public AbstractBeanFactory(BeanFactory parentBeanFactory) {
// Implementation of BeanFactory interface
//---------------------------------------------------------------------
+ @Override
public Object getBean(String name) throws BeansException {
return doGetBean(name, null, null, false);
}
+ @Override
public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
return doGetBean(name, requiredType, null, false);
}
+ @Override
public Object getBean(String name, Object... args) throws BeansException {
return doGetBean(name, null, args, false);
}
@@ -290,6 +293,7 @@ protected <T> T doGetBean(
// Create bean instance.
if (mbd.isSingleton()) {
sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() {
+ @Override
public Object getObject() throws BeansException {
try {
return createBean(beanName, mbd, args);
@@ -327,6 +331,7 @@ else if (mbd.isPrototype()) {
}
try {
Object scopedInstance = scope.get(beanName, new ObjectFactory<Object>() {
+ @Override
public Object getObject() throws BeansException {
beforePrototypeCreation(beanName);
try {
@@ -364,6 +369,7 @@ public Object getObject() throws BeansException {
return (T) bean;
}
+ @Override
public boolean containsBean(String name) {
String beanName = transformedBeanName(name);
if (containsSingleton(beanName) || containsBeanDefinition(beanName)) {
@@ -374,6 +380,7 @@ public boolean containsBean(String name) {
return (parentBeanFactory != null && parentBeanFactory.containsBean(originalBeanName(name)));
}
+ @Override
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -419,6 +426,7 @@ else if (containsSingleton(beanName)) {
}
}
+ @Override
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -443,6 +451,7 @@ public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
final FactoryBean<?> factoryBean = (FactoryBean<?>) getBean(FACTORY_BEAN_PREFIX + beanName);
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ @Override
public Boolean run() {
return ((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean<?>) factoryBean).isPrototype()) ||
!factoryBean.isSingleton());
@@ -460,6 +469,7 @@ public Boolean run() {
}
}
+ @Override
public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
Class<?> typeToMatch = (targetType != null ? targetType : Object.class);
@@ -531,6 +541,7 @@ else if (containsSingleton(beanName) && !containsBeanDefinition(beanName)) {
}
}
+ @Override
public Class<?> getType(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -621,10 +632,12 @@ public String[] getAliases(String name) {
// Implementation of HierarchicalBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public BeanFactory getParentBeanFactory() {
return this.parentBeanFactory;
}
+ @Override
public boolean containsLocalBean(String name) {
String beanName = transformedBeanName(name);
return ((containsSingleton(beanName) || containsBeanDefinition(beanName)) &&
@@ -636,53 +649,65 @@ public boolean containsLocalBean(String name) {
// Implementation of ConfigurableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public void setParentBeanFactory(BeanFactory parentBeanFactory) {
if (this.parentBeanFactory != null && this.parentBeanFactory != parentBeanFactory) {
throw new IllegalStateException("Already associated with parent BeanFactory: " + this.parentBeanFactory);
}
this.parentBeanFactory = parentBeanFactory;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = (beanClassLoader != null ? beanClassLoader : ClassUtils.getDefaultClassLoader());
}
+ @Override
public ClassLoader getBeanClassLoader() {
return this.beanClassLoader;
}
+ @Override
public void setTempClassLoader(ClassLoader tempClassLoader) {
this.tempClassLoader = tempClassLoader;
}
+ @Override
public ClassLoader getTempClassLoader() {
return this.tempClassLoader;
}
+ @Override
public void setCacheBeanMetadata(boolean cacheBeanMetadata) {
this.cacheBeanMetadata = cacheBeanMetadata;
}
+ @Override
public boolean isCacheBeanMetadata() {
return this.cacheBeanMetadata;
}
+ @Override
public void setBeanExpressionResolver(BeanExpressionResolver resolver) {
this.beanExpressionResolver = resolver;
}
+ @Override
public BeanExpressionResolver getBeanExpressionResolver() {
return this.beanExpressionResolver;
}
+ @Override
public void setConversionService(ConversionService conversionService) {
this.conversionService = conversionService;
}
+ @Override
public ConversionService getConversionService() {
return this.conversionService;
}
+ @Override
public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar) {
Assert.notNull(registrar, "PropertyEditorRegistrar must not be null");
this.propertyEditorRegistrars.add(registrar);
@@ -695,12 +720,14 @@ public Set<PropertyEditorRegistrar> getPropertyEditorRegistrars() {
return this.propertyEditorRegistrars;
}
+ @Override
public void registerCustomEditor(Class<?> requiredType, Class<? extends PropertyEditor> propertyEditorClass) {
Assert.notNull(requiredType, "Required type must not be null");
Assert.isAssignable(PropertyEditor.class, propertyEditorClass);
this.customEditors.put(requiredType, propertyEditorClass);
}
+ @Override
public void copyRegisteredEditorsTo(PropertyEditorRegistry registry) {
registerCustomEditors(registry);
}
@@ -712,6 +739,7 @@ public Map<Class<?>, Class<? extends PropertyEditor>> getCustomEditors() {
return this.customEditors;
}
+ @Override
public void setTypeConverter(TypeConverter typeConverter) {
this.typeConverter = typeConverter;
}
@@ -724,6 +752,7 @@ protected TypeConverter getCustomTypeConverter() {
return this.typeConverter;
}
+ @Override
public TypeConverter getTypeConverter() {
TypeConverter customConverter = getCustomTypeConverter();
if (customConverter != null) {
@@ -738,11 +767,13 @@ public TypeConverter getTypeConverter() {
}
}
+ @Override
public void addEmbeddedValueResolver(StringValueResolver valueResolver) {
Assert.notNull(valueResolver, "StringValueResolver must not be null");
this.embeddedValueResolvers.add(valueResolver);
}
+ @Override
public String resolveEmbeddedValue(String value) {
String result = value;
for (StringValueResolver resolver : this.embeddedValueResolvers) {
@@ -751,6 +782,7 @@ public String resolveEmbeddedValue(String value) {
return result;
}
+ @Override
public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) {
Assert.notNull(beanPostProcessor, "BeanPostProcessor must not be null");
this.beanPostProcessors.remove(beanPostProcessor);
@@ -763,6 +795,7 @@ public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) {
}
}
+ @Override
public int getBeanPostProcessorCount() {
return this.beanPostProcessors.size();
}
@@ -795,6 +828,7 @@ protected boolean hasDestructionAwareBeanPostProcessors() {
return this.hasDestructionAwareBeanPostProcessors;
}
+ @Override
public void registerScope(String scopeName, Scope scope) {
Assert.notNull(scopeName, "Scope identifier must not be null");
Assert.notNull(scope, "Scope must not be null");
@@ -804,10 +838,12 @@ public void registerScope(String scopeName, Scope scope) {
this.scopes.put(scopeName, scope);
}
+ @Override
public String[] getRegisteredScopeNames() {
return StringUtils.toStringArray(this.scopes.keySet());
}
+ @Override
public Scope getRegisteredScope(String scopeName) {
Assert.notNull(scopeName, "Scope identifier must not be null");
return this.scopes.get(scopeName);
@@ -833,6 +869,7 @@ public AccessControlContext getAccessControlContext() {
AccessController.getContext());
}
+ @Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
Assert.notNull(otherFactory, "BeanFactory must not be null");
setBeanClassLoader(otherFactory.getBeanClassLoader());
@@ -866,6 +903,7 @@ public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
* @throws NoSuchBeanDefinitionException if there is no bean with the given name
* @throws BeanDefinitionStoreException in case of an invalid bean definition
*/
+ @Override
public BeanDefinition getMergedBeanDefinition(String name) throws BeansException {
String beanName = transformedBeanName(name);
@@ -877,6 +915,7 @@ public BeanDefinition getMergedBeanDefinition(String name) throws BeansException
return getMergedLocalBeanDefinition(beanName);
}
+ @Override
public boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -959,6 +998,7 @@ else if (curVal instanceof Set) {
}
}
+ @Override
public void destroyBean(String beanName, Object beanInstance) {
destroyBean(beanName, beanInstance, getMergedLocalBeanDefinition(beanName));
}
@@ -974,6 +1014,7 @@ protected void destroyBean(String beanName, Object beanInstance, RootBeanDefinit
new DisposableBeanAdapter(beanInstance, beanName, mbd, getBeanPostProcessors(), getAccessControlContext()).destroy();
}
+ @Override
public void destroyScopedBean(String beanName) {
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
if (mbd.isSingleton() || mbd.isPrototype()) {
@@ -1246,6 +1287,7 @@ protected Class<?> resolveBeanClass(final RootBeanDefinition mbd, String beanNam
}
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
+ @Override
public Class<?> run() throws Exception {
return doResolveBeanClass(mbd, typesToMatch);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java | @@ -51,6 +51,7 @@ abstract class AutowireUtils {
*/
public static void sortConstructors(Constructor[] constructors) {
Arrays.sort(constructors, new Comparator<Constructor>() {
+ @Override
public int compare(Constructor c1, Constructor c2) {
boolean p1 = Modifier.isPublic(c1.getModifiers());
boolean p2 = Modifier.isPublic(c2.getModifiers());
@@ -73,6 +74,7 @@ public int compare(Constructor c1, Constructor c2) {
*/
public static void sortFactoryMethods(Method[] factoryMethods) {
Arrays.sort(factoryMethods, new Comparator<Method>() {
+ @Override
public int compare(Method fm1, Method fm2) {
boolean p1 = Modifier.isPublic(fm1.getModifiers());
boolean p2 = Modifier.isPublic(fm2.getModifiers());
@@ -162,6 +164,7 @@ public ObjectFactoryDelegatingInvocationHandler(ObjectFactory objectFactory) {
this.objectFactory = objectFactory;
}
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String methodName = method.getName();
if (methodName.equals("equals")) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java | @@ -64,11 +64,13 @@ public boolean isReadable() {
return false;
}
+ @Override
public InputStream getInputStream() throws IOException {
throw new FileNotFoundException(
"Resource cannot be opened because it points to " + getDescription());
}
+ @Override
public String getDescription() {
return "BeanDefinition defined in " + this.beanDefinition.getResourceDescription();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java | @@ -153,6 +153,7 @@ public int hashCode() {
*/
private class LookupOverrideMethodInterceptor extends CglibIdentitySupport implements MethodInterceptor {
+ @Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp) throws Throwable {
// Cast is safe, as CallbackFilter filters are used selectively.
LookupOverride lo = (LookupOverride) beanDefinition.getMethodOverrides().getOverride(method);
@@ -167,6 +168,7 @@ public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp
*/
private class ReplaceOverrideMethodInterceptor extends CglibIdentitySupport implements MethodInterceptor {
+ @Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp) throws Throwable {
ReplaceOverride ro = (ReplaceOverride) beanDefinition.getMethodOverrides().getOverride(method);
// TODO could cache if a singleton for minor performance optimization
@@ -181,6 +183,7 @@ public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp
*/
private class CallbackFilterImpl extends CglibIdentitySupport implements CallbackFilter {
+ @Override
public int accept(Method method) {
MethodOverride methodOverride = beanDefinition.getMethodOverrides().getOverride(method);
if (logger.isTraceEnabled()) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java | @@ -132,10 +132,12 @@ public ChildBeanDefinition(ChildBeanDefinition original) {
}
+ @Override
public void setParentName(String parentName) {
this.parentName = parentName;
}
+ @Override
public String getParentName() {
return this.parentName;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java | @@ -270,6 +270,7 @@ else if (ambiguousConstructors != null && !mbd.isLenientConstructorResolution())
final Constructor ctorToUse = constructorToUse;
final Object[] argumentsToUse = argsToUse;
beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return beanFactory.getInstantiationStrategy().instantiate(
mbd, beanName, beanFactory, ctorToUse, argumentsToUse);
@@ -402,6 +403,7 @@ public BeanWrapper instantiateUsingFactoryMethod(final String beanName, final Ro
final Class factoryClazz = factoryClass;
if (System.getSecurityManager() != null) {
rawCandidates = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
+ @Override
public Method[] run() {
return (mbd.isNonPublicAccessAllowed() ?
ReflectionUtils.getAllDeclaredMethods(factoryClazz) : factoryClazz.getMethods());
@@ -560,6 +562,7 @@ else if (ambiguousFactoryMethods != null && !mbd.isLenientConstructorResolution(
final Method factoryMethod = factoryMethodToUse;
final Object[] args = argsToUse;
beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
return beanFactory.getInstantiationStrategy().instantiate(
mbd, beanName, beanFactory, fb, factoryMethod, args); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultBeanNameGenerator.java | @@ -27,6 +27,7 @@
*/
public class DefaultBeanNameGenerator implements BeanNameGenerator {
+ @Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
return BeanDefinitionReaderUtils.generateBeanName(definition, registry);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java | @@ -215,6 +215,7 @@ public void setAutowireCandidateResolver(final AutowireCandidateResolver autowir
if (System.getSecurityManager() != null) {
final BeanFactory target = this;
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
((BeanFactoryAware) autowireCandidateResolver).setBeanFactory(target);
return null;
@@ -253,6 +254,7 @@ public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
// Implementation of ListableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public <T> T getBean(Class<T> requiredType) throws BeansException {
Assert.notNull(requiredType, "Required type must not be null");
String[] beanNames = getBeanNamesForType(requiredType);
@@ -285,10 +287,12 @@ public boolean containsBeanDefinition(String beanName) {
return this.beanDefinitionMap.containsKey(beanName);
}
+ @Override
public int getBeanDefinitionCount() {
return this.beanDefinitionMap.size();
}
+ @Override
public String[] getBeanDefinitionNames() {
synchronized (this.beanDefinitionMap) {
if (this.frozenBeanDefinitionNames != null) {
@@ -300,10 +304,12 @@ public String[] getBeanDefinitionNames() {
}
}
+ @Override
public String[] getBeanNamesForType(Class<?> type) {
return getBeanNamesForType(type, true, true);
}
+ @Override
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
if (!isConfigurationFrozen() || type == null || !allowEagerInit) {
return doGetBeanNamesForType(type, includeNonSingletons, allowEagerInit);
@@ -407,10 +413,12 @@ private boolean requiresEagerInitForType(String factoryBeanName) {
return (factoryBeanName != null && isFactoryBean(factoryBeanName) && !containsSingleton(factoryBeanName));
}
+ @Override
public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException {
return getBeansOfType(type, true, true);
}
+ @Override
public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
throws BeansException {
@@ -441,6 +449,7 @@ public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingle
return result;
}
+ @Override
public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) {
Set<String> beanNames = new LinkedHashSet<String>(getBeanDefinitionCount());
beanNames.addAll(Arrays.asList(getBeanDefinitionNames()));
@@ -460,6 +469,7 @@ public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> an
* found on the given class itself, as well as checking its raw bean class
* if not found on the exposed bean reference (e.g. in case of a proxy).
*/
+ @Override
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
A ann = null;
Class<?> beanType = getType(beanName);
@@ -483,6 +493,7 @@ public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> a
// Implementation of ConfigurableListableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public void registerResolvableDependency(Class<?> dependencyType, Object autowiredValue) {
Assert.notNull(dependencyType, "Type must not be null");
if (autowiredValue != null) {
@@ -492,6 +503,7 @@ public void registerResolvableDependency(Class<?> dependencyType, Object autowir
}
}
+ @Override
public boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor)
throws NoSuchBeanDefinitionException {
@@ -552,13 +564,15 @@ public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefini
return bd;
}
+ @Override
public void freezeConfiguration() {
this.configurationFrozen = true;
synchronized (this.beanDefinitionMap) {
this.frozenBeanDefinitionNames = StringUtils.toStringArray(this.beanDefinitionNames);
}
}
+ @Override
public boolean isConfigurationFrozen() {
return this.configurationFrozen;
}
@@ -573,6 +587,7 @@ protected boolean isBeanEligibleForMetadataCaching(String beanName) {
return (this.configurationFrozen || super.isBeanEligibleForMetadataCaching(beanName));
}
+ @Override
public void preInstantiateSingletons() throws BeansException {
if (this.logger.isInfoEnabled()) {
this.logger.info("Pre-instantiating singletons in " + this);
@@ -591,6 +606,7 @@ public void preInstantiateSingletons() throws BeansException {
boolean isEagerInit;
if (System.getSecurityManager() != null && factory instanceof SmartFactoryBean) {
isEagerInit = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ @Override
public Boolean run() {
return ((SmartFactoryBean<?>) factory).isEagerInit();
}
@@ -616,6 +632,7 @@ public Boolean run() {
// Implementation of BeanDefinitionRegistry interface
//---------------------------------------------------------------------
+ @Override
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition)
throws BeanDefinitionStoreException {
@@ -657,6 +674,7 @@ public void registerBeanDefinition(String beanName, BeanDefinition beanDefinitio
resetBeanDefinition(beanName);
}
+ @Override
public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException {
Assert.hasText(beanName, "'beanName' must not be empty");
@@ -717,6 +735,7 @@ protected boolean allowAliasOverriding() {
// Dependency resolution functionality
//---------------------------------------------------------------------
+ @Override
public Object resolveDependency(DependencyDescriptor descriptor, String beanName,
Set<String> autowiredBeanNames, TypeConverter typeConverter) throws BeansException {
@@ -1032,6 +1051,7 @@ public DependencyObjectFactory(DependencyDescriptor descriptor, String beanName)
this.beanName = beanName;
}
+ @Override
public Object getObject() throws BeansException {
return doResolveDependency(this.descriptor, this.descriptor.getDependencyType(), this.beanName, null, null);
}
@@ -1047,6 +1067,7 @@ public DependencyProvider(DependencyDescriptor descriptor, String beanName) {
super(descriptor, beanName);
}
+ @Override
public Object get() throws BeansException {
return getObject();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | @@ -117,6 +117,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
private final Map<String, Set<String>> dependenciesForBeanMap = new ConcurrentHashMap<String, Set<String>>(64);
+ @Override
public void registerSingleton(String beanName, Object singletonObject) throws IllegalStateException {
Assert.notNull(beanName, "'beanName' must not be null");
synchronized (this.singletonObjects) {
@@ -163,6 +164,7 @@ protected void addSingletonFactory(String beanName, ObjectFactory singletonFacto
}
}
+ @Override
public Object getSingleton(String beanName) {
return getSingleton(beanName, true);
}
@@ -270,16 +272,19 @@ protected void removeSingleton(String beanName) {
}
}
+ @Override
public boolean containsSingleton(String beanName) {
return (this.singletonObjects.containsKey(beanName));
}
+ @Override
public String[] getSingletonNames() {
synchronized (this.singletonObjects) {
return StringUtils.toStringArray(this.registeredSingletons);
}
}
+ @Override
public int getSingletonCount() {
synchronized (this.singletonObjects) {
return this.registeredSingletons.size(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java | @@ -203,10 +203,12 @@ private List<DestructionAwareBeanPostProcessor> filterPostProcessors(List<BeanPo
}
+ @Override
public void run() {
destroy();
}
+ @Override
public void destroy() {
if (this.beanPostProcessors != null && !this.beanPostProcessors.isEmpty()) {
for (DestructionAwareBeanPostProcessor processor : this.beanPostProcessors) {
@@ -221,6 +223,7 @@ public void destroy() {
try {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
((DisposableBean) bean).destroy();
return null;
@@ -258,6 +261,7 @@ private Method determineDestroyMethod() {
try {
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ @Override
public Method run() {
return findDestroyMethod();
}
@@ -298,13 +302,15 @@ private void invokeCustomDestroyMethod(final Method destroyMethod) {
try {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
public Object run() {
ReflectionUtils.makeAccessible(destroyMethod);
return null;
}
});
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
destroyMethod.invoke(bean, args);
return null; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java | @@ -56,6 +56,7 @@ protected Class getTypeForFactoryBean(final FactoryBean factoryBean) {
try {
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedAction<Class>() {
+ @Override
public Class run() {
return factoryBean.getObjectType();
}
@@ -129,6 +130,7 @@ private Object doGetObjectFromFactoryBean(
AccessControlContext acc = getAccessControlContext();
try {
object = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+ @Override
public Object run() throws Exception {
return factory.getObject();
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java | @@ -66,10 +66,12 @@ public GenericBeanDefinition(BeanDefinition original) {
}
+ @Override
public void setParentName(String parentName) {
this.parentName = parentName;
}
+ @Override
public String getParentName() {
return this.parentName;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java | @@ -57,6 +57,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
@@ -83,10 +84,12 @@ public void setMergeEnabled(boolean mergeEnabled) {
this.mergeEnabled = mergeEnabled;
}
+ @Override
public boolean isMergeEnabled() {
return this.mergeEnabled;
}
+ @Override
@SuppressWarnings("unchecked")
public List<E> merge(Object parent) {
if (!this.mergeEnabled) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java | @@ -58,6 +58,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
@@ -98,10 +99,12 @@ public void setMergeEnabled(boolean mergeEnabled) {
this.mergeEnabled = mergeEnabled;
}
+ @Override
public boolean isMergeEnabled() {
return this.mergeEnabled;
}
+ @Override
@SuppressWarnings("unchecked")
public Object merge(Object parent) {
if (!this.mergeEnabled) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java | @@ -45,6 +45,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
@@ -57,11 +58,13 @@ public void setMergeEnabled(boolean mergeEnabled) {
this.mergeEnabled = mergeEnabled;
}
+ @Override
public boolean isMergeEnabled() {
return this.mergeEnabled;
}
+ @Override
public Object merge(Object parent) {
if (!this.mergeEnabled) {
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'"); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java | @@ -56,6 +56,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
@@ -82,10 +83,12 @@ public void setMergeEnabled(boolean mergeEnabled) {
this.mergeEnabled = mergeEnabled;
}
+ @Override
public boolean isMergeEnabled() {
return this.mergeEnabled;
}
+ @Override
@SuppressWarnings("unchecked")
public Set<E> merge(Object parent) {
if (!this.mergeEnabled) { | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java | @@ -83,6 +83,7 @@ public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.