Program: 120691
Project: 120691
Buggy source:
void init(){
  if (demoProjects == null) {
synchronized (DemoProjectsProvider.class) {
      allDemoProviders=new HashMap<String,DemoProvider>();
      readRegistry();
      Map<String,DemoProvider> finalDemoProviders=new HashMap<String,DemoProvider>(allDemoProviders);
      List<String> overrideIds=new ArrayList<String>();
      Iterator<String> iterator=finalDemoProviders.keySet().iterator();
      while (iterator.hasNext()) {
        String id=iterator.next();
        String overrideId=finalDemoProviders.get(id).overrideId;
        if (overrideId != null && finalDemoProviders.containsKey(overrideId)) {
          overrideIds.add(overrideId);
        }
      }
      for (      String overrideId : overrideIds) {
        finalDemoProviders.remove(overrideId);
      }
      List<DemoProvider> finalDemoProvidersList=new ArrayList<DemoProvider>(finalDemoProviders.values());
      Collections.sort(finalDemoProvidersList,new Comparator<DemoProvider>(){
        @Override public int compare(        DemoProvider dp1,        DemoProvider dp2){
          return dp1.order - dp2.order;
        }
      }
);
      List<DemoProjectBean> finalDemoProjects=new ArrayList<DemoProjectBean>();
      for (      DemoProvider demoProvider : finalDemoProvidersList) {
        DemoProjectBean demoBean=new DemoProjectBean();
        demoBean.setProjectName(demoProvider.name);
        demoBean.setPluginId(demoProvider.pluginId);
        demoBean.setDescriptionFilePath(demoProvider.descHtml);
        demoBean.setDemoProjectFilePath(demoProvider.projectUrl);
        if (demoBean.getDemoProjectFilePath().endsWith(FileExtensions.ZIP_FILE_SUFFIX) || demoBean.getDemoProjectFilePath().endsWith(FileExtensions.TAR_GZ_FILE_SUFFIX)) {
          demoBean.setDemoProjectFileType(EDemoProjectFileType.ARCHIVE);
        }
 else {
          demoBean.setDemoProjectFileType(EDemoProjectFileType.FOLDER);
        }
        finalDemoProjects.add(demoBean);
      }
      demoProjects=finalDemoProjects.toArray(new DemoProjectBean[0]);
    }
  }
}

Fixed version (ground truth):
void init(){
  if (demoProjects == null) {
synchronized (DemoProjectsProvider.class) {
      allDemoProviders=new HashMap<String,DemoProvider>();
      readRegistry();
      Map<String,DemoProvider> finalDemoProviders=new HashMap<String,DemoProvider>(allDemoProviders);
      List<String> overrideIds=new ArrayList<String>();
      Iterator<String> iterator=finalDemoProviders.keySet().iterator();
      while (iterator.hasNext()) {
        String id=iterator.next();
        String overrideId=finalDemoProviders.get(id).overrideId;
        if (overrideId != null && finalDemoProviders.containsKey(overrideId)) {
          overrideIds.add(overrideId);
        }
      }
      for (      String overrideId : overrideIds) {
        finalDemoProviders.remove(overrideId);
      }
      List<DemoProvider> finalDemoProvidersList=new ArrayList<DemoProvider>(finalDemoProviders.values());
      Collections.sort(finalDemoProvidersList,new Comparator<DemoProvider>(){
        @Override public int compare(        DemoProvider dp1,        DemoProvider dp2){
          return dp1.order - dp2.order;
        }
      }
);
      List<DemoProjectBean> finalDemoProjects=new ArrayList<DemoProjectBean>();
      for (      DemoProvider demoProvider : finalDemoProvidersList) {
        DemoProjectBean demoBean=new DemoProjectBean();
        demoBean.setProjectName(demoProvider.name);
        demoBean.setPluginId(demoProvider.pluginId);
        demoBean.setDescriptionFilePath(demoProvider.descHtml);
        demoBean.setDemoProjectFilePath(demoProvider.projectUrl);
        if (demoBean.getDemoProjectFilePath().endsWith(FileExtensions.ZIP_FILE_SUFFIX) || demoBean.getDemoProjectFilePath().endsWith(FileExtensions.TAR_FILE_SUFFIX) || demoBean.getDemoProjectFilePath().endsWith(FileExtensions.TAR_GZ_FILE_SUFFIX)) {
          demoBean.setDemoProjectFileType(EDemoProjectFileType.ARCHIVE);
        }
 else {
          demoBean.setDemoProjectFileType(EDemoProjectFileType.FOLDER);
        }
        finalDemoProjects.add(demoBean);
      }
      demoProjects=finalDemoProjects.toArray(new DemoProjectBean[0]);
    }
  }
}