1
1
/*
2
- * Copyright 2002-2011 the original author or authors.
2
+ * Copyright 2002-2012 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.
@@ -310,14 +310,14 @@ public <T extends Annotation> T getParameterAnnotation(Class<T> annotationType)
310
310
* Return true if the parameter has at least one annotation, false if it has none.
311
311
*/
312
312
public boolean hasParameterAnnotations () {
313
- return getParameterAnnotations ().length != 0 ;
313
+ return ( getParameterAnnotations ().length != 0 ) ;
314
314
}
315
315
316
316
/**
317
317
* Return true if the parameter has the given annotation type, and false if it doesn't.
318
318
*/
319
319
public <T extends Annotation > boolean hasParameterAnnotation (Class <T > annotationType ) {
320
- return getParameterAnnotation (annotationType ) != null ;
320
+ return ( getParameterAnnotation (annotationType ) != null ) ;
321
321
}
322
322
323
323
/**
@@ -416,28 +416,6 @@ private Map<Integer, Integer> getTypeIndexesPerLevel() {
416
416
return this .typeIndexesPerLevel ;
417
417
}
418
418
419
-
420
- /**
421
- * Create a new MethodParameter for the given method or constructor.
422
- * <p>This is a convenience constructor for scenarios where a
423
- * Method or Constructor reference is treated in a generic fashion.
424
- * @param methodOrConstructor the Method or Constructor to specify a parameter for
425
- * @param parameterIndex the index of the parameter
426
- * @return the corresponding MethodParameter instance
427
- */
428
- public static MethodParameter forMethodOrConstructor (Object methodOrConstructor , int parameterIndex ) {
429
- if (methodOrConstructor instanceof Method ) {
430
- return new MethodParameter ((Method ) methodOrConstructor , parameterIndex );
431
- }
432
- else if (methodOrConstructor instanceof Constructor ) {
433
- return new MethodParameter ((Constructor ) methodOrConstructor , parameterIndex );
434
- }
435
- else {
436
- throw new IllegalArgumentException (
437
- "Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor" );
438
- }
439
- }
440
-
441
419
@ Override
442
420
public boolean equals (Object obj ) {
443
421
if (this == obj ) {
@@ -459,7 +437,6 @@ else if (this.getMember().equals(other.getMember())) {
459
437
return false ;
460
438
}
461
439
462
-
463
440
@ Override
464
441
public int hashCode () {
465
442
int result = this .hash ;
@@ -471,4 +448,26 @@ public int hashCode() {
471
448
return result ;
472
449
}
473
450
451
+
452
+ /**
453
+ * Create a new MethodParameter for the given method or constructor.
454
+ * <p>This is a convenience constructor for scenarios where a
455
+ * Method or Constructor reference is treated in a generic fashion.
456
+ * @param methodOrConstructor the Method or Constructor to specify a parameter for
457
+ * @param parameterIndex the index of the parameter
458
+ * @return the corresponding MethodParameter instance
459
+ */
460
+ public static MethodParameter forMethodOrConstructor (Object methodOrConstructor , int parameterIndex ) {
461
+ if (methodOrConstructor instanceof Method ) {
462
+ return new MethodParameter ((Method ) methodOrConstructor , parameterIndex );
463
+ }
464
+ else if (methodOrConstructor instanceof Constructor ) {
465
+ return new MethodParameter ((Constructor ) methodOrConstructor , parameterIndex );
466
+ }
467
+ else {
468
+ throw new IllegalArgumentException (
469
+ "Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor" );
470
+ }
471
+ }
472
+
474
473
}
0 commit comments