Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -310,14 +310,14 @@ public class MethodParameter {
|
||||
* Return true if the parameter has at least one annotation, false if it has none.
|
||||
*/
|
||||
public boolean hasParameterAnnotations() {
|
||||
return getParameterAnnotations().length != 0;
|
||||
return (getParameterAnnotations().length != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the parameter has the given annotation type, and false if it doesn't.
|
||||
*/
|
||||
public <T extends Annotation> boolean hasParameterAnnotation(Class<T> annotationType) {
|
||||
return getParameterAnnotation(annotationType) != null;
|
||||
return (getParameterAnnotation(annotationType) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,6 +416,38 @@ public class MethodParameter {
|
||||
return this.typeIndexesPerLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj != null && obj instanceof MethodParameter) {
|
||||
MethodParameter other = (MethodParameter) obj;
|
||||
|
||||
if (this.parameterIndex != other.parameterIndex) {
|
||||
return false;
|
||||
}
|
||||
else if (this.getMember().equals(other.getMember())) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = this.hash;
|
||||
if (result == 0) {
|
||||
result = getMember().hashCode();
|
||||
result = 31 * result + this.parameterIndex;
|
||||
this.hash = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new MethodParameter for the given method or constructor.
|
||||
@@ -438,37 +470,4 @@ public class MethodParameter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj != null && obj instanceof MethodParameter) {
|
||||
MethodParameter other = (MethodParameter) obj;
|
||||
|
||||
if (this.parameterIndex != other.parameterIndex) {
|
||||
return false;
|
||||
}
|
||||
else if (this.getMember().equals(other.getMember())) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = this.hash;
|
||||
if (result == 0) {
|
||||
result = getMember().hashCode();
|
||||
result = 31 * result + this.parameterIndex;
|
||||
this.hash = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user