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

8263320: [test] Add Object Stream Formatter to work with test utility HexPrinter #2900

Closed

Conversation

RogerRiggs
Copy link
Contributor

@RogerRiggs RogerRiggs commented Mar 9, 2021

ObjectStreamPrinter is a Formatter plugin to the test library HexPrinter.

A binary stream of serialized java objects is converted into a textual form by parsing the header, typecodes, and interpreting the stream contents. The formatter can be used standalone or with the HexPrinter to align the formatted stream with the corresponding hexadecimal bytes.

StreamDump is a test utility to pass the contents of a file to the HexPrinter utility. The format of the file is guessed from the encoding and initial bytes. ASN.1 and serialized object streams are supported.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263320: [test] Add Object Stream Formatter to work with test utility HexPrinter

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/2900/head:pull/2900
$ git checkout pull/2900

To update a local copy of the PR:
$ git checkout pull/2900
$ git pull https://git.openjdk.java.net/jdk pull/2900/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 9, 2021

👋 Welcome back rriggs! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 9, 2021
@openjdk
Copy link

openjdk bot commented Mar 9, 2021

@RogerRiggs The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Mar 9, 2021
@RogerRiggs
Copy link
Contributor Author

RogerRiggs commented Mar 9, 2021

The idea is to provide a fairly literal interpretation of the stream contents with annotations to make it easy to read and understand the nesting, object handle assignments, internal references, class descriptors, and block data usage.

A Hashmap with three key/value pairs is formatted:

    Map<String, String> map = new HashMap<>();
    map.put("1", "One");
    map.put("2", "Two");
    map.put("2.2", "Two");
0000: ac ed 00 05                                      // ObjectStream Version: 5
0004:             73 72 00 11 6a 61 76 61 2e 75 74 69  // READ CLASSDESC #0 java.util.HashMap
0010: 6c 2e 48 61 73 68 4d 61 70                       // 
0019:                            05 07 da c1 c3 16 60  //   svid: 362498820763181265L
0020: d1                                               // 
0021:    03                                            //   flags: WRITE_OBJECT, SERIALIZABLE
0022:       00 02                                      //   2 field(s) {
0024:             46 00 0a 6c 6f 61 64 46 61 63 74 6f  //     F loadFactor float; 
0030: 72                                               // 
0031:    49 00 09 74 68 72 65 73 68 6f 6c 64           //     I threshold int; 
003d:                                        78        //   } ENDBLOCK; 
003e:                                           70     //   Super: NULL; 
003f:                                                  // OBJ #1 java.util.HashMap 
003f:                                              3f  //   loadFactor:0.75 
0040: 40 00 00                                         // 
0043:          00 00 00 0c                             //   threshold:12 
0047:                                                  //   CustomData: 
0047:                      77 08 00 00 00 10 00 00 00  //     BLOCKDATA 8[ ........]; 
0050: 03                                               // 
0051:    74 00 01 31                                   //     STRING #2 "1" 
0055:                74 00 03 4f 6e 65                 //     STRING #3 "One" 
005b:                                  74 00 01 32     //     STRING #4 "2" 
005f:                                              74  //     STRING #5 "Two" 
0060: 00 03 54 77 6f                                   // 
0065:                74 00 03 32 2e 32                 //     STRING #6 "2.2" 
006b:                                  71 00 7e 00 05  //     REF #5 Two 
0070: 78                                               //     ENDBLOCK; 

The tests include a number of other examples.

@mlbridge
Copy link

mlbridge bot commented Mar 9, 2021

Webrevs

@openjdk
Copy link

openjdk bot commented Mar 18, 2021

@RogerRiggs This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8263320: [test] Add Object Stream Formatter to work with test utility HexPrinter

Reviewed-by: chegar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 143 new commits pushed to the master branch:

  • e333b6e: 8246494: introduce vm.flagless at-requires property
  • 8c8d1b3: 8263495: Gather liveness info in the mark phase of G1 full gc
  • a85dc55: 8263311: Watch registry changes for remote printers update instead of polling
  • 3f31a6b: 8263775: C2: igv_print() crash unexpectedly when called from debugger
  • 63eae8f: 8260605: Various java.lang.invoke cleanups
  • 9cd21b6: 8263590: Rawtypes warnings should be produced for pattern matching in instanceof
  • ff52f29: 8260716: Assert in MacroAssembler::clear_mem with -XX:-IdealizeClearArrayNode
  • 72b82fd: 8263725: JFR oldobject tests are not run when GCs are specified explicitly
  • 444a80b: 8263455: NMT: assert on registering a region which completely engulfs an existing region
  • 2b93ae0: 8261480: MetaspaceShared::preload_and_dump should check exceptions
  • ... and 133 more: https://git.openjdk.java.net/jdk/compare/b7f0b3fc8b556b352fd7593ca674ab8e562c709a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 18, 2021
@RogerRiggs
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Mar 18, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 18, 2021
@openjdk
Copy link

openjdk bot commented Mar 18, 2021

@RogerRiggs Since your change was applied there have been 150 commits pushed to the master branch:

  • fa0f161: 8263742: (bf) MappedByteBuffer.force() should use the capacity as its upper bound
  • c82a673: 8262001: java/lang/management/ThreadMXBean/ResetPeakThreadCount.java failed with "RuntimeException: Current Peak = 14 Expected to be == previous peak = 7 + 8"
  • 01ddf3d: 8263622: The java.awt.color.ICC_Profile#setData invert the order of bytes for the "head" tag
  • e34f766: 8252723: Run stack016.java also with C2-only
  • 2173fed: 8263439: getSupportedAttributeValues() throws NPE for Finishings attribute
  • e543a50: 8261352: Create implementation for component peer for all the components who should be ignored in a11y interactions
  • 21db0f6: 8263659: Reflow GTestResultParser for better readability
  • e333b6e: 8246494: introduce vm.flagless at-requires property
  • 8c8d1b3: 8263495: Gather liveness info in the mark phase of G1 full gc
  • a85dc55: 8263311: Watch registry changes for remote printers update instead of polling
  • ... and 140 more: https://git.openjdk.java.net/jdk/compare/b7f0b3fc8b556b352fd7593ca674ab8e562c709a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 788e30c.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@RogerRiggs RogerRiggs deleted the 8263320-object-stream-print branch March 22, 2021 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
2 participants