RFR: 8256480: Refactor ObjectInputStream field reader implementation [v2]
Roger Riggs
rriggs at openjdk.java.net
Thu Nov 19 20:32:17 UTC 2020
> ObjectInputStream has nearly identical but separate implementations to read values from the stream.
> Both implementations read primitive and object values from the stream and return an object holding the values.
> OIS.readFields() uses the internal class GetFieldImpl while OIS.defaultReadObject and reading records uses the internal class FieldValues.
> The behavioral difference between the two is whether dependencies are tracked in the object handle table or not.
>
> The classes are merged, retaining the internal FieldValues name and the behavior to track dependencies or not.
> The constructor is passed the class descriptor and flag to track or not; it reads and saves the values from the stream.
> The callers are updated to call the merge FieldValues methods.
>
> There is no change in behavior; all current tests pass.
Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
Improvements as per review comments
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/1296/files
- new: https://git.openjdk.java.net/jdk/pull/1296/files/aa736f6b..a06f2f53
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1296&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1296&range=00-01
Stats: 14 lines in 1 file changed: 8 ins; 4 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/1296.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1296/head:pull/1296
PR: https://git.openjdk.java.net/jdk/pull/1296
More information about the core-libs-dev
mailing list