/** * Checks whether this data object has nested SQL statements. * * @param data * {@link InvocationSequenceData} * @return True if it has nested SQLs, false otherwise. */ public static boolean hasNestedExceptions(InvocationSequenceData data) { return (null != data.isNestedExceptions()) && data.isNestedExceptions().booleanValue(); }
/** * Resolves additional span details (e.g. has nested exception or SQL data) for the given * {@link InvocationTreeElement}. * * @param element * the {@link InvocationTreeElement} which details should be resolved * @param spanToInvocationSequenceMap * lookup map for mapping the spans to {@link InvocationSequenceData} */ private void resolveSpanDetails(InvocationTreeElement element, Map<Long, InvocationSequenceData> spanToInvocationSequenceMap) { if (!element.isSpan()) { return; } InvocationSequenceData sequenceData = spanToInvocationSequenceMap.get(((Span) element.getDataElement()).getSpanIdent().getId()); if (sequenceData != null) { element.setHasNestedSqls((sequenceData.isNestedSqlStatements() != null) && sequenceData.isNestedSqlStatements()); element.setHasNestedExceptions((sequenceData.isNestedExceptions() != null) && sequenceData.isNestedExceptions()); } }
assertThat(parent.isNestedExceptions(), is(nullValue()));
assertThat(parent.isNestedExceptions(), is(true));
/** * Clones invocation sequence. This method returns new object exactly same as the original * object, but with out nested sequences set. * * @return Cloned invocation sequence. */ public InvocationSequenceData getClonedInvocationSequence() { InvocationSequenceData clone = new InvocationSequenceData(this.getTimeStamp(), this.getPlatformIdent(), this.getSensorTypeIdent(), this.getMethodIdent()); clone.setId(this.getId()); clone.setSpanIdent(this.getSpanIdent()); clone.setChildCount(this.getChildCount()); clone.setDuration(this.getDuration()); clone.setEnd(this.getEnd()); clone.setNestedSequences(Collections.<InvocationSequenceData> emptyList()); clone.setParameterContentData(this.getParameterContentData()); clone.setParentSequence(this.getParentSequence()); clone.setPosition(this.getPosition()); clone.setSqlStatementData(this.getSqlStatementData()); clone.setTimerData(this.getTimerData()); clone.setExceptionSensorDataObjects(this.getExceptionSensorDataObjects()); clone.setStart(this.getStart()); clone.setNestedSqlStatements(this.isNestedSqlStatements()); clone.setNestedExceptions(this.isNestedExceptions()); clone.setLoggingData(this.getLoggingData()); clone.setApplicationId(this.getApplicationId()); clone.setBusinessTransactionId(this.getBusinessTransactionId()); return clone; }