Skip to content

Commit 4e6067d

Browse files
committed
Fixing MIT copyright
1 parent 52b680c commit 4e6067d

8 files changed

Lines changed: 97 additions & 41 deletions

File tree

.claude/rules/code-conventions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,7 @@ Inside a class, the order should always be:
149149
- Inner classes (ordered by visibility then alphabetically)
150150
- Enum constants (ordered alphabetically)
151151
- Nested classes (ordered alphabetically)
152+
153+
## Javadoc
154+
155+
When Javadoc is written, use sentence structure, punctuation, and capitalization of common American English publications. This rule applies to @param, @return, @throws, and the main comment block.

.claude/rules/copyright.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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)

project.latte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2018-2025, The Lattte Project, All Rights Reserved
3-
* License: MIT (See LICENSE file in root)
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
44
*/
55
jackson5Version = "3.0.1"
66
restifyVersion = "4.2.1"

src/main/java/module-info.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
4+
*/
15
module org.lattejava.http {
26
exports org.lattejava.http;
37
exports org.lattejava.http.io;

src/test/java/module-info.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
4+
*/
15
module org.lattejava.http.tests {
26
requires jackson5;
37
requires java.net.http;

src/test/java/org/lattejava/http/tests/server/BareLineFeedHeaderTest.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
* Copyright (c) 2026, Brian Pontarelli, All Rights Reserved
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing,
11-
* software distributed under the License is distributed on an
12-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13-
* either express or implied. See the License for the specific
14-
* language governing permissions and limitations under the License.
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
154
*/
165
package org.lattejava.http.tests.server;
176

src/test/java/org/lattejava/http/tests/server/ResponseSplittingTest.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
* Copyright (c) 2026, Brian Pontarelli, All Rights Reserved
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing,
11-
* software distributed under the License is distributed on an
12-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13-
* either express or implied. See the License for the specific
14-
* language governing permissions and limitations under the License.
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
154
*/
165
package org.lattejava.http.tests.server;
176

src/test/java/org/lattejava/http/tests/server/TransferEncodingSmugglingTest.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
* Copyright (c) 2026, Brian Pontarelli, All Rights Reserved
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing,
11-
* software distributed under the License is distributed on an
12-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13-
* either express or implied. See the License for the specific
14-
* language governing permissions and limitations under the License.
2+
* Copyright (c) 2026 Latte Java
3+
* SPDX-License-Identifier: MIT
154
*/
165
package org.lattejava.http.tests.server;
176

0 commit comments

Comments
 (0)