gt: 		return value != null && value.booleanValue();
context: /*
   * FindBugs - Find bugs in Java programs
   * Copyright (C) 2003-2005 University of Maryland
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
   * This library 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
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this library; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
  /*
   * Project.java
   *
   * Created on March 30, 2003, 2:22 PM
   */
  
  package edu.umd.cs.findbugs;
  
  import java.io.BufferedInputStream;
  import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.PrintWriter;
  import java.io.Reader;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.LinkedHashSet;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  import java.util.jar.Attributes;
  import java.util.jar.Manifest;
  
  import org.dom4j.DocumentException;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.XMLReader;
  import org.xml.sax.helpers.XMLReaderFactory;
  
  import edu.umd.cs.findbugs.annotations.CheckForNull;
  import edu.umd.cs.findbugs.annotations.NonNull;
  import edu.umd.cs.findbugs.ba.SourceFinder;
  import edu.umd.cs.findbugs.ba.URLClassPath;
  import edu.umd.cs.findbugs.filter.Filter;
  import edu.umd.cs.findbugs.util.Util;
  import edu.umd.cs.findbugs.xml.OutputStreamXMLOutput;
  import edu.umd.cs.findbugs.xml.XMLAttributeList;
  import edu.umd.cs.findbugs.xml.XMLOutput;
  import edu.umd.cs.findbugs.xml.XMLOutputUtil;
  import edu.umd.cs.findbugs.xml.XMLWriteable;
  
  /**
   * A project in the GUI.
   * This consists of some number of Jar files to analyze for bugs, and optionally
   * <p/>
   * <ul>
   * <li> some number of source directories, for locating the program's
   * source code
   * <li> some number of auxiliary classpath entries, for locating classes
   * referenced by the program which the user doesn't want to analyze
   * <li> some number of boolean options
   * </ul>
   *
   * @author David Hovemeyer
   */
  public class Project implements XMLWriteable {
  	private static final boolean DEBUG = SystemProperties.getBoolean("findbugs.project.debug");
  
  	private List<File> currentWorkingDirectoryList;
  	/**
  	 * Project filename.
  	 */
  	@Deprecated
  	private String projectFileName;
  
  	private String projectName;
  
  	
  	
  	/**
  	 * Options.
  	 */
  	@Deprecated
  	private Map<String, Boolean> optionsMap;
  
  	/**
  	 * List of jars/directories to analyze
  	 */
  	private List<String> analysisTargets;
  
  	/**
  	 * The list of source directories.
  	 */
  	private List<String> srcDirList;
  
  	/**
  	 * The list of auxiliary classpath entries.
  	 */
  	private List<String> auxClasspathEntryList;
  
  	/**
  	 * Flag to indicate that this Project has been modified.
  	 */
  	private boolean isModified;
  
  	/**
  	 * Constant used to name anonymous projects.
  	 */
  	public static final String UNNAMED_PROJECT = "<<unnamed project>>";
  
  	private long timestampForAnalyzedClasses = 0L;
  	
  	private IGuiCallback guiCallback;
  
  	@NonNull private Filter suppressionFilter = new Filter();
  
  	private SourceFinder sourceFinder;
  	/**
  	 * Create an anonymous project.
  	 */
  	public Project() {
  		this.projectFileName = UNNAMED_PROJECT;
  		optionsMap = new HashMap<String, Boolean>();
  		optionsMap.put(RELATIVE_PATHS, Boolean.FALSE);
  		analysisTargets = new LinkedList<String>();
  		srcDirList = new LinkedList<String>();
  		auxClasspathEntryList = new LinkedList<String>();
  		isModified = false;
                  currentWorkingDirectoryList = new ArrayList<File>();
  	}
  
  	/**
  	 * Return an exact copy of this Project.
  	 */
  	public Project duplicate() {
  		Project dup = new Project();
  		dup.projectFileName = this.projectFileName;
          dup.currentWorkingDirectoryList.addAll(this.currentWorkingDirectoryList);
          dup.projectName = this.projectName;
  		dup.optionsMap.clear();
  		dup.optionsMap.putAll(this.optionsMap);
  		dup.analysisTargets.addAll(this.analysisTargets);
  		dup.srcDirList.addAll(this.srcDirList);
  		dup.auxClasspathEntryList.addAll(this.auxClasspathEntryList);
  		dup.timestampForAnalyzedClasses = timestampForAnalyzedClasses;
  		dup.guiCallback = guiCallback;
  		return dup;
  	}
  	
  	public SourceFinder getSourceFinder() {
  		if (sourceFinder == null) {
  			sourceFinder = new SourceFinder(this);
  		}
  		return sourceFinder;
  	}
  	public boolean isGuiAvaliable(){
  		return guiCallback != null;
  	}
  	
  	/**
  	 * add information from project2 to this project
  	 */
  	public void add(Project project2) {
  		optionsMap.putAll(project2.optionsMap);
  		analysisTargets = appendWithoutDuplicates(analysisTargets, project2.analysisTargets);
  		srcDirList = appendWithoutDuplicates(srcDirList, project2.srcDirList);
  		auxClasspathEntryList = appendWithoutDuplicates(auxClasspathEntryList, project2.auxClasspathEntryList);
  	}
  
  	public static <T> List<T> appendWithoutDuplicates(List<T> lst1, List<T> lst2) {
  		LinkedHashSet<T> joined = new LinkedHashSet<T>(lst1);
  		joined.addAll(lst2);
  		return new ArrayList<T>(joined);
  
  	}
  	public void setCurrentWorkingDirectory(File f) {
  		if (f != null)
  			addWorkingDir(f.toString());
  	}
  	/**
  	 * Return whether or not this Project has unsaved modifications.
  	 */
  	public boolean isModified() {
  		return isModified;
  	}
  
  	/**
  	 * Set whether or not this Project has unsaved modifications.
  	 */
  	public void setModified(boolean isModified) {
  		this.isModified = isModified;
  	}
  
  	/**
  	 * Get the project filename.
  	 */
  	@Deprecated
  	public String getProjectFileName() {
  		return projectFileName;
  	}
  
  	/**
  	 * Set the project filename.
  	 *
  	 * @param projectFileName the new filename
  	 */
  	@Deprecated
  	public void setProjectFileName(String projectFileName) {
  		this.projectFileName = projectFileName;
  	}
  
  	/**
  	 * Add a file to the project.
  	 *
  	 * @param fileName the file to add
  	 * @return true if the file was added, or false if the
  	 *         file was already present
  	 */
  	public boolean addFile(String fileName) {
  		return addToListInternal(analysisTargets, makeAbsoluteCWD(fileName));
  	}
  
  	/**
  	 * Add a source directory to the project.
  	 * @param dirName the directory to add
  	 * @return true if the source directory was added, or false if the
  	 *   source directory was already present
  	 */
  	public boolean addSourceDir(String dirName) {
            boolean isNew = false;
            for (String dir : makeAbsoluteCwdCandidates(dirName)) {
              isNew = addToListInternal(srcDirList, dir) || isNew;
            }
            return isNew;
  	}
  
  	/**
  	 * Add a working directory to the project.
  	 * @param dirName the directory to add
  	 * @return true if the working directory was added, or false if the
  	 *   working directory was already present
  	 */
  	public boolean addWorkingDir(String dirName) {
  		  if (dirName == null)
  			  throw new NullPointerException();
            return addToListInternal(currentWorkingDirectoryList, new File(dirName));
  	}
  
  
  	/**
  	 * Retrieve the Options value.
  	 *
  	 * @param option the name of option to get
  	 * @return the value of the option
  	 */
  	@Deprecated
  	public boolean getOption(String option) {
  		Boolean value = optionsMap.get(option);
  