File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -850,7 +850,7 @@ public ClassSpecification parseClassSpecificationArguments(boolean readFirstWord
850
850
int requiredUnsetClassAccessFlags = 0 ;
851
851
852
852
// Parse the class annotations and access modifiers until the class keyword.
853
- while (!ConfigurationConstants .CLASS_KEYWORD .equals (nextWord ))
853
+ while (!ConfigurationConstants .CLASS_KEYWORD .equals (nextWord ) && ! configurationEnd ( true ) )
854
854
{
855
855
// Strip the negating sign, if any.
856
856
boolean negated =
Original file line number Diff line number Diff line change @@ -82,6 +82,17 @@ class ConfigurationParserTest : FreeSpec({
82
82
}
83
83
}
84
84
85
+ " A ParseException should be thrown with invalid annotation config at the end of the file" - {
86
+ // This is a parse error without any further config after it.
87
+ val configStr = ("-keep @MyAnnotation @ThisShouldBeInterfaceKeyword ")
88
+
89
+ " Then the option should throw a ParseException" {
90
+ shouldThrow<ParseException > {
91
+ configStr.asConfiguration()
92
+ }
93
+ }
94
+ }
95
+
85
96
" Wildcard type tests" - {
86
97
class TestConfig (
87
98
val configOption: String ,
You can’t perform that action at this time.
0 commit comments