gt: 			String tName = atts.getValue(TraceXmlWrapper.NAME_TAG);
context: /*
   * #%~
   * Combinatorial Testing
   * %%
   * Copyright (C) 2008 - 2014 Overture
   * %%
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as
   * published by the Free Software Foundation, either version 3 of the
   * License, or (at your option) any later version.
   * 
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   * 
   * You should have received a copy of the GNU General Public
   * License along with this program.  If not, see
   * <http://www.gnu.org/licenses/gpl-3.0.html>.
   * #~%
   */
  package org.overture.ide.plugins.combinatorialtesting;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.Vector;
  
  import org.overture.ct.utils.TraceTestResult;
  import org.overture.ct.utils.TraceXmlWrapper;
  import org.overture.ct.utils.XmlFileWriter;
  import org.overture.interpreter.traces.TraceReductionType;
  import org.overture.interpreter.traces.Verdict;
  import org.xml.sax.Attributes;
  import org.xml.sax.InputSource;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  import org.xml.sax.SAXParseException;
  import org.xml.sax.XMLReader;
  import org.xml.sax.helpers.DefaultHandler;
  import org.xml.sax.helpers.XMLReaderFactory;
  
  public class TracesXmlStoreReader extends DefaultHandler
  {
  	public class TraceStatusXml
  	{
  		private Integer testCount;
  		private Integer skippedTestCount;
  		private Verdict verdict;
  		private Integer faildCount;
  		private Integer inconclusiveCount;
  
  		public void setTestCount(Integer testCount)
  		{
  			this.testCount = testCount;
  		}
  
  		public Integer getTestCount()
  		{
  			return testCount;
  		}
  
  		public void setSkippedTestCount(Integer skippedTestCount)
  		{
  			this.skippedTestCount = skippedTestCount;
  		}
  
  		public Integer getSkippedTestCount()
  		{
  			return skippedTestCount;
  		}
  
  		public void setVerdict(Verdict verdict)
  		{
  			this.verdict = verdict;
  		}
  
  		public Verdict getVerdict()
  		{
  			return verdict;
  		}
  
  		public void setFaildCount(Integer faildCount)
  		{
  			this.faildCount = faildCount;
  		}
  
  		public Integer getFaildCount()
  		{
  			return faildCount;
  		}
  
  		public void setInconclusiveCount(Integer inconclusiveCount)
  		{
  			this.inconclusiveCount = inconclusiveCount;
  		}
  
  		public Integer getInconclusiveCount()
  		{
  			return inconclusiveCount;
  		}
  	}
  
  	public class TraceInfo
  	{
  		private String className;
  		private String traceName;
  		private Integer testCount;
  		private Float subset;
  		private TraceReductionType traceReductionType;
  		private Long seed;
  
  		public void setSeed(Long seed)
  		{
  			this.seed = seed;
  		}
  
  		public Long getSeed()
  		{
  			return seed;
  		}
  
  		public void setTraceReductionType(TraceReductionType traceReductionType)
  		{
  			this.traceReductionType = traceReductionType;
  		}
  
  		public TraceReductionType getTraceReductionType()
  		{
  			return traceReductionType;
  		}
  
  		public void setSubset(Float subset)
  		{
  			this.subset = subset;
  		}
  
  		public Float getSubset()
  		{
  			return subset;
  		}
  
  		public void setTestCount(Integer testCount)
  		{
  			this.testCount = testCount;
  		}
  
  		public Integer getTestCount()
  		{
  			return testCount;
  		}
  
  		public void setTraceName(String traceName)
  		{
  			this.traceName = traceName;
  		}
  
  		public String getTraceName()
  		{
  			return traceName;
  		}
  
  		public void setClassName(String className)
  		{
  			this.className = className;
  		}
  
  		public String getClassName()
  		{
  			return className;
  		}
  	}
  
  	StringBuilder data = new StringBuilder();
  	File file;
  	String className;
  	String traceName;
  	Map<String, TraceInfo> traceCount = new HashMap<String, TraceInfo>();
  
  	Map<String, TraceStatusXml> traceStatus = new HashMap<String, TraceStatusXml>();
  
  	List<TraceTestResult> traceTestResults;
  	TraceTestResult currentResult;
  	int currentResultIndex;
  	Locator locator;
  
  	boolean inClass = false;
  	boolean inTrace = false;
  	boolean initialParse = true;
  	boolean traceTestParse = false;
  
  	boolean insertArgument = false;
  	boolean insertResult = false;
  
  	Integer traceTaceTestStartNumber;
  	Integer traceTaceTestStopNumber;
  	String currentTraceName;
  	final String charset;
  
  	public TracesXmlStoreReader(File file, String className)
  			throws SAXException, IOException
  	{
  		this(file, className, "utf-8");
  	}
  
  	public TracesXmlStoreReader(File file, String className, String charset)
  			throws SAXException, IOException
  	{
  		super();
  		this.file = file;
  		this.className = className;
  		this.charset = charset;
  		parse();
  		initialParse = false;
  	}
  
  	private void parse() throws SAXException, IOException
  	{
  		XMLReader xr = XMLReaderFactory.createXMLReader();
  		TracesXmlStoreReader handler = this;
  		xr.setContentHandler(handler);
  		xr.setErrorHandler(handler);
  
  		// FileReader r = new FileReader(this.file); this cannot be used since it doesnt suppport char set
  		InputStreamReader r = new InputStreamReader(new FileInputStream(this.file), "UTF-8");
  		InputSource input = new InputSource(r);
  		input.setEncoding("UTF-8");
  		xr.parse(input);
  		r.close();
  
  	}
  
  	public List<TraceTestResult> getTraceTestResults(String traceName,
  			Integer startNumber, Integer stopNumber) throws SAXException,
  			IOException
  	{
  		traceTestResults = new Vector<TraceTestResult>();
  
  		this.traceTaceTestStartNumber = startNumber;
  		this.traceTaceTestStopNumber = stopNumber;
  		this.traceName = traceName;
  		this.traceTestParse = true;
  
  		parse();
  		List<TraceTestResult> traceTestResults1 = traceTestResults;
  		traceTestResults = null;
  		return traceTestResults1;
  	}
  
  	// //////////////////////////////////////////////////////////////////
  	// Event handlers.
  	// //////////////////////////////////////////////////////////////////
  
  	@Override
  	public void startDocument()
  	{
  		// System.out.println("Start document");
  	}
  
  	@Override
  	public void endDocument()
  	{
  		// System.out.println("End document");
  	}
  
  	@Override
  	public void setDocumentLocator(Locator locator)
  	{
  		this.locator = locator;
  	}
  
  	@Override
  	public void startElement(String uri, String name, String qName,
  			Attributes atts)
  	{
  		if (name.equals(TraceXmlWrapper.CLASS_TAG))
  		{
  			String cName = atts.getValue(TraceXmlWrapper.NAME_TAG);
  			if (cName != null && cName.equals(className))
  			{
  				inClass = true;
  			}
  		} else if (inClass && name.equals(TraceXmlWrapper.TRACE_TAG))
  		{
  