11/*
2- * Copyright 2002-2011 the original author or authors.
2+ * Copyright 2002-2012 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.
@@ -310,14 +310,14 @@ public <T extends Annotation> T getParameterAnnotation(Class<T> annotationType)
310310 * Return true if the parameter has at least one annotation, false if it has none.
311311 */
312312public boolean hasParameterAnnotations () {
313- return getParameterAnnotations ().length != 0 ;
313+ return ( getParameterAnnotations ().length != 0 ) ;
314314}
315315
316316/**
317317 * Return true if the parameter has the given annotation type, and false if it doesn't.
318318 */
319319public <T extends Annotation > boolean hasParameterAnnotation (Class <T > annotationType ) {
320- return getParameterAnnotation (annotationType ) != null ;
320+ return ( getParameterAnnotation (annotationType ) != null ) ;
321321}
322322
323323/**
@@ -416,28 +416,6 @@ private Map<Integer, Integer> getTypeIndexesPerLevel() {
416416return this .typeIndexesPerLevel ;
417417}
418418
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-
441419@ Override
442420public boolean equals (Object obj ) {
443421if (this == obj ) {
@@ -459,7 +437,6 @@ else if (this.getMember().equals(other.getMember())) {
459437return false ;
460438}
461439
462-
463440@ Override
464441public int hashCode () {
465442int result = this .hash ;
@@ -471,4 +448,26 @@ public int hashCode() {
471448return result ;
472449}
473450
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+
474473}
0 commit comments