Skip to content

Commit 8f50da6

Browse files
committed
spotless
1 parent 4d345ea commit 8f50da6

File tree

1 file changed

+121
-114
lines changed

1 file changed

+121
-114
lines changed

dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java

Lines changed: 121 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,36 +1557,52 @@ public final CoreSpanBuilder ignoreActiveSpan() {
15571557
protected final DDSpan buildSpan() {
15581558
return buildSpan(tracer, instrumentationName, timestampMicro, links, buildSpanContext());
15591559
}
1560-
1560+
15611561
protected static final DDSpan buildSpan(
1562-
final CoreTracer tracer,
1563-
long spanId,
1564-
String instrumentationName,
1565-
long timestampMicro,
1566-
String serviceName,
1567-
CharSequence operationName,
1568-
String resourceName,
1569-
AgentSpanContext incomingParentContext,
1570-
boolean ignoreScope,
1571-
boolean errorFlag,
1572-
CharSequence spanType,
1573-
TagMap.Ledger tagLedger,
1574-
List<AgentSpanLink> links,
1575-
Object builderRequestContextDataAppSec,
1576-
Object builderRequestContextDataIast,
1577-
Object builderCiVisibilityContextData)
1578-
{
1579-
return buildSpan(tracer, instrumentationName, timestampMicro, links,
1580-
buildSpanContext(tracer, spanId, serviceName, operationName, resourceName, incomingParentContext, ignoreScope, errorFlag, spanType, tagLedger, links, builderRequestContextDataAppSec, builderRequestContextDataIast, builderCiVisibilityContextData));
1581-
}
1582-
1562+
final CoreTracer tracer,
1563+
long spanId,
1564+
String instrumentationName,
1565+
long timestampMicro,
1566+
String serviceName,
1567+
CharSequence operationName,
1568+
String resourceName,
1569+
AgentSpanContext incomingParentContext,
1570+
boolean ignoreScope,
1571+
boolean errorFlag,
1572+
CharSequence spanType,
1573+
TagMap.Ledger tagLedger,
1574+
List<AgentSpanLink> links,
1575+
Object builderRequestContextDataAppSec,
1576+
Object builderRequestContextDataIast,
1577+
Object builderCiVisibilityContextData) {
1578+
return buildSpan(
1579+
tracer,
1580+
instrumentationName,
1581+
timestampMicro,
1582+
links,
1583+
buildSpanContext(
1584+
tracer,
1585+
spanId,
1586+
serviceName,
1587+
operationName,
1588+
resourceName,
1589+
incomingParentContext,
1590+
ignoreScope,
1591+
errorFlag,
1592+
spanType,
1593+
tagLedger,
1594+
links,
1595+
builderRequestContextDataAppSec,
1596+
builderRequestContextDataIast,
1597+
builderCiVisibilityContextData));
1598+
}
1599+
15831600
protected static final DDSpan buildSpan(
1584-
CoreTracer tracer,
1585-
String instrumentationName,
1586-
long timestampMicro,
1587-
List<AgentSpanLink> links,
1588-
DDSpanContext spanContext)
1589-
{
1601+
CoreTracer tracer,
1602+
String instrumentationName,
1603+
long timestampMicro,
1604+
List<AgentSpanLink> links,
1605+
DDSpanContext spanContext) {
15901606
DDSpan span = DDSpan.create(instrumentationName, timestampMicro, spanContext, links);
15911607
if (span.isLocalRootSpan()) {
15921608
EndpointTracker tracker = tracer.onRootSpanStarted(span);
@@ -1598,8 +1614,7 @@ protected static final DDSpan buildSpan(
15981614
}
15991615

16001616
private static final List<AgentSpanLink> addParentContextLink(
1601-
List<AgentSpanLink> links,
1602-
AgentSpanContext parentContext) {
1617+
List<AgentSpanLink> links, AgentSpanContext parentContext) {
16031618
SpanLink link;
16041619
if (parentContext instanceof ExtractedContext) {
16051620
String headers = ((ExtractedContext) parentContext).getPropagationStyle().toString();
@@ -1616,9 +1631,7 @@ private static final List<AgentSpanLink> addParentContextLink(
16161631
}
16171632

16181633
protected static final List<AgentSpanLink> addTerminatedContextAsLinks(
1619-
List<AgentSpanLink> links,
1620-
AgentSpanContext parentContext)
1621-
{
1634+
List<AgentSpanLink> links, AgentSpanContext parentContext) {
16221635
if (parentContext instanceof TagContext) {
16231636
List<AgentSpanLink> terminatedContextLinks =
16241637
((TagContext) parentContext).getTerminatedContextLinks();
@@ -1628,31 +1641,27 @@ protected static final List<AgentSpanLink> addTerminatedContextAsLinks(
16281641
}
16291642
return links;
16301643
}
1631-
1644+
16321645
protected static final List<AgentSpanLink> addLink(
1633-
List<AgentSpanLink> links,
1634-
AgentSpanLink link)
1635-
{
1636-
if ( links == null ) links = new ArrayList<>();
1646+
List<AgentSpanLink> links, AgentSpanLink link) {
1647+
if (links == null) links = new ArrayList<>();
16371648
links.add(link);
16381649
return links;
16391650
}
16401651

16411652
protected static final List<AgentSpanLink> addLinks(
1642-
List<AgentSpanLink> links,
1643-
List<AgentSpanLink> additionalLinks)
1644-
{
1645-
if ( links == null ) {
1646-
links = new ArrayList<>(additionalLinks);
1653+
List<AgentSpanLink> links, List<AgentSpanLink> additionalLinks) {
1654+
if (links == null) {
1655+
links = new ArrayList<>(additionalLinks);
16471656
} else {
1648-
links.addAll(additionalLinks);
1657+
links.addAll(additionalLinks);
16491658
}
16501659
return links;
1651-
}
1660+
}
16521661

16531662
@Override
1654-
public abstract AgentSpan start();
1655-
1663+
public abstract AgentSpan start();
1664+
16561665
protected AgentSpan startImpl() {
16571666
AgentSpanContext pc = parent;
16581667
if (pc == null && !ignoreScope) {
@@ -1669,23 +1678,22 @@ protected AgentSpan startImpl() {
16691678
}
16701679

16711680
protected static final AgentSpan startSpan(
1672-
final CoreTracer tracer,
1673-
long spanId,
1674-
String instrumentationName,
1675-
long timestampMicro,
1676-
String serviceName,
1677-
CharSequence operationName,
1678-
String resourceName,
1679-
AgentSpanContext incomingParentContext,
1680-
boolean ignoreScope,
1681-
boolean errorFlag,
1682-
CharSequence spanType,
1683-
TagMap.Ledger tagLedger,
1684-
List<AgentSpanLink> links,
1685-
Object builderRequestContextDataAppSec,
1686-
Object builderRequestContextDataIast,
1687-
Object builderCiVisibilityContextData)
1688-
{
1681+
final CoreTracer tracer,
1682+
long spanId,
1683+
String instrumentationName,
1684+
long timestampMicro,
1685+
String serviceName,
1686+
CharSequence operationName,
1687+
String resourceName,
1688+
AgentSpanContext incomingParentContext,
1689+
boolean ignoreScope,
1690+
boolean errorFlag,
1691+
CharSequence spanType,
1692+
TagMap.Ledger tagLedger,
1693+
List<AgentSpanLink> links,
1694+
Object builderRequestContextDataAppSec,
1695+
Object builderRequestContextDataIast,
1696+
Object builderCiVisibilityContextData) {
16891697
AgentSpanContext pc = incomingParentContext;
16901698
if (pc == null && !ignoreScope) {
16911699
final AgentSpan span = tracer.activeSpan();
@@ -1698,22 +1706,22 @@ protected static final AgentSpan startSpan(
16981706
return new BlackHoleSpan(pc.getTraceId());
16991707
}
17001708
return buildSpan(
1701-
tracer,
1702-
spanId,
1703-
instrumentationName,
1704-
timestampMicro,
1705-
serviceName,
1706-
operationName,
1707-
resourceName,
1708-
incomingParentContext,
1709-
ignoreScope,
1710-
errorFlag,
1711-
spanType,
1712-
tagLedger,
1713-
links,
1714-
builderRequestContextDataAppSec,
1715-
builderRequestContextDataIast,
1716-
builderCiVisibilityContextData);
1709+
tracer,
1710+
spanId,
1711+
instrumentationName,
1712+
timestampMicro,
1713+
serviceName,
1714+
operationName,
1715+
resourceName,
1716+
incomingParentContext,
1717+
ignoreScope,
1718+
errorFlag,
1719+
spanType,
1720+
tagLedger,
1721+
links,
1722+
builderRequestContextDataAppSec,
1723+
builderRequestContextDataIast,
1724+
builderCiVisibilityContextData);
17171725
}
17181726

17191727
@Override
@@ -1840,38 +1848,37 @@ public final CoreSpanBuilder withSpanId(final long spanId) {
18401848
*/
18411849
private final DDSpanContext buildSpanContext() {
18421850
return this.buildSpanContext(
1843-
this.tracer,
1844-
this.spanId,
1845-
this.serviceName,
1846-
this.operationName,
1847-
this.resourceName,
1848-
this.parent,
1849-
this.ignoreScope,
1850-
this.errorFlag,
1851-
this.spanType,
1852-
this.tagLedger,
1853-
this.links,
1854-
this.builderRequestContextDataAppSec,
1855-
this.builderRequestContextDataIast,
1856-
this.builderCiVisibilityContextData);
1857-
}
1858-
1851+
this.tracer,
1852+
this.spanId,
1853+
this.serviceName,
1854+
this.operationName,
1855+
this.resourceName,
1856+
this.parent,
1857+
this.ignoreScope,
1858+
this.errorFlag,
1859+
this.spanType,
1860+
this.tagLedger,
1861+
this.links,
1862+
this.builderRequestContextDataAppSec,
1863+
this.builderRequestContextDataIast,
1864+
this.builderCiVisibilityContextData);
1865+
}
1866+
18591867
protected static final DDSpanContext buildSpanContext(
1860-
final CoreTracer tracer,
1861-
long spanId,
1862-
String serviceName,
1863-
CharSequence operationName,
1864-
String resourceName,
1865-
AgentSpanContext incomingParentContext,
1866-
boolean ignoreScope,
1867-
boolean errorFlag,
1868-
CharSequence spanType,
1869-
TagMap.Ledger tagLedger,
1870-
List<AgentSpanLink> links,
1871-
Object builderRequestContextDataAppSec,
1872-
Object builderRequestContextDataIast,
1873-
Object builderCiVisibilityContextData)
1874-
{
1868+
final CoreTracer tracer,
1869+
long spanId,
1870+
String serviceName,
1871+
CharSequence operationName,
1872+
String resourceName,
1873+
AgentSpanContext incomingParentContext,
1874+
boolean ignoreScope,
1875+
boolean errorFlag,
1876+
CharSequence spanType,
1877+
TagMap.Ledger tagLedger,
1878+
List<AgentSpanLink> links,
1879+
Object builderRequestContextDataAppSec,
1880+
Object builderRequestContextDataIast,
1881+
Object builderCiVisibilityContextData) {
18751882
DDTraceId traceId;
18761883
long parentSpanId;
18771884
final Map<String, String> baggage;
@@ -1889,7 +1896,7 @@ protected static final DDSpanContext buildSpanContext(
18891896
Object ciVisibilityContextData;
18901897
final PathwayContext pathwayContext;
18911898
final PropagationTags propagationTags;
1892-
1899+
18931900
if (spanId == 0) {
18941901
spanId = tracer.idGenerationStrategy.generateSpanId();
18951902
}
@@ -1903,7 +1910,7 @@ protected static final DDSpanContext buildSpanContext(
19031910
parentContext = activeSpan.context();
19041911
}
19051912
}
1906-
1913+
19071914
// Handle remote terminated context as span links
19081915
if (parentContext != null && parentContext.isRemote()) {
19091916
switch (Config.get().getTracePropagationBehaviorExtract()) {
@@ -2056,7 +2063,7 @@ protected static final DDSpanContext buildSpanContext(
20562063
serviceName = tracer.serviceName;
20572064
}
20582065

2059-
if ( operationName == null ) operationName = resourceName;
2066+
if (operationName == null) operationName = resourceName;
20602067

20612068
final TagMap mergedTracerTags = traceConfig.mergedTracerTags;
20622069
boolean mergedTracerTagsNeedsIntercept = traceConfig.mergedTracerTagsNeedsIntercept;

0 commit comments

Comments
 (0)