Integrated: 8311239: GC: Remove trailing blank lines in source files

Leo Korinth lkorinth at openjdk.org
Thu Jul 13 08:57:21 UTC 2023


On Mon, 3 Jul 2023 12:03:08 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

> Remove trailing "blank" lines in source files.
> 
> I like to use global-whitespace-cleanup-mode, but I can not use it if the files are "dirty" to begin with. This fix will make more files "clean". I also considered adding a check for this in jcheck for skara, however it seems jcheck code handling hunks does not track end-of-files.
> 
> The fix removes trailing lines matching ^[[:space:]]*$ in gc owned files.
> 
> I have applied the following bash script to each file:
> 
> `find test/hotspot/jtreg/gc test/hotspot/jtreg/vmTestbase/gc src/hotspot/share/gc -type f | xargs -n 1 clean-script`
> 
> 
> #!/usr/bin/env bash
> # clean-script
> set -eu -o pipefail
> [[ -v TRACE ]] && set -o xtrace
>     
> file="$1"
> mime=$(file --brief --mime-type "$file")
> if [[ ! "$mime" =~ text/.* ]]; then
>     echo "excluding file: $file with mime: $mime";
>     exit 0;
> fi
> 
> while [[ $(tail -n 1 "$file") =~ ^[[:space:]]*$ ]]; do
>     truncate -s -1 "$file"
> done
> 
> The only non text file in the gc folders was: testcases.jar
> and "[JDK-8311240](https://bugs.openjdk.org/browse/JDK-8311240) Create testcases.jar from test case" was filed
> 
> `git diff --ignore-space-change --ignore-blank-lines master` displays no changes
> `git diff --ignore-blank-lines master` displays no changes

This pull request has now been integrated.

Changeset: bb5278d9
Author:    Leo Korinth <lkorinth at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/bb5278d98a20a98b12510e49a74839efdabafd93
Stats:     213 lines in 210 files changed: 0 ins; 213 del; 0 mod

8311239: GC: Remove trailing blank lines in source files

Reviewed-by: tschatzl, aboldtch, mli

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

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


More information about the hotspot-gc-dev mailing list