[Question] What's the difference between matcher and pattern in spoon?
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
From my understanding, the matcher could be used to search a code block. And the pattern is used to search a single statement or invocation. If there is a chance, could you provide more rich cases on the official site?
And I have some cases in pseudocode that need to use matcher / pattern to search in the code base. Could you tell me if they can be matched use matcher / pattern in spoon?
- Case1
`javax.crypto.Cipher.getInstance("AES")`
I know it's easy to use `invocation.getExecutable().getParameters()` to limit the parameter value. But is there any chance to use matcher / pattern?
- Case2
```java
public class $JMS_LISTENER implements javax.jms.MessageListener {
...
public void onMessage(javax.jms.Message $JMS_MSG) {
...
}
}
```
- Case3
```java
org.apache.commons.text.StringSubstitutor.createInterpolator().replace(...)
```
Contributor guide
Research direction
Start with the official Spoon documentation for matcher and pattern, then review how the APIs apply to the three Java cases in the issue: a Cipher invocation, a JMS listener class, and StringSubstitutor.createInterpolator().replace(...). Done means the documentation distinguishes matcher from pattern, includes richer examples, and explains whether these cases can be matched.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100