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 ;
@@ -227,8 +226,8 @@ private static final class ReturnedClass extends ReturnedType {
227
226
228
227
private static final Set <Class <?>> VOID_TYPES = new HashSet <>(Arrays .asList (Void .class , void .class ));
229
228
230
- private final Lazy <Boolean > isDto ;
231
229
private final Class <?> type ;
230
+ private final boolean isDto ;
232
231
private final List <String > inputProperties ;
233
232
234
233
/**
@@ -246,15 +245,14 @@ public ReturnedClass(Class<?> returnedType, Class<?> domainType) {
246
245
Assert .isTrue (!returnedType .isInterface (), "Returned type must not be an interface" );
247
246
248
247
this .type = returnedType ;
249
- this .isDto = Lazy .of (() ->
250
- !Object .class .equals (type ) && //
251
- !type .isEnum () && //
252
- !isDomainSubtype () && //
253
- !isPrimitiveOrWrapper () && //
254
- !Number .class .isAssignableFrom (type ) && //
255
- !VOID_TYPES .contains (type ) && //
256
- !type .getPackage ().getName ().startsWith ("java." )
257
- );
248
+ this .isDto = !Object .class .equals (type ) && //
249
+ !type .isEnum () && //
250
+ !isDomainSubtype () && //
251
+ !isPrimitiveOrWrapper () && //
252
+ !Number .class .isAssignableFrom (type ) && //
253
+ !VOID_TYPES .contains (type ) && //
254
+ !type .getPackage ().getName ().startsWith ("java." );
255
+
258
256
this .inputProperties = detectConstructorParameterNames (returnedType );
259
257
}
260
258
@@ -306,7 +304,7 @@ private List<String> detectConstructorParameterNames(Class<?> type) {
306
304
}
307
305
308
306
private boolean isDto () {
309
- return isDto . get () ;
307
+ return isDto ;
310
308
}
311
309
312
310
private boolean isDomainSubtype () {
0 commit comments