Top Description Fields Constructors Methods
reactor.core.publisher

pack-priv final Class Traces

extends Object
Class Inheritance
Imports
java.util.List, java.util.function.Supplier, java.util.stream.Collectors, .Stream

Utilities around manipulating stack traces and displaying assembly traces.
Authors
Simon Baslé, Sergei Egorov

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final Supplier<Supplier<String>>
callSiteSupplierFactory

Transform the current stack trace into a String representation, each element being prepended with a tabulation and appended with a newline.

pack-priv static final boolean
full

If set to true, the creation of FluxOnAssembly will capture the raw stacktrace instead of the sanitized version.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static String

Returns:

a String representing operator and operator assembly site extracted from the assembly stack trace.
extractOperatorAssemblyInformation
(String
the sanitized assembly stacktrace in String format.
source
)

Extract operator information out of an assembly stack trace in String form (see Traces#callSiteSupplierFactory).

pack-priv static String[]

Returns:

a String representing operator and operator assembly site extracted from the assembly stack trace.
extractOperatorAssemblyInformationParts
(String
the sanitized assembly stacktrace in String format.
source
)

Extract operator information out of an assembly stack trace in String form (see Traces#callSiteSupplierFactory) which potentially has a header line that one can skip by setting skipFirst to true.

pack-priv static boolean
pack-priv static boolean

Returns:

true if it should be sanitized out, false if it should be kept
shouldSanitize
(String
the row to check
stackTraceRow
)

Return true for strings (usually from a stack trace element) that should be sanitized out by Traces#callSiteSupplierFactory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CALL_SITE_GLUEback to summary
pack-priv static final String CALL_SITE_GLUE
callSiteSupplierFactoryback to summary
pack-priv static final Supplier<Supplier<String>> callSiteSupplierFactory

Transform the current stack trace into a String representation, each element being prepended with a tabulation and appended with a newline.

fullback to summary
pack-priv static final boolean full

If set to true, the creation of FluxOnAssembly will capture the raw stacktrace instead of the sanitized version.

Constructor Detail

Tracesback to summary
pack-priv Traces()

Method Detail

extractOperatorAssemblyInformationback to summary
pack-priv static String extractOperatorAssemblyInformation(String source)

Extract operator information out of an assembly stack trace in String form (see Traces#callSiteSupplierFactory).

Most operators will result in a line of the form "Flux.map ⇢ user.code.Class.method(Class.java:123)", that is:

  1. The top of the stack is inspected for Reactor API references, and the deepest one is kept, since multiple API references generally denote an alias operator. (eg. "Flux.map")
  2. The next stacktrace element is considered user code and is appended to the result with a ⇢ separator. (eg. " ⇢ user.code.Class.method(Class.java:123)")
  3. If no user code is found in the sanitized stack, then the API reference is outputed in the later format only.
  4. If the sanitized stack is empty, returns "[no operator assembly information]"
Parameters
source:String

the sanitized assembly stacktrace in String format.

Returns:String

a String representing operator and operator assembly site extracted from the assembly stack trace.

extractOperatorAssemblyInformationPartsback to summary
pack-priv static String[] extractOperatorAssemblyInformationParts(String source)

Extract operator information out of an assembly stack trace in String form (see Traces#callSiteSupplierFactory) which potentially has a header line that one can skip by setting skipFirst to true.

Most operators will result in a line of the form "Flux.map ⇢ user.code.Class.method(Class.java:123)", that is:

  1. The top of the stack is inspected for Reactor API references, and the deepest one is kept, since multiple API references generally denote an alias operator. (eg. "Flux.map")
  2. The next stacktrace element is considered user code and is appended to the result with a ⇢ separator. (eg. " ⇢ user.code.Class.method(Class.java:123)")
  3. If no user code is found in the sanitized stack, then the API reference is outputed in the later format only.
  4. If the sanitized stack is empty, returns "[no operator assembly information]"
Parameters
source:String

the sanitized assembly stacktrace in String format.

Returns:String[]

a String representing operator and operator assembly site extracted from the assembly stack trace.

isUserCodeback to summary
pack-priv static boolean isUserCode(String line)
shouldSanitizeback to summary
pack-priv static boolean shouldSanitize(String stackTraceRow)

Return true for strings (usually from a stack trace element) that should be sanitized out by Traces#callSiteSupplierFactory.

Parameters
stackTraceRow:String

the row to check

Returns:boolean

true if it should be sanitized out, false if it should be kept