public Reference getRef(int i) throws ClassFormatException {
		if (i == 0)
			return null;
		if (tags[i] != FIELDREF && tags[i] != METHODREF
				&& tags[i] != INTERFACEMETHODREF)
			throw new ClassFormatException("Tag mismatch");
		if (constants[i] == null) {
			int classIndex = indices1[i];
			int nameTypeIndex = indices2[i];
			if (tags[nameTypeIndex] != NAMEANDTYPE)
				throw new ClassFormatException("Tag mismatch");
			String type = getUTF8(indices2[nameTypeIndex]);
			try {
				if (tags[i] == FIELDREF)
					TypeSignature.checkTypeSig(type);
				else
					TypeSignature.checkMethodTypeSig(type);
			} catch (IllegalArgumentException ex) {
				throw new ClassFormatException(ex.getMessage());
			}
			String clName = getClassType(classIndex);
			constants[i] = Reference.getReference(clName,
					getUTF8(indices1[nameTypeIndex]), type);
		}
		return (Reference) constants[i];
	}