1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -383,7 +383,7 @@ public Class<?> getBeanClass() throws IllegalStateException {
383
383
throw new IllegalStateException (
384
384
"Bean class name [" + beanClassObject + "] has not been resolved into an actual Class" );
385
385
}
386
- return (Class ) beanClassObject ;
386
+ return (Class <?> ) beanClassObject ;
387
387
}
388
388
389
389
public void setBeanClassName (String beanClassName ) {
@@ -393,7 +393,7 @@ public void setBeanClassName(String beanClassName) {
393
393
public String getBeanClassName () {
394
394
Object beanClassObject = this .beanClass ;
395
395
if (beanClassObject instanceof Class ) {
396
- return ((Class ) beanClassObject ).getName ();
396
+ return ((Class <?> ) beanClassObject ).getName ();
397
397
}
398
398
else {
399
399
return (String ) beanClassObject ;
@@ -408,12 +408,12 @@ public String getBeanClassName() {
408
408
* @return the resolved bean class
409
409
* @throws ClassNotFoundException if the class name could be resolved
410
410
*/
411
- public Class resolveBeanClass (ClassLoader classLoader ) throws ClassNotFoundException {
411
+ public Class <?> resolveBeanClass (ClassLoader classLoader ) throws ClassNotFoundException {
412
412
String className = getBeanClassName ();
413
413
if (className == null ) {
414
414
return null ;
415
415
}
416
- Class resolvedClass = ClassUtils .forName (className , classLoader );
416
+ Class <?> resolvedClass = ClassUtils .forName (className , classLoader );
417
417
this .beanClass = resolvedClass ;
418
418
return resolvedClass ;
419
419
}
@@ -551,8 +551,8 @@ public int getResolvedAutowireMode() {
551
551
// Work out whether to apply setter autowiring or constructor autowiring.
552
552
// If it has a no-arg constructor it's deemed to be setter autowiring,
553
553
// 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 ) {
556
556
if (constructor .getParameterTypes ().length == 0 ) {
557
557
return AUTOWIRE_BY_TYPE ;
558
558
}
@@ -678,6 +678,7 @@ public void copyQualifiersFrom(AbstractBeanDefinition source) {
678
678
/**
679
679
* Specify whether to allow access to non-public constructors and methods,
680
680
* for the case of externalized metadata pointing to those.
681
+ * The default is {@code true}; switch this to {@false} for public access only.
681
682
* <p>This applies to constructor resolution, factory method resolution,
682
683
* and also init/destroy methods. Bean property accessors have to be public
683
684
* in any case and are not affected by this setting.
@@ -699,7 +700,7 @@ public boolean isNonPublicAccessAllowed() {
699
700
/**
700
701
* Specify whether to resolve constructors in lenient mode ({@code true},
701
702
* 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,
703
704
* whereas lenient mode would use the one with the 'closest' type matches).
704
705
*/
705
706
public void setLenientConstructorResolution (boolean lenientConstructorResolution ) {
0 commit comments