Skip to content

Commit

Permalink
Reformats after prettier-java update
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Oct 10, 2023
1 parent d02af93 commit e156dce
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public SealedTypeContainer(
@Override
public boolean equals(Object obj) {
return (
obj instanceof SealedTypeContainer other &&
obj instanceof
SealedTypeContainer other &&
Objects.equals(sealedWithFinalChild, other.sealedWithFinalChild) &&
Objects.equals(sealedWithNonsealedChild, other.sealedWithNonsealedChild)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,8 @@ private void assertFieldShouldBeIgnored(
private boolean shouldAllFieldsBeUsed(FieldAccessor fieldAccessor) {
return (
!warningsToSuppress.contains(Warning.ALL_FIELDS_SHOULD_BE_USED) &&
!(
warningsToSuppress.contains(Warning.ALL_NONFINAL_FIELDS_SHOULD_BE_USED) &&
!fieldAccessor.fieldIsFinal()
)
!(warningsToSuppress.contains(Warning.ALL_NONFINAL_FIELDS_SHOULD_BE_USED) &&
!fieldAccessor.fieldIsFinal())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ private String buildMessage(Throwable e, Class<?> type, List<?> params) {
String msg = prefix;
if (hasZeros) {
msg +=
"\n If the record does not accept 0 or false as a value for its constructor parameters," +
" consider suppressing Warning.ZERO_FIELDS.";
"\n If the record does not accept 0 or false as a value for its constructor parameters," +
" consider suppressing Warning.ZERO_FIELDS.";
}
if (hasSomethingElse) {
msg +=
"\n If the record does not accept any of the given values for its constructor parameters," +
" consider providing prefab values for the types of those fields.";
"\n If the record does not accept any of the given values for its constructor parameters," +
" consider providing prefab values for the types of those fields.";
}
return msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ public boolean equals(Object obj) {
}
ThreeFieldsUsingAndOr other = (ThreeFieldsUsingAndOr) obj;
return (
Objects.equals(f, other.f) &&
Objects.equals(g, other.g) ||
(Objects.equals(f, other.f) && Objects.equals(g, other.g)) ||
Objects.equals(h, other.h)
);
}
Expand Down Expand Up @@ -300,8 +299,7 @@ public boolean equals(Object obj) {
ThreeFieldsUsingOrAnd other = (ThreeFieldsUsingOrAnd) obj;
return (
Objects.equals(f, other.f) ||
Objects.equals(g, other.g) &&
Objects.equals(h, other.h)
(Objects.equals(g, other.g) && Objects.equals(h, other.h))
);
}

Expand Down Expand Up @@ -372,10 +370,8 @@ public boolean equals(Object obj) {
FiveFieldsUsingAndsAndOrs other = (FiveFieldsUsingAndsAndOrs) obj;
return (
Objects.equals(f, other.f) ||
Objects.equals(g, other.g) &&
Objects.equals(h, other.h) ||
Objects.equals(i, other.i) &&
Objects.equals(j, other.j)
(Objects.equals(g, other.g) && Objects.equals(h, other.h)) ||
(Objects.equals(i, other.i) && Objects.equals(j, other.j))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public class TypeTagParameterizedTest<T> {
private final Map<String, List<String>> fieldWithNestedTypeParameters = null;

@SuppressWarnings("unused")
private final Map<List<Integer>, Map<List<Double>, Map<String, Float>>> fieldWithRidiculousTypeParameters =
null;
private final Map<
List<Integer>,
Map<List<Double>, Map<String, Float>>
> fieldWithRidiculousTypeParameters = null;

@SuppressWarnings({ "unused", "rawtypes" })
private final Map rawMapField = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ public boolean equals(Object obj) {
result &= Objects.equals(_Byte, other._Byte);
result &= _Char == other._Char;
result &=
_Double == null
? other._Double == null
: Double.compare(_Double, other._Double) == 0;
_Double == null ? other._Double == null : Double.compare(_Double, other._Double) == 0;
result &=
_Float == null ? other._Float == null : Float.compare(_Float, other._Float) == 0;
_Float == null ? other._Float == null : Float.compare(_Float, other._Float) == 0;
result &= Objects.equals(_Int, other._Int);
result &= Objects.equals(_Long, other._Long);
result &= Objects.equals(_Short, other._Short);
Expand Down

0 comments on commit e156dce

Please sign in to comment.