langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
changeset 13689 4d519199a6aa
parent 7681 1f0819a3341f
child 14258 8d2148961366
equal deleted inserted replaced
13636:bee2d435e11f 13689:4d519199a6aa
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   175         public void visitConstant(Attribute.Constant c) {
   175         public void visitConstant(Attribute.Constant c) {
   176             value = c.getValue();
   176             value = c.getValue();
   177         }
   177         }
   178 
   178 
   179         public void visitClass(Attribute.Class c) {
   179         public void visitClass(Attribute.Class c) {
   180             value = new MirroredTypeExceptionProxy(c.type);
   180             value = new MirroredTypeExceptionProxy(c.classType);
   181         }
   181         }
   182 
   182 
   183         public void visitArray(Attribute.Array a) {
   183         public void visitArray(Attribute.Array a) {
   184             Name elemName = ((ArrayType) a.type).elemtype.tsym.getQualifiedName();
   184             Name elemName = ((ArrayType) a.type).elemtype.tsym.getQualifiedName();
   185 
   185 
   186             if (elemName.equals(elemName.table.names.java_lang_Class)) {   // Class[]
   186             if (elemName.equals(elemName.table.names.java_lang_Class)) {   // Class[]
   187                 // Construct a proxy for a MirroredTypesException
   187                 // Construct a proxy for a MirroredTypesException
   188                 ListBuffer<TypeMirror> elems = new ListBuffer<TypeMirror>();
   188                 ListBuffer<TypeMirror> elems = new ListBuffer<TypeMirror>();
   189                 for (Attribute value : a.values) {
   189                 for (Attribute value : a.values) {
   190                     Type elem = ((Attribute.Class) value).type;
   190                     Type elem = ((Attribute.Class) value).classType;
   191                     elems.append(elem);
   191                     elems.append(elem);
   192                 }
   192                 }
   193                 value = new MirroredTypesExceptionProxy(elems.toList());
   193                 value = new MirroredTypesExceptionProxy(elems.toList());
   194 
   194 
   195             } else {
   195             } else {