[MNG-7804] Fix broken MavenModelVersion generation (#1284)

This commit is contained in:
Guillaume Nodet 2023-10-16 15:44:33 +02:00 committed by GitHub
parent f2df54723b
commit 80a8e41540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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(

View File

@ -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