emma

= null) {
        for (int r = 0; r < requires.length; r++)
        {
          OptDef ropt = result.getOptDef(requires[r], null);
          if (ropt == null) {
            throw new IllegalArgumentException("option [" + optdef.getCanonicalName() + "] specifies an unknown option [" + requires[r] + "] in its 'requires' set");
          }
          if (ropt == optdef) {
            throw new IllegalArgumentException("option [" + optdef.getCanonicalName() + "] specifies itself in its 'requires' set");
          }
        }
      }
      String[] excludes = optdef.getExcludesSet();
      if (excludes != null) {
        for (int x = 0; x < excludes.length; x++)
        {
          OptDef xopt = result.getOptDef(excludes[x], null);
          if (xopt == null) {
            throw new IllegalArgumentException("option [" + optdef.getCanonicalName() + "] specifies an unknown option [" + excludes[x] + "] in its 'excludes' set");
          }
          if (xopt.isRequired()) {
            throw new IllegalArgumentException("option [" + optdef.getCanonicalName() + "] specifies a required option [" + excludes[x] + "] in its 'excludes' set");
          }
          if (xopt == optdef) {
            throw new IllegalArgumentException("option [" + optdef.getCanonicalName() + "] specifies itself in its 'excludes' set");
          }
        }
      }
    }
    return result;
  }
  
  private String formatMessage(String msg)
  {
    if (m_msgPrefix == null) {
      return msg;
    }
    return m_msgPrefix.concat(msg);
  }
  
  private static final String[] OPT_PREFIXES = { "--", "-" };
  private static final char[] OPT_VALUE_SEPARATORS = { ':', '=' };
  private static final int STATE_OPT = 0;
  private static final int STATE_OPT_VALUE = 1;
  private static final int STATE_FREE_ARGS = 2;
  private static final int STATE_ERROR = 3;
}

/* Location:
 * Qualified Name:     com.vladium.util.args.OptsParser
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.asserts;

public abstract class $assert
{
  public static final boolean ENABLED = false;
  
  public static void ASSERT(boolean condition, String msg) {}
  
  public static void ASSERT(boolean condition) {}
}

/* Location:
 * Qualified Name:     com.vladium.util.asserts..assert
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public abstract class AbstractException
  extends Exception
  implements ICodedException, IThrowableWrapper
{
  private String m_message;
  private final transient Object[] m_arguments;
  private final Throwable m_cause;
  
  public AbstractException()
  {
    m_cause = null;
    m_arguments = null;
  }
  
  public AbstractException(String message)
  {
    super(message);
    m_cause = null;
    m_arguments = null;
  }
  
  public AbstractException(String message, Object[] arguments)
  {
    super(message);
    m_cause = null;
    m_arguments = (arguments == null ? null : (Object[])arguments.clone());
  }
  
  public AbstractException(Throwable cause)
  {
    m_cause = cause;
    m_arguments = null;
  }
  
  public AbstractException(String message, Throwable cause)
  {
    super(message);
    m_cause = cause;
    m_arguments = null;
  }
  
  public AbstractException(String message, Object[] arguments, Throwable cause)
  {
    super(message);
    m_cause = cause;
    m_arguments = (arguments == null ? null : (Object[])arguments.clone());
  }
  
  public final String getMessage()
  {
    if (m_message == null)
    {
      String supermsg = super.getMessage();
      Class _class = getClass();
      String msg;
      String msg;
      if (m_arguments == null) {
        msg = ExceptionCommon.getMessage(_class, supermsg);
      } else {
        msg = ExceptionCommon.getMessage(_class, supermsg, m_arguments);
      }
      if (msg == null)
      {
        String className = _class.getName();
        
        msg = supermsg != null ? className + ": " + supermsg : className;
      }
      m_message = msg;
    }
    return m_message;
  }
  
  public final String getLocalizedMessage()
  {
    return getMessage();
  }
  
  public final void printStackTrace()
  {
    ExceptionCommon.printStackTrace(this, System.out);
  }
  
  public final void printStackTrace(PrintStream s)
  {
    ExceptionCommon.printStackTrace(this, s);
  }
  
  public final void printStackTrace(PrintWriter s)
  {
    ExceptionCommon.printStackTrace(this, s);
  }
  
  public final String getErrorCode()
  {
    return super.getMessage();
  }
  
  public final Throwable getCause()
  {
    return m_cause;
  }
  
  public void __printStackTrace(PrintStream ps)
  {
    super.printStackTrace(ps);
  }
  
  public void __printStackTrace(PrintWriter pw)
  {
    super.printStackTrace(pw);
  }
  
  public static void addExceptionResource(Class namespace, String messageResourceBundleName)
  {
    ExceptionCommon.addExceptionResource(namespace, messageResourceBundleName);
  }
  
  private void writeObject(ObjectOutputStream out)
    throws IOException
  {
    getMessage();
    out.defaultWriteObject();
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.AbstractException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public abstract class AbstractRuntimeException
  extends RuntimeException
  implements ICodedException, IThrowableWrapper
{
  private String m_message;
  private final transient Object[] m_arguments;
  private final Throwable m_cause;
  
  public AbstractRuntimeException()
  {
    m_cause = null;
    m_arguments = null;
  }
  
  public AbstractRuntimeException(String message)
  {
    super(message);
    m_cause = null;
    m_arguments = null;
  }
  
  public AbstractRuntimeException(String message, Object[] arguments)
  {
    super(message);
    m_cause = null;
    m_arguments = (arguments == null ? null : (Object[])arguments.clone());
  }
  
  public AbstractRuntimeException(Throwable cause)
  {
    m_cause = cause;
    m_arguments = null;
  }
  
  public AbstractRuntimeException(String message, Throwable cause)
  {
    super(message);
    m_cause = cause;
    m_arguments = null;
  }
  
  public AbstractRuntimeException(String message, Object[] arguments, Throwable cause)
  {
    super(message);
    m_cause = cause;
    m_arguments = (arguments == null ? null : (Object[])arguments.clone());
  }
  
  public final String getMessage()
  {
    if (m_message == null)
    {
      String supermsg = super.getMessage();
      Class _class = getClass();
      String msg;
      String msg;
      if (m_arguments == null) {
        msg = ExceptionCommon.getMessage(_class, supermsg);
      } else {
        msg = ExceptionCommon.getMessage(_class, supermsg, m_arguments);
      }
      if (msg == null)
      {
        String className = _class.getName();
        
        msg = supermsg != null ? className + ": " + supermsg : className;
      }
      m_message = msg;
    }
    return m_message;
  }
  
  public final String getLocalizedMessage()
  {
    return getMessage();
  }
  
  public final void printStackTrace()
  {
    ExceptionCommon.printStackTrace(this, System.out);
  }
  
  public final void printStackTrace(PrintStream s)
  {
    ExceptionCommon.printStackTrace(this, s);
  }
  
  public final void printStackTrace(PrintWriter s)
  {
    ExceptionCommon.printStackTrace(this, s);
  }
  
  public final String getErrorCode()
  {
    return super.getMessage();
  }
  
  public final Throwable getCause()
  {
    return m_cause;
  }
  
  public void __printStackTrace(PrintStream ps)
  {
    super.printStackTrace(ps);
  }
  
  public void __printStackTrace(PrintWriter pw)
  {
    super.printStackTrace(pw);
  }
  
  public static void addExceptionResource(Class namespace, String messageResourceBundleName)
  {
    ExceptionCommon.addExceptionResource(namespace, messageResourceBundleName);
  }
  
  private void writeObject(ObjectOutputStream out)
    throws IOException
  {
    getMessage();
    out.defaultWriteObject();
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.AbstractRuntimeException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

import java.util.Enumeration;
import java.util.ResourceBundle;

class ExceptionCommon$1
  extends ResourceBundle
{
  public Object handleGetObject(String key)
  {
    return null;
  }
  
  public Enumeration getKeys()
  {
    return ExceptionCommon.EMPTY_ENUMERATION;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.ExceptionCommon.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

import com.vladium.util.IJREVersion;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;

abstract class ExceptionCommon
  implements IJREVersion
{
  private static final boolean EMBED_ERROR_CODE = true;
  private static final String ROOT_RESOURCE_BUNDLE_NAME;
  private static final ResourceBundle ROOT_RESOURCE_BUNDLE;
  
  public static ResourceBundle addExceptionResource(Class namespace, String messageResourceBundleName)
  {
    if ((namespace != null) && (messageResourceBundleName != null) && (messageResourceBundleName.length() > 0))
    {
      if ((!ABSTRACT_EXCEPTION.isAssignableFrom(namespace)) && (!ABSTACT_RUNTIME_EXCEPTION.isAssignableFrom(namespace))) {
        throw new Error("addExceptionResource(): class [" + namespace + "] is not a subclass of " + ABSTRACT_EXCEPTION.getName() + " or " + ABSTACT_RUNTIME_EXCEPTION.getName());
      }
      ResourceBundle temprb = null;
      String nameInNamespace = null;
      try
      {
        nameInNamespace = getNameInNamespace(namespace, messageResourceBundleName);
        
        ClassLoader loader = namespace.getClassLoader();
        if (loader == null) {
          loader = ClassLoader.getSystemClassLoader();
        }
        temprb = ResourceBundle.getBundle(nameInNamespace, Locale.getDefault(), loader);
      }
      catch (Throwable ignore)
      {
        temprb = null;
      }
      if (temprb != null) {
        synchronized (s_exceptionCodeMap)
        {
          ResourceBundle currentrb = (ResourceBundle)s_exceptionCodeMap.get(namespace);
          if (currentrb != null) {
            return currentrb;
          }
          s_exceptionCodeMap.put(namespace, temprb);
          return temprb;
        }
      }
    }
    return null;
  }
  
  static void printStackTrace(Throwable t, PrintWriter out)
  {
    boolean first;
    if (IJREVersion.JRE_1_4_PLUS)
    {
      if ((t instanceof IThrowableWrapper))
      {
        IThrowableWrapper tw = (IThrowableWrapper)t;
        
        tw.__printStackTrace(out);
      }
      else
      {
        t.printStackTrace(out);
      }
    }
    else {
      for (first = true; t != null;)
      {
        if (first)
        {
          first = false;
        }
        else
        {
          out.println();
          out.println("[NESTED EXCEPTION]:");
        }
        if ((t instanceof IThrowableWrapper))
        {
          IThrowableWrapper tw = (IThrowableWrapper)t;
          
          tw.__printStackTrace(out);
          t = tw.getCause();
        }
        else
        {
          t.printStackTrace(out);
        }
      }
    }
  }
  
  static void printStackTrace(Throwable t, PrintStream out)
  {
    boolean first;
    if (IJREVersion.JRE_1_4_PLUS)
    {
      if ((t instanceof IThrowableWrapper))
      {
        IThrowableWrapper tw = (IThrowableWrapper)t;
        
        tw.__printStackTrace(out);
      }
      else
      {
        t.printStackTrace(out);
      }
    }
    else {
      for (first = true; t != null;)
      {
        if (first)
        {
          first = false;
        }
        else
        {
          out.println();
          out.println("[NESTED EXCEPTION]:");
        }
        if ((t instanceof IThrowableWrapper))
        {
          IThrowableWrapper tw = (IThrowableWrapper)t;
          
          tw.__printStackTrace(out);
          t = tw.getCause();
        }
        else
        {
          t.printStackTrace(out);
        }
      }
    }
  }
  
  static String getMessage(Class namespace, String code)
  {
    if (code == null) {
      return null;
    }
    try
    {
      if (code.length() > 0)
      {
        String msg = lookup(namespace, code);
        if (msg == null) {
          return code;
        }
        return "[" + code + "] " + msg;
      }
      return "";
    }
    catch (Throwable t) {}
    return code;
  }
  
  static String getMessage(Class namespace, String code, Object[] arguments)
  {
    if (code == null) {
      return null;
    }
    String pattern = getMessage(namespace, code);
    if ((arguments == null) || (arguments.length == 0)) {
      return pattern;
    }
    try
    {
      return MessageFormat.format(pattern, arguments);
    }
    catch (Throwable t)
    {
      StringBuffer msg = new StringBuffer(code + EOL);
      for (int a = 0; a < arguments.length; a++)
      {
        msg.append("\t{" + a + "} = [");
        Object arg = arguments[a];
        try
        {
          msg.append(arg.toString());
        }
        catch (Throwable e)
        {
          if (arg != null) {
            msg.append(arg.getClass().getName());
          } else {
            msg.append("null");
          }
        }
        msg.append("]");
        msg.append(EOL);
      }
      return msg.toString();
    }
  }
  
  private static String lookup(Class namespace, String propertyName)
  {
    if (propertyName == null) {
      return null;
    }
    if (namespace != null) {
      while ((namespace != ABSTRACT_EXCEPTION) && (namespace != ABSTACT_RUNTIME_EXCEPTION) && (namespace != THROWABLE) && (namespace != null))
      {
        synchronized (s_exceptionCodeMap)
        {
          ResourceBundle rb = (ResourceBundle)s_exceptionCodeMap.get(namespace);
          if (rb == null) {
            if ((rb = addExceptionResource(namespace, "exceptions")) == null) {
              s_exceptionCodeMap.put(namespace, EMPTY_RESOURCE_BUNDLE);
            }
          }
        }
        ResourceBundle rb;
        if (rb != null)
        {
          String propertyValue = null;
          try
          {
            propertyValue = rb.getString(propertyName);
          }
          catch (Throwable ignore) {}
          if (propertyValue != null) {
            return propertyValue;
          }
        }
        namespace = namespace.getSuperclass();
      }
    }
    if (ROOT_RESOURCE_BUNDLE != null)
    {
      String propertyValue = null;
      try
      {
        propertyValue = ROOT_RESOURCE_BUNDLE.getString(propertyName);
      }
      catch (Throwable ignore) {}
      if (propertyValue != null) {
        return propertyValue;
      }
    }
    return null;
  }
  
  private static String getNameInNamespace(Class namespace, String name)
  {
    if (namespace == null) {
      return name;
    }
    String namespaceName = namespace.getName();
    int lastDot = namespaceName.lastIndexOf('.');
    if (lastDot <= 0) {
      return name;
    }
    return namespaceName.substring(0, lastDot + 1) + name;
  }
  
  private static final Map s_exceptionCodeMap = new HashMap();
  private static final String NESTED_THROWABLE_HEADER = "[NESTED EXCEPTION]:";
  private static final Class THROWABLE = Throwable.class;
  private static final Class ABSTRACT_EXCEPTION = AbstractException.class;
  private static final Class ABSTACT_RUNTIME_EXCEPTION = AbstractRuntimeException.class;
  static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_SET);
  private static final ResourceBundle EMPTY_RESOURCE_BUNDLE = new ResourceBundle()
  {
    public Object handleGetObject(String key)
    {
      return null;
    }
    
    public Enumeration getKeys()
    {
      return ExceptionCommon.EMPTY_ENUMERATION;
    }
  };
  private static final String EOL = System.getProperty("line.separator", "\n");
  
  static
  {
    ROOT_RESOURCE_BUNDLE_NAME = getNameInNamespace(ExceptionCommon.class, "exceptions");
    
    ResourceBundle temprb = null;
    try
    {
      temprb = ResourceBundle.getBundle(ROOT_RESOURCE_BUNDLE_NAME);
    }
    catch (Throwable ignore) {}
    ROOT_RESOURCE_BUNDLE = temprb;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.ExceptionCommon
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

public abstract class Exceptions
{
  public static boolean unexpectedFailure(Throwable t, Class[] expected)
  {
    if (t == null) {
      return false;
    }
    if (expected == null) {
      return true;
    }
    Class reClass = t.getClass();
    for (int e = 0; e < expected.length; e++) {
      if ((expected[e] != null) && 
        (expected[e].isAssignableFrom(reClass))) {
        return false;
      }
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.Exceptions
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

public abstract interface ICodedException
{
  public abstract String getErrorCode();
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.ICodedException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exception;

import java.io.PrintStream;
import java.io.PrintWriter;

abstract interface IThrowableWrapper
{
  public abstract Throwable getCause();
  
  public abstract void __printStackTrace(PrintWriter paramPrintWriter);
  
  public abstract void __printStackTrace(PrintStream paramPrintStream);
}

/* Location:
 * Qualified Name:     com.vladium.util.exception.IThrowableWrapper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exit;

import sun.misc.Signal;
import sun.misc.SignalHandler;

final class ExitHookManager$INTSignalHandler
  implements SignalHandler
{
  private Runnable m_runnable;
  private SignalHandler m_previous;
  
  public synchronized void handle(Signal signal)
  {
    if (m_runnable != null) {
      try
      {
        m_runnable.run();
      }
      catch (Throwable ignore) {}
    }
    m_runnable = null;
    if ((m_previous != null) && (m_previous != SignalHandler.SIG_DFL) && (m_previous != SignalHandler.SIG_IGN)) {
      try
      {
        m_previous.handle(signal);
      }
      catch (Throwable ignore) {}
    } else {
      System.exit(0);
    }
  }
  
  ExitHookManager$INTSignalHandler(Runnable runnable)
  {
    m_runnable = runnable;
  }
  
  synchronized void register()
  {
    m_previous = Signal.handle(new Signal("INT"), this);
  }
  
  synchronized void unregister()
  {
    m_runnable = null;
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exit.ExitHookManager.INTSignalHandler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exit;

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

final class ExitHookManager$JRE13ExitHookManager
  extends ExitHookManager
{
  private final Map m_exitThreadMap;
  
  public synchronized boolean addExitHook(Runnable runnable)
  {
    if ((runnable != null) && (!m_exitThreadMap.containsKey(runnable)))
    {
      Thread exitThread = new Thread(runnable, "EMMA shutdown handler thread");
      try
      {
        Runtime.getRuntime().addShutdownHook(exitThread);
        m_exitThreadMap.put(runnable, exitThread);
        
        return true;
      }
      catch (Exception e)
      {
        System.out.println("exception caught while adding a shutdown hook:");
        e.printStackTrace(System.out);
      }
    }
    return false;
  }
  
  public synchronized boolean removeExitHook(Runnable runnable)
  {
    if (runnable != null)
    {
      Thread exitThread = (Thread)m_exitThreadMap.get(runnable);
      if (exitThread != null) {
        try
        {
          Runtime.getRuntime().removeShutdownHook(exitThread);
          m_exitThreadMap.remove(runnable);
          
          return true;
        }
        catch (Exception e)
        {
          System.out.println("exception caught while removing a shutdown hook:");
          e.printStackTrace(System.out);
        }
      }
    }
    return false;
  }
  
  ExitHookManager$JRE13ExitHookManager()
  {
    m_exitThreadMap = new HashMap();
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exit.ExitHookManager.JRE13ExitHookManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exit;

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

final class ExitHookManager$SunJREExitHookManager
  extends ExitHookManager
{
  private final Map m_signalHandlerMap;
  
  public synchronized boolean addExitHook(Runnable runnable)
  {
    if ((runnable != null) && (!m_signalHandlerMap.containsKey(runnable)))
    {
      ExitHookManager.INTSignalHandler handler = new ExitHookManager.INTSignalHandler(runnable);
      try
      {
        handler.register();
        m_signalHandlerMap.put(runnable, handler);
        
        return true;
      }
      catch (Throwable t)
      {
        System.out.println("exception caught while adding a shutdown hook:");
        t.printStackTrace(System.out);
      }
    }
    return false;
  }
  
  public synchronized boolean removeExitHook(Runnable runnable)
  {
    if (runnable != null)
    {
      ExitHookManager.INTSignalHandler handler = (ExitHookManager.INTSignalHandler)m_signalHandlerMap.get(runnable);
      if (handler != null) {
        try
        {
          handler.unregister();
          m_signalHandlerMap.remove(runnable);
          
          return true;
        }
        catch (Exception e)
        {
          System.out.println("exception caught while removing a shutdown hook:");
          e.printStackTrace(System.out);
        }
      }
    }
    return false;
  }
  
  ExitHookManager$SunJREExitHookManager()
  {
    m_signalHandlerMap = new HashMap();
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exit.ExitHookManager.SunJREExitHookManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.util.exit;

import com.vladium.util.IJREVersion;
import com.vladium.util.Property;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
import sun.misc.Signal;
import sun.misc.SignalHandler;

public abstract class ExitHookManager
  implements IJREVersion
{
  private static ExitHookManager s_singleton;
  
  public abstract boolean addExitHook(Runnable paramRunnable);
  
  public abstract boolean removeExitHook(Runnable paramRunnable);
  
  public static synchronized ExitHookManager getSingleton()
  {
    if (s_singleton == null) {
      if (IJREVersion.JRE_1_3_PLUS) {
        s_singleton = new JRE13ExitHookManager();
      } else if (IJREVersion.JRE_SUN_SIGNAL_COMPATIBLE) {
        s_singleton = new SunJREExitHookManager();
      } else {
        throw new UnsupportedOperationException("no shutdown hook manager available [JVM: " + Property.getSystemFingerprint() + "]");
      }
    }
    return s_singleton;
  }
  
  private static final class JRE13ExitHookManager
    extends ExitHookManager
  {
    private final Map m_exitThreadMap;
    
    public synchronized boolean addExitHook(Runnable runnable)
    {
      if ((runnable != null) && (!m_exitThreadMap.containsKey(runnable)))
      {
        Thread exitThread = new Thread(runnable, "EMMA shutdown handler thread");
        try
        {
          Runtime.getRuntime().addShutdownHook(exitThread);
          m_exitThreadMap.put(runnable, exitThread);
          
          return true;
        }
        catch (Exception e)
        {
          System.out.println("exception caught while adding a shutdown hook:");
          e.printStackTrace(System.out);
        }
      }
      return false;
    }
    
    public synchronized boolean removeExitHook(Runnable runnable)
    {
      if (runnable != null)
      {
        Thread exitThread = (Thread)m_exitThreadMap.get(runnable);
        if (exitThread != null) {
          try
          {
            Runtime.getRuntime().removeShutdownHook(exitThread);
            m_exitThreadMap.remove(runnable);
            
            return true;
          }
          catch (Exception e)
          {
            System.out.println("exception caught while removing a shutdown hook:");
            e.printStackTrace(System.out);
          }
        }
      }
      return false;
    }
    
    JRE13ExitHookManager()
    {
      m_exitThreadMap = new HashMap();
    }
  }
  
  private static final class SunJREExitHookManager
    extends ExitHookManager
  {
    private final Map m_signalHandlerMap;
    
    public synchronized boolean addExitHook(Runnable runnable)
    {
      if ((runnable != null) && (!m_signalHandlerMap.containsKey(runnable)))
      {
        ExitHookManager.INTSignalHandler handler = new ExitHookManager.INTSignalHandler(runnable);
        try
        {
          handler.register();
          m_signalHandlerMap.put(runnable, handler);
          
          return true;
        }
        catch (Throwable t)
        {
          System.out.println("exception caught while adding a shutdown hook:");
          t.printStackTrace(System.out);
        }
      }
      return false;
    }
    
    public synchronized boolean removeExitHook(Runnable runnable)
    {
      if (runnable != null)
      {
        ExitHookManager.INTSignalHandler handler = (ExitHookManager.INTSignalHandler)m_signalHandlerMap.get(runnable);
        if (handler != null) {
          try
          {
            handler.unregister();
            m_signalHandlerMap.remove(runnable);
            
            return true;
          }
          catch (Exception e)
          {
            System.out.println("exception caught while removing a shutdown hook:");
            e.printStackTrace(System.out);
          }
        }
      }
      return false;
    }
    
    SunJREExitHookManager()
    {
      m_signalHandlerMap = new HashMap();
    }
  }
  
  private static final class INTSignalHandler
    implements SignalHandler
  {
    private Runnable m_runnable;
    private SignalHandler m_previous;
    
    public synchronized void handle(Signal signal)
    {
      if (m_runnable != null) {
        try
        {
          m_runnable.run();
        }
        catch (Throwable ignore) {}
      }
      m_runnable = null;
      if ((m_previous != null) && (m_previous != SignalHandler.SIG_DFL) && (m_previous != SignalHandler.SIG_IGN)) {
        try
        {
          m_previous.handle(signal);
        }
        catch (Throwable ignore) {}
      } else {
        System.exit(0);
      }
    }
    
    INTSignalHandler(Runnable runnable)
    {
      m_runnable = runnable;
    }
    
    synchronized void register()
    {
      m_previous = Signal.handle(new Signal("INT"), this);
    }
    
    synchronized void unregister()
    {
      m_runnable = null;
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.util.exit.ExitHookManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
import com.vladium.emma.Command;
import com.vladium.emma.EMMARuntimeException;
import java.io.PrintStream;

public final class emma
{
  public static void main(String[] args)
    throws EMMARuntimeException
  {
    if ((args.length == 0) || (args[0].startsWith("-h")))
    {
      System.out.println(USAGE);
      return;
    }
    String commandName = args[0];
    String[] commandArgs = new String[args.length - 1];
    System.arraycopy(args, 1, commandArgs, 0, commandArgs.length);
    
    Command command = Command.create(commandName, "emma ".concat(commandName), commandArgs);
    command.run();
  }
  
  private static final String EOL = System.getProperty("line.separator", "\n");
  private static final String USAGE = "emma usage: emma <command> [command options]," + EOL + "  where <command> is one of:" + EOL + EOL + "   run     application runner {same as 'emmarun' tool};" + EOL + "   instr   offline instrumentation processor;" + EOL + "   report  offline report generator;" + EOL + "   merge   offline data file merge processor." + EOL + EOL + "  {use '<command> -h' to see usage help for a given command}" + EOL + EOL + "[EMMA v2.0, build 5312]";
}

/* Location:
 * Qualified Name:     emma
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
import com.vladium.emma.Command;
import com.vladium.emma.EMMARuntimeException;

public final class emmarun
{
  public static void main(String[] args)
    throws EMMARuntimeException
  {
    Command command = Command.create("run", emmarun.class.getName(), args);
    command.run();
  }
}

/* Location:
 * Qualified Name:     emmarun
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

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