[Bug]: DefaultJavaPrettyPrinter incorrectly print Annotation method
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
### Describe the bug
```
@interface MyAnnotation{
int value();
}
public class array {
@MyAnnotation(value=50)
private float foo() {
int[] a ={3,4,5};
return 2;
}
}
```
The code above is the code to be analyzed. When printing the method foo with DefaultJavaPrettyPrinter, the following is produced. Obviously, in annotation part, "value" is missed.
```
@MyAnnotation(50)
private float foo() {
int[] a = new int[]{ 3, 4, 5 };
return 2;
}
```
### Source code you are trying to analyze/transform
_No response_
### Source code for your Spoon processing
_No response_
### Actual output
_No response_
### Expected output
_No response_
### Spoon Version
9.1.0
### JVM Version
11
### What operating system are you using?
ubuntu
Contributor guide
Research direction
Start by locating DefaultJavaPrettyPrinter and reproducing the annotation-method example from the issue. Trace how @MyAnnotation(value=50) is printed, then verify that the generated output preserves the value= element rather than reducing it to @MyAnnotation(50).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100