Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Case sensitive Java type annotations

Open
#1,974 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Start by reproducing the formatting of the Java snippet with Spotless 2.38.0 under Maven 3.8, then trace the hardcoded type-annotation matching used by the formatter. Done means annotations differing only by case, such as Checker Framework @min and Jakarta Validation @Min, are not treated as the same annotation and the shown examples format consistently.

Written by the indexing model from the issue text.

Description

enhancement

We are running Spotless 2.38.0 with Maven 3.8 to format Java and its annotations. Since currently hardcoded list of type annotations doesn't have fully qualified names I think annotations should be matched by case sensitive check.

Case in point, @min annotation from Checker Framework and @Min(X) annotation from Jakarta Validation are two different annotations.

Consider such code:

  @NotNull
  @Min(60)
  @Max(86400)
  public long getExpiration() {
    return super.getExpiration();
  }

Current behaviour results in @Min annotation moved inline with @NotNull and @Max left alone. What's more interesting (and could be related), is that @NotNull and @Min is never moved inline with public long even if I completely remove @Max.

  @NotNull @Min(60)
  @Max(86400)
  public long getExpiration() {
    return super.getExpiration();
  }

Of source, checking by fully qualified names would be even better solution, but I think case sensitivity would solve current issue in a more trivial way.

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 9h
Merged PRs (30d)
40

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.