Java Docs: use instanceof with name binding (#2087)
* Java Docs: use instanceof with name binding * remove changes in generated code * Update docs/src/test/java/jdocs/ddata/protobuf/TwoPhaseSetSerializer2.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * merge issue --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
18d7ff815a
commit
56470a4569
16 changed files with 60 additions and 76 deletions
|
|
@ -49,8 +49,8 @@ public class TwoPhaseSetSerializer2 extends AbstractSerializationSupport {
|
|||
|
||||
@Override
|
||||
public byte[] toBinary(Object obj) {
|
||||
if (obj instanceof TwoPhaseSet) {
|
||||
return twoPhaseSetToProto((TwoPhaseSet) obj).toByteArray();
|
||||
if (obj instanceof TwoPhaseSet tps) {
|
||||
return twoPhaseSetToProto(tps).toByteArray();
|
||||
} else {
|
||||
throw new IllegalArgumentException("Can't serialize object of type " + obj.getClass());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue