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

[MCOMPILER-498] Recompilation when class name doesn't match file name

Open
#699 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the report with SpecialTest.java containing UncommonTest and CommonTest, then run mvn -X test-compile twice. Inspect the compiler plugin's stale-source detection entry point and verify that a second invocation no longer reports SpecialTest.java as stale solely because its filename does not match a contained class.

Written by the indexing model from the issue text.

Description

bug priority:minor

T3rm1 opened MCOMPILER-498 and commented

The compiler plugin detects a file as stale whenever the class defined inside has a different name than the file.

Steps to reproduce:

Create a file named SpecialTest.java in directory {}foo{}.
Paste in following content:

package foo;

class UncommonTest {
}

class CommonTest {
} 

Run mvn -X test-compile

It'll report on each invocation: [DEBUG] Stale source detected: F:\Git\bug\src\test\java\foo\SpecialTest.java

That's because the plugin is looking for a file {}SpecialTest.class{}.

This is a problem because it can easily happen that you have a typo in your class or file name so that they don't match.


No further details from MCOMPILER-498

Dominant language
Java
Stars
261
Forks
194
Avg merge
1d 5h
Merged PRs (30d)
17

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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 apache/maven-compiler-plugin

All issues in apache/maven-compiler-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.