[java] New rule for simplifiable system property access
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.5k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 54
Description
Rule name: TBD
Add a rule to convert calls to System.getProperty("line.separator") to use System.lineSeparator() since that is the reason the method was added See JDK-6900043.
Originally posted by @Sthornton12 in https://github.com/pmd/pmd/issues/1993#issuecomment-558408123
See also File.separator/ File.separatorChar vs System.getProperty("file.separator"), although those don't have an @since
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 by reviewing existing Java rules that simplify system property access and their tests. Confirm whether the scope is limited to System.getProperty("line.separator") or also includes the File.separator variants, and establish the rule name. Done means the selected access patterns are converted to their standard alternatives with tests covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100