Program: 5429
Project: 5429
Buggy source:
/** 
 * Creates a new <tt>TorrentInfoSection</tt> object based on the information contained on the passed <tt>value</tt> argument
 * @param value A bencode value containing the info section
 * @return A new <tt>TorrentInfoSection</tt> that represents the<tt>value</tt> parameter
 * @throws NullPointerException if <tt>value</tt> is <tt>null</tt>
 * @throws IllegalArgumentException if <tt>value</tt> is not a bencodedictionary that holds the information in a torrent info section
 */
public static TorrentInfoSection fromValue(Value<?> value){
  if (value == null) {
    throw new NullPointerException();
  }
  try {
    long pieceLength=((IntegerValue)Bencode.getChildValue(value,"String_Node_Str")).getValue().longValue();
    IntegerValue privv=(IntegerValue)Bencode.getChildValue(value,"String_Node_Str");
    boolean priv=privv == null ? false : (privv.getValue().longValue() == 1L);
    StringValue piecesv=(StringValue)Bencode.getChildValue(value,"String_Node_Str");
    byte[] piecesa=piecesv.getValue();
    if (piecesa.length % 20 != 0) {
      throw new IllegalArgumentException();
    }
    List<Sha1Hash> pieceHashes=new ArrayList<Sha1Hash>();
    for (int i=0; i < piecesa.length; i+=20) {
      byte[] hashbytes=new byte[20];
      for (int j=0; j < 20; j++) {
        hashbytes[j]=piecesa[i + j];
      }
      pieceHashes.add(new Sha1Hash(hashbytes));
    }
    String baseDir;
    List<TorrentFileInfo> files=new ArrayList<TorrentFileInfo>();
    ListValue filesv=(ListValue)Bencode.getChildValue(value,"String_Node_Str");
    if (filesv == null) {
      baseDir="String_Node_Str";
      long length=((IntegerValue)Bencode.getChildValue(value,"String_Node_Str")).getValue().longValue();
      String fname=((StringValue)Bencode.getChildValue(value,"String_Node_Str")).getStringValue();
      TorrentFileInfo file=new TorrentFileInfo(length,Arrays.asList(fname));
      files.add(file);
    }
 else {
      baseDir=((StringValue)Bencode.getChildValue(value,"String_Node_Str")).getStringValue();
      List<Value<?>> filesvl=filesv.getValue();
      for (      Value<?> val : filesvl) {
        DictionaryValue dval=(DictionaryValue)val;
        long length=((IntegerValue)Bencode.getChildValue(dval,"String_Node_Str")).getValue().longValue();
        ListValue pathv=(ListValue)Bencode.getChildValue(dval,"String_Node_Str");
        List<String> path=new ArrayList<String>();
        for (        Value<?> pathpiece : pathv.getValue()) {
          StringValue pps=(StringValue)pathpiece;
          path.add(pps.getStringValue());
        }
        files.add(new TorrentFileInfo(length,path));
      }
    }
    Sha1Hash hash=Sha1Hash.forValue(value);
    return new TorrentInfoSection(pieceLength,pieceHashes,priv,baseDir,files,hash);
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException) {
      throw ((IllegalArgumentException)e);
    }
 else {
      throw new IllegalArgumentException(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new <tt>TorrentInfoSection</tt> object based on the information contained on the passed <tt>value</tt> argument
 * @param value A bencode value containing the info section
 * @return A new <tt>TorrentInfoSection</tt> that represents the<tt>value</tt> parameter
 * @throws NullPointerException if <tt>value</tt> is <tt>null</tt>
 * @throws IllegalArgumentException if <tt>value</tt> is not a bencodedictionary that holds the information in a torrent info section
 */
public static TorrentInfoSection fromValue(Value<?> value){
  if (value == null) {
    throw new NullPointerException();
  }
  try {
    long pieceLength=((IntegerValue)Bencode.getChildValue(value,"String_Node_Str")).getValue().longValue();
    IntegerValue privv=(IntegerValue)Bencode.getChildValue(value,"String_Node_Str");
    boolean priv=privv == null ? false : (privv.getValue().longValue() == 1L);
    StringValue piecesv=(StringValue)Bencode.getChildValue(value,"String_Node_Str");
    byte[] piecesa=piecesv.getValue();
    if (piecesa.length % 20 != 0) {
      throw new IllegalArgumentException();
    }
    List<Sha1Hash> pieceHashes=new ArrayList<Sha1Hash>();
    for (int i=0; i < piecesa.length; i+=20) {
      byte[] hashbytes=new byte[20];
      for (int j=0; j < 20; j++) {
        hashbytes[j]=piecesa[i + j];
      }
      pieceHashes.add(new Sha1Hash(hashbytes));
    }
    String name=((StringValue)Bencode.getChildValue(value,"String_Node_Str")).getStringValue();
    String baseDir;
    List<TorrentFileInfo> files=new ArrayList<TorrentFileInfo>();
    ListValue filesv=(ListValue)Bencode.getChildValue(value,"String_Node_Str");
    if (filesv == null) {
      baseDir="String_Node_Str";
      long length=((IntegerValue)Bencode.getChildValue(value,"String_Node_Str")).getValue().longValue();
      String fname=((StringValue)Bencode.getChildValue(value,"String_Node_Str")).getStringValue();
      TorrentFileInfo file=new TorrentFileInfo(length,Arrays.asList(fname));
      files.add(file);
    }
 else {
      baseDir=((StringValue)Bencode.getChildValue(value,"String_Node_Str")).getStringValue();
      List<Value<?>> filesvl=filesv.getValue();
      for (      Value<?> val : filesvl) {
        DictionaryValue dval=(DictionaryValue)val;
        long length=((IntegerValue)Bencode.getChildValue(dval,"String_Node_Str")).getValue().longValue();
        ListValue pathv=(ListValue)Bencode.getChildValue(dval,"String_Node_Str");
        List<String> path=new ArrayList<String>();
        for (        Value<?> pathpiece : pathv.getValue()) {
          StringValue pps=(StringValue)pathpiece;
          path.add(pps.getStringValue());
        }
        files.add(new TorrentFileInfo(length,path));
      }
    }
    Sha1Hash hash=Sha1Hash.forValue(value);
    return new TorrentInfoSection(pieceLength,pieceHashes,priv,baseDir,files,hash,name);
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException) {
      throw ((IllegalArgumentException)e);
    }
 else {
      throw new IllegalArgumentException(e);
    }
  }
}