ASSERT-KTH / ASSERT-KTH/spork

Spoon fails to mark @SuppressWarnings package as implicit if named element is used

Open
#49 1 comment 0 reactions 0 assignees View on GitHub
bug wontfix
Dominant language
Java
Stars
72
Forks
11
PR merge metrics
No merged PRs in 30d

Description

I've no idea why this happens, but if you write this:

```java
@SuppressWarnings(value="unchecked")
```
then Spoon will not mark `java.lang` as implicit, and the output will be:

```java
@java.lang.SuppressWarnings(value="unchecked")
```

Took me an hour of debugging to figure out ... To be clear, the problem is the use of a named element, if you remove the `value=`, it the annotation type's package gets properly marked as implicit.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the two @SuppressWarnings examples in the report and compare the generated output. Trace how Spoon handles named annotation elements and implicit annotation-type packages. Done means the named-element form also emits SuppressWarnings without the java.lang qualification, matching the unnamed form.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.