|
4 | 4 | */ |
5 | 5 | package org.hibernate.processor.util; |
6 | 6 |
|
| 7 | +import jakarta.persistence.AccessType; |
7 | 8 | import org.checkerframework.checker.nullness.qual.Nullable; |
8 | 9 | import org.hibernate.processor.Context; |
9 | 10 | import org.hibernate.processor.MetaModelGenerationException; |
|
29 | 30 | import javax.lang.model.util.Elements; |
30 | 31 | import javax.lang.model.util.SimpleTypeVisitor8; |
31 | 32 | import javax.tools.Diagnostic; |
32 | | - |
33 | | -import jakarta.persistence.AccessType; |
34 | | - |
35 | | -import java.util.Arrays; |
36 | 33 | import java.util.HashMap; |
37 | 34 | import java.util.HashSet; |
38 | 35 | import java.util.List; |
39 | 36 | import java.util.Map; |
40 | 37 | import java.util.Set; |
41 | 38 | import java.util.function.Function; |
42 | | -import java.util.stream.Collectors; |
43 | 39 |
|
44 | 40 | import static java.beans.Introspector.decapitalize; |
45 | 41 | import static org.hibernate.processor.util.AccessTypeInformation.DEFAULT_ACCESS_TYPE; |
@@ -675,13 +671,14 @@ public static boolean isMemberType(Element element) { |
675 | 671 | } |
676 | 672 |
|
677 | 673 | public static String getGeneratedClassFullyQualifiedName(TypeElement element, String packageName, boolean jakartaDataStyle) { |
678 | | - final String packageNamePrefix = !packageName.isEmpty() ? packageName + "." : ""; |
679 | | - final String className = Arrays.stream( |
680 | | - element.getQualifiedName().toString().substring( packageNamePrefix.length() ).split( "\\." ) ) |
681 | | - .map( StringUtil::removeDollar ) |
682 | | - .map( part -> jakartaDataStyle ? '_' + part : part + '_' ) |
683 | | - .collect( Collectors.joining( "." ) ); |
684 | | - return packageNamePrefix + className; |
| 674 | + final StringBuilder builder = new StringBuilder( !packageName.isEmpty() ? packageName + "." : "" ); |
| 675 | + final int length = builder.length(); |
| 676 | + for ( String s : element.getQualifiedName().toString() |
| 677 | + .substring( length ).split( "\\." ) ) { |
| 678 | + String part = StringUtil.removeDollar( s ); |
| 679 | + builder.append( jakartaDataStyle ? '_' + part : part + '_' ); |
| 680 | + } |
| 681 | + return builder.toString(); |
685 | 682 | } |
686 | 683 |
|
687 | 684 | static class EmbeddedAttributeVisitor extends SimpleTypeVisitor8<@Nullable TypeElement, Element> { |
|
0 commit comments