src/main/java/me/senseiwells/arucas/utils/ArucasClassDefinitionMap.java
private void addSubclasses(AbstractClassDefinition value) {
		if (value instanceof ArucasClassDefinition || value instanceof WrapperClassDefinition) {
			// We do not want to add wrapper classes and arucas classes here
			return;
		}

		Class<?> clazz = value.getValueClass();
		Class<?> baseClazz = clazz;
		List<AbstractClassDefinition> baseSet = this.classMap.computeIfAbsent(clazz, (v) -> new ArrayList<>());
		boolean isEmpty = baseSet.isEmpty();
		baseSet.add(0, value);

		if (clazz != null) {
			if (isEmpty) {
				while (clazz != null && clazz != Object.class) {
					clazz = clazz.getSuperclass();

					List<AbstractClassDefinition> childList = this.classMap.get(clazz);
					if (childList != null) {
						baseSet.addAll(childList);
						break;
					}
				}
			}

			for (Class<?> key : this.classMap.keySet()) {
				if (key != null && baseClazz.isAssignableFrom(key) && baseClazz != key) {
					List<AbstractClassDefinition> childList = this.classMap.get(key);

					if (childList != null) {
						int classIndex = this.getClassIndex(baseClazz, childList);
						childList.add(classIndex, value);
					}
				}
			}
		}

		this.merge();
	}
/**
	 * This method adds the class definition value to all of its subclasses.
	 */
This method adds the class definition value to all of its subclasses.
This method adds the class definition value to all of its subclasses .
private void addSubclasses(AbstractClassDefinition value) {
		if (value instanceof ArucasClassDefinition || value instanceof WrapperClassDefinition) {
			return;
		}
		Class<?> clazz = value.getValueClass();
		Class<?> baseClazz = clazz;
		List<AbstractClassDefinition> baseSet = this.classMap.computeIfAbsent(clazz, (v) -> new ArrayList<>());
		boolean isEmpty = baseSet.isEmpty();
		baseSet.add(0, value);
		if (clazz != null) {
			if (isEmpty) {
				while (clazz != null && clazz != Object.class) {
					clazz = clazz.getSuperclass();
					List<AbstractClassDefinition> childList = this.classMap.get(clazz);
					if (childList != null) {
						baseSet.addAll(childList);
						break;
					}
				}
			}
			for (Class<?> key : this.classMap.keySet()) {
				if (key != null && baseClazz.isAssignableFrom(key) && baseClazz != key) {
					List<AbstractClassDefinition> childList = this.classMap.get(key);
					if (childList != null) {
						int classIndex = this.getClassIndex(baseClazz, childList);
						childList.add(classIndex, value);
					}
				}
			}
		}
		this.merge();
	}
private void addSubclasses ( AbstractClassDefinition value ) { if ( value instanceof ArucasClassDefinition || value instanceof WrapperClassDefinition ) { return ; } Class < ? > clazz = value . getValueClass ( ) ; Class < ? > baseClazz = clazz ; List < AbstractClassDefinition > baseSet = this . classMap . computeIfAbsent ( clazz , ( v ) -> new ArrayList < > ( ) ) ; boolean isEmpty = baseSet . isEmpty ( ) ; baseSet . add ( 0 , value ) ; if ( clazz != null ) { if ( isEmpty ) { while ( clazz != null && clazz != Object . class ) { clazz = clazz . getSuperclass ( ) ; List < AbstractClassDefinition > childList = this . classMap . get ( clazz ) ; if ( childList != null ) { baseSet . addAll ( childList ) ; break ; } } } for ( Class < ? > key : this . classMap . keySet ( ) ) { if ( key != null && baseClazz . isAssignableFrom ( key ) && baseClazz != key ) { List < AbstractClassDefinition > childList = this . classMap . get ( key ) ; if ( childList != null ) { int classIndex = this . getClassIndex ( baseClazz , childList ) ; childList . add ( classIndex , value ) ; } } } } this . merge ( ) ; }
This method adds the class definition value to all of its subclasses.
This method adds the class definition value to all of its subclasses .
// We do not want to add wrapper classes and arucas classes here