@SuppressWarnings("unchecked") static boolean hasTagImpl(Set<Class<?>> providedTags, Node node, Class<?> tag) { if (providedTags.contains(tag)) { if (node instanceof InstrumentableNode) { return ((InstrumentableNode) node).hasTag((Class<? extends Tag>) tag); } else { return AccessorInstrumentHandler.nodesAccess().isTaggedWith(node, tag); } } return false; }
@SuppressWarnings("unchecked") static boolean hasTagImpl(Set<Class<?>> providedTags, Node node, Class<?> tag) { if (providedTags.contains(tag)) { if (node instanceof InstrumentableNode) { return ((InstrumentableNode) node).hasTag((Class<? extends Tag>) tag); } else { return AccessorInstrumentHandler.nodesAccess().isTaggedWith(node, tag); } } return false; }
/** * Returns <code>true</code> if the underlying instrumented AST is tagged with a particular tag. * The return value of {@link #hasTag(Class)} always returns the same value for a particular tag * and {@link EventContext}. The method may be used on compiled code paths. * * @param tag the tag to check to check, must not be <code>null</code>. * @since 0.33 */ public boolean hasTag(Class<? extends Tag> tag) { if (tag == null) { CompilerDirectives.transferToInterpreter(); throw new NullPointerException(); } Node node = getInstrumentedNode(); if (node instanceof InstrumentableNode) { return ((InstrumentableNode) node).hasTag(tag); } else { // legacy support return AccessorInstrumentHandler.nodesAccess().isTaggedWith(node, tag); } }
/** * Returns <code>true</code> if the underlying instrumented AST is tagged with a particular tag. * The return value of {@link #hasTag(Class)} always returns the same value for a particular tag * and {@link EventContext}. The method may be used on compiled code paths. * * @param tag the tag to check to check, must not be <code>null</code>. * @since 0.33 */ public boolean hasTag(Class<? extends Tag> tag) { if (tag == null) { CompilerDirectives.transferToInterpreter(); throw new NullPointerException(); } Node node = getInstrumentedNode(); if (node instanceof InstrumentableNode) { return ((InstrumentableNode) node).hasTag(tag); } else { // legacy support return AccessorInstrumentHandler.nodesAccess().isTaggedWith(node, tag); } }