Skip to content

Commit

Permalink
common: Fix new Eclipse compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlschuetter committed Dec 8, 2023
1 parent 2c2af88 commit 70df5c5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
Expand Down Expand Up @@ -83,7 +84,7 @@ public final int value() {
* @return {@code true} iff set.
*/
public final boolean hasFlag(T flag) {
int v = flag.value();
int v = Objects.requireNonNull(flag).value();
return (this.flags & v) == v;
}

Expand All @@ -102,8 +103,9 @@ public final String toString() {
* @param other The other flag / flag set to merge.
* @return An instance combining both.
*/
@SuppressWarnings("PMD.ShortMethodName")
protected final T combineWith(T[] allFlags, T flagsNone, Constructor<T> constr, T other) {
@SuppressWarnings({"PMD.ShortMethodName", "null"})
protected final T combineWith(T[] allFlags, T flagsNone, Constructor<@NonNull T> constr,
T other) {
return resolve(allFlags, flagsNone, constr, value() | other.value());
}

Expand Down

0 comments on commit 70df5c5

Please sign in to comment.