private boolean passesPreconditions(Program program, Address address) throws Exception {

		if (!demangledNameSuccessfully()) {
			throw new DemangledException("Symbol did not demangle at address: " + address);
		}

		if (isAlreadyDemangled(program, address)) {
			return false; // not an error, but signifies that we should not continue to process
		}

		if (address.isMemoryAddress()) {
			CodeUnit codeUnit = program.getListing().getCodeUnitAt(address);
			if (codeUnit == null) {
				throw new IllegalArgumentException(
					"Address not in memory or is off-cut data/instruction: " + address);
			}
			if (codeUnit instanceof Data) {
				if (((Data) codeUnit).isDefined()) {
					throw new IllegalArgumentException("Defined data at address: " + address);
				}
			}
		}
		return true;
	}
This method assumes preconditions test has been run.
Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java