@@ -22,9 +22,6 @@ final class TypeExtendsReader {
22
22
private static final Set <String > ROUTE_TYPES = Set .of (
23
23
"io.avaje.http.api.AvajeJavalinPlugin" ,
24
24
"io.helidon.webserver.http.HttpFeature" );
25
-
26
- private static final String JAVA_LANG_OBJECT = "java.lang.Object" ;
27
- private static final String JAVA_LANG_RECORD = "java.lang.Record" ;
28
25
private final UType baseUType ;
29
26
private final TypeElement baseType ;
30
27
private final TypeExtendsInjection extendsInjection ;
@@ -203,7 +200,7 @@ private String initProvidesAspect() {
203
200
private void addSuperType (TypeElement element , TypeMirror mirror , boolean proxyBean ) {
204
201
readInterfaces (element );
205
202
final String fullName = mirror .toString ();
206
- if (! JAVA_LANG_OBJECT . equals ( fullName ) && ! JAVA_LANG_RECORD . equals (fullName )) {
203
+ if (Util . notJavaLang (fullName )) {
207
204
final String type = Util .unwrapProvider (fullName );
208
205
209
206
if (proxyBean || isPublic (element )) {
@@ -226,38 +223,36 @@ private void addSuperType(TypeElement element, TypeMirror mirror, boolean proxyB
226
223
}
227
224
228
225
private void readInterfaces (TypeElement type ) {
229
- for (final TypeMirror anInterface : type .getInterfaces ()) {
230
- if (isPublic (asElement (anInterface ))) {
231
- readInterfacesOf (anInterface );
226
+ if (Util .notJavaLang (type .getQualifiedName ().toString ())) {
227
+ for (final TypeMirror anInterface : type .getInterfaces ()) {
228
+ if (isPublic (asElement (anInterface ))) {
229
+ readInterfacesOf (anInterface );
230
+ }
232
231
}
233
232
}
234
233
}
235
234
236
235
private void readInterfacesOf (TypeMirror anInterface ) {
237
- final String rawType = Util .unwrapProvider (anInterface .toString ());
238
- final UType rawUType = Util .unwrapProvider (anInterface );
239
- if (JAVA_LANG_OBJECT .equals (rawType )) {
240
- // we can stop
241
- return ;
242
- }
243
- if (rawType .indexOf ('.' ) == -1 ) {
244
- logWarn ("skip when no package on interface " + rawType );
245
- } else if (Constants .AUTO_CLOSEABLE .equals (rawType ) || Constants .IO_CLOSEABLE .equals (rawType )) {
236
+ final String rawType = Util .unwrapProvider (anInterface .toString ());
237
+ final UType rawUType = Util .unwrapProvider (anInterface );
238
+ if (Constants .AUTO_CLOSEABLE .equals (rawType ) || Constants .IO_CLOSEABLE .equals (rawType )) {
246
239
closeable = true ;
240
+ } else if (!Util .notJavaLang (rawType )) {
241
+ // return
242
+ } else if (rawType .indexOf ('.' ) == -1 ) {
243
+ logWarn ("skip when no package on interface " + rawType );
247
244
} else {
248
245
if (qualifierName == null ) {
249
246
final String mainType = rawUType .mainType ();
250
- final String iShortName = Util .shortName (mainType );
251
- if (beanSimpleName .endsWith (iShortName )) {
247
+ final String shortName = Util .shortName (mainType );
248
+ if (beanSimpleName .endsWith (shortName )) {
252
249
// derived qualifier name based on prefix to interface short name
253
- qualifierName = beanSimpleName .substring (0 , beanSimpleName .length () - iShortName .length ());
250
+ qualifierName = beanSimpleName .substring (0 , beanSimpleName .length () - shortName .length ());
254
251
}
255
252
}
256
253
interfaceTypes .add (rawUType );
257
- if (Util .notJavaLang (rawType )) {
258
- for (final TypeMirror supertype : types ().directSupertypes (anInterface )) {
259
- readInterfacesOf (supertype );
260
- }
254
+ for (final TypeMirror supertype : types ().directSupertypes (anInterface )) {
255
+ readInterfacesOf (supertype );
261
256
}
262
257
}
263
258
}
0 commit comments