if (getMethod != null && getMethod.getParameterTypes().length > 0) { throw new IntrospectionException("get method has parameters");
String capitalized; try { capitalized = Character.toUpperCase(name.charAt(0)) + name.substring(1); } catch(StringIndexOutOfBoundsException e) { capitalized = "";
	public IndexedPropertyDescriptor(String name, Method getMethod, Method setMethod, Method getIndex, Method setIndex) throws IntrospectionException {		super(name);		if (getMethod != null && getMethod.getParameterTypes().length > 0) {			throw new IntrospectionException("get method has parameters");		}		if (getMethod != null && setMethod.getParameterTypes().length != 1) {			throw new IntrospectionException("set method does not have exactly one parameter");		}		if (getMethod != null && setMethod != null) {			if (!getMethod.getReturnType().equals(setMethod.getParameterTypes()[0])) {				throw new IntrospectionException("set and get methods do not share the same type");			}			if (!getMethod.getDeclaringClass().isAssignableFrom(setMethod.getDeclaringClass())				&& !setMethod.getDeclaringClass().isAssignableFrom(getMethod.getDeclaringClass())) {				throw new IntrospectionException("set and get methods are not in the same class.");			}		}		if (getIndex != null && (getIndex.getParameterTypes().length != 1 || !(getIndex.getParameterTypes()[0]).equals(java.lang.Integer.TYPE))) {			throw new IntrospectionException("get index method has wrong parameters");		}		if (setIndex != null && (setIndex.getParameterTypes().length != 2 || !(setIndex.getParameterTypes()[0]).equals(java.lang.Integer.TYPE))) {			throw new IntrospectionException("set index method has wrong parameters");		}		if (getIndex != null && setIndex != null) {			if (!getIndex.getReturnType().equals(setIndex.getParameterTypes()[1])) {				throw new IntrospectionException("set index methods do not share the same type");			}			if (!getIndex.getDeclaringClass().isAssignableFrom(setIndex.getDeclaringClass())				&& !setIndex.getDeclaringClass().isAssignableFrom(getIndex.getDeclaringClass())) {				throw new IntrospectionException("get and set index methods are not in the same class.");			}		}		if (getIndex != null			&& getMethod != null			&& !getIndex.getDeclaringClass().isAssignableFrom(getMethod.getDeclaringClass())			&& !getMethod.getDeclaringClass().isAssignableFrom(getIndex.getDeclaringClass())) {			throw new IntrospectionException("methods are not in the same class.");		}		if (getIndex != null && getMethod != null && !Array.newInstance(getIndex.getReturnType(), 0).getClass().equals(getMethod.getReturnType())) {			throw new IntrospectionException("array methods do not match index methods.");		}		this.getMethod = getMethod;		this.setMethod = setMethod;		this.getIndex = getIndex;		this.setIndex = getIndex;		this.indexedPropertyType = getIndex != null ? getIndex.getReturnType() : setIndex.getParameterTypes()[1];		this.propertyType =			getMethod != null				? getMethod.getReturnType()				: (setMethod != null ? setMethod.getParameterTypes()[0] : Array.newInstance(this.indexedPropertyType, 0).getClass());	}