RFR: 8212961: [TESTBUG] vmTestbase/nsk/stress/jni/ native code cleanup

David Holmes dholmes at openjdk.java.net
Thu Jul 22 22:53:19 UTC 2021


Please review what is primarily a code style cleanup with some old native code:

- add spaces around operators and after commas
- fixed indent and line breaks
- added braces to blocks
- replaced raw malloc with c_malloc (check malloc)
- fixed CE macro using and exception processing in general
  - added different CHECK macro for monitor enter/exit
  - removed some unreachable explicit exception checking code

I staged this as multiple commits to try and make the changes more obvious at each step (and if you hide whitespace changes it simplifies quite a bit), but it may be easier to just look at the end results and see if anything jumps out as still needing changing.

Note: there was no attempt to actually change the logic of any test or rewrite them in a better way - that is out of scope for the cleanup. The only logic changes relates to the CE macro and exception/error checking.

Testing:
- local running of the tests themselves
- tier5 testing in our CI system (in progress).

This may be of interest to @iignatev  and @lmesnik .

Thanks,
David

-------------

Commit messages:
 - - final misc cleanups: more missing spaces around operators
 - - Fixed the exception logic to restore original
 - - really fixed incorrectly added spaces
 - - fixed incorrectly added spaces
 - - step 7: add spaces after commas
 - - fixed incorrectly added spaces
 - - step 6: Fix up exception processing
 - - step 5: add missing braces
 - - step 4: replace malloc with c_malloc
 - - step 3: use CE macros from jnihelper.h
 - ... and 2 more: https://git.openjdk.java.net/jdk/compare/1eeb1791...64ae394c

Changes: https://git.openjdk.java.net/jdk/pull/4882/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4882&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8212961
  Stats: 780 lines in 8 files changed: 114 ins; 127 del; 539 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4882.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4882/head:pull/4882

PR: https://git.openjdk.java.net/jdk/pull/4882


More information about the hotspot-runtime-dev mailing list