konveyor / analyzer-lsp

Add-on that is focused on providing analysis based on the Language Server Protocol.
Apache License 2.0
12 stars 45 forks source link

[BUG] [RULES] Cannot match `System.out.println` with anything mores specifc than `pattern: "System*"` #693

Closed JonahSussman closed 2 months ago

JonahSussman commented 2 months ago

Is there an existing issue for this?

Konveyor version

N/A

Priority

Undefined (Default)

Current Behavior

There appears to be no combination of rules to match System.out.println, aside from:

java.referenced:
    pattern: "System*"

I have tried setting pattern to each one of these, with and without the additional location: METHOD_CALL but they give no matches:

- "java.io.PrintStream.println"
- "java.io.PrintStream.println(*)"
- "java.lang.System.out.println"
- "java.lang.System.out.println(*)"
- "*out*"
- "System.*"
- "System\\.*"
- "*System.out*"
- "System.out*"

Expected Behavior

Any one of these more specific combinations should match the call of System.out.println.

How Reproducible

Always (Default)

Steps To Reproduce

On Fedora 40 with maven installed:

  1. Navigate to an empty directory
  2. Download the latest release of Kantra
  3. Generate the helloworld project: mvn archetype:generate -DgroupId=io.konveyor -DartifactId=helloworld -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
  4. Download the attached rule set.
  5. Run ./kantra analyze --input helloworld --output analysis --rules blog-post-rules --skip-static-report --overwrite --enable-default-rulesets=false
  6. Note that note of the rules matched

blog-post-rules.zip

Environment

- `be48b40abe11a6de1a9ce82dcd660eea430e8cf66a4caf91ebb54e2384eb5738  kantra`

Anything else?

N/A

konveyor-ci-bot[bot] commented 2 months ago

This issue is currently awaiting triage. If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance. The triage/accepted label can be added by org members.