Commit 1867ebdb authored by Pakulin's avatar Pakulin
Browse files

Downgraded for Java 5.

Removed warnings in the code.
parent 927e3cf8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.5
+5 −6
Original line number Diff line number Diff line
@@ -6,14 +6,13 @@ import java.util.ArrayList;
import java.util.List;

import org.custommonkey.xmlunit.Difference;
import org.w3c.dom.Document;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class DiffErrorHandler implements ErrorHandler {
	private List<SAXParseException> errors = new ArrayList<>();
	private List<SAXParseException> warnings = new ArrayList<>();
	private List<SAXParseException> errors = new ArrayList<SAXParseException>();
	private List<SAXParseException> warnings = new ArrayList<SAXParseException>();
	private static final String NEWLINE = System.getProperty("line.separator");
	private boolean hasErrors = false;
	
@@ -38,7 +37,7 @@ public class DiffErrorHandler implements ErrorHandler {
	 * Parser error handler
	 * 
	 *************************************************************/
	@Override
	//@Override
	public void error(SAXParseException err) throws SAXException {
		errors.add(err);
		appendDescripion(err);
@@ -46,7 +45,7 @@ public class DiffErrorHandler implements ErrorHandler {
		XmlDiff.logger.warning("Fatal error while parsing: ", err.getMessage());
	}

	@Override
	//@Override
	public void fatalError(SAXParseException err) throws SAXException {
		errors.add(err);
		appendDescripion(err);
@@ -59,7 +58,7 @@ public class DiffErrorHandler implements ErrorHandler {
		err.printStackTrace(new PrintWriter(sw));
		description.append(sw).append(NEWLINE);
	}
	@Override
	//@Override
	public void warning(SAXParseException warn) throws SAXException {
		warnings.add(warn);
		XmlDiff.logger.warning("Error while parsing: ", warn.getMessage());
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import org.w3c.dom.TypeInfo;

public class DifferenceHandler implements DifferenceListener {
	private Document originalReference;
	@SuppressWarnings("unused")
	private Document originalTest;
	private XPathFactory xpathFactory;

@@ -28,7 +29,7 @@ public class DifferenceHandler implements DifferenceListener {
	}


	@Override
	//@Override
    public int differenceFound(Difference difference) {
    	int id = difference.getId();
		if (id == DifferenceEngine.NAMESPACE_PREFIX_ID) {
@@ -152,7 +153,7 @@ public class DifferenceHandler implements DifferenceListener {
	}
    

	@Override
	//@Override
	public void skippedComparison(Node control, Node test) {
	}
	
+26 −32
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.Difference;
import org.custommonkey.xmlunit.XMLUnit;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

@@ -101,7 +100,6 @@ public class XmlDiff {
		logger.debug("Reference file: ", file, 
				", xsd file names: ", (xsdFileNames == null)? "null" : Arrays.toString(xsdFileNames),
				", xsd search path: ", (xsdSearchPath == null)? "null" : Arrays.toString(xsdSearchPath));		
		try {
		this.referenceXmlFile = file;
		if (!this.referenceXmlFile.exists()) {
			logger.severe("No such file: ", this.referenceXmlFile.getAbsolutePath());
@@ -129,10 +127,6 @@ public class XmlDiff {
		if (xsdFiles.size() > 0) {
			addXmlSchemas();
		}
		} catch(Throwable err) {
			err.printStackTrace();
			throw err;
		}
	}

	/** Compare an XML document against the reference one.