[scala] CPD terminates with an exception when a small value is set for --minimum-tokens
Open
Nobody has claimed this yet.
a:bug
- Dominant language
- Java
- Stars
- 5.5k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 54
Description
Affects PMD Version:
6.18.0, 6.20.0
Rule:
Description:
When targeting a scala file, if a small value is set for --minimum-tokens, CPD will exit with an exception.
Code Sample demonstrating the issue:
object Foo {
void foo() {
String[] array = null;
array = {"abc", "def", "ghi"};
}
}
I prepared another same file.
Running PMD through: [CLI]
pmd-bin-6.18.0/bin/run.sh cpd --minimum-tokens 20 --language scala --files scala/
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 reproducing the issue with the provided run.sh cpd command, --minimum-tokens 20, --language scala, and the scala/ files. Inspect the CPD Scala processing path after reproducing the exception. Done means the same input completes without an exception when a small minimum-token value is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100