From 425a38b5c13c1103f7f4042678aa5c4d88188c7d Mon Sep 17 00:00:00 2001 From: luxbe Date: Thu, 21 Nov 2024 09:43:46 +0100 Subject: [PATCH] [Bug #285] format code properly --- .../kbss/jopa/proxy/lazy/LazyLoadingProxyFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jopa-impl/src/main/java/cz/cvut/kbss/jopa/proxy/lazy/LazyLoadingProxyFactory.java b/jopa-impl/src/main/java/cz/cvut/kbss/jopa/proxy/lazy/LazyLoadingProxyFactory.java index 855abfa2e..07acf568a 100644 --- a/jopa-impl/src/main/java/cz/cvut/kbss/jopa/proxy/lazy/LazyLoadingProxyFactory.java +++ b/jopa-impl/src/main/java/cz/cvut/kbss/jopa/proxy/lazy/LazyLoadingProxyFactory.java @@ -62,10 +62,9 @@ public Object createProxy(T entity, FieldSpecification fieldSp return new LazyLoadingMapProxy<>(entity, (FieldSpecification) fieldSpec, uow); } else if (Collection.class.isAssignableFrom(type)) { CollectionType collectionType; - assert fieldSpec instanceof PluralAttribute || fieldSpec instanceof PluralQueryAttribute; + assert fieldSpec instanceof PluralAttribute || fieldSpec instanceof PluralQueryAttribute; - if(fieldSpec instanceof PluralAttribute) { - final PluralAttribute pa = (PluralAttribute) fieldSpec; + if (fieldSpec instanceof PluralAttribute pa) { collectionType = pa.getCollectionType(); } else { final PluralQueryAttribute pa = (PluralQueryAttribute) fieldSpec; @@ -77,10 +76,11 @@ public Object createProxy(T entity, FieldSpecification fieldSp case SET, COLLECTION -> new LazyLoadingSetProxy<>(entity, (FieldSpecification) fieldSpec, uow); default -> throw new IllegalArgumentException("Unsupported collection type for lazy proxying."); }; - }else if (uow.getMetamodel().isEntityType(type)) { + } else if (uow.getMetamodel().isEntityType(type)) { try { final Class proxyType = uow.getMetamodel().getLazyLoadingProxy(type); - final LazyLoadingEntityProxy proxy = (LazyLoadingEntityProxy) proxyType.getDeclaredConstructor().newInstance(); + final LazyLoadingEntityProxy proxy = (LazyLoadingEntityProxy) proxyType.getDeclaredConstructor() + .newInstance(); proxy.setOwner(entity); proxy.setPersistenceContext(uow); proxy.setFieldSpec(fieldSpec);