if(getIndex != null) { if(setIndexName != null) { try {
} if(getIndex != null) { if(setIndexName != null) { try {
	private void findMethods(Class beanClass, String getMethodName, String setMethodName, String getIndexName, String setIndexName) throws IntrospectionException {		try {			if(getIndexName != null) {				try {					Class[] getArgs = new Class[1];					getArgs[0] = java.lang.Integer.TYPE;					getIndex = beanClass.getMethod(getIndexName,getArgs);					indexedPropertyType = getIndex.getReturnType();				} catch(NoSuchMethodException E) {				}			}			if(getIndex != null) {				if(setIndexName != null) {					try {						Class[] setArgs = new Class[2];						setArgs[0] = java.lang.Integer.TYPE;						setArgs[1] = indexedPropertyType;						setIndex = beanClass.getMethod(setIndexName,setArgs);						if(!setIndex.getReturnType().equals(java.lang.Void.TYPE)) {							throw new IntrospectionException(setIndexName + " has non-void return type");						}					} catch(NoSuchMethodException E) {					}				}			} else if(setIndexName != null) {				Method[] m = beanClass.getMethods();				for(int i=0;i<m.length;i++) {					Method current = m[i];					if(current.getName().equals(setIndexName)					   && current.getParameterTypes().length == 2					   && (current.getParameterTypes()[0]).equals(java.lang.Integer.TYPE)					   && current.getReturnType().equals(java.lang.Void.TYPE)) {						if(setIndex != null) {							throw new IntrospectionException("Multiple, different set methods found that fit the bill!");						} else {							setIndex = current;							indexedPropertyType = current.getParameterTypes()[1];						}					}				}				if(setIndex == null) {					throw new IntrospectionException("Cannot find get or set methods.");				}			} else {				throw new IntrospectionException("Cannot find get or set methods.");			}			Class arrayType = Array.newInstance(indexedPropertyType,0).getClass();			Class[] setArgs = new Class[1];			setArgs[0] = arrayType;			try {				setMethod = beanClass.getMethod(setMethodName,setArgs);				if(!setMethod.getReturnType().equals(java.lang.Void.TYPE)) {					setMethod = null;				}			} catch(NoSuchMethodException E) {			}			Class[] getArgs = new Class[0];			try {				getMethod = beanClass.getMethod(getMethodName,getArgs);				if(!getMethod.getReturnType().equals(arrayType)) {					getMethod = null;				}			} catch(NoSuchMethodException E) {			}		} catch(SecurityException E) {			throw new IntrospectionException("SecurityException while trying to find methods.");		}	}