public void updateClassMemberStructure(Structure structure) throws CancelledException {

		// initialize by copying first structure
		if (computedClassStructure == null) {

			computedClassStructure =
				new StructureDataType(classPath, name, structure.getLength(), dataTypeManager);

			int numComponents = structure.getNumComponents();
			for (int i = 0; i < numComponents; i++) {
				DataTypeComponent component = structure.getComponent(i);
				int offset = component.getOffset();

				computedClassStructure.replaceAtOffset(offset, component.getDataType(),
					component.getDataType().getLength(), component.getFieldName(),
					component.getComment());
			}

			return;
		}

		// update initial structure using all further structures
		if (structure.getLength() > computedClassStructure.getLength()) {
			computedClassStructure.growStructure(
				structure.getLength() - computedClassStructure.getLength());
		}

		DataTypeComponent[] definedComponents = structure.getDefinedComponents();
		for (DataTypeComponent newComponent : definedComponents) {

			DataType newComponentDataType = newComponent.getDataType();

			int offset = newComponent.getOffset();

			DataTypeComponent currentComponent =
				computedClassStructure.getComponentContaining(offset);
			DataType currentComponentDataType = currentComponent.getDataType();

			if (currentComponentDataType.equals(newComponentDataType)) {
				continue;
			}

			int length = newComponentDataType.getLength();
			String fieldName = newComponent.getFieldName();
			String comment = newComponent.getComment();

			// if new component is an existing class data type pointer then replace current item
			// with a void pointer of same size if there is room
			if (newComponentDataType instanceof Pointer &&
				newComponentDataType.getName().equals(name + " *")) {

				Pointer pointer =
					new PointerDataType(VoidDataType.dataType, length, dataTypeManager);

				if (EditStructureUtils.hasEnoughUndefinedsOfAnyLengthAtOffset(
					computedClassStructure, offset, pointer.getLength(), monitor) ||
					length <= currentComponent.getLength()) {

					computedClassStructure.replaceAtOffset(offset, pointer, length, fieldName,
						comment);
				}
				continue;
			}

			// if the new component is a non-empty structure, check to see if the current
			// structure has undefined or equivalent components and replace with new struct if so
			if (newComponentDataType instanceof Structure) {
			
				// if new component is any empty placeholder structure AND if the existing component
				// is undefined then replace with undefined1 dt
				if (newComponentDataType.isNotYetDefined()) {
					if (Undefined.isUndefined(currentComponentDataType)) {
						computedClassStructure.replaceAtOffset(offset, new Undefined1DataType(), 1,
						fieldName, comment);
					}
					continue;
				}
				if (EditStructureUtils.hasReplaceableComponentsAtOffset(computedClassStructure,
					offset, (Structure)newComponentDataType, monitor)) {
					
					boolean successfulClear =
						EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset,
							length, monitor);

					if (successfulClear) {
						computedClassStructure.replaceAtOffset(offset, newComponentDataType, length,
							fieldName, comment);
					}
					continue;
				}
			}

			// if current component is undefined size 1 and new component is not undefined size 1
			// and there are enough undefineds for it to fit, then replace it
			if (EditStructureUtils.isUndefined1(currentComponentDataType) &&
				!EditStructureUtils.isUndefined1(newComponentDataType)) {
				if (EditStructureUtils.hasEnoughUndefinedsOfAnyLengthAtOffset(
					computedClassStructure,
					offset, length, monitor)) {
					boolean successfulClear =
						EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset,
							length, monitor);

					if (successfulClear) {
						computedClassStructure.replaceAtOffset(offset, newComponentDataType, length,
							fieldName, comment);
					}
				}
				continue;
			}

			// if new component is not an undefined data type and the current componenent(s)
			// that make up new component length are all undefineds then clear and replace
			// the current component(s) with the new one
			if (Undefined.isUndefined(currentComponentDataType) &&
				!Undefined.isUndefined(newComponentDataType)) {

				if (EditStructureUtils.hasEnoughUndefinedsOfAnyLengthAtOffset(
					computedClassStructure,
					offset, length, monitor)) {
					boolean successfulClear =
						EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset,
							length, monitor);

					if (successfulClear) {
						computedClassStructure.replaceAtOffset(offset, newComponentDataType, length,
							fieldName, comment);
					}
				}
			}
		}

		return;
	}
The Class that describes object oriented classes that exist in the program
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClass.java