Skip to content

HIVE-29455: Normalize Java license headers, part 2 - license source line#6313

Open
okumin wants to merge 3 commits intoapache:masterfrom
okumin:HIVE-29455-license-source
Open

HIVE-29455: Normalize Java license headers, part 2 - license source line#6313
okumin wants to merge 3 commits intoapache:masterfrom
okumin:HIVE-29455-license-source

Conversation

@okumin
Copy link
Contributor

@okumin okumin commented Feb 11, 2026

What changes were proposed in this pull request?

Align headers with asf.header.

Why are the changes needed?

Our quality gates report a non-obvious error when a new file has a non-aligned header. See also the following ticket.

https://issues.apache.org/jira/browse/HIVE-29455

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Put the following checkstyle/checkstyle.xml, and then ran mvn checkstyle:check.

<module name="Checker">
  <!-- HIVE-29245: An incremental process to normalize headers. We will finally remove the following one -->
  <module name="RegexpHeader">
    <property name="severity" value="error"/>
    <property name="headerFile" value="${config_loc}/asf.header.incremental"/>
    <property name="fileExtensions" value="java"/>
    <property name="multiLines" value="2,4"/>
  </module>
</module>

Review instruction

This PR includes three changes.

  1. Updatge the transient expected file, i.e., asf.header.incremental
  2. Align indentes with the following command
  3. Update irregular files that violate the new asf.header.incremental

You can reproduce the second commit with the following command.

find . -path "./iceberg" -prune -o -type f -name "*.java" -print0 | \
while IFS= read -r -d '' file; do
  perl -i -pe '
    if ($. <= 11 && m{^ \* +http://www\.apache\.org/licenses/LICENSE-2\.0\n$} && !m{^ \* {5}http://www\.apache\.org/licenses/LICENSE-2\.0\n$}) {
      $_ = " *     [http://www.apache.org/licenses/LICENSE-2.0\n](http://www.apache.org/licenses/LICENSE-2.0/n)";
    }
  ' "$file"
done

This PR changes mostly only whitespaces, so you can use the -w option to make your review easier.

gh pr checkout 6313 -R apache/hive
git diff master...HEAD -w

okumin added 3 commits March 7, 2026 13:00
find . -path "./iceberg" -prune -o -type f -name "*.java" -print0 | \
while IFS= read -r -d '' file; do
  perl -i -pe '
    if ($. <= 11 && m{^ \* +http://www\.apache\.org/licenses/LICENSE-2\.0\n$} && !m{^ \* {5}http://www\.apache\.org/licenses/LICENSE-2\.0\n$}) {
      $_ = " *     http://www.apache.org/licenses/LICENSE-2.0\n";
    }
  ' "$file"
done
@okumin okumin force-pushed the HIVE-29455-license-source branch from 16e249f to 22c6399 Compare March 7, 2026 04:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

@okumin okumin changed the title [WIP] HIVE-29455: Normalize Java license headers, part 2 - license source line HIVE-29455: Normalize Java license headers, part 2 - license source line Mar 8, 2026
@okumin okumin marked this pull request as ready for review March 8, 2026 05:59
@okumin
Copy link
Contributor Author

okumin commented Mar 8, 2026

@difin PTAL when you have a chance. Please read Review instruction in the description to make it easy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants