else { if (!propertyType.equals(setMethod.getParameterTypes()[0])) { String msg = "set and get methods do not share the same type";
else {     if (newPropertyType != null && !newPropertyType.isAssignableFrom( writeMethod.getParameterTypes()[0])) {  throw new IntrospectionException("read and write method are not compatible"); }  /* note: the check whether both method are defined in related classes makes sense but is not * done in the JDK. * I leave this code here in case someone at Sun decides to add that functionality in later versions (rschuster) if ((!readMethod .getDeclaringClass() .isAssignableFrom(writeMethod.getDeclaringClass())) && (!writeMethod .getDeclaringClass() .isAssignableFrom(readMethod.getDeclaringClass()))) { String msg = "set and get methods are not in the same class.";
  private void checkMethods()     throws IntrospectionException  {    if (getMethod != null) {      if (getMethod.getParameterTypes().length > 0) {	throw new IntrospectionException("get method has parameters");      }      this.propertyType = getMethod.getReturnType();      if (propertyType == Void.TYPE) {	throw new IntrospectionException("get method has void return type");      }    }    if (setMethod != null) {      if (setMethod.getParameterTypes().length != 1) {	String msg = "set method does not have exactly one parameter"; 	throw new IntrospectionException(msg);      }      if (getMethod == null) {	propertyType = setMethod.getParameterTypes()[0];      }      else {	if (!propertyType.equals(setMethod.getParameterTypes()[0])) {	  String msg = "set and get methods do not share the same type";	  throw new IntrospectionException(msg);	}	if ((!getMethod.getDeclaringClass().	     isAssignableFrom(setMethod.getDeclaringClass())) &&	    (!setMethod.getDeclaringClass().	     isAssignableFrom(getMethod.getDeclaringClass()))) {	  String msg = "set and get methods are not in the same class.";	  throw new IntrospectionException(msg);	}      }    }  }