• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

INRIA / spoon / #18513

22 Aug 2026 08:14PM UTC coverage: 88.151% (+0.003%) from 88.148%
#18513

push

github

web-flow
Fix class modificator dissapear (#6849)

When a type is annotated with an annotation whose argument contains a class literal (e.g. @EnableAutoConfiguration(exclude = {String.class})), the sniper printer could drop the 'class' keyword of the type declaration during a relocation/mutation pass, producing non-compilable output ("@X class Foo" -> "@X Foo").

AbstractSourceFragmentContextCollection.knowsHowToPrint matched a KEYWORD token against child fragments with a loose substring 'contains' check. The 'String.class' fragment source contains the substring "class", so a muted annotation collection context wrongly claimed the following type's 'class' keyword and the sniper silently dropped it. Replace the substring match with a token-boundary match (containsKeywordToken) that only accepts 'class' as a standalone keyword and not as a '.class' / qualified-name suffix. Adds a sniper regression test.

fix #6848

16 of 17 new or added lines in 1 file covered. (94.12%)

30650 of 34770 relevant lines covered (88.15%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/main/java/spoon/support/sniper/internal/AbstractSourceFragmentContextCollection.java


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc