Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not overwrite putFields field in accessor #134

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates.
* Copyright (c) 1998-1999 IBM Corp. All rights reserved.
* Copyright (c) 2022 Contributors to the Eclipse Foundation. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -21,6 +22,7 @@
package com.sun.corba.ee.impl.io;

import java.io.IOException;
import java.io.NotActiveException;
import java.io.ObjectOutputStream;
import java.io.ObjectOutput;
import java.util.Map;
Expand Down Expand Up @@ -145,7 +147,9 @@ public void defaultWriteObject() throws IOException {
@Override
public ObjectOutputStream.PutField putFields()
throws IOException {
putFields = new HookPutFields();
if (putFields == null) {
putFields = new HookPutFields();
}
return putFields;
}

Expand All @@ -169,7 +173,11 @@ public void writeFields()

writeObjectState.defaultWriteObject(this);

putFields.write(this);
if (putFields != null) {
putFields.write(this);
} else {
throw new NotActiveException("no current PutField object");
}
}

abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream();
Expand Down