/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Enter annotations on symbols. Annotations accumulate in a queue,
* which is processed at the top level of any set of recursive calls
* requesting it be processed.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class Annotate {
return instance;
}
}
/* ********************************************************************
* Queue maintenance
*********************************************************************/
q.append(a);
}
q.prepend(a);
}
/** Called when the Enter phase starts. */
public void enterStart() {
enterCount++;
}
/** Called after the Enter phase completes. */
public void enterDone() {
enterCount--;
flush();
}
public void flush() {
if (enterCount != 0) return;
enterCount++;
try {
while (q.nonEmpty())
q.next().enterAnnotation();
} finally {
enterCount--;
}
}
/** A client that has annotations to add registers an annotator,
* the method it will use to add the annotation. There are no
* parameters; any needed data should be captured by the
* Annotator.
*/
public interface Annotator {
void enterAnnotation();
}
/* ********************************************************************
* Compute an attribute from its annotation.
*********************************************************************/
/** Process a single compound annotation, returning its
* Attribute. Used from MemberEnter for attaching the attributes
* to the annotated symbol.
*/
// The annotation might have had its type attributed (but not checked)
// by attr.attribAnnotationTypes during MemberEnter, in which case we do not
// need to do it again.
if (a.type.isErroneous())
}
// special case: elided "value=" assumed
}
continue;
}
continue;
}
env,
a.type,
null);
}
}
//first, try completing the attribution value sym - if a completion
//error is thrown, we should recover gracefully, and display an
//ordinary resolution diagnostic.
try {
} catch(CompletionFailure e) {
}
if (result.isErroneous())
}
}
if (result.isErroneous())
}
}
}
}
}
}
l.head,
env));
}
return new Attribute.
}
}
}
if (!expected.isErroneous())
}
}