diff --git a/maven-model/src/test/java/org/apache/maven/model/v4/MavenModelVersionTest.java b/maven-model/src/test/java/org/apache/maven/model/v4/MavenModelVersionTest.java index e65a70ec52..371561fe04 100644 --- a/maven-model/src/test/java/org/apache/maven/model/v4/MavenModelVersionTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/v4/MavenModelVersionTest.java @@ -65,7 +65,7 @@ class MavenModelVersionTest { } @Test - void testV4V4ModelPriority() { + void testV4ModelPriority() { Model m = model.withBuild(Build.newInstance() .withPlugins(Collections.singleton(Plugin.newInstance() .withExecutions(Collections.singleton( diff --git a/src/mdo/model-version.vm b/src/mdo/model-version.vm index 709b9a8989..0fcca232e4 100644 --- a/src/mdo/model-version.vm +++ b/src/mdo/model-version.vm @@ -123,6 +123,15 @@ public class ${className} { #end #end #end + #if ( $class.superClass ) + #if ( $classToFields.containsKey( $model.getClass( $class.superClass, $class.versionRange ) ) ) + #set ( $fields = $classToFields.get( $class ) ) + #if ( ! $fields ) + #set ( $fields = $LinkedHashSet.newInstance() ) + #set ( $dummy = $classToFields.put( $class, $fields ) ) + #end + #end + #end #end #end #foreach ( $class in $classToFields.keySet() ) @@ -131,7 +140,7 @@ public class ${className} { return ${var} != null && ( #set ( $pfx = " " ) #if ( $class.superClass ) - #if ( $classToFields.containsKey( $model.getClass( $class.superClass, $version ) ) ) + #if ( $classToFields.containsKey( $model.getClass( $class.superClass, $class.versionRange ) ) ) $pfx is_${v}((${class.superClass}) ${var}) #set ( $pfx = "||" ) #end