emma_ant

16:35:34.183 INFO  jd.cli.Main - Decompiling emma_ant.jar
package com.vladium.emma;

import java.io.PrintStream;

public final class ANTMain
{
  public static void main(String[] args)
  {
    System.out.println("this jar contains ANT task definitions for EMMA and is not meant to be executable");
    
    System.out.println();
    System.out.println("[EMMA v2.0, build 5312]");
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ANTMain
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;

public abstract class FileTask
  extends NestedTask
{
  private final List m_dataFileSets;
  
  public final void addInfileset(XFileSet set)
  {
    if (set != null) {
      m_dataFileSets.add(set);
    }
  }
  
  public final void addFileset(XFileSet set)
  {
    if (set != null) {
      m_dataFileSets.add(set);
    }
  }
  
  protected FileTask(SuppressableTask parent)
  {
    super(parent);
    
    m_dataFileSets = new ArrayList();
  }
  
  protected final String[] getDataPath(boolean removeNonexistent)
  {
    List _files = new ArrayList();
    for (Iterator i = m_dataFileSets.iterator(); i.hasNext();)
    {
      FileSet set = (FileSet)i.next();
      DirectoryScanner ds = set.getDirectoryScanner(project);
      File dsBaseDir = ds.getBasedir();
      
      String[] dsfiles = ds.getIncludedFiles();
      for (int f = 0; f < dsfiles.length; f++) {
        _files.add(new File(dsBaseDir, dsfiles[f]).getAbsolutePath());
      }
    }
    if (_files.size() == 0) {
      return EMPTY_STRING_ARRAY;
    }
    String[] files = new String[_files.size()];
    _files.toArray(files);
    
    return files;
  }
  
  private static final String[] EMPTY_STRING_ARRAY = new String[0];
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.FileTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import com.vladium.emma.instr.FilterCfg;
import com.vladium.emma.instr.FilterCfg.filterElement;
import java.io.File;
import org.apache.tools.ant.BuildException;

public abstract class FilterTask
  extends NestedTask
{
  protected static final String COMMA = ",";
  protected static final String COMMA_DELIMITERS = ", \t\r\n";
  
  public void init()
    throws BuildException
  {
    super.init();
    
    m_filterCfg = new FilterCfg(this);
  }
  
  public final void setFilter(String filter)
  {
    m_filterCfg.setFilter(filter);
  }
  
  public final FilterCfg.filterElement createFilter()
  {
    return m_filterCfg.createFilter();
  }
  
  protected FilterTask(SuppressableTask parent)
  {
    super(parent);
  }
  
  protected final String[] getFilterSpecs()
  {
    return m_filterCfg.getFilterSpecs();
  }
  
  protected static final String PATH_DELIMITERS = ",".concat(File.pathSeparator);
  private FilterCfg m_filterCfg;
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.FilterTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import com.vladium.emma.EMMAProperties;
import com.vladium.util.IProperties;
import com.vladium.util.Property;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class GenericCfg
{
  private final Task m_task;
  private final List m_genericPropertyElements;
  private File m_settingsFile;
  private transient IProperties m_fileSettings;
  private transient IProperties m_genericSettings;
  
  public GenericCfg(Task task)
  {
    if (task == null) {
      throw new IllegalArgumentException("null input: task");
    }
    m_task = task;
    m_genericPropertyElements = new ArrayList();
  }
  
  public void setProperties(File file)
  {
    m_settingsFile = file;
  }
  
  public PropertyElement createProperty()
  {
    m_genericSettings = null;
    
    PropertyElement property = new PropertyElement();
    m_genericPropertyElements.add(property);
    
    return property;
  }
  
  public IProperties getFileSettings()
  {
    IProperties fileSettings = m_fileSettings;
    if ((fileSettings == null) && (m_settingsFile != null))
    {
      try
      {
        fileSettings = EMMAProperties.wrap(Property.getPropertiesFromFile(m_settingsFile));
      }
      catch (IOException ioe)
      {
        throw ((BuildException)SuppressableTask.newBuildException(m_task.getTaskName() + ": property file [" + m_settingsFile.getAbsolutePath() + "] could not be read", ioe, m_task.getLocation()).fillInStackTrace());
      }
      m_fileSettings = fileSettings;
      
      return fileSettings;
    }
    return fileSettings;
  }
  
  public IProperties getGenericSettings()
  {
    IProperties genericSettings = m_genericSettings;
    if (genericSettings == null)
    {
      genericSettings = EMMAProperties.wrap(new Properties());
      for (Iterator i = m_genericPropertyElements.iterator(); i.hasNext();)
      {
        PropertyElement property = (PropertyElement)i.next();
        
        String name = property.getName();
        String value = property.getValue();
        if (value == null) {
          value = "";
        }
        if (name != null)
        {
          String currentValue = genericSettings.getProperty(name);
          if ((currentValue != null) && (!value.equals(currentValue))) {
            throw ((BuildException)SuppressableTask.newBuildException(m_task.getTaskName() + ": conflicting settings for property [" + name + "]: [" + value + "]", m_task.getLocation()).fillInStackTrace());
          }
          genericSettings.setProperty(name, value);
        }
      }
      m_genericSettings = genericSettings;
      
      return genericSettings;
    }
    return genericSettings;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.GenericCfg
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

class IANTVersion$1
{
  static Class class$java$io$File;
  static Class class$org$apache$tools$ant$types$FileSet;
  
  static Class class$(String x0)
  {
    try
    {
      return Class.forName(x0);
    }
    catch (ClassNotFoundException x1)
    {
      throw new NoClassDefFoundError(x1.getMessage());
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.IANTVersion.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import java.lang.reflect.Method;

public abstract class IANTVersion$_ANTVersion
{
  static final boolean _ANT_1_5_PLUS;
  
  static
  {
    boolean temp = true;
    try
    {
      Method m = (IANTVersion.1.class$org$apache$tools$ant$types$FileSet == null ? (IANTVersion.1.class$org$apache$tools$ant$types$FileSet = IANTVersion.1.class$("org.apache.tools.ant.types.FileSet")) : IANTVersion.1.class$org$apache$tools$ant$types$FileSet).getMethod("setFile", new Class[] { IANTVersion.1.class$java$io$File == null ? (IANTVersion.1.class$java$io$File = IANTVersion.1.class$("java.io.File")) : IANTVersion.1.class$java$io$File });
      
      int modifiers = m.getModifiers();
      if ((modifiers & 0x8) != 0) {
        temp = false;
      }
    }
    catch (NoSuchMethodException nsme)
    {
      temp = false;
    }
    catch (SecurityException se)
    {
      temp = false;
    }
    catch (Throwable t)
    {
      t.printStackTrace(System.out);
      temp = false;
    }
    _ANT_1_5_PLUS = temp;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.IANTVersion._ANTVersion
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import java.lang.reflect.Method;

public abstract interface IANTVersion
{
  public static final boolean ANT_1_5_PLUS = _ANTVersion._ANT_1_5_PLUS;
  
  public static abstract class _ANTVersion
  {
    static final boolean _ANT_1_5_PLUS;
    
    static
    {
      boolean temp = true;
      try
      {
        Method m = (IANTVersion.1.class$org$apache$tools$ant$types$FileSet == null ? (IANTVersion.1.class$org$apache$tools$ant$types$FileSet = IANTVersion.1.class$("org.apache.tools.ant.types.FileSet")) : IANTVersion.1.class$org$apache$tools$ant$types$FileSet).getMethod("setFile", new Class[] { IANTVersion.1.class$java$io$File == null ? (IANTVersion.1.class$java$io$File = IANTVersion.1.class$("java.io.File")) : IANTVersion.1.class$java$io$File });
        
        int modifiers = m.getModifiers();
        if ((modifiers & 0x8) != 0) {
          temp = false;
        }
      }
      catch (NoSuchMethodException nsme)
      {
        temp = false;
      }
      catch (SecurityException se)
      {
        temp = false;
      }
      catch (Throwable t)
      {
        t.printStackTrace(System.out);
        temp = false;
      }
      _ANT_1_5_PLUS = temp;
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.IANTVersion
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import com.vladium.util.IProperties;
import com.vladium.util.IProperties.Factory;

public abstract class NestedTask
  extends SuppressableTask
{
  protected final SuppressableTask m_parent;
  
  protected NestedTask(SuppressableTask parent)
  {
    if (parent == null) {
      throw new IllegalArgumentException("null input: parent");
    }
    m_parent = parent;
  }
  
  protected final IProperties getTaskSettings()
  {
    IProperties parentSettings = m_parent != null ? m_parent.getTaskSettings() : null;
    
    IProperties taskOverrides = super.getTaskSettings();
    if (parentSettings == null) {
      return taskOverrides;
    }
    IProperties settings = IProperties.Factory.combine(taskOverrides, parentSettings);
    
    return settings;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.NestedTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

public final class PropertyElement
{
  private String m_name;
  private String m_value;
  
  public String getName()
  {
    return m_name;
  }
  
  public String getValue()
  {
    return m_value;
  }
  
  public void setName(String name)
  {
    m_name = name;
  }
  
  public void setValue(String value)
  {
    m_value = value;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.PropertyElement
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import org.apache.tools.ant.Task;

public abstract class StringValue
{
  protected final Task m_task;
  private StringBuffer m_value;
  
  public void appendValue(String value, String separator)
  {
    if ((value != null) && (value.length() > 0)) {
      if (m_value == null)
      {
        m_value = new StringBuffer(value);
      }
      else
      {
        m_value.append(separator);
        m_value.append(value);
      }
    }
  }
  
  public String getValue()
  {
    return m_value != null ? m_value.toString() : null;
  }
  
  protected StringValue(Task task)
  {
    if (task == null) {
      throw new IllegalArgumentException("null input: task");
    }
    m_task = task;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.StringValue
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import com.vladium.util.IProperties;
import com.vladium.util.IProperties.Factory;
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Task;

public abstract class SuppressableTask
  extends Task
{
  private VerbosityCfg m_verbosityCfg;
  private GenericCfg m_genericCfg;
  private boolean m_enabled;
  
  public void init()
    throws BuildException
  {
    super.init();
    
    m_verbosityCfg = new VerbosityCfg();
    m_genericCfg = new GenericCfg(this);
  }
  
  public final void setEnabled(boolean enabled)
  {
    m_enabled = enabled;
  }
  
  public final boolean isEnabled()
  {
    return m_enabled;
  }
  
  public void setVerbosity(VerbosityCfg.VerbosityAttribute verbosity)
  {
    m_verbosityCfg.setVerbosity(verbosity);
  }
  
  public void setVerbosityfilter(String filter)
  {
    m_verbosityCfg.setVerbosityfilter(filter);
  }
  
  public final void setProperties(File file)
  {
    m_genericCfg.setProperties(file);
  }
  
  public final PropertyElement createProperty()
  {
    return m_genericCfg.createProperty();
  }
  
  public static BuildException newBuildException(String msg, Location location)
  {
    String prefixedMsg = "[EMMA v2.0.5312] " + msg;
    
    return new BuildException(prefixedMsg, location);
  }
  
  public static BuildException newBuildException(String msg, Throwable cause, Location location)
  {
    String prefixedMsg = "[EMMA v2.0.5312] " + msg;
    
    return new BuildException(prefixedMsg, cause, location);
  }
  
  protected SuppressableTask()
  {
    m_enabled = true;
  }
  
  protected IProperties getTaskSettings()
  {
    IProperties fileSettings = m_genericCfg.getFileSettings();
    IProperties genericSettings = m_genericCfg.getGenericSettings();
    IProperties verbositySettings = m_verbosityCfg.getSettings();
    
    return IProperties.Factory.combine(verbositySettings, IProperties.Factory.combine(genericSettings, fileSettings));
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.SuppressableTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import org.apache.tools.ant.types.EnumeratedAttribute;

public final class VerbosityCfg$VerbosityAttribute
  extends EnumeratedAttribute
{
  public String[] getValues()
  {
    return VALUES;
  }
  
  private static final String[] VALUES = { "severe", "silent", "warning", "quiet", "info", "verbose", "trace1", "trace2", "trace3" };
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.VerbosityCfg.VerbosityAttribute
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import com.vladium.emma.EMMAProperties;
import com.vladium.util.IProperties;
import java.util.Properties;
import org.apache.tools.ant.types.EnumeratedAttribute;

public final class VerbosityCfg
{
  private String m_verbosity;
  private String m_verbosityFilter;
  private transient IProperties m_settings;
  
  public static final class VerbosityAttribute
    extends EnumeratedAttribute
  {
    public String[] getValues()
    {
      return VALUES;
    }
    
    private static final String[] VALUES = { "severe", "silent", "warning", "quiet", "info", "verbose", "trace1", "trace2", "trace3" };
  }
  
  public void setVerbosity(VerbosityAttribute verbosity)
  {
    m_verbosity = verbosity.getValue();
  }
  
  public void setVerbosityfilter(String filter)
  {
    m_verbosityFilter = filter;
  }
  
  public IProperties getSettings()
  {
    IProperties settings = m_settings;
    if (settings == null)
    {
      settings = EMMAProperties.wrap(new Properties());
      if ((m_verbosity != null) && (m_verbosity.trim().length() > 0)) {
        settings.setProperty("verbosity.level", m_verbosity.trim());
      }
      if ((m_verbosityFilter != null) && (m_verbosityFilter.trim().length() > 0)) {
        settings.setProperty("verbosity.filter", m_verbosityFilter.trim());
      }
      m_settings = settings;
      return settings;
    }
    return settings;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.VerbosityCfg
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.ant;

import java.io.File;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.PatternSet.NameEntry;

public final class XFileSet
  extends FileSet
{
  public XFileSet() {}
  
  public XFileSet(FileSet fileset)
  {
    super(fileset);
  }
  
  public void setFile(File file)
  {
    if (IANTVersion.ANT_1_5_PLUS)
    {
      super.setFile(file);
    }
    else
    {
      if (isReference()) {
        throw tooManyAttributes();
      }
      File parent = file.getParentFile();
      if (parent != null) {
        setDir(parent);
      }
      PatternSet.NameEntry include = createInclude();
      include.setName(file.getName());
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.ant.XFileSet
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.data;

import com.vladium.emma.ant.FileTask;
import com.vladium.emma.ant.SuppressableTask;
import java.io.File;
import org.apache.tools.ant.BuildException;

public final class mergeTask
  extends FileTask
{
  private File m_outFile;
  
  public mergeTask(SuppressableTask parent)
  {
    super(parent);
  }
  
  public void execute()
    throws BuildException
  {
    if (isEnabled())
    {
      String[] files = getDataPath(true);
      if ((files == null) || (files.length == 0)) {
        throw ((BuildException)newBuildException(getTaskName() + ": no valid input data files have been specified", location).fillInStackTrace());
      }
      MergeProcessor processor = MergeProcessor.create();
      
      processor.setDataPath(files);files = null;
      processor.setSessionOutFile(m_outFile != null ? m_outFile.getAbsolutePath() : null);
      processor.setPropertyOverrides(getTaskSettings());
      
      processor.run();
    }
  }
  
  public void setMergefile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)newBuildException(getTaskName() + ": merge data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
  
  public void setOutfile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)newBuildException(getTaskName() + ": merge data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
  
  public void setTofile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)newBuildException(getTaskName() + ": merge data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
  
  public void setFile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)newBuildException(getTaskName() + ": merge data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.data.mergeTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma;

import com.vladium.emma.ant.NestedTask;
import com.vladium.emma.ant.SuppressableTask;
import com.vladium.emma.data.mergeTask;
import com.vladium.emma.instr.instrTask;
import com.vladium.emma.report.reportTask;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.BuildException;

public final class emmaTask
  extends SuppressableTask
{
  private final List m_tasks;
  
  public emmaTask()
  {
    m_tasks = new ArrayList();
  }
  
  public synchronized void execute()
    throws BuildException
  {
    log("[EMMA v2.0, build 5312 (2005/06/12 19:32:43)]", 3);
    if (isEnabled()) {
      while (!m_tasks.isEmpty())
      {
        NestedTask task = (NestedTask)m_tasks.remove(0);
        
        String name = getTaskName();
        try
        {
          setTaskName(task.getTaskName());
          
          task.execute();
        }
        finally
        {
          setTaskName(name);
        }
      }
    }
  }
  
  public NestedTask createInstr()
  {
    return addTask(new instrTask(this), getNestedTaskName("instr"));
  }
  
  public NestedTask createMerge()
  {
    return addTask(new mergeTask(this), getNestedTaskName("merge"));
  }
  
  public NestedTask createReport()
  {
    return addTask(new reportTask(this), getNestedTaskName("report"));
  }
  
  protected NestedTask addTask(NestedTask task, String pseudoName)
  {
    initTask(task, pseudoName);
    
    m_tasks.add(task);
    return task;
  }
  
  protected void initTask(NestedTask task, String pseudoName)
  {
    task.setTaskName(pseudoName);
    task.setProject(getProject());
    task.setLocation(getLocation());
    task.setOwningTarget(getOwningTarget());
    
    task.init();
  }
  
  protected String getNestedTaskName(String subname)
  {
    return getTaskName().concat(".").concat(subname);
  }
}

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

import com.vladium.emma.ant.GenericCfg;
import com.vladium.emma.ant.PropertyElement;
import com.vladium.emma.ant.SuppressableTask;
import com.vladium.emma.ant.VerbosityCfg;
import com.vladium.emma.ant.VerbosityCfg.VerbosityAttribute;
import com.vladium.emma.instr.FilterCfg;
import com.vladium.emma.instr.FilterCfg.filterElement;
import com.vladium.emma.report.IReportEnums.DepthAttribute;
import com.vladium.emma.report.IReportEnums.UnitsTypeAttribute;
import com.vladium.emma.report.ReportCfg;
import com.vladium.emma.report.ReportCfg.Element_HTML;
import com.vladium.emma.report.ReportCfg.Element_TXT;
import com.vladium.emma.report.ReportCfg.Element_XML;
import com.vladium.util.IProperties;
import com.vladium.util.IProperties.Factory;
import com.vladium.util.Strings;
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.Java;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Commandline.Argument;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;

public class emmajavaTask
  extends Java
{
  private Path m_classpath;
  private String m_classname;
  private File m_jar;
  private Commandline m_appArgs;
  private boolean m_fork;
  private boolean m_forkUserOverride;
  private boolean m_enabled;
  private Path m_libClasspath;
  private VerbosityCfg m_verbosityCfg;
  private GenericCfg m_genericCfg;
  private FilterCfg m_filterCfg;
  private ReportCfg m_reportCfg;
  private boolean m_scanCoveragePath;
  private boolean m_dumpSessionData;
  private File m_outFile;
  private Boolean m_outFileMerge;
  
  public void init()
    throws BuildException
  {
    super.init();
    
    m_verbosityCfg = new VerbosityCfg();
    m_genericCfg = new GenericCfg(this);
    m_filterCfg = new FilterCfg(this);
    m_reportCfg = new ReportCfg(project, this);
    setEnabled(true);
  }
  
  public void execute()
    throws BuildException
  {
    log("[EMMA v2.0, build 5312 (2005/06/12 19:32:43)]", 3);
    if (getClasspath() == null) {
      throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + ": this task requires 'classpath' attribute to be set", location).fillInStackTrace());
    }
    if (isEnabled())
    {
      if ((m_forkUserOverride) && (!m_fork)) {
        log(getTaskName() + ": 'fork=\"false\"' attribute setting ignored (this task always forks)", 1);
      }
      super.setFork(true);
      
      Path libClasspath = m_libClasspath;
      if ((libClasspath != null) && (libClasspath.size() > 0)) {
        super.createClasspath().append(libClasspath);
      }
      super.setClassname("emmarun");
      
      String reportTypes = Strings.toListForm(m_reportCfg.getReportTypes(), ',');
      if ((reportTypes == null) || (reportTypes.length() == 0)) {
        reportTypes = "txt";
      }
      super.createArg().setValue("-r");
      super.createArg().setValue(reportTypes);
      if (m_scanCoveragePath) {
        super.createArg().setValue("-f");
      }
      if (m_dumpSessionData)
      {
        super.createArg().setValue("-raw");
        if (m_outFile != null)
        {
          super.createArg().setValue("-out");
          super.createArg().setValue(m_outFile.getAbsolutePath());
        }
        if (m_outFileMerge != null)
        {
          super.createArg().setValue("-merge");
          super.createArg().setValue(m_outFileMerge.booleanValue() ? "y" : "n");
        }
      }
      else
      {
        if (m_outFile != null) {
          log(getTaskName() + ": output file attribute ignored ('fullmetadata=\"true\"' not specified)", 1);
        }
        if (m_outFileMerge != null) {
          log(getTaskName() + ": merge attribute setting ignored ('fullmetadata=\"true\"' not specified)", 1);
        }
      }
      String[] specs = m_filterCfg.getFilterSpecs();
      if ((specs != null) && (specs.length > 0))
      {
        super.createArg().setValue("-ix");
        super.createArg().setValue(Strings.toListForm(specs, ','));
      }
      Path srcpath = m_reportCfg.getSourcepath();
      if (srcpath != null)
      {
        super.createArg().setValue("-sp");
        super.createArg().setValue(Strings.toListForm(srcpath.list(), ','));
      }
      IProperties reportSettings = m_reportCfg.getReportSettings();
      IProperties genericSettings = m_genericCfg.getGenericSettings();
      
      IProperties fileSettings = m_genericCfg.getFileSettings();
      
      IProperties verbositySettings = m_verbosityCfg.getSettings();
      
      IProperties settings = IProperties.Factory.combine(reportSettings, IProperties.Factory.combine(verbositySettings, IProperties.Factory.combine(genericSettings, fileSettings)));
      
      String[] argForm = settings.toAppArgsForm("-D");
      if (argForm.length > 0) {
        for (int a = 0; a < argForm.length; a++) {
          super.createArg().setValue(argForm[a]);
        }
      }
      super.createArg().setValue("-cp");
      super.createArg().setPath(getClasspath());
      if (getClassname() != null)
      {
        super.createArg().setValue(getClassname());
      }
      else if (getJar() != null)
      {
        super.createArg().setValue("-jar");
        super.createArg().setValue(getJar().getAbsolutePath());
      }
      else
      {
        throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + "either 'jar' or 'classname' attribute must be set", location).fillInStackTrace());
      }
      if (m_appArgs != null)
      {
        String[] args = m_appArgs.getArguments();
        for (int a = 0; a < args.length; a++) {
          super.createArg().setValue(args[a]);
        }
      }
    }
    else
    {
      super.setFork(m_fork);
      
      super.createClasspath().append(getClasspath());
      if (getClassname() != null) {
        super.setClassname(getClassname());
      } else if (getJar() != null) {
        super.setJar(getJar());
      } else {
        throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + "either 'jar' or 'classname' attribute must be set", location).fillInStackTrace());
      }
      if (m_appArgs != null)
      {
        String[] args = m_appArgs.getArguments();
        for (int a = 0; a < args.length; a++) {
          super.createArg().setValue(args[a]);
        }
      }
    }
    super.execute();
  }
  
  public void setClassname(String classname)
  {
    if (getJar() != null) {
      throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + "'jar' and 'classname' attributes cannot be set at the same time", location).fillInStackTrace());
    }
    m_classname = classname;
  }
  
  public void setJar(File file)
  {
    if (getClassname() != null) {
      throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + "'jar' and 'classname' attributes cannot be set at the same time", location).fillInStackTrace());
    }
    m_jar = file;
  }
  
  public void setClasspath(Path path)
  {
    if (m_classpath == null) {
      m_classpath = path;
    } else {
      m_classpath.append(path);
    }
  }
  
  public void setClasspathRef(Reference ref)
  {
    createClasspath().setRefid(ref);
  }
  
  public Path createClasspath()
  {
    if (m_classpath == null) {
      m_classpath = new Path(project);
    }
    return m_classpath.createPath();
  }
  
  public void setArgs(String args)
  {
    throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + ": disallows using <java>'s deprecated 'args' attribute", location).fillInStackTrace());
  }
  
  public final void setFork(boolean fork)
  {
    m_fork = fork;
    m_forkUserOverride = true;
  }
  
  public final Commandline.Argument createArg()
  {
    if (m_appArgs == null) {
      m_appArgs = new Commandline();
    }
    return m_appArgs.createArgument();
  }
  
  public void setEnabled(boolean enabled)
  {
    m_enabled = enabled;
  }
  
  public final void setProperties(File file)
  {
    m_genericCfg.setProperties(file);
  }
  
  public final PropertyElement createProperty()
  {
    return m_genericCfg.createProperty();
  }
  
  public void setVerbosity(VerbosityCfg.VerbosityAttribute verbosity)
  {
    m_verbosityCfg.setVerbosity(verbosity);
  }
  
  public void setVerbosityfilter(String filter)
  {
    m_verbosityCfg.setVerbosityfilter(filter);
  }
  
  public final void setLibclasspath(Path classpath)
  {
    if (m_libClasspath == null) {
      m_libClasspath = classpath;
    } else {
      m_libClasspath.append(classpath);
    }
  }
  
  public final void setLibclasspathRef(Reference ref)
  {
    if (m_libClasspath == null) {
      m_libClasspath = new Path(project);
    }
    m_libClasspath.createPath().setRefid(ref);
  }
  
  public void setFullmetadata(boolean full)
  {
    m_scanCoveragePath = full;
  }
  
  public void setDumpsessiondata(boolean dump)
  {
    m_dumpSessionData = dump;
  }
  
  public void setSessiondatafile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + ": session data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
  
  public void setOutfile(File file)
  {
    if (m_outFile != null) {
      throw ((BuildException)SuppressableTask.newBuildException(getTaskName() + ": session data file attribute already set", location).fillInStackTrace());
    }
    m_outFile = file;
  }
  
  public void setMerge(boolean merge)
  {
    m_outFileMerge = (merge ? Boolean.TRUE : Boolean.FALSE);
  }
  
  public final void setFilter(String filter)
  {
    m_filterCfg.setFilter(filter);
  }
  
  public final FilterCfg.filterElement createFilter()
  {
    return m_filterCfg.createFilter();
  }
  
  public final void setSourcepath(Path path)
  {
    m_reportCfg.setSourcepath(path);
  }
  
  public final void setSourcepathRef(Reference ref)
  {
    m_reportCfg.setSourcepathRef(ref);
  }
  
  public final Path createSourcepath()
  {
    return m_reportCfg.createSourcepath();
  }
  
  public final ReportCfg.Element_TXT createTxt()
  {
    return m_reportCfg.createTxt();
  }
  
  public final ReportCfg.Element_HTML createHtml()
  {
    return m_reportCfg.createHtml();
  }
  
  public final ReportCfg.Element_XML createXml()
  {
    return m_reportCfg.createXml();
  }
  
  public final void setUnits(IReportEnums.UnitsTypeAttribute units)
  {
    m_reportCfg.setUnits(units);
  }
  
  public final void setDepth(IReportEnums.DepthAttribute depth)
  {
    m_reportCfg.setDepth(depth);
  }
  
  public final void setColumns(String columns)
  {
    m_reportCfg.setColumns(columns);
  }
  
  public final void setSort(String sort)
  {
    m_reportCfg.setSort(sort);
  }
  
  public final void setMetrics(String metrics)
  {
    m_reportCfg.setMetrics(metrics);
  }
  
  public void setEncoding(String encoding)
  {
    m_reportCfg.setEncoding(encoding);
  }
  
  protected String getClassname()
  {
    return m_classname;
  }
  
  protected File getJar()
  {
    return m_jar;
  }
  
  protected Path getClasspath()
  {
    return m_classpath;
  }
  
  protected boolean isEnabled()
  {
    return m_enabled;
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.emmajavaTask
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.instr;

import com.vladium.emma.ant.StringValue;
import com.vladium.util.Strings;
import java.io.File;
import org.apache.tools.ant.Task;

public final class FilterCfg$filterElement
  extends StringValue
{
  public FilterCfg$filterElement(Task task)
  {
    super(task);
  }
  
  public void setValue(String value)
  {
    String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
    for (int i = 0; i < specs.length; i++)
    {
      String spec = specs[i];
      if ((spec.startsWith("+")) || (spec.startsWith("-"))) {
        appendValue(spec, ",");
      } else {
        appendValue('+' + spec, ",");
      }
    }
  }
  
  public void setFile(File file)
  {
    appendValue("@".concat(file.getAbsolutePath()), ",");
  }
  
  public void setIncludes(String value)
  {
    String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
    for (int i = 0; i < specs.length; i++)
    {
      String spec = specs[i];
      if (spec.startsWith("+")) {
        appendValue(spec, ",");
      } else if (spec.startsWith("-")) {
        appendValue('+' + spec.substring(1), ",");
      } else {
        appendValue('+' + spec, ",");
      }
    }
  }
  
  public void setExcludes(String value)
  {
    String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
    for (int i = 0; i < specs.length; i++)
    {
      String spec = specs[i];
      if (spec.startsWith("-")) {
        appendValue(spec, ",");
      } else if (spec.startsWith("+")) {
        appendValue('-' + spec.substring(1), ",");
      } else {
        appendValue('-' + spec, ",");
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.emma.instr.FilterCfg.filterElement
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.instr;

import com.vladium.emma.ant.StringValue;
import com.vladium.emma.ant.SuppressableTask;
import com.vladium.util.IConstants;
import com.vladium.util.Strings;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class FilterCfg
{
  protected static final String COMMA = ",";
  protected static final String COMMA_DELIMITERS = ", \t\r\n";
  
  public static final class filterElement
    extends StringValue
  {
    public filterElement(Task task)
    {
      super();
    }
    
    public void setValue(String value)
    {
      String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
      for (int i = 0; i < specs.length; i++)
      {
        String spec = specs[i];
        if ((spec.startsWith("+")) || (spec.startsWith("-"))) {
          appendValue(spec, ",");
        } else {
          appendValue('+' + spec, ",");
        }
      }
    }
    
    public void setFile(File file)
    {
      appendValue("@".concat(file.getAbsolutePath()), ",");
    }
    
    public void setIncludes(String value)
    {
      String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
      for (int i = 0; i < specs.length; i++)
      {
        String spec = specs[i];
        if (spec.startsWith("+")) {
          appendValue(spec, ",");
        } else if (spec.startsWith("-")) {
          appendValue('+' + spec.substring(1), ",");
        } else {
          appendValue('+' + spec, ",");
        }
      }
    }
    
    public void setExcludes(String value)
    {
      String[] specs = Strings.merge(new String[] { value }, ", \t\r\n", true);
      for (int i = 0; i < specs.length; i++)
      {
        String spec = specs[i];
        if (spec.startsWith("-")) {
          appendValue(spec, ",");
        } else if (spec.startsWith("+")) {
          appendValue('-' + spec.substring(1), ",");
        } else {
          appendValue('-' + spec, ",");
        }
      }
    }
  }
  
  public FilterCfg(Task task)
  {
    if (task == null) {
      throw new IllegalArgumentException("null input: task");
    }
    m_task = task;
    m_filterList = new ArrayList();
  }
  
  public void setFilter(String filter)
  {
    createFilter().appendValue(filter, ",");
  }
  
  public filterElement createFilter()
  {
    filterElement result = new filterElement(m_task);
    m_filterList.add(result);
    
    return result;
  }
  
  public String[] getFilterSpecs()
  {
    if (m_specs != null) {
      return m_specs;
    }
    if ((m_filterList == null) || (m_filterList.isEmpty()))
    {
      m_specs = IConstants.EMPTY_STRING_ARRAY;
    }
    else
    {
      String[] values = new String[m_filterList.size()];
      
      int j = 0;
      for (Iterator i = m_filterList.iterator(); i.hasNext(); j++) {
        values[j] = ((StringValue)i.next()).getValue();
      }
      try
      {
        m_specs = Strings.mergeAT(values, ", \t\r\n", true);
      }
      catch (IOException ioe)
      {
        throw ((BuildException)SuppressableTask.newBuildException(m_task.getTaskName() + ": I/O exception while processing input", ioe, m_task.getLocation()).fillInStackTrace());
      }
    }
    return m_specs;
  }
  
  protected static final String PATH_DELIMITERS = ",".concat(File.pathSeparator);
  private final Task m_task;
  private final List m_filterList;
  private transient String[] m_specs;
}

/* Location:
 * Qualified Name:     com.vladium.emma.instr.FilterCfg
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.instr;

import org.apache.tools.ant.types.EnumeratedAttribute;

public final class instrTask$ModeAttribute
  extends EnumeratedAttribute
{
  public String[] getValues()
  {
    return VALUES;
  }
  
  private static final String[] VALUES = { "copy", "overwrite", "fullcopy" };
}

/* Location:
 * Qualified Name:     com.vladium.emma.instr.instrTask.ModeAttribute
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.emma.instr;

import com.vladium.emma.ant.FilterTask;
import com.vladium.emma.ant.SuppressableTask;
import com.vladium.util.asserts..assert;
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;

public final class instrTask
  extends FilterTask
{
  private Path m_instrpath;
  private InstrProcessor.OutMode m_outMode;
  private File m_outDir;
  private File m_outFile;
  private Boolean m_outFileMerge;
  
  public static final class ModeAttribute
    extends EnumeratedAttribute
  {
    public String[] getValues()
    {
      return VALUES;
    }
    
    private static final String[] VALUES = { "copy", "overwrite", "fullcopy" };
  }
  
  public instrTask(SuppressableTask parent)
  {
    super(parent);
    
    m_outMode = InstrProcessor.OutMode.OUT_MODE_COPY;
  }
  
  public void execute()
    throws BuildException
  {
    if (isEnabled())
    {
      if (m_instrpath == null) {
        throw ((BuildException)newBuildException(getTaskName() + ": instrumentation path must be specified", location).fillInStackTrace());
      }
      if ((m_outMode != InstrProcessor.OutMode.OUT_MODE_OVERWRITE) && (m_outDir == null)) {
        throw ((BuildException)newBuildException(getTaskName() + ": output directory must be specified for '" + m_outMode + "' output mode", location).fillInStackTrace());
      }
      InstrProcessor processor = InstrProcessor.create();
      
      .assert.ASSERT(m_instrpath != null, "m_instrpath not set");
      processor.setInstrPath(m_instrpath.list(), true);
      
      processor.setInclExclFilter(getFilterSpecs());
      .assert.ASSERT(m_outMode != null, "m_outMode not set");
      processor.setOutMode(m_outMode);
      processor.setInstrOutDir(m_outDir != null ? m_outDir.getAbsolutePath() : null);
      processor.setMetaOutFile(m_outFile != null ? m_outFile.getAbsolutePath() : null);
      processor.setMetaOutMerge(m_outFileMerge);
      processor.setPropertyOverrides(getTaskSettings());
      
      processor.run();
    }
  }
  
  public void setInstrpath(Path path)
  {
    if (m_instrpath == null) {
      m_instrpath = pa
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