29
29
import org .springframework .data .mapping .model .PreferredConstructorDiscoverer ;
30
30
import org .springframework .data .projection .ProjectionFactory ;
31
31
import org .springframework .data .projection .ProjectionInformation ;
32
- import org .springframework .data .util .Lazy ;
33
32
import org .springframework .lang .NonNull ;
34
33
import org .springframework .lang .Nullable ;
35
34
import org .springframework .util .Assert ;
@@ -226,8 +225,8 @@ private static final class ReturnedClass extends ReturnedType {
226
225
227
226
private static final Set <Class <?>> VOID_TYPES = new HashSet <>(Arrays .asList (Void .class , void .class ));
228
227
229
- private final Lazy <Boolean > isDto ;
230
228
private final Class <?> type ;
229
+ private final boolean isDto ;
231
230
private final List <String > inputProperties ;
232
231
233
232
/**
@@ -245,15 +244,14 @@ public ReturnedClass(Class<?> returnedType, Class<?> domainType) {
245
244
Assert .isTrue (!returnedType .isInterface (), "Returned type must not be an interface" );
246
245
247
246
this .type = returnedType ;
248
- this .isDto = Lazy .of (() ->
249
- !Object .class .equals (type ) && //
250
- !type .isEnum () && //
251
- !isDomainSubtype () && //
252
- !isPrimitiveOrWrapper () && //
253
- !Number .class .isAssignableFrom (type ) && //
254
- !VOID_TYPES .contains (type ) && //
255
- !type .getPackage ().getName ().startsWith ("java." )
256
- );
247
+ this .isDto = !Object .class .equals (type ) && //
248
+ !type .isEnum () && //
249
+ !isDomainSubtype () && //
250
+ !isPrimitiveOrWrapper () && //
251
+ !Number .class .isAssignableFrom (type ) && //
252
+ !VOID_TYPES .contains (type ) && //
253
+ !type .getPackage ().getName ().startsWith ("java." );
254
+
257
255
this .inputProperties = detectConstructorParameterNames (returnedType );
258
256
}
259
257
@@ -305,7 +303,7 @@ private List<String> detectConstructorParameterNames(Class<?> type) {
305
303
}
306
304
307
305
private boolean isDto () {
308
- return isDto . get () ;
306
+ return isDto ;
309
307
}
310
308
311
309
private boolean isDomainSubtype () {
0 commit comments