javaparser / javaparser/javaparser
Multiple providers for single SPI in module-info.java is not treated as an error
Open
Nobody has claimed this yet.
Question (JP usage)
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 17h 36m
- Merged PRs (30d)
- 28
Description
The following module-info.java source is invalid
module com.example {
exports com.example;
provides com.example.Service with com.example.Provider1;
provides com.example.Service with com.example.Provider2;
}
But v3.25.1 does not flag it as an error. Affects https://github.com/moditect/moditect/issues/173
The correct syntax is
module com.example {
exports com.example;
provides com.example.Service with com.example.Provider1, com.example.Provider2;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the module-info.java example and reproduce how the parser handles two separate provides declarations for the same service. Confirm that the repeated-provider form is rejected as invalid while the comma-separated form remains accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100