Polish diamond operator usage.

Closes #3620
This commit is contained in:
Tran Ngoc Nhan
2024-09-24 19:27:48 +07:00
committed by Mark Paluch
parent 9d6676c893
commit cdc91d33f6
3 changed files with 7 additions and 4 deletions

View File

@@ -65,6 +65,7 @@ import org.springframework.util.Assert;
* @author Donghun Shin
* @author Greg Turnquist
* @author Aref Behboodi
* @author Ngoc Nhan
*/
@Transactional(readOnly = true)
public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N>>
@@ -117,7 +118,7 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
Assert.notNull(id, "Identifier must not be null!");
Assert.notNull(revisionNumber, "Revision number must not be null!");
List<Object[]> singleResult = (List<Object[]>) createBaseQuery(id) //
List<Object[]> singleResult = createBaseQuery(id) //
.add(AuditEntity.revisionNumber().eq(revisionNumber)) //
.getResultList();

View File

@@ -34,6 +34,7 @@ import org.springframework.lang.Nullable;
* @author Thomas Darimont
* @author Mark Paluch
* @author Greg Turnquist
* @author Ngoc Nhan
* @param <PK> the type of the identifier.
*/
@MappedSuperclass
@@ -89,7 +90,7 @@ public abstract class AbstractPersistable<PK extends Serializable> implements Pe
AbstractPersistable<?> that = (AbstractPersistable<?>) obj;
return null == this.getId() ? false : this.getId().equals(that.getId());
return this.getId() != null && this.getId().equals(that.getId());
}
@Override

View File

@@ -37,6 +37,7 @@ import java.util.List;
* @author Christoph Strobl
* @author David Madden
* @author Jens Schauder
* @author Ngoc Nhan
*/
public class JpaSort extends Sort {
@@ -281,14 +282,14 @@ public class JpaSort extends Sort {
* @return
*/
public <P extends PluralAttribute<S, ?, U>, U> Path<S, U> dot(P attribute) {
return new Path<S, U>(add(attribute));
return new Path<>(add(attribute));
}
private List<Attribute<?, ?>> add(Attribute<?, ?> attribute) {
Assert.notNull(attribute, "Attribute must not be null");
List<Attribute<?, ?>> newAttributes = new ArrayList<Attribute<?, ?>>(attributes.size() + 1);
List<Attribute<?, ?>> newAttributes = new ArrayList<>(attributes.size() + 1);
newAttributes.addAll(attributes);
newAttributes.add(attribute);
return newAttributes;