check some parameters

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1183 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-05-28 00:09:44 +00:00
parent 24d1b5f63c
commit e2174bbdde
5 changed files with 16 additions and 0 deletions

View File

@ -106,6 +106,9 @@ public abstract class AbstractDeclaredTransaction implements Comparable<IDeclare
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this.getClass() != obj.getClass()) if (this.getClass() != obj.getClass())
return false; return false;
AbstractDeclaredTransaction other = (AbstractDeclaredTransaction) obj; AbstractDeclaredTransaction other = (AbstractDeclaredTransaction) obj;

View File

@ -144,10 +144,14 @@ public class J2EEUtil {
* *
* @param method the Method in question * @param method the Method in question
* @return String a String representation of the signature. * @return String a String representation of the signature.
* @throws IllegalArgumentException if method is null
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static String buildDescriptor(Method method) { public static String buildDescriptor(Method method) {
if (method == null) {
throw new IllegalArgumentException("method is null");
}
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("("); sb.append("(");

View File

@ -81,6 +81,9 @@ public class ClassImpl implements IClass {
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
public boolean equals(Object arg0) { public boolean equals(Object arg0) {
if (arg0 == null) {
return false;
}
if (getClass().equals(arg0.getClass())) { if (getClass().equals(arg0.getClass())) {
ClassImpl other = (ClassImpl) arg0; ClassImpl other = (ClassImpl) arg0;
return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName()); return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName());

View File

@ -37,6 +37,9 @@ public class FieldImpl extends MemberImpl implements IField {
* @see com.ibm.wala.j2ee.client.impl.MemberImpl#equals(java.lang.Object) * @see com.ibm.wala.j2ee.client.impl.MemberImpl#equals(java.lang.Object)
*/ */
public boolean equals(Object arg0) { public boolean equals(Object arg0) {
if (arg0 == null) {
return false;
}
if (getClass().equals(arg0.getClass())) { if (getClass().equals(arg0.getClass())) {
FieldImpl other = (FieldImpl)arg0; FieldImpl other = (FieldImpl)arg0;
return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName()); return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName());

View File

@ -63,6 +63,9 @@ public class MethodImpl extends MemberImpl implements IMethod {
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
public boolean equals(Object arg0) { public boolean equals(Object arg0) {
if (arg0 == null) {
return false;
}
if (getClass().equals(arg0.getClass())) { if (getClass().equals(arg0.getClass())) {
MethodImpl other = (MethodImpl) arg0; MethodImpl other = (MethodImpl) arg0;
return getDeclaringClass().equals(other.getDeclaringClass()) && getClassLoaderName().equals(other.getClassLoaderName()) return getDeclaringClass().equals(other.getDeclaringClass()) && getClassLoaderName().equals(other.getClassLoaderName())