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

Add missing copyright headers to Java source files #528

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

Azquelt
Copy link
Contributor

@Azquelt Azquelt commented Jan 17, 2024

The copyright owner and date for each header was generated by finding the original author and date from the git history.

Add the apache RAT plugin to verify that all java files have an appropriate header.

For #525

Copyright owner and date was generated by finding the original author
and date from the git history.
@Ladicek
Copy link
Contributor

Ladicek commented Jan 18, 2024

Impressive! To verify, I did the following:

mvn -pl . -fn org.apache.rat:apache-rat-plugin:0.16:check -Drat.excludeSubprojects=false`

for F in $(grep -h ????? target/rat.txt | grep \\.java | sed -e 's| !????? ||') ; do
  data=$(git log --format="%ae %as" $F | tail -1)

  if [[ $data =~ redhat || $data =~ starksm ]] ; then
    company="Red Hat, Inc."
  elif [[ $data =~ ibm ]] ; then
    company="IBM Corp."
  else
    exit 1
  fi
  
  year=$(echo $data | cut -d ' ' -f 2 | cut -d '-' -f 1)
  
  cat > tmp.txt <<EOF
/*
 * Copyright $year, $company, and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
EOF
  cat $F >> tmp.txt
  mv tmp.txt $F
done 

Then, I committed the changes, exported a diff and compared with the diff from this PR. No difference between my commit and the commit in this PR (except the obvious difference in the commit header).

@Azquelt
Copy link
Contributor Author

Azquelt commented Jan 18, 2024

Nice! That is somewhat neater than my script and serves as a good indication that the results are good.

@Emily-Jiang
Copy link
Contributor

hmm. I thought in this week's call, we agreed to use :
Copyright $year, Eclipse Foundation and individual contributors
instead of using a particular company. @Azquelt @Ladicek @manovotn please comment.

@Azquelt
Copy link
Contributor Author

Azquelt commented Jan 19, 2024

I don't think we agreed anything, we suggested we could change to a more generic copyright header.

If we do decide to change it, we can still do that, but that doesn't stop us merging this to add the headers following the current scheme. This is probably better discussed on the issue.

@manovotn
Copy link
Contributor

hmm. I thought in this week's call, we agreed to use :
Copyright $year, Eclipse Foundation and individual contributors
instead of using a particular company. @Azquelt @Ladicek @manovotn please comment.

These are older files, not new ones. We therefore cannot claim the eclipse contributor variant and instead attribute it to the commiter's respective company

Copy link
Contributor

@Emily-Jiang Emily-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the comments, I think we are better off to use the copyright statement of:

Copyright , Eclipse Foundation and individual contributors

@Azquelt
Copy link
Contributor Author

Azquelt commented Jan 19, 2024

As mentioned in the comments, I think we are better off to use the copyright statement of:

Copyright , Eclipse Foundation and individual contributors

I think that statement would be wrong. The eclipse foundation does not own the copyright on any of the code.

Note that the Jakarta Data header says

Copyright (c) {year} Contributors to the Eclipse Foundation

Stating that the copyright belongs to the contributors, not to the Eclipse Foundation itself.

In this case I'm not sure whether even that would be correct, as the original authors did not make their contribution to the Eclipse Foundation since it wasn't the owner of this project at the time.

@Ladicek
Copy link
Contributor

Ladicek commented Jan 19, 2024

I disagree. This PR fills a gap that has existed for several years and does it consistently with existing code, which seems best considering the apparent importance.

We can always simplify later.

@Emily-Jiang
Copy link
Contributor

Emily-Jiang commented Jan 19, 2024

As mentioned in the comments, I think we are better off to use the copyright statement of:
Copyright , Eclipse Foundation and individual contributors

I think that statement would be wrong. The eclipse foundation does not own the copyright on any of the code.

Note that the Jakarta Data header says

Copyright (c) {year} Contributors to the Eclipse Foundation

Stating that the copyright belongs to the contributors, not to the Eclipse Foundation itself.

In this case I'm not sure whether even that would be correct, as the original authors did not make their contribution to the Eclipse Foundation since it wasn't the owner of this project at the time.

The projects are under Eclipse Foundation though. I prefer something universal. I looked at the MicroProfile files, they use
"Copyright (c) <year> Contributors to the Eclipse Foundation"

@Emily-Jiang Emily-Jiang self-requested a review January 22, 2024 11:43
@Emily-Jiang
Copy link
Contributor

I think I have expressed my opinion clearly. For Red Hat contributions, obviously the contributors have choose to use the copyright header to Red Hat, which is fine. I suggest for the contributors otherwise Red Hat are free to use contributors to Eclipse Foundation for easier maintenance.

@Emily-Jiang Emily-Jiang dismissed their stale review January 22, 2024 11:45

as per my explanation

@Emily-Jiang Emily-Jiang merged commit ce3e932 into jakartaee:master Jan 30, 2024
4 checks passed
@Ladicek Ladicek added this to the CDI 4.1 milestone Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants