Skip to content

Commit de190d7

Browse files
Restructure code to avoid assignment expression warning. (#2833)
* Restructure code to avoid assignment expression warning.
1 parent 3d66847 commit de190d7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gson/src/main/java/com/google/gson/internal/Excluder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ private TypeAdapter<T> delegate() {
147147
// A race might lead to `delegate` being assigned by multiple threads but the last
148148
// assignment will stick
149149
TypeAdapter<T> d = delegate;
150-
return d != null ? d : (delegate = gson.getDelegateAdapter(Excluder.this, type));
150+
if (d == null) {
151+
d = delegate = gson.getDelegateAdapter(Excluder.this, type);
152+
}
153+
return d;
151154
}
152155
};
153156
}

0 commit comments

Comments
 (0)