@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }
@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }