<commit_before>/*
 * FindBugs - Find Bugs in Java programs
 * Copyright (C) 2003-2007 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
 */

package edu.umd.cs.findbugs.ba.jsr305;

import edu.umd.cs.findbugs.ba.Location;
import edu.umd.cs.findbugs.ba.vna.ValueNumber;

/**
 * Information about a source or sink in
 * the type qualifier dataflow analysis.
 * 
 * @author <NAME>
 */
public class SourceSinkInfo implements Comparable<SourceSinkInfo> {
	private final SourceSinkType type;
	private final Location location;
	private final ValueNumber vn;
	private final TypeQualifierAnnotation tqa;
	private int parameter;
	private int local;

	/**
	 * Constructor.
	 * 
	 * @param type     type of the source or sink
	 * @param location Location of the source or sink
	 * @param vn       the ValueNumber of the annotated value
	 * @param tqa      the TypeQualifierAnnotation
	 */
	public SourceSinkInfo(SourceSinkType type, Location location, ValueNumber vn, TypeQualifierAnnotation tqa) {
		this.type = type;
		this.location = location;
		this.vn = vn;
		this.tqa = tqa;
	}

	/**
	 * @return Returns the type.
	 */
	public SourceSinkType getType() {
		return type;
	}

	/**
	 * @return Returns the location.
	 */
	public Location getLocation() {
		return location;
	}
	
	/**
	 * @return Returns the ValueNumber.
	 */
	public ValueNumber getValueNumber() {
		return vn;
	}
	
	/**
	 * @return Returns the TypeQualifierAnnotation.
	 */
	public TypeQualifierAnnotation getTypeQualifierAnnotation() {
		return tqa;
	}

	/**
	 * @param parameter The parameter to set.
	 */
	public void setParameter(int parameter) {
		this.parameter = parameter;
	}

	/**
	 * @param parameter The parameter to set.
	 * @param local     The local to set.
	 */
	public void setParameterAndLocal(int parameter, int local) {
		this.parameter = parameter;
		this.local = local;
	}

	/**
	 * @return Returns the parameter.
	 */
	public int getParameter() {
		return parameter;
	}

	/**
	 * @return Returns the local.
	 */
	public int getLocal() {
		return local;
	}

	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(SourceSinkInfo o) {
		return this.location.compareTo(o.location);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return location.hashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj == null || obj.getClass() != this.getClass()) {
			return false;
		}
		SourceSinkInfo other = (SourceSinkInfo) obj;
		return this.location.equals(other.location);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return type.toString() + "@" + location.toCompactString();
	}
}<commit_msg>Improved toString() method.<commit_after>/*
 * FindBugs - Find Bugs in Java programs
 * Copyright (C) 2003-2007 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
 */

package edu.umd.cs.findbugs.ba.jsr305;

import edu.umd.cs.findbugs.ba.Location;
import edu.umd.cs.findbugs.ba.vna.ValueNumber;

/**
 * Information about a source or sink in
 * the type qualifier dataflow analysis.
 * 
 * @author <NAME>
 */
public class SourceSinkInfo implements Comparable<SourceSinkInfo> {
	private final SourceSinkType type;
	private final Location location;
	private final ValueNumber vn;
	private final TypeQualifierAnnotation tqa;
	private int parameter;
	private int local;

	/**
	 * Constructor.
	 * 
	 * @param type     type of the source or sink
	 * @param location Location of the source or sink
	 * @param vn       the ValueNumber of the annotated value
	 * @param tqa      the TypeQualifierAnnotation
	 */
	public SourceSinkInfo(SourceSinkType type, Location location, ValueNumber vn, TypeQualifierAnnotation tqa) {
		this.type = type;
		this.location = location;
		this.vn = vn;
		this.tqa = tqa;
	}

	/**
	 * @return Returns the type.
	 */
	public SourceSinkType getType() {
		return type;
	}

	/**
	 * @return Returns the location.
	 */
	public Location getLocation() {
		return location;
	}
	
	/**
	 * @return Returns the ValueNumber.
	 */
	public ValueNumber getValueNumber() {
		return vn;
	}
	
	/**
	 * @return Returns the TypeQualifierAnnotation.
	 */
	public TypeQualifierAnnotation getTypeQualifierAnnotation() {
		return tqa;
	}

	/**
	 * @param parameter The parameter to set.
	 */
	public void setParameter(int parameter) {
		this.parameter = parameter;
	}

	/**
	 * @param parameter The parameter to set.
	 * @param local     The local to set.
	 */
	public void setParameterAndLocal(int parameter, int local) {
		this.parameter = parameter;
		this.local = local;
	}

	/**
	 * @return Returns the parameter.
	 */
	public int getParameter() {
		return parameter;
	}

	/**
	 * @return Returns the local.
	 */
	public int getLocal() {
		return local;
	}

	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(SourceSinkInfo o) {
		return this.location.compareTo(o.location);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return location.hashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj == null || obj.getClass() != this.getClass()) {
			return false;
		}
		SourceSinkInfo other = (SourceSinkInfo) obj;
		return this.location.equals(other.location);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return type.toString() + "@" + location.toCompactString() + "[vn=" + vn.getNumber() +
		",tqa="+tqa+"]";
	}
}
{'fraction_non_alphanumeric': 0.10652051714446319, 'fraction_numerical': 0.007588532883642495, 'mean_word_length': 3.4509068167604755, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3633684', 'n_tokens_mistral': 2329, 'n_tokens_neox': 2142, 'n_words': 723}