Is this a bug in the check for mixed inheritence? (Hibernate 6.5)

I am not clear if Hibernate supports mixed inheritence stratgies. I was looking at the source code I checked out class AnnotationBinder. There is see the following method that gets called when resolving the “inheritence state” for each of the entity class:

	private static void logMixedInheritance(XClass clazz, InheritanceState superclassState, InheritanceState state) {
		if ( state.getType() != null && superclassState.getType() != null ) {
			final boolean nonDefault = InheritanceType.SINGLE_TABLE != state.getType();
			final boolean mixingStrategy = state.getType() != superclassState.getType();
			if ( nonDefault && mixingStrategy ) {
				throw new AnnotationException( "Entity '" + clazz.getName()
						+ "' may not override the inheritance mapping strategy '" + superclassState.getType()
						+ "' of its hierarchy"
						+ "' (each entity hierarchy has a single inheritance mapping strategy)" );

Based on the exception message, it seems like Hibernate does not support mixed inheritance strategies.
However, if that’s the case, shouldn’t the exception be thrown if just mixingStrategy is yields true? I am not sure if I understand the relevance of nonDefault here.

Is this a bug or am I misunderstanding something?

Hibernate, nor JPA for that matter, explicitly does not support mixing inheritance strategies. The check is done because by default, if no @Inheritance annotation is used to explicitly set the strategy, SINGLE_TABLE is selected.

Now, this might be a problem if a subtype of an inheritance hierarchy which is configured as either JOINED or TABLE_PER_CLASS is explicitly annotated @Inheritance( strategy = InheritanceType.SINGLE_TABLE ) and we do not throw the exception. Is this your case? If so, I would say this is a bug, yeah, so please create an issue in the issue tracker and ideally attach a test case that reproduces the problematic behavior.