From d87e8a387fe4af9dd2befa291adc7ba80f8c9116 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 2 Aug 2021 09:32:15 +0200 Subject: [PATCH] HHH-14768 Fix recursive type variable rendering --- .../jpamodelgen/util/TypeRenderingVisitor.java | 6 +++++- .../CollectionAsBasicTypeTest.java | 7 +++++++ .../test/collectionbasictype/EnumHolder.java | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/EnumHolder.java diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/util/TypeRenderingVisitor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/util/TypeRenderingVisitor.java index 5652b37991..8654c95d84 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/util/TypeRenderingVisitor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/util/TypeRenderingVisitor.java @@ -6,7 +6,9 @@ */ package org.hibernate.jpamodelgen.util; +import java.util.HashSet; import java.util.List; +import java.util.Set; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeParameterElement; @@ -30,6 +32,7 @@ import javax.lang.model.util.SimpleTypeVisitor8; public final class TypeRenderingVisitor extends SimpleTypeVisitor8 { private final StringBuilder sb = new StringBuilder(); + private final Set visitedTypeVariables = new HashSet<>(); private TypeRenderingVisitor() { } @@ -129,9 +132,10 @@ public final class TypeRenderingVisitor extends SimpleTypeVisitor8> E getMyEnum() { + return null; + } +}