code: public void setVariable(String name, Object value) {
          TraceState ts = traceState.get();
  
          if (ts != null) {
              if (log.isLoggable(Level.FINEST)) {
                  log.finest("Set variable '" + name + "' value = " + value);
              }
              ts.getVariables().put(name, value);
          } else if (log.isLoggable(Level.FINEST)) {
              log.finest("Set variable '" + name + "' value = " + value + "' requested, but no trace state");
          }
      }
docs: This method retrieves a variable associated with the
  current trace.
  
  @return The variable value, or null if not found