slf4j-api-1.6.4

16:52:52.484 INFO  jd.cli.Main - Decompiling slf4j-api-1.6.4.jar
package org.slf4j.helpers;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.slf4j.Marker;

public class BasicMarker
  implements Marker
{
  private static final long serialVersionUID = 1803952589649545191L;
  private final String name;
  private List refereceList;
  
  BasicMarker(String name)
  {
    if (name == null) {
      throw new IllegalArgumentException("A merker name cannot be null");
    }
    this.name = name;
  }
  
  public String getName()
  {
    return name;
  }
  
  public synchronized void add(Marker reference)
  {
    if (reference == null) {
      throw new IllegalArgumentException("A null value cannot be added to a Marker as reference.");
    }
    if (contains(reference)) {
      return;
    }
    if (reference.contains(this)) {
      return;
    }
    if (refereceList == null) {
      refereceList = new Vector();
    }
    refereceList.add(reference);
  }
  
  public synchronized boolean hasReferences()
  {
    return (refereceList != null) && (refereceList.size() > 0);
  }
  
  public boolean hasChildren()
  {
    return hasReferences();
  }
  
  public synchronized Iterator iterator()
  {
    if (refereceList != null) {
      return refereceList.iterator();
    }
    return Collections.EMPTY_LIST.iterator();
  }
  
  public synchronized boolean remove(Marker referenceToRemove)
  {
    if (refereceList == null) {
      return false;
    }
    int size = refereceList.size();
    for (int i = 0; i < size; i++)
    {
      Marker m = (Marker)refereceList.get(i);
      if (referenceToRemove.equals(m))
      {
        refereceList.remove(i);
        return true;
      }
    }
    return false;
  }
  
  public boolean contains(Marker other)
  {
    if (other == null) {
      throw new IllegalArgumentException("Other cannot be null");
    }
    if (equals(other)) {
      return true;
    }
    if (hasReferences()) {
      for (int i = 0; i < refereceList.size(); i++)
      {
        Marker ref = (Marker)refereceList.get(i);
        if (ref.contains(other)) {
          return true;
        }
      }
    }
    return false;
  }
  
  public boolean contains(String name)
  {
    if (name == null) {
      throw new IllegalArgumentException("Other cannot be null");
    }
    if (this.name.equals(name)) {
      return true;
    }
    if (hasReferences()) {
      for (int i = 0; i < refereceList.size(); i++)
      {
        Marker ref = (Marker)refereceList.get(i);
        if (ref.contains(name)) {
          return true;
        }
      }
    }
    return false;
  }
  
  private static String OPEN = "[ ";
  private static String CLOSE = " ]";
  private static String SEP = ", ";
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (!(obj instanceof Marker)) {
      return false;
    }
    Marker other = (Marker)obj;
    return name.equals(other.getName());
  }
  
  public int hashCode()
  {
    return name.hashCode();
  }
  
  public String toString()
  {
    if (!hasReferences()) {
      return getName();
    }
    Iterator it = iterator();
    
    StringBuffer sb = new StringBuffer(getName());
    sb.append(' ').append(OPEN);
    while (it.hasNext())
    {
      Marker reference = (Marker)it.next();
      sb.append(reference.getName());
      if (it.hasNext()) {
        sb.append(SEP);
      }
    }
    sb.append(CLOSE);
    
    return sb.toString();
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.BasicMarker
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.util.HashMap;
import java.util.Map;
import org.slf4j.IMarkerFactory;
import org.slf4j.Marker;

public class BasicMarkerFactory
  implements IMarkerFactory
{
  Map markerMap = new HashMap();
  
  public synchronized Marker getMarker(String name)
  {
    if (name == null) {
      throw new IllegalArgumentException("Marker name cannot be null");
    }
    Marker marker = (Marker)markerMap.get(name);
    if (marker == null)
    {
      marker = new BasicMarker(name);
      markerMap.put(name, marker);
    }
    return marker;
  }
  
  public synchronized boolean exists(String name)
  {
    if (name == null) {
      return false;
    }
    return markerMap.containsKey(name);
  }
  
  public boolean detachMarker(String name)
  {
    if (name == null) {
      return false;
    }
    return markerMap.remove(name) != null;
  }
  
  public Marker getDetachedMarker(String name)
  {
    return new BasicMarker(name);
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.BasicMarkerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.slf4j.spi.MDCAdapter;

public class BasicMDCAdapter
  implements MDCAdapter
{
  private InheritableThreadLocal inheritableThreadLocal = new InheritableThreadLocal();
  
  static boolean isJDK14()
  {
    try
    {
      String javaVersion = System.getProperty("java.version");
      return javaVersion.startsWith("1.4");
    }
    catch (SecurityException se) {}
    return false;
  }
  
  static boolean IS_JDK14 = ;
  
  public void put(String key, String val)
  {
    if (key == null) {
      throw new IllegalArgumentException("key cannot be null");
    }
    Map map = (Map)inheritableThreadLocal.get();
    if (map == null)
    {
      map = Collections.synchronizedMap(new HashMap());
      inheritableThreadLocal.set(map);
    }
    map.put(key, val);
  }
  
  public String get(String key)
  {
    Map Map = (Map)inheritableThreadLocal.get();
    if ((Map != null) && (key != null)) {
      return (String)Map.get(key);
    }
    return null;
  }
  
  public void remove(String key)
  {
    Map map = (Map)inheritableThreadLocal.get();
    if (map != null) {
      map.remove(key);
    }
  }
  
  public void clear()
  {
    Map map = (Map)inheritableThreadLocal.get();
    if (map != null)
    {
      map.clear();
      if (isJDK14()) {
        inheritableThreadLocal.set(null);
      } else {
        inheritableThreadLocal.remove();
      }
    }
  }
  
  public Set getKeys()
  {
    Map map = (Map)inheritableThreadLocal.get();
    if (map != null) {
      return map.keySet();
    }
    return null;
  }
  
  public Map getCopyOfContextMap()
  {
    Map oldMap = (Map)inheritableThreadLocal.get();
    if (oldMap != null)
    {
      Map newMap = Collections.synchronizedMap(new HashMap());
      synchronized (oldMap)
      {
        newMap.putAll(oldMap);
      }
      return newMap;
    }
    return null;
  }
  
  public void setContextMap(Map contextMap)
  {
    Map map = Collections.synchronizedMap(new HashMap(contextMap));
    inheritableThreadLocal.set(map);
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.BasicMDCAdapter
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

public class FormattingTuple
{
  public static FormattingTuple NULL = new FormattingTuple(null);
  private String message;
  private Throwable throwable;
  private Object[] argArray;
  
  public FormattingTuple(String message)
  {
    this(message, null, null);
  }
  
  public FormattingTuple(String message, Object[] argArray, Throwable throwable)
  {
    this.message = message;
    this.throwable = throwable;
    if (throwable == null) {
      this.argArray = argArray;
    } else {
      this.argArray = trimmedCopy(argArray);
    }
  }
  
  static Object[] trimmedCopy(Object[] argArray)
  {
    if ((argArray == null) || (argArray.length == 0)) {
      throw new IllegalStateException("non-sensical empty or null argument array");
    }
    int trimemdLen = argArray.length - 1;
    Object[] trimmed = new Object[trimemdLen];
    System.arraycopy(argArray, 0, trimmed, 0, trimemdLen);
    return trimmed;
  }
  
  public String getMessage()
  {
    return message;
  }
  
  public Object[] getArgArray()
  {
    return argArray;
  }
  
  public Throwable getThrowable()
  {
    return throwable;
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.FormattingTuple
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import org.slf4j.Logger;
import org.slf4j.Marker;

public abstract class MarkerIgnoringBase
  extends NamedLoggerBase
  implements Logger
{
  private static final long serialVersionUID = 9044267456635152283L;
  
  public boolean isTraceEnabled(Marker marker)
  {
    return isTraceEnabled();
  }
  
  public void trace(Marker marker, String msg)
  {
    trace(msg);
  }
  
  public void trace(Marker marker, String format, Object arg)
  {
    trace(format, arg);
  }
  
  public void trace(Marker marker, String format, Object arg1, Object arg2)
  {
    trace(format, arg1, arg2);
  }
  
  public void trace(Marker marker, String format, Object[] argArray)
  {
    trace(format, argArray);
  }
  
  public void trace(Marker marker, String msg, Throwable t)
  {
    trace(msg, t);
  }
  
  public boolean isDebugEnabled(Marker marker)
  {
    return isDebugEnabled();
  }
  
  public void debug(Marker marker, String msg)
  {
    debug(msg);
  }
  
  public void debug(Marker marker, String format, Object arg)
  {
    debug(format, arg);
  }
  
  public void debug(Marker marker, String format, Object arg1, Object arg2)
  {
    debug(format, arg1, arg2);
  }
  
  public void debug(Marker marker, String format, Object[] argArray)
  {
    debug(format, argArray);
  }
  
  public void debug(Marker marker, String msg, Throwable t)
  {
    debug(msg, t);
  }
  
  public boolean isInfoEnabled(Marker marker)
  {
    return isInfoEnabled();
  }
  
  public void info(Marker marker, String msg)
  {
    info(msg);
  }
  
  public void info(Marker marker, String format, Object arg)
  {
    info(format, arg);
  }
  
  public void info(Marker marker, String format, Object arg1, Object arg2)
  {
    info(format, arg1, arg2);
  }
  
  public void info(Marker marker, String format, Object[] argArray)
  {
    info(format, argArray);
  }
  
  public void info(Marker marker, String msg, Throwable t)
  {
    info(msg, t);
  }
  
  public boolean isWarnEnabled(Marker marker)
  {
    return isWarnEnabled();
  }
  
  public void warn(Marker marker, String msg)
  {
    warn(msg);
  }
  
  public void warn(Marker marker, String format, Object arg)
  {
    warn(format, arg);
  }
  
  public void warn(Marker marker, String format, Object arg1, Object arg2)
  {
    warn(format, arg1, arg2);
  }
  
  public void warn(Marker marker, String format, Object[] argArray)
  {
    warn(format, argArray);
  }
  
  public void warn(Marker marker, String msg, Throwable t)
  {
    warn(msg, t);
  }
  
  public boolean isErrorEnabled(Marker marker)
  {
    return isErrorEnabled();
  }
  
  public void error(Marker marker, String msg)
  {
    error(msg);
  }
  
  public void error(Marker marker, String format, Object arg)
  {
    error(format, arg);
  }
  
  public void error(Marker marker, String format, Object arg1, Object arg2)
  {
    error(format, arg1, arg2);
  }
  
  public void error(Marker marker, String format, Object[] argArray)
  {
    error(format, argArray);
  }
  
  public void error(Marker marker, String msg, Throwable t)
  {
    error(msg, t);
  }
  
  public String toString()
  {
    return getClass().getName() + "(" + getName() + ")";
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.MarkerIgnoringBase
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;

public final class MessageFormatter
{
  static final char DELIM_START = '{';
  static final char DELIM_STOP = '}';
  static final String DELIM_STR = "{}";
  private static final char ESCAPE_CHAR = '\\';
  
  public static final FormattingTuple format(String messagePattern, Object arg)
  {
    return arrayFormat(messagePattern, new Object[] { arg });
  }
  
  public static final FormattingTuple format(String messagePattern, Object arg1, Object arg2)
  {
    return arrayFormat(messagePattern, new Object[] { arg1, arg2 });
  }
  
  static final Throwable getThrowableCandidate(Object[] argArray)
  {
    if ((argArray == null) || (argArray.length == 0)) {
      return null;
    }
    Object lastEntry = argArray[(argArray.length - 1)];
    if ((lastEntry instanceof Throwable)) {
      return (Throwable)lastEntry;
    }
    return null;
  }
  
  public static final FormattingTuple arrayFormat(String messagePattern, Object[] argArray)
  {
    Throwable throwableCandidate = getThrowableCandidate(argArray);
    if (messagePattern == null) {
      return new FormattingTuple(null, argArray, throwableCandidate);
    }
    if (argArray == null) {
      return new FormattingTuple(messagePattern);
    }
    int i = 0;
    
    StringBuffer sbuf = new StringBuffer(messagePattern.length() + 50);
    for (int L = 0; L < argArray.length; L++)
    {
      int j = messagePattern.indexOf("{}", i);
      if (j == -1)
      {
        if (i == 0) {
          return new FormattingTuple(messagePattern, argArray, throwableCandidate);
        }
        sbuf.append(messagePattern.substring(i, messagePattern.length()));
        return new FormattingTuple(sbuf.toString(), argArray, throwableCandidate);
      }
      if (isEscapedDelimeter(messagePattern, j))
      {
        if (!isDoubleEscaped(messagePattern, j))
        {
          L--;
          sbuf.append(messagePattern.substring(i, j - 1));
          sbuf.append('{');
          i = j + 1;
        }
        else
        {
          sbuf.append(messagePattern.substring(i, j - 1));
          deeplyAppendParameter(sbuf, argArray[L], new HashMap());
          i = j + 2;
        }
      }
      else
      {
        sbuf.append(messagePattern.substring(i, j));
        deeplyAppendParameter(sbuf, argArray[L], new HashMap());
        i = j + 2;
      }
    }
    sbuf.append(messagePattern.substring(i, messagePattern.length()));
    if (L < argArray.length - 1) {
      return new FormattingTuple(sbuf.toString(), argArray, throwableCandidate);
    }
    return new FormattingTuple(sbuf.toString(), argArray, null);
  }
  
  static final boolean isEscapedDelimeter(String messagePattern, int delimeterStartIndex)
  {
    if (delimeterStartIndex == 0) {
      return false;
    }
    char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1);
    if (potentialEscape == '\\') {
      return true;
    }
    return false;
  }
  
  static final boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex)
  {
    if ((delimeterStartIndex >= 2) && (messagePattern.charAt(delimeterStartIndex - 2) == '\\')) {
      return true;
    }
    return false;
  }
  
  private static void deeplyAppendParameter(StringBuffer sbuf, Object o, Map seenMap)
  {
    if (o == null)
    {
      sbuf.append("null");
      return;
    }
    if (!o.getClass().isArray()) {
      safeObjectAppend(sbuf, o);
    } else if ((o instanceof boolean[])) {
      booleanArrayAppend(sbuf, (boolean[])o);
    } else if ((o instanceof byte[])) {
      byteArrayAppend(sbuf, (byte[])o);
    } else if ((o instanceof char[])) {
      charArrayAppend(sbuf, (char[])o);
    } else if ((o instanceof short[])) {
      shortArrayAppend(sbuf, (short[])o);
    } else if ((o instanceof int[])) {
      intArrayAppend(sbuf, (int[])o);
    } else if ((o instanceof long[])) {
      longArrayAppend(sbuf, (long[])o);
    } else if ((o instanceof float[])) {
      floatArrayAppend(sbuf, (float[])o);
    } else if ((o instanceof double[])) {
      doubleArrayAppend(sbuf, (double[])o);
    } else {
      objectArrayAppend(sbuf, (Object[])o, seenMap);
    }
  }
  
  private static void safeObjectAppend(StringBuffer sbuf, Object o)
  {
    try
    {
      String oAsString = o.toString();
      sbuf.append(oAsString);
    }
    catch (Throwable t)
    {
      System.err.println("SLF4J: Failed toString() invocation on an object of type [" + o.getClass().getName() + "]");
      
      t.printStackTrace();
      sbuf.append("[FAILED toString()]");
    }
  }
  
  private static void objectArrayAppend(StringBuffer sbuf, Object[] a, Map seenMap)
  {
    sbuf.append('[');
    if (!seenMap.containsKey(a))
    {
      seenMap.put(a, null);
      int len = a.length;
      for (int i = 0; i < len; i++)
      {
        deeplyAppendParameter(sbuf, a[i], seenMap);
        if (i != len - 1) {
          sbuf.append(", ");
        }
      }
      seenMap.remove(a);
    }
    else
    {
      sbuf.append("...");
    }
    sbuf.append(']');
  }
  
  private static void booleanArrayAppend(StringBuffer sbuf, boolean[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void byteArrayAppend(StringBuffer sbuf, byte[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void charArrayAppend(StringBuffer sbuf, char[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void shortArrayAppend(StringBuffer sbuf, short[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void intArrayAppend(StringBuffer sbuf, int[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void longArrayAppend(StringBuffer sbuf, long[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void floatArrayAppend(StringBuffer sbuf, float[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
  
  private static void doubleArrayAppend(StringBuffer sbuf, double[] a)
  {
    sbuf.append('[');
    int len = a.length;
    for (int i = 0; i < len; i++)
    {
      sbuf.append(a[i]);
      if (i != len - 1) {
        sbuf.append(", ");
      }
    }
    sbuf.append(']');
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.MessageFormatter
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.io.ObjectStreamException;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

abstract class NamedLoggerBase
  implements Logger, Serializable
{
  private static final long serialVersionUID = 7535258609338176893L;
  protected String name;
  
  public String getName()
  {
    return name;
  }
  
  protected Object readResolve()
    throws ObjectStreamException
  {
    return LoggerFactory.getLogger(getName());
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.NamedLoggerBase
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

public class NOPLogger
  extends MarkerIgnoringBase
{
  private static final long serialVersionUID = -517220405410904473L;
  public static final NOPLogger NOP_LOGGER = new NOPLogger();
  
  public String getName()
  {
    return "NOP";
  }
  
  public final boolean isTraceEnabled()
  {
    return false;
  }
  
  public final void trace(String msg) {}
  
  public final void trace(String format, Object arg) {}
  
  public final void trace(String format, Object arg1, Object arg2) {}
  
  public final void trace(String format, Object[] argArray) {}
  
  public final void trace(String msg, Throwable t) {}
  
  public final boolean isDebugEnabled()
  {
    return false;
  }
  
  public final void debug(String msg) {}
  
  public final void debug(String format, Object arg) {}
  
  public final void debug(String format, Object arg1, Object arg2) {}
  
  public final void debug(String format, Object[] argArray) {}
  
  public final void debug(String msg, Throwable t) {}
  
  public final boolean isInfoEnabled()
  {
    return false;
  }
  
  public final void info(String msg) {}
  
  public final void info(String format, Object arg1) {}
  
  public final void info(String format, Object arg1, Object arg2) {}
  
  public final void info(String format, Object[] argArray) {}
  
  public final void info(String msg, Throwable t) {}
  
  public final boolean isWarnEnabled()
  {
    return false;
  }
  
  public final void warn(String msg) {}
  
  public final void warn(String format, Object arg1) {}
  
  public final void warn(String format, Object arg1, Object arg2) {}
  
  public final void warn(String format, Object[] argArray) {}
  
  public final void warn(String msg, Throwable t) {}
  
  public final boolean isErrorEnabled()
  {
    return false;
  }
  
  public final void error(String msg) {}
  
  public final void error(String format, Object arg1) {}
  
  public final void error(String format, Object arg1, Object arg2) {}
  
  public final void error(String format, Object[] argArray) {}
  
  public final void error(String msg, Throwable t) {}
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.NOPLogger
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

public class NOPLoggerFactory
  implements ILoggerFactory
{
  public Logger getLogger(String name)
  {
    return NOPLogger.NOP_LOGGER;
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.NOPLoggerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.util.Map;
import org.slf4j.spi.MDCAdapter;

public class NOPMDCAdapter
  implements MDCAdapter
{
  public void clear() {}
  
  public String get(String key)
  {
    return null;
  }
  
  public void put(String key, String val) {}
  
  public void remove(String key) {}
  
  public Map getCopyOfContextMap()
  {
    return null;
  }
  
  public void setContextMap(Map contextMap) {}
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.NOPMDCAdapter
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.util.ArrayList;
import java.util.List;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

public class SubstituteLoggerFactory
  implements ILoggerFactory
{
  final List loggerNameList = new ArrayList();
  
  public Logger getLogger(String name)
  {
    synchronized (loggerNameList)
    {
      loggerNameList.add(name);
    }
    return NOPLogger.NOP_LOGGER;
  }
  
  public List getLoggerNameList()
  {
    List copy = new ArrayList();
    synchronized (loggerNameList)
    {
      copy.addAll(loggerNameList);
    }
    return copy;
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.SubstituteLoggerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j.helpers;

import java.io.PrintStream;

public class Util
{
  public static final void report(String msg, Throwable t)
  {
    System.err.println(msg);
    System.err.println("Reported exception:");
    t.printStackTrace();
  }
  
  public static final void report(String msg)
  {
    System.err.println("SLF4J: " + msg);
  }
}

/* Location:
 * Qualified Name:     org.slf4j.helpers.Util
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

public abstract interface ILoggerFactory
{
  public abstract Logger getLogger(String paramString);
}

/* Location:
 * Qualified Name:     org.slf4j.ILoggerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

public abstract interface IMarkerFactory
{
  public abstract Marker getMarker(String paramString);
  
  public abstract boolean exists(String paramString);
  
  public abstract boolean detachMarker(String paramString);
  
  public abstract Marker getDetachedMarker(String paramString);
}

/* Location:
 * Qualified Name:     org.slf4j.IMarkerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

public abstract interface Logger
{
  public static final String ROOT_LOGGER_NAME = "ROOT";
  
  public abstract String getName();
  
  public abstract boolean isTraceEnabled();
  
  public abstract void trace(String paramString);
  
  public abstract void trace(String paramString, Object paramObject);
  
  public abstract void trace(String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void trace(String paramString, Object[] paramArrayOfObject);
  
  public abstract void trace(String paramString, Throwable paramThrowable);
  
  public abstract boolean isTraceEnabled(Marker paramMarker);
  
  public abstract void trace(Marker paramMarker, String paramString);
  
  public abstract void trace(Marker paramMarker, String paramString, Object paramObject);
  
  public abstract void trace(Marker paramMarker, String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void trace(Marker paramMarker, String paramString, Object[] paramArrayOfObject);
  
  public abstract void trace(Marker paramMarker, String paramString, Throwable paramThrowable);
  
  public abstract boolean isDebugEnabled();
  
  public abstract void debug(String paramString);
  
  public abstract void debug(String paramString, Object paramObject);
  
  public abstract void debug(String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void debug(String paramString, Object[] paramArrayOfObject);
  
  public abstract void debug(String paramString, Throwable paramThrowable);
  
  public abstract boolean isDebugEnabled(Marker paramMarker);
  
  public abstract void debug(Marker paramMarker, String paramString);
  
  public abstract void debug(Marker paramMarker, String paramString, Object paramObject);
  
  public abstract void debug(Marker paramMarker, String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void debug(Marker paramMarker, String paramString, Object[] paramArrayOfObject);
  
  public abstract void debug(Marker paramMarker, String paramString, Throwable paramThrowable);
  
  public abstract boolean isInfoEnabled();
  
  public abstract void info(String paramString);
  
  public abstract void info(String paramString, Object paramObject);
  
  public abstract void info(String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void info(String paramString, Object[] paramArrayOfObject);
  
  public abstract void info(String paramString, Throwable paramThrowable);
  
  public abstract boolean isInfoEnabled(Marker paramMarker);
  
  public abstract void info(Marker paramMarker, String paramString);
  
  public abstract void info(Marker paramMarker, String paramString, Object paramObject);
  
  public abstract void info(Marker paramMarker, String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void info(Marker paramMarker, String paramString, Object[] paramArrayOfObject);
  
  public abstract void info(Marker paramMarker, String paramString, Throwable paramThrowable);
  
  public abstract boolean isWarnEnabled();
  
  public abstract void warn(String paramString);
  
  public abstract void warn(String paramString, Object paramObject);
  
  public abstract void warn(String paramString, Object[] paramArrayOfObject);
  
  public abstract void warn(String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void warn(String paramString, Throwable paramThrowable);
  
  public abstract boolean isWarnEnabled(Marker paramMarker);
  
  public abstract void warn(Marker paramMarker, String paramString);
  
  public abstract void warn(Marker paramMarker, String paramString, Object paramObject);
  
  public abstract void warn(Marker paramMarker, String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void warn(Marker paramMarker, String paramString, Object[] paramArrayOfObject);
  
  public abstract void warn(Marker paramMarker, String paramString, Throwable paramThrowable);
  
  public abstract boolean isErrorEnabled();
  
  public abstract void error(String paramString);
  
  public abstract void error(String paramString, Object paramObject);
  
  public abstract void error(String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void error(String paramString, Object[] paramArrayOfObject);
  
  public abstract void error(String paramString, Throwable paramThrowable);
  
  public abstract boolean isErrorEnabled(Marker paramMarker);
  
  public abstract void error(Marker paramMarker, String paramString);
  
  public abstract void error(Marker paramMarker, String paramString, Object paramObject);
  
  public abstract void error(Marker paramMarker, String paramString, Object paramObject1, Object paramObject2);
  
  public abstract void error(Marker paramMarker, String paramString, Object[] paramArrayOfObject);
  
  public abstract void error(Marker paramMarker, String paramString, Throwable paramThrowable);
}

/* Location:
 * Qualified Name:     org.slf4j.Logger
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

import java.io.IOException;
import java.net.URL;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.slf4j.helpers.NOPLoggerFactory;
import org.slf4j.helpers.SubstituteLoggerFactory;
import org.slf4j.helpers.Util;
import org.slf4j.impl.StaticLoggerBinder;

public final class LoggerFactory
{
  static final String CODES_PREFIX = "http://www.slf4j.org/codes.html";
  static final String NO_STATICLOGGERBINDER_URL = "http://www.slf4j.org/codes.html#StaticLoggerBinder";
  static final String MULTIPLE_BINDINGS_URL = "http://www.slf4j.org/codes.html#multiple_bindings";
  static final String NULL_LF_URL = "http://www.slf4j.org/codes.html#null_LF";
  static final String VERSION_MISMATCH = "http://www.slf4j.org/codes.html#version_mismatch";
  static final String SUBSTITUTE_LOGGER_URL = "http://www.slf4j.org/codes.html#substituteLogger";
  static final String UNSUCCESSFUL_INIT_URL = "http://www.slf4j.org/codes.html#unsuccessfulInit";
  static final String UNSUCCESSFUL_INIT_MSG = "org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit";
  static final int UNINITIALIZED = 0;
  static final int ONGOING_INITILIZATION = 1;
  static final int FAILED_INITILIZATION = 2;
  static final int SUCCESSFUL_INITILIZATION = 3;
  static final int NOP_FALLBACK_INITILIZATION = 4;
  static int INITIALIZATION_STATE = 0;
  static SubstituteLoggerFactory TEMP_FACTORY = new SubstituteLoggerFactory();
  static NOPLoggerFactory NOP_FALLBACK_FACTORY = new NOPLoggerFactory();
  private static final String[] API_COMPATIBILITY_LIST = { "1.6" };
  
  static void reset()
  {
    INITIALIZATION_STATE = 0;
    TEMP_FACTORY = new SubstituteLoggerFactory();
  }
  
  private static final void performInitialization()
  {
    singleImplementationSanityCheck();
    bind();
    if (INITIALIZATION_STATE == 3) {
      versionSanityCheck();
    }
  }
  
  private static boolean messageContainsOrgSlf4jImplStaticLoggerBinder(String msg)
  {
    if (msg == null) {
      return false;
    }
    if (msg.indexOf("org/slf4j/impl/StaticLoggerBinder") != -1) {
      return true;
    }
    if (msg.indexOf("org.slf4j.impl.StaticLoggerBinder") != -1) {
      return true;
    }
    return false;
  }
  
  private static final void bind()
  {
    try
    {
      StaticLoggerBinder.getSingleton();
      INITIALIZATION_STATE = 3;
      emitSubstituteLoggerWarning();
    }
    catch (NoClassDefFoundError ncde)
    {
      String msg = ncde.getMessage();
      if (messageContainsOrgSlf4jImplStaticLoggerBinder(msg))
      {
        INITIALIZATION_STATE = 4;
        Util.report("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
        
        Util.report("Defaulting to no-operation (NOP) logger implementation");
        Util.report("See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.");
      }
      else
      {
        failedBinding(ncde);
        throw ncde;
      }
    }
    catch (NoSuchMethodError nsme)
    {
      String msg = nsme.getMessage();
      if ((msg != null) && (msg.indexOf("org.slf4j.impl.StaticLoggerBinder.getSingleton()") != -1))
      {
        INITIALIZATION_STATE = 2;
        Util.report("slf4j-api 1.6.x (or later) is incompatible with this binding.");
        Util.report("Your binding is version 1.5.5 or earlier.");
        Util.report("Upgrade your binding to version 1.6.x. or 2.0.x");
      }
      throw nsme;
    }
    catch (Exception e)
    {
      failedBinding(e);
      throw new IllegalStateException("Unexpected initialization failure", e);
    }
  }
  
  static void failedBinding(Throwable t)
  {
    INITIALIZATION_STATE = 2;
    Util.report("Failed to instantiate SLF4J LoggerFactory", t);
  }
  
  private static final void emitSubstituteLoggerWarning()
  {
    List loggerNameList = TEMP_FACTORY.getLoggerNameList();
    if (loggerNameList.size() == 0) {
      return;
    }
    Util.report("The following loggers will not work because they were created");
    
    Util.report("during the default configuration phase of the underlying logging system.");
    
    Util.report("See also http://www.slf4j.org/codes.html#substituteLogger");
    for (int i = 0; i < loggerNameList.size(); i++)
    {
      String loggerName = (String)loggerNameList.get(i);
      Util.report(loggerName);
    }
  }
  
  private static final void versionSanityCheck()
  {
    try
    {
      String requested = StaticLoggerBinder.REQUESTED_API_VERSION;
      
      boolean match = false;
      for (int i = 0; i < API_COMPATIBILITY_LIST.length; i++) {
        if (requested.startsWith(API_COMPATIBILITY_LIST[i])) {
          match = true;
        }
      }
      if (!match)
      {
        Util.report("The requested version " + requested + " by your slf4j binding is not compatible with " + Arrays.asList(API_COMPATIBILITY_LIST).toString());
        
        Util.report("See http://www.slf4j.org/codes.html#version_mismatch for further details.");
      }
    }
    catch (NoSuchFieldError nsfe) {}catch (Throwable e)
    {
      Util.report("Unexpected problem occured during version sanity check", e);
    }
  }
  
  private static String STATIC_LOGGER_BINDER_PATH = "org/slf4j/impl/StaticLoggerBinder.class";
  
  private static void singleImplementationSanityCheck()
  {
    try
    {
      ClassLoader loggerFactoryClassLoader = LoggerFactory.class.getClassLoader();
      Enumeration paths;
      Enumeration paths;
      if (loggerFactoryClassLoader == null) {
        paths = ClassLoader.getSystemResources(STATIC_LOGGER_BINDER_PATH);
      } else {
        paths = loggerFactoryClassLoader.getResources(STATIC_LOGGER_BINDER_PATH);
      }
      Set implementationSet = new LinkedHashSet();
      while (paths.hasMoreElements())
      {
        URL path = (URL)paths.nextElement();
        implementationSet.add(path);
      }
      if (implementationSet.size() > 1)
      {
        Util.report("Class path contains multiple SLF4J bindings.");
        Iterator iterator = implementationSet.iterator();
        while (iterator.hasNext())
        {
          URL path = (URL)iterator.next();
          Util.report("Found binding in [" + path + "]");
        }
        Util.report("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.");
      }
    }
    catch (IOException ioe)
    {
      Util.report("Error getting resources from path", ioe);
    }
  }
  
  public static Logger getLogger(String name)
  {
    ILoggerFactory iLoggerFactory = getILoggerFactory();
    return iLoggerFactory.getLogger(name);
  }
  
  public static Logger getLogger(Class clazz)
  {
    return getLogger(clazz.getName());
  }
  
  public static ILoggerFactory getILoggerFactory()
  {
    if (INITIALIZATION_STATE == 0)
    {
      INITIALIZATION_STATE = 1;
      performInitialization();
    }
    switch (INITIALIZATION_STATE)
    {
    case 3: 
      return StaticLoggerBinder.getSingleton().getLoggerFactory();
    case 4: 
      return NOP_FALLBACK_FACTORY;
    case 2: 
      throw new IllegalStateException("org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit");
    case 1: 
      return TEMP_FACTORY;
    }
    throw new IllegalStateException("Unreachable code");
  }
}

/* Location:
 * Qualified Name:     org.slf4j.LoggerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

import java.io.Serializable;
import java.util.Iterator;

public abstract interface Marker
  extends Serializable
{
  public static final String ANY_MARKER = "*";
  public static final String ANY_NON_NULL_MARKER = "+";
  
  public abstract String getName();
  
  public abstract void add(Marker paramMarker);
  
  public abstract boolean remove(Marker paramMarker);
  
  /**
   * @deprecated
   */
  public abstract boolean hasChildren();
  
  public abstract boolean hasReferences();
  
  public abstract Iterator iterator();
  
  public abstract boolean contains(Marker paramMarker);
  
  public abstract boolean contains(String paramString);
  
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
}

/* Location:
 * Qualified Name:     org.slf4j.Marker
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

import org.slf4j.helpers.BasicMarkerFactory;
import org.slf4j.helpers.Util;
import org.slf4j.impl.StaticMarkerBinder;

public class MarkerFactory
{
  static IMarkerFactory markerFactory;
  
  static
  {
    try
    {
      markerFactory = StaticMarkerBinder.SINGLETON.getMarkerFactory();
    }
    catch (NoClassDefFoundError e)
    {
      markerFactory = new BasicMarkerFactory();
    }
    catch (Exception e)
    {
      Util.report("Unexpected failure while binding MarkerFactory", e);
    }
  }
  
  public static Marker getMarker(String name)
  {
    return markerFactory.getMarker(name);
  }
  
  public static Marker getDetachedMarker(String name)
  {
    return markerFactory.getDetachedMarker(name);
  }
  
  public static IMarkerFactory getIMarkerFactory()
  {
    return markerFactory;
  }
}

/* Location:
 * Qualified Name:     org.slf4j.MarkerFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package org.slf4j;

import java.util.Map;
import org.slf4j.helpers.NOPMDCAdapter;
import org.slf4j.helpers.Util;
import org.slf4j.impl.StaticMDCBinder;
import org.slf4j.spi.MDCAdapter;

public class MDC
{
  static final String NULL_MDCA_URL = "http://www.slf4j.org/codes.html#null_MDCA";
  static final String NO_STATIC_MDC_BINDER_URL = "http://www.slf4j.org/codes.html#no_static_mdc_binder";
  static MDCAdapter mdcAdapter;
  
  static
  {
    try
    {
      mdcAdapter = StaticMDCBinder.SINGLETON.getMDCA();
    }
    catch (NoClassDefFoundError ncde)
    {
      mdcAdapter = new NOPMDCAdapter();
      String msg = ncde.getMessage();
      if ((msg != null) && (ms
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd