RFR: 8308252: Refactor line-by-line file reading code [v5]

Ioi Lam iklam at openjdk.org
Wed May 24 04:49:20 UTC 2023


> I extracted the `get_line()` code from `CompileReplay` and put it in a utility class so that it can be used by `ClassListParser` as well. A few notable changes:
> 
> - Simplified the API
> - Changed the buffer size to a size_t
> - Added size overflow and OOM checks
> - Brought over the `fdopen` logic from `ClassListParser` for handling long path names on Windows. (I don't know how valid this is nowadays, but I don't want to drop it in a refactoring PR).

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  Avoid changing behavior in a refactoring PR - removed _max_buffer_length and reverted to getc()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/14025/files
  - new: https://git.openjdk.org/jdk/pull/14025/files/6530758a..b8a0f31e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14025&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14025&range=03-04

  Stats: 46 lines in 2 files changed: 9 ins; 25 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/14025.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14025/head:pull/14025

PR: https://git.openjdk.org/jdk/pull/14025


More information about the hotspot-dev mailing list