Skip to content

Commit

Permalink
Merge pull request #25 from bvdmitri/master
Browse files Browse the repository at this point in the history
static testing
  • Loading branch information
mikessh committed Apr 6, 2015
2 parents 69996ab + 5ab34cf commit 60043c2
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.antigenomics.vdjtools.util.ExecUtil
* Class that represents Variable and Joining segment frequency (usage) vector and V-J pairing matrix
*/
public class SegmentUsage {
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
public static boolean VERBOSE = true

private final Map<String, double[]> vSegmentUsage = new HashMap<>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.antigenomics.vdjtools.util.ExecUtil
* computes a set of overlap metrics
*/
public class Overlap {
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
public static boolean VERBOSE = true

private final SamplePair samplePair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import static com.antigenomics.vdjtools.overlap.OverlapMetric.*
* A helper class to compute various overlap metrics for joint overlap
*/
class OverlapEvaluator {
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
public static boolean VERBOSE = true

private final JointSample jointSample
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/antigenomics/vdjtools/LinkedListExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
public class LinkedListExt<E>
extends AbstractSequentialList<E>
implements List<E>, Deque<E>, Cloneable, java.io.Serializable {
private static final long serialVersionUID = 876323262645176354L;
private transient Entry<E> header = new Entry<E>(null, null, null);
private transient int size = 0;

Expand Down Expand Up @@ -971,8 +972,6 @@ public <T> T[] toArray(T[] a) {
return a;
}

private static final long serialVersionUID = 876323262645176354L;

/**
* Save the state of this <tt>LinkedList</tt> instance to a stream (that
* is, serialize it).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public int hashCode() {

@Override
public boolean equals(Object o) {
if (o == null) return false;
VJLenSignature key = (VJLenSignature) o;
return getV().equals(key.getV()) &&
getJ().equals(key.getJ()) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ JointClonotype changeParent(JointSample newParent) {

@Override
public int compareTo(JointClonotype o) {
return -Double.compare(this.getBaseFreq(), o.getBaseFreq());
return Double.compare(o.getBaseFreq(), this.getBaseFreq());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public ClonotypeKey(Clonotype clonotype) {
@Override
public boolean equals(Object o) {
// no it shouldn't
return this.equals(((ClonotypeKey) o).clonotype);
return o != null && this.equals(((ClonotypeKey) o).clonotype);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import com.antigenomics.vdjtools.Misc;
import com.antigenomics.vdjtools.sample.Clonotype;

import java.util.HashSet;
import java.util.Set;

public abstract class ClonotypeAggregator {
private int sampleId;
private int incidenceCount, count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
package com.antigenomics.vdjtools.sample;

public class BlankClonotypeFilter extends ClonotypeFilter {
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
public static BlankClonotypeFilter INSTANCE = new BlankClonotypeFilter();

private BlankClonotypeFilter() {
super(false);
}

public static BlankClonotypeFilter INSTANCE = new BlankClonotypeFilter();

@Override
protected boolean checkPass(Clonotype clonotype) {
return true;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/antigenomics/vdjtools/sample/Clonotype.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import com.antigenomics.vdjtools.ClonotypeContainer;
import com.antigenomics.vdjtools.Countable;
import com.antigenomics.vdjtools.join.key.ClonotypeKey;
import com.antigenomics.vdjtools.join.key.StrictKey;

/**
* A class holding comprehensive info on a T- or B-cell clonotype.
Expand Down

0 comments on commit 60043c2

Please sign in to comment.