Skip to content

Commit

Permalink
Added missing @serial (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Nov 25, 2024
1 parent fce6057 commit 9a187c2
Show file tree
Hide file tree
Showing 116 changed files with 249 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.querydsl.codegen.utils.Evaluator;
import com.querydsl.core.util.NullSafeComparableComparator;
import java.io.Serial;
import java.io.Serializable;
import java.util.Comparator;

Expand All @@ -29,7 +30,7 @@ public class MultiComparator<T> implements Comparator<T>, Serializable {
@SuppressWarnings("unchecked")
private static final Comparator<Object> naturalOrder = new NullSafeComparableComparator();

private static final long serialVersionUID = 1121416260773566299L;
@Serial private static final long serialVersionUID = 1121416260773566299L;

private final boolean[] asc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.Visitor;
import java.io.Serial;
import java.util.Objects;
import org.jetbrains.annotations.Nullable;

Expand All @@ -38,7 +39,7 @@
*/
public final class BooleanBuilder implements Predicate, Cloneable {

private static final long serialVersionUID = -4129485177345542519L;
@Serial private static final long serialVersionUID = -4129485177345542519L;

@Nullable private Predicate predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.ValidatingVisitor;
import com.querydsl.core.util.CollectionUtils;
import java.io.Serial;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
Expand All @@ -50,7 +51,7 @@
*/
public class DefaultQueryMetadata implements QueryMetadata, Cloneable {

private static final long serialVersionUID = 317736313966701232L;
@Serial private static final long serialVersionUID = 317736313966701232L;

private boolean distinct;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.ParamExpression;
import com.querydsl.core.types.Predicate;
import java.io.Serial;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand All @@ -31,7 +32,7 @@
*/
public final class EmptyMetadata implements QueryMetadata {

private static final long serialVersionUID = 134750105981272499L;
@Serial private static final long serialVersionUID = 134750105981272499L;

public static final QueryMetadata DEFAULT = new EmptyMetadata();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Predicate;
import com.querydsl.core.util.CollectionUtils;
import java.io.Serial;
import java.io.Serializable;
import java.util.Collections;
import java.util.Objects;
Expand All @@ -31,7 +32,7 @@
@Immutable
public final class JoinExpression implements Serializable {

private static final long serialVersionUID = -1131755765747174886L;
@Serial private static final long serialVersionUID = -1131755765747174886L;

@Nullable private final Predicate condition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.querydsl.core.annotations.Immutable;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.ExpressionUtils;
import java.io.Serial;
import java.io.Serializable;

/**
Expand Down Expand Up @@ -48,7 +49,7 @@ public enum Position {
END
}

private static final long serialVersionUID = -688265393547206465L;
@Serial private static final long serialVersionUID = -688265393547206465L;

private final Expression<?> flag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
package com.querydsl.core;

import java.io.Serial;

/**
* {@code NonUniqueResultException} is thrown for query results where one result row is expected,
* but multiple are retrieved.
Expand All @@ -21,7 +23,7 @@
*/
public class NonUniqueResultException extends QueryException {

private static final long serialVersionUID = -1757423191400510323L;
@Serial private static final long serialVersionUID = -1757423191400510323L;

public NonUniqueResultException() {
super("Only one result is allowed for fetchOne calls");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
*/
package com.querydsl.core;

import java.io.Serial;

/**
* {@code QueryException} is thrown for exceptional query construction issues
*
* @author tiwe
*/
public class QueryException extends RuntimeException {

private static final long serialVersionUID = 2345665389612058703L;
@Serial private static final long serialVersionUID = 2345665389612058703L;

public QueryException(String msg) {
super(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.querydsl.core.types.Expression;
import com.querydsl.core.types.ExpressionUtils;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

Expand All @@ -25,7 +26,7 @@
*/
public class QueryFlag implements Serializable {

private static final long serialVersionUID = -7131081607441961628L;
@Serial private static final long serialVersionUID = -7131081607441961628L;

/** The different {@code QueryFlag} positions */
public enum Position {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package com.querydsl.core;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
Expand All @@ -26,7 +27,7 @@
*/
public final class QueryModifiers implements Serializable {

private static final long serialVersionUID = 2934344588433680339L;
@Serial private static final long serialVersionUID = 2934344588433680339L;

/** No limit and not offset restriction */
public static final QueryModifiers EMPTY = new QueryModifiers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package com.querydsl.core;

import java.io.Serial;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
Expand All @@ -26,7 +27,7 @@
*/
public final class QueryResults<T> implements Serializable {

private static final long serialVersionUID = -4591506147471300909L;
@Serial private static final long serialVersionUID = -4591506147471300909L;

private static final QueryResults<Object> EMPTY =
new QueryResults<>(Collections.emptyList(), Long.MAX_VALUE, 0L, 0L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.querydsl.core.types.Visitor;
import com.querydsl.core.types.dsl.DslExpression;
import com.querydsl.core.types.dsl.Expressions;
import java.io.Serial;

/**
* A base class for GroupExpressions
Expand All @@ -30,7 +31,7 @@
*/
public abstract class AbstractGroupExpression<T, R> implements GroupExpression<T, R> {

private static final long serialVersionUID = 1509709546966783160L;
@Serial private static final long serialVersionUID = 1509709546966783160L;

private final Class<? extends R> type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.querydsl.core.types.Expression;
import com.querydsl.core.util.MathUtils;
import java.io.Serial;
import java.math.BigDecimal;
import java.math.MathContext;

Expand All @@ -26,7 +27,7 @@
@SuppressWarnings("unchecked")
public class GAvg<T extends Number> extends AbstractGroupExpression<T, T> {

private static final long serialVersionUID = 3518868612387641383L;
@Serial private static final long serialVersionUID = 3518868612387641383L;

private final MathContext mathContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.querydsl.core.types.Expression;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -24,7 +25,7 @@
*/
public class GList<T> extends AbstractGroupExpression<T, List<T>> {

private static final long serialVersionUID = -5613861506383727078L;
@Serial private static final long serialVersionUID = -5613861506383727078L;

public GList(Expression<T> expr) {
super(List.class, expr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.mysema.commons.lang.Pair;
import java.io.Serial;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
Expand All @@ -31,7 +32,7 @@
public abstract class GMap<K, V, M extends Map<K, V>>
extends AbstractGroupExpression<Pair<K, V>, M> {

private static final long serialVersionUID = 7106389414200843920L;
@Serial private static final long serialVersionUID = 7106389414200843920L;

GMap(QPair<K, V> qpair) {
super(Map.class, qpair);
Expand Down Expand Up @@ -98,7 +99,7 @@ public M get() {
public static class Mixin<K, V, T, U, R extends Map<? super T, ? super U>>
extends AbstractGroupExpression<Pair<K, V>, R> {

private static final long serialVersionUID = 1939989270493531116L;
@Serial private static final long serialVersionUID = 1939989270493531116L;

private class GroupCollectorImpl implements GroupCollector<Pair<K, V>, R> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.querydsl.core.types.Expression;
import java.io.Serial;

/**
* GMax
Expand All @@ -22,7 +23,7 @@
*/
public class GMax<T extends Comparable<? super T>> extends AbstractGroupExpression<T, T> {

private static final long serialVersionUID = 3815394663181131511L;
@Serial private static final long serialVersionUID = 3815394663181131511L;

@SuppressWarnings("unchecked")
public GMax(Expression<T> expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.querydsl.core.types.Expression;
import java.io.Serial;

/**
* GMin
Expand All @@ -22,7 +23,7 @@
*/
public class GMin<T extends Comparable<? super T>> extends AbstractGroupExpression<T, T> {

private static final long serialVersionUID = 8312168556148122576L;
@Serial private static final long serialVersionUID = 8312168556148122576L;

@SuppressWarnings("unchecked")
public GMin(Expression<T> expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.querydsl.core.types.Expression;
import java.io.Serial;

/**
* GOne
Expand All @@ -22,7 +23,7 @@
*/
public class GOne<T> extends AbstractGroupExpression<T, T> {

private static final long serialVersionUID = 3518868612387641383L;
@Serial private static final long serialVersionUID = 3518868612387641383L;

@SuppressWarnings("unchecked")
public GOne(Expression<T> expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.querydsl.core.group;

import com.querydsl.core.types.Expression;
import java.io.Serial;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.Set;
Expand All @@ -28,7 +29,7 @@
*/
public abstract class GSet<T, S extends Set<T>> extends AbstractGroupExpression<T, S> {

private static final long serialVersionUID = -1575808026237160843L;
@Serial private static final long serialVersionUID = -1575808026237160843L;

public static <U> GSet<U, Set<U>> createLinked(Expression<U> expr) {
return new GSet<>(expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.querydsl.core.types.Expression;
import com.querydsl.core.util.MathUtils;
import java.io.Serial;
import java.math.BigDecimal;

/**
Expand All @@ -24,7 +25,7 @@
*/
public class GSum<T extends Number> extends AbstractGroupExpression<T, T> {

private static final long serialVersionUID = 3518868612387641383L;
@Serial private static final long serialVersionUID = 3518868612387641383L;

@SuppressWarnings("unchecked")
public GSum(Expression<T> expr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
package com.querydsl.core.group;

import java.io.Serial;

/**
* {@code MixinGroupExpression} provides nesting support for {@link GroupExpression} instances
*
Expand All @@ -22,7 +24,7 @@
*/
public class MixinGroupExpression<E, F, R> extends AbstractGroupExpression<E, R> {

private static final long serialVersionUID = -5419707469727395643L;
@Serial private static final long serialVersionUID = -5419707469727395643L;

private class GroupCollectorImpl implements GroupCollector<E, R> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.mysema.commons.lang.Pair;
import com.querydsl.core.types.ConstructorExpression;
import com.querydsl.core.types.Expression;
import java.io.Serial;

/**
* A pair of (Map) key and value
Expand All @@ -26,7 +27,7 @@
*/
public final class QPair<K, V> extends ConstructorExpression<Pair<K, V>> {

private static final long serialVersionUID = -1943990903548916056L;
@Serial private static final long serialVersionUID = -1943990903548916056L;

public static <K, V> QPair<K, V> create(Expression<K> key, Expression<V> value) {
return new QPair<>(key, value);
Expand Down
Loading

0 comments on commit 9a187c2

Please sign in to comment.