|
| 1 | +--- |
| 2 | +paths: |
| 3 | + - "**/*.java" |
| 4 | + - project.latte |
| 5 | +--- |
| 6 | + |
| 7 | +# Copyright Header |
| 8 | + |
| 9 | +Every Java file — including `module-info.java` — starts with the SPDX-tagged copyright header as the very first thing in the file (before the `package` or `module` declaration). No blank line above it. |
| 10 | + |
| 11 | +## The header |
| 12 | + |
| 13 | +```java |
| 14 | +/* |
| 15 | + * Copyright (c) <year> Latte Java |
| 16 | + * SPDX-License-Identifier: MIT |
| 17 | + */ |
| 18 | +``` |
| 19 | + |
| 20 | +That is the only accepted form in this project. Do not invent variants — no prose paraphrases, no "see LICENSE for details" line, no `All Rights Reserved`, no Javadoc-style `/** */`. |
| 21 | + |
| 22 | +## Why this exact form |
| 23 | + |
| 24 | +- **SPDX is the modern, machine-readable standard.** The `SPDX-License-Identifier:` tag is defined by the SPDX spec and is the form authoritative compliance tooling (FOSSA, REUSE, `licensee`, GitHub's license detector) parses directly. No prose is needed alongside it. |
| 25 | +- **No `All Rights Reserved`.** The phrase contradicts the MIT grant (which gives everyone broad rights), creates legal ambiguity, and is a vestige of pre-1989 copyright treaty law that's no longer required. Microsoft removed it from VS Code's headers in 2019; the OpenStack Legal FAQ, Liferay, and Šuklje's widely-cited "How and why to properly write copyright statements in your code" all recommend against it. The canonical MIT license text on opensource.org omits it. |
| 26 | +- **Block comment, not Javadoc.** `/* */` keeps legal boilerplate out of generated API docs. `/** */` is for API documentation only. |
| 27 | + |
| 28 | +The MIT license itself does not mandate any per-file header — the only hard requirement is reproducing the full license text "in all copies or substantial portions of the Software," satisfied by `LICENSE` at the repo root. The SPDX header is an unambiguous convention layered on top. |
| 29 | + |
| 30 | +## Copyright line format |
| 31 | + |
| 32 | +``` |
| 33 | +Copyright (c) <year> Latte Java |
| 34 | +``` |
| 35 | + |
| 36 | +- `(c)` lowercase in parens. Don't use `©` — keep it ASCII. |
| 37 | +- No comma between year and holder. (The canonical MIT text has no comma.) |
| 38 | +- Holder is always exactly `Latte Java`. |
| 39 | + |
| 40 | +## Year handling |
| 41 | + |
| 42 | +- New file: single year — `Copyright (c) 2026 Latte Java`. |
| 43 | +- File modified in a later year than it was created: extend to a range — `Copyright (c) 2025-2026 Latte Java`. Bump the upper bound on substantive changes, not whitespace edits. Don't list years individually. |
| 44 | + |
| 45 | +## Placement |
| 46 | + |
| 47 | +```java |
| 48 | +/* |
| 49 | + * Copyright (c) 2026 Latte Java |
| 50 | + * SPDX-License-Identifier: MIT |
| 51 | + */ |
| 52 | +package org.lattejava.json; |
| 53 | + |
| 54 | +import module java.base; |
| 55 | + |
| 56 | +/** |
| 57 | + * Class-level Javadoc — separate block, not part of the file header. |
| 58 | + * |
| 59 | + * @author ... |
| 60 | + */ |
| 61 | +public class Example { |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +The file header is not the class Javadoc. They are distinct blocks separated by the `package` declaration and imports. `module-info.java` follows the same pattern — file header at the top, then the `module` declaration. |
| 66 | + |
| 67 | +## Upstream files |
| 68 | + |
| 69 | +Some files in this project are from upstream projects such as `FusionAuth/java-http`. These files *MUST* retain the Copyright Header that explicitly states they are Apache 2.0 licensed and from FusionAuth or Inversoft. |
| 70 | + |
| 71 | +## Sources |
| 72 | + |
| 73 | +- [opensource.org — MIT License canonical text](https://opensource.org/license/MIT) |
| 74 | +- [SPDX — Using SPDX short identifiers in source files](https://spdx.github.io/spdx-spec/v2.3/using-SPDX-short-identifiers-in-source-files/) |
| 75 | +- [Choose a License — MIT](https://choosealicense.com/licenses/mit/) |
| 76 | +- [Matija Šuklje — How and why to properly write copyright statements in your code](https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code) |
| 77 | +- [microsoft/vscode#96747 — Remove "All rights reserved" from copyright headers](https://github.com/microsoft/vscode/issues/96747) |
0 commit comments