Skip to content

Commit b40403c

Browse files
committed
Polishing
Issue: SPR-11422 (cherry picked from commit 520ef9e)
1 parent 0972582 commit b40403c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1373,7 +1373,7 @@ protected void applyPropertyValues(String beanName, BeanDefinition mbd, BeanWrap
13731373
MutablePropertyValues mpvs = null;
13741374
List<PropertyValue> original;
13751375

1376-
if (System.getSecurityManager()!= null) {
1376+
if (System.getSecurityManager() != null) {
13771377
if (bw instanceof BeanWrapperImpl) {
13781378
((BeanWrapperImpl) bw).setSecurityContext(getAccessControlContext());
13791379
}
@@ -1666,7 +1666,7 @@ protected void removeSingleton(String beanName) {
16661666

16671667

16681668
/**
1669-
* Special DependencyDescriptor variant for autowire="byType".
1669+
* Special DependencyDescriptor variant for Spring's good old autowire="byType" mode.
16701670
* Always optional; never considering the parameter name for choosing a primary candidate.
16711671
*/
16721672
@SuppressWarnings("serial")

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -383,7 +383,7 @@ public Class<?> getBeanClass() throws IllegalStateException {
383383
throw new IllegalStateException(
384384
"Bean class name [" + beanClassObject + "] has not been resolved into an actual Class");
385385
}
386-
return (Class) beanClassObject;
386+
return (Class<?>) beanClassObject;
387387
}
388388

389389
public void setBeanClassName(String beanClassName) {
@@ -393,7 +393,7 @@ public void setBeanClassName(String beanClassName) {
393393
public String getBeanClassName() {
394394
Object beanClassObject = this.beanClass;
395395
if (beanClassObject instanceof Class) {
396-
return ((Class) beanClassObject).getName();
396+
return ((Class<?>) beanClassObject).getName();
397397
}
398398
else {
399399
return (String) beanClassObject;
@@ -408,12 +408,12 @@ public String getBeanClassName() {
408408
* @return the resolved bean class
409409
* @throws ClassNotFoundException if the class name could be resolved
410410
*/
411-
public Class resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundException {
411+
public Class<?> resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundException {
412412
String className = getBeanClassName();
413413
if (className == null) {
414414
return null;
415415
}
416-
Class resolvedClass = ClassUtils.forName(className, classLoader);
416+
Class<?> resolvedClass = ClassUtils.forName(className, classLoader);
417417
this.beanClass = resolvedClass;
418418
return resolvedClass;
419419
}
@@ -551,8 +551,8 @@ public int getResolvedAutowireMode() {
551551
// Work out whether to apply setter autowiring or constructor autowiring.
552552
// If it has a no-arg constructor it's deemed to be setter autowiring,
553553
// otherwise we'll try constructor autowiring.
554-
Constructor[] constructors = getBeanClass().getConstructors();
555-
for (Constructor constructor : constructors) {
554+
Constructor<?>[] constructors = getBeanClass().getConstructors();
555+
for (Constructor<?> constructor : constructors) {
556556
if (constructor.getParameterTypes().length == 0) {
557557
return AUTOWIRE_BY_TYPE;
558558
}
@@ -678,6 +678,7 @@ public void copyQualifiersFrom(AbstractBeanDefinition source) {
678678
/**
679679
* Specify whether to allow access to non-public constructors and methods,
680680
* for the case of externalized metadata pointing to those.
681+
* The default is {@code true}; switch this to {@false} for public access only.
681682
* <p>This applies to constructor resolution, factory method resolution,
682683
* and also init/destroy methods. Bean property accessors have to be public
683684
* in any case and are not affected by this setting.
@@ -699,7 +700,7 @@ public boolean isNonPublicAccessAllowed() {
699700
/**
700701
* Specify whether to resolve constructors in lenient mode ({@code true},
701702
* which is the default) or to switch to strict resolution (throwing an exception
702-
* in case of ambigious constructors that all match when converting the arguments,
703+
* in case of ambiguous constructors that all match when converting the arguments,
703704
* whereas lenient mode would use the one with the 'closest' type matches).
704705
*/
705706
public void setLenientConstructorResolution(boolean lenientConstructorResolution) {

0 commit comments

Comments
 (0)