File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/compiler/scala/tools/nsc/symtab/classfile Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1013,9 +1013,16 @@ abstract class ClassfileParser {
1013
1013
} catch {
1014
1014
case f : FatalError => throw f // don't eat fatal errors, they mean a class was not found
1015
1015
case ex : Throwable =>
1016
- debuglog(" dropping annotation on " + sym + " , an error occured during parsing (e.g. annotation class not found)" )
1017
-
1018
- None // ignore malformed annotations ==> t1135
1016
+ // We want to be robust when annotations are unavailable, so the very least
1017
+ // we can do is warn the user about the exception
1018
+ // There was a reference to ticket 1135, but that is outdated: a reference to a class not on
1019
+ // the classpath would *not* end up here. A class not found is signaled
1020
+ // with a `FatalError` exception, handled above. Here you'd end up after a NPE (for example),
1021
+ // and that should never be swallowed silently.
1022
+ warning(" Caught: " + ex + " while parsing annotations in " + in.file)
1023
+ if (settings.debug.value) ex.printStackTrace()
1024
+
1025
+ None // ignore malformed annotations
1019
1026
}
1020
1027
1021
1028
/**
You can’t perform that action at this time.
0 commit comments