Trace a message with "JNDI_CALL' that includes the returned objects from that JNDI call.

@param methodname The name of the method that is requesting the trace.
@param duration The duration of the call in milliseconds.
@param objs The objects to trace.
357853
private void traceJndiReturn(String methodname, long duration, Object... objs) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms]", objs);
        }
    }
1050870
static <T> T trace(Level level, Object reason) {
        // NOTE: do not make this method private as it affects stack traces
        try {
            if (System.getProperty(propertyName) != null) {
                StackTraceElement[] st = Thread.currentThread().getStackTrace();
                String method = "???";
                String cls = ToolProvider.class.getName();
                if (st.length > 2) {
                    StackTraceElement frame = st[2];
                    method = String.format((Locale)null, "%s(%s:%s)",
                                           frame.getMethodName(),
                                           frame.getFileName(),
                                           frame.getLineNumber());
                    cls = frame.getClassName();
                }
                Logger logger = Logger.getLogger(loggerName);
                if (reason instanceof Throwable) {
                    logger.logp(level, cls, method,
                                reason.getClass().getName(), (Throwable)reason);
                } else {
                    logger.logp(level, cls, method, String.valueOf(reason));
                }
            }
        } catch (SecurityException ex) {
            System.err.format((Locale)null, "%s: %s; %s%n",
                              ToolProvider.class.getName(),
                              reason,
                              ex.getLocalizedMessage());
        }
        return null;
    }
999222
public void tracev(String format, Object param1) {
        if (isEnabled(Level.TRACE)) {
            doLog(Level.TRACE, FQCN, format, new Object[] { param1 }, null);
        }
    }
1348497
@Override
    public void visitMethod(final Method obj) {
        methodName = obj.getName();
        methodIsStatic = obj.isStatic();
    }
370997
@Override
    public void visitMethod(final Method obj) {
        if (obj.isSynthetic()) {
            return;
        }
        ExceptionTable et = obj.getExceptionTable();
        if (et != null) {
            String[] exNames = et.getExceptionNames();
            Set<String> methodRTExceptions = new HashSet<>(6);
            int priority = LOW_PRIORITY;
            boolean foundRuntime = false;
            for (String ex : exNames) {
                boolean isRuntime = false;
                if (runtimeExceptions.contains(ex)) {
                    isRuntime = true;
                } else {
                    try {
                        JavaClass exClass = Repository.lookupClass(ex);
                        if (exClass.instanceOf(runtimeExceptionClass)) {
                            runtimeExceptions.add(ex);
                            if (ex.startsWith("java.lang.")) {
                                priority = NORMAL_PRIORITY;
                            }
                            isRuntime = true;
                        }
                    } catch (ClassNotFoundException cnfe) {
                        bugReporter.reportMissingClass(cnfe);
                    }
                }
                if (isRuntime) {
                    foundRuntime = true;
                    methodRTExceptions.add(ex);
                }
            }

            if (foundRuntime) {
                BugInstance bug = new BugInstance(this, BugType.DRE_DECLARED_RUNTIME_EXCEPTION.name(), priority).addClass(this).addMethod(this);

                for (String ex : methodRTExceptions) {
                    bug.add(new StringAnnotation(ex));
                }

                bugReporter.reportBug(bug);
            }
        }
    }
1048706
private void invokeDestroy(String method, String name) {
        Class clazz = this.jmsServerManager().getClass();
        Method destroy = null;
        for (Method each: clazz.getMethods()) {
            if (method.equals(each.getName())) {
                destroy = each;
                break;
            }
        }

        if (destroy == null) {
            throw new IllegalStateException(String.format("Class %s has no %s method", clazz, method));
        }

        try {
            if (destroy.getParameterTypes().length == 1) {
                destroy.invoke(this.jmsServerManager(), name);
            } else {
                destroy.invoke(this.jmsServerManager(), name, true);
            }
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException("Failed to destroy destination " + name, e);
        }
    }
645786
public void trace(Object message, Throwable exception) {
    log(Level.TRACE, message, exception);
  }
675324
public void trace(String message, Object... args) {
    if (isDebugEnabled()) {
      trace(String.format(message, args), getThrowable(args));
    }
  }
187020
@Override
    public void addToTimeLimitDaemon(Object id, long expirationTime, int inactivity) {
        final String methodName = "addToTimeLimitDaemon()";
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called");
        }
    }
499429
public void trace( String format, Object arg )
    {
        if( m_delegate.isTraceEnabled() )
        {
            FormattingTuple tuple = MessageFormatter.format( format, arg );
            m_delegate.trace( tuple.getMessage(), tuple.getThrowable() );
        }
    }
1305428
public static void traceEJBCallExit(String methodDesc)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            StringBuffer sbuf = new StringBuffer();

            sbuf
                            .append(BeanLifeCycle_EJBCallExit_Type_Str).append(DataDelimiter)
                            .append(BeanLifeCycle_EJBCallExit_Type).append(DataDelimiter)
                            .append(methodDesc);

            Tr.debug(tc, sbuf.toString());
        }
    }
11004
public static void showOnUiThread(Context applicationContext, String message, int duration) {
        Handler handler = HandlerUtils.getMainHandler();
        showOnUiThread(applicationContext, message, duration, handler);
    }
683396
public void recordTimeout(String trackerName) {
    synchronized (this) {
      NodeUsageReport usageReport = getReportUnprotected(trackerName);
      usageReport.setNumTimeout(usageReport.getNumTimeout() + 1);
    }
  }
547259
@Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (target == null) {
            target = JndiUtils.lookup(name);
        }
        return method.invoke(target, args);
    }
1314758
public CompositeGeneratorNode trace(final EObject obj, final StringConcatenationClient code) {
    return this.appendTemplate(this.trace(obj), code);
  }
430231
public static void traceEJBCallEntry(String methodDesc)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            StringBuffer sbuf = new StringBuffer();

            sbuf
                            .append(BeanLifeCycle_EJBCallEntry_Type_Str).append(DataDelimiter)
                            .append(BeanLifeCycle_EJBCallEntry_Type).append(DataDelimiter)
                            .append(methodDesc);

            Tr.debug(tc, sbuf.toString());
        }
    }
607402
public static TraceEvent beginDuration(String name, Object... args) {
        return new TraceEvent(TraceEventType.DURATION_BEGIN, name, null, args);
    }