Program: 39914
Project: 39914
Buggy source:
@SuppressWarnings("String_Node_Str") protected Partition obfuscatePartition(Partition partition,Random rand){
  if (partition instanceof RingPartitionSimple) {
    RingPartitionSimple p=(RingPartitionSimple)partition;
    double sign=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon=minEpsilon + rand.nextDouble() * this.size;
    double position=p.getId().getPosition() + sign * epsilon;
    return new RingPartitionSimple(new RingIdentifier(position,p.getId().getIdSpace()));
  }
 else   if (partition instanceof RingPartition) {
    RingPartition p=(RingPartition)partition;
    double sign1=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon1=minEpsilon + rand.nextDouble() * this.size;
    double position1=p.getStart().getPosition() + sign1 * epsilon1;
    double sign2=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon2=minEpsilon + rand.nextDouble() * this.size;
    double position2=p.getEnd().getPosition() + sign2 * epsilon2;
    return new RingPartition(new RingIdentifier(position1,p.getStart().getIdSpace()),new RingIdentifier(position2,p.getEnd().getIdSpace()));
  }
 else   if (partition instanceof PlanePartitionSimple) {
    PlanePartitionSimple p=(PlanePartitionSimple)partition;
    double sign1=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon1=minEpsilon + rand.nextDouble() * this.size;
    double position1=p.getId().getX() + sign1 * epsilon1;
    double sign2=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon2=minEpsilon + rand.nextDouble() * this.size;
    double position2=p.getId().getY() + sign2 * epsilon2;
    return new PlanePartitionSimple(new PlaneIdentifier(position1,position2,p.getId().getIdSpace()));
  }
 else   if (partition instanceof ChordPartition) {
    ChordPartition p=(ChordPartition)partition;
    BigInteger epsilon1=new BigInteger(this.diff,rand);
    BigInteger position1=rand.nextBoolean() ? p.getPred().getId().add(this.min).add(epsilon1).mod(p.getPred().getIdSpace().getModulus()) : p.getPred().getId().subtract(this.min).subtract(epsilon1).abs().mod(p.getPred().getIdSpace().getModulus());
    BigInteger epsilon2=new BigInteger(this.diff,rand);
    BigInteger position2=rand.nextBoolean() ? p.getPred().getId().add(this.min).add(epsilon2).mod(p.getPred().getIdSpace().getModulus()) : p.getPred().getId().subtract(this.min).subtract(epsilon2).abs().mod(p.getPred().getIdSpace().getModulus());
    return new ChordPartition(new ChordIdentifier(p.getPred().getIdSpace(),position1),new ChordIdentifier(p.getSucc().getIdSpace(),position2));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected Partition obfuscatePartition(Partition partition,Random rand){
  if (this.minBits == 0 && this.maxBits == 0) {
    return this.copyPartition(partition);
  }
  if (partition instanceof RingPartitionSimple) {
    RingPartitionSimple p=(RingPartitionSimple)partition;
    double sign=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon=minEpsilon + rand.nextDouble() * this.size;
    double position=p.getId().getPosition() + sign * epsilon;
    return new RingPartitionSimple(new RingIdentifier(position,p.getId().getIdSpace()));
  }
 else   if (partition instanceof RingPartition) {
    RingPartition p=(RingPartition)partition;
    double sign1=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon1=minEpsilon + rand.nextDouble() * this.size;
    double position1=p.getStart().getPosition() + sign1 * epsilon1;
    double sign2=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon2=minEpsilon + rand.nextDouble() * this.size;
    double position2=p.getEnd().getPosition() + sign2 * epsilon2;
    return new RingPartition(new RingIdentifier(position1,p.getStart().getIdSpace()),new RingIdentifier(position2,p.getEnd().getIdSpace()));
  }
 else   if (partition instanceof PlanePartitionSimple) {
    PlanePartitionSimple p=(PlanePartitionSimple)partition;
    double sign1=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon1=minEpsilon + rand.nextDouble() * this.size;
    double position1=p.getId().getX() + sign1 * epsilon1;
    double sign2=rand.nextBoolean() ? 1.0 : -1.0;
    double epsilon2=minEpsilon + rand.nextDouble() * this.size;
    double position2=p.getId().getY() + sign2 * epsilon2;
    return new PlanePartitionSimple(new PlaneIdentifier(position1,position2,p.getId().getIdSpace()));
  }
 else   if (partition instanceof ChordPartition) {
    ChordPartition p=(ChordPartition)partition;
    BigInteger epsilon1=new BigInteger(this.diff,rand);
    BigInteger position1=rand.nextBoolean() ? p.getPred().getId().add(this.min).add(epsilon1).mod(p.getPred().getIdSpace().getModulus()) : p.getPred().getId().subtract(this.min).subtract(epsilon1).abs().mod(p.getPred().getIdSpace().getModulus());
    BigInteger epsilon2=new BigInteger(this.diff,rand);
    BigInteger position2=rand.nextBoolean() ? p.getSucc().getId().add(this.min).add(epsilon2).mod(p.getSucc().getIdSpace().getModulus()) : p.getSucc().getId().subtract(this.min).subtract(epsilon2).mod(p.getSucc().getIdSpace().getModulus());
    return new ChordPartition(new ChordIdentifier(p.getPred().getIdSpace(),position1),new ChordIdentifier(p.getSucc().getIdSpace(),position2));
  }
 else {
    return null;
  }
}