# HG changeset patch # User darcy # Date 1363730373 25200 # Node ID bfd86c4f4249b3833ac3f69b4a1f3ae34b4a5a22 # Parent eeec610295741fc45a752af20c1e301454443b70 8001309: Better handling of annotation interfaces Reviewed-by: ahgross, smarks, alanb diff -r eeec61029574 -r bfd86c4f4249 jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java --- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Tue Mar 19 14:29:34 2013 -0700 +++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Tue Mar 19 14:59:33 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -337,12 +337,15 @@ try { annotationType = AnnotationType.getInstance(type); } catch(IllegalArgumentException e) { - // Class is no longer an annotation type; all bets are off - return; + // Class is no longer an annotation type; time to punch out + throw new java.io.InvalidObjectException("Non-annotation type in annotation serial stream"); } Map> memberTypes = annotationType.memberTypes(); + + // If there are annotation members without values, that + // situation is handled by the invoke method. for (Map.Entry memberValue : memberValues.entrySet()) { String name = memberValue.getKey(); Class memberType = memberTypes.get(name);