Program: 47292
Project: 47292
Buggy source:
/** 
 * Returns iPhoto folder. Used by manageRoot, so it is usually used as a folder at the root folder. Only works when PMS is run on MacOsX. TODO: Requirements for iPhoto.
 */
private DLNAResource getiPhotoFolder(){
  VirtualFolder res=null;
  if (Platform.isMac()) {
    Map<String,Object> iPhotoLib;
    ArrayList<?> ListofRolls;
    HashMap<?,?> Roll;
    HashMap<?,?> PhotoList;
    HashMap<?,?> Photo;
    ArrayList<?> RollPhotos;
    try {
      Process prc=Runtime.getRuntime().exec("String_Node_Str");
      BufferedReader in=new BufferedReader(new InputStreamReader(prc.getInputStream()));
      String line=null;
      line=in.readLine();
      if ((line=in.readLine()) != null) {
        line=line.trim();
        line=line.substring(1,line.length() - 1);
      }
      in.close();
      if (line != null) {
        URI tURI=new URI(line);
        iPhotoLib=Plist.load(URLDecoder.decode(tURI.toURL().getFile(),System.getProperty("String_Node_Str")));
        PhotoList=(HashMap<?,?>)iPhotoLib.get("String_Node_Str");
        ListofRolls=(ArrayList<?>)iPhotoLib.get("String_Node_Str");
        res=new VirtualFolder("String_Node_Str",null);
        for (        Object item : ListofRolls) {
          Roll=(HashMap<?,?>)item;
          VirtualFolder rf=new VirtualFolder(Roll.get("String_Node_Str").toString(),null);
          RollPhotos=(ArrayList<?>)Roll.get("String_Node_Str");
          for (          Object p : RollPhotos) {
            Photo=(HashMap<?,?>)PhotoList.get(p);
            RealFile file=new RealFile(new File(Photo.get("String_Node_Str").toString()));
            rf.addChild(file);
          }
          res.addChild(rf);
        }
      }
 else {
        LOGGER.info("String_Node_Str");
      }
    }
 catch (    XmlParseException e) {
      LOGGER.error("String_Node_Str",e);
    }
catch (    URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Returns iPhoto folder. Used by manageRoot, so it is usually used as a folder at the root folder. Only works when PMS is run on MacOsX. TODO: Requirements for iPhoto.
 */
private DLNAResource getiPhotoFolder(){
  VirtualFolder res=null;
  if (Platform.isMac()) {
    Map<String,Object> iPhotoLib;
    ArrayList<HashMap<?,?>> listOfRolls;
    HashMap<?,?> photoList;
    HashMap<?,?> photoProperties;
    ArrayList<?> rollPhotos;
    try {
      Process prc=Runtime.getRuntime().exec("String_Node_Str");
      BufferedReader in=new BufferedReader(new InputStreamReader(prc.getInputStream()));
      String line=null;
      line=in.readLine();
      if ((line=in.readLine()) != null) {
        line=line.trim();
        line=line.substring(1,line.length() - 1);
      }
      in.close();
      if (line != null) {
        URI fileUri=new URI(line);
        iPhotoLib=Plist.load(URLDecoder.decode(fileUri.toURL().getFile(),System.getProperty("String_Node_Str")));
        photoList=(HashMap<?,?>)iPhotoLib.get("String_Node_Str");
        listOfRolls=(ArrayList<HashMap<?,?>>)iPhotoLib.get("String_Node_Str");
        res=new VirtualFolder("String_Node_Str",null);
        for (        HashMap<?,?> roll : listOfRolls) {
          Object rollName=roll.get("String_Node_Str");
          if (rollName != null) {
            VirtualFolder rf=new VirtualFolder(rollName.toString(),null);
            rollPhotos=(ArrayList<?>)roll.get("String_Node_Str");
            for (            Object photo : rollPhotos) {
              photoProperties=(HashMap<?,?>)photoList.get(photo);
              if (photoProperties != null) {
                Object imagePath=photoProperties.get("String_Node_Str");
                if (imagePath != null) {
                  RealFile file=new RealFile(new File(imagePath.toString()));
                  rf.addChild(file);
                }
              }
            }
            res.addChild(rf);
          }
        }
      }
 else {
        LOGGER.info("String_Node_Str");
      }
    }
 catch (    XmlParseException e) {
      LOGGER.error("String_Node_Str",e);
    }
catch (    URISyntaxException e) {
      LOGGER.error("String_Node_Str",e);
    }
catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  return res;
}