8037420: Silent failures in Annotate.actualEnterTypeAnnotations
Summary: Remove two silent failures
Reviewed-by: jjg
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Mar 13 20:13:43 2014 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Fri Mar 14 15:35:13 2014 -0400
@@ -808,9 +808,7 @@
Attribute.TypeCompound tc =
enterTypeAnnotation(a, syms.annotationType, env);
- if (tc == null) {
- continue;
- }
+ Assert.checkNonNull(tc, "Failed to create type annotation");
if (annotated.containsKey(a.type.tsym)) {
if (!allowRepeatedAnnos) {
@@ -827,10 +825,9 @@
}
}
- if (s != null) {
- s.appendTypeAttributesWithCompletion(
- new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
- }
+ Assert.checkNonNull(s, "Symbol argument to actualEnterTypeAnnotations is null");
+ s.appendTypeAttributesWithCompletion(
+ new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
} finally {
if (prevLintPos != null)
deferredLintHandler.setPos(prevLintPos);