// Path: src/main/java/BlueTurtle/warnings/FindBugsWarning.java
// public class FindBugsWarning extends Warning {
// 
// 	
// 	@Getter @Setter private String category;
// 	@Getter @Setter private String priority;
// 
// 	
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param filePath
// 	 *            the path to the file where the warning is located.
// 	 * @param filename
// 	 *            the name of the file where the warning is located.
// 	 * @param line
// 	 *            the line number where the warning is located.
// 	 * @param message
// 	 *            the message of the warning.
// 	 * @param category
// 	 *            the category of the warning.
// 	 * @param priority
// 	 *            the priority of the warning.            
// 	 * @param ruleName
// 	 *            the rule name of the warning.
// 	 * @param classification
// 	 *            of the violated rule of the warning.
// 	 */
// 	public FindBugsWarning(String filePath, String filename, int line, String message, String category, String priority, String ruleName, String classification) {
// 		super(filePath, filename, line, "FindBugs", ruleName, message, classification);
// 		setCategory(category);
// 		setPriority(priority);
// 	}
// 	
// 
// 	/**
// 	 * Check whether two FindBugs warnings are the same.
// 	 * 
// 	 * @param other
// 	 *            the other warning.
// 	 * @return a boolean
// 	 */
// 	@Override
// 	public boolean equals(Object other) {
// 
// 		if (!(other instanceof FindBugsWarning)) {
// 			return false;
// 		}
// 
// 		FindBugsWarning that = (FindBugsWarning) other;
// 
// 		return (filePath.equals(that.filePath) && fileName.equals(that.fileName) && line == that.line
// 				&& message.equals(that.message) && category.equals(that.category) && classification.equals(that.classification)
// 				&& priority.equals(that.priority) && type.equals(that.type) && ruleName.equals(that.ruleName));
// 	}
// 	
// 	/**
// 	 * HashCode for the FindBugsWarning.
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return java.util.Objects.hash(filePath, fileName, type, line, message, category, priority, ruleName, classification);
// 	}
// 	
// 	/**
// 	 * toString method for FindBugsWarning.
// 	 */
// 	@Override
// 	public String toString() {
// 		return "FindBugsWarning [lineNumber=" + line + ", message=" + message + ", category=" + category
// 				+ ", priority=" + priority + ", classification="
// 				+ classification + ", fileName=" + fileName + ", type=" + type + ", filePath=" + filePath
// 				+ ", ruleName=" + ruleName + "]";
// 	}
// 	
// }


import java.io.File;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import BlueTurtle.finders.ProjectInfoFinder;
import BlueTurtle.warnings.FindBugsWarning;
import BlueTurtle.warnings.Warning;
			// The message contained by the warning.
			String message = warningElement.getAttribute("message");

			// The category of warning.
			String category = warningElement.getAttribute("category");

			// The priority of warning, can be high or low.
			String priority = warningElement.getAttribute("priority");

			// line number where the warning is located.
			int line = Integer.parseInt(warningElement.getAttribute("lineNumber"));

			// Get the category of the warning.
			String ruleName = warningElement.getAttribute("type");

			String classification = classify(ruleName);

			try {
				// replace the dot in the file name with file separator.
				String fileNWithSep = fileName.replaceAll("\\.", Matcher.quoteReplacement(File.separator)) + ".java";

				// for-loop in stream.
				String filePath = ProjectInfoFinder.getClassPaths().stream().filter(p -> p.endsWith(fileNWithSep))
						.findFirst().get();

				// Get the name of the file where the warning is from.
				String finalFileName = fileNWithSep.substring(fileNWithSep.lastIndexOf(File.separatorChar) + 1,
						fileNWithSep.length());

				// Construct the new FindBugsWarning.
// Path: src/main/java/BlueTurtle/warnings/FindBugsWarning.java
// public class FindBugsWarning extends Warning {
// 
// 	
// 	@Getter @Setter private String category;
// 	@Getter @Setter private String priority;
// 
// 	
// 	/**
// 	 * Constructor.
// 	 * 
// 	 * @param filePath
// 	 *            the path to the file where the warning is located.
// 	 * @param filename
// 	 *            the name of the file where the warning is located.
// 	 * @param line
// 	 *            the line number where the warning is located.
// 	 * @param message
// 	 *            the message of the warning.
// 	 * @param category
// 	 *            the category of the warning.
// 	 * @param priority
// 	 *            the priority of the warning.            
// 	 * @param ruleName
// 	 *            the rule name of the warning.
// 	 * @param classification
// 	 *            of the violated rule of the warning.
// 	 */
// 	public FindBugsWarning(String filePath, String filename, int line, String message, String category, String priority, String ruleName, String classification) {
// 		super(filePath, filename, line, "FindBugs", ruleName, message, classification);
// 		setCategory(category);
// 		setPriority(priority);
// 	}
// 	
// 
// 	/**
// 	 * Check whether two FindBugs warnings are the same.
// 	 * 
// 	 * @param other
// 	 *            the other warning.
// 	 * @return a boolean
// 	 */
// 	@Override
// 	public boolean equals(Object other) {
// 
// 		if (!(other instanceof FindBugsWarning)) {
// 			return false;
// 		}
// 
// 		FindBugsWarning that = (FindBugsWarning) other;
// 
// 		return (filePath.equals(that.filePath) && fileName.equals(that.fileName) && line == that.line
// 				&& message.equals(that.message) && category.equals(that.category) && classification.equals(that.classification)
// 				&& priority.equals(that.priority) && type.equals(that.type) && ruleName.equals(that.ruleName));
// 	}
// 	
// 	/**
// 	 * HashCode for the FindBugsWarning.
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return java.util.Objects.hash(filePath, fileName, type, line, message, category, priority, ruleName, classification);
// 	}
// 	
// 	/**
// 	 * toString method for FindBugsWarning.
// 	 */
// 	@Override
// 	public String toString() {
// 		return "FindBugsWarning [lineNumber=" + line + ", message=" + message + ", category=" + category
// 				+ ", priority=" + priority + ", classification="
// 				+ classification + ", fileName=" + fileName + ", type=" + type + ", filePath=" + filePath
// 				+ ", ruleName=" + ruleName + "]";
// 	}
// 	
// }


// Path: src/main/java/BlueTurtle/parsers/FindBugsXMLParser.java
import java.io.File;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import BlueTurtle.finders.ProjectInfoFinder;
import BlueTurtle.warnings.FindBugsWarning;
import BlueTurtle.warnings.Warning;

			// The message contained by the warning.
			String message = warningElement.getAttribute("message");

			// The category of warning.
			String category = warningElement.getAttribute("category");

			// The priority of warning, can be high or low.
			String priority = warningElement.getAttribute("priority");

			// line number where the warning is located.
			int line = Integer.parseInt(warningElement.getAttribute("lineNumber"));

			// Get the category of the warning.
			String ruleName = warningElement.getAttribute("type");

			String classification = classify(ruleName);

			try {
				// replace the dot in the file name with file separator.
				String fileNWithSep = fileName.replaceAll("\\.", Matcher.quoteReplacement(File.separator)) + ".java";

				// for-loop in stream.
				String filePath = ProjectInfoFinder.getClassPaths().stream().filter(p -> p.endsWith(fileNWithSep))
						.findFirst().get();

				// Get the name of the file where the warning is from.
				String finalFileName = fileNWithSep.substring(fileNWithSep.lastIndexOf(File.separatorChar) + 1,
						fileNWithSep.length());

				// Construct the new FindBugsWarning.
				FindBugsWarning fbw = new FindBugsWarning(filePath, finalFileName, line, message, category, priority,