nus-yam/ex-repair huggingface dataset:
Program: 3893
Project: 3893
Buggy source:
public void updateLibraryPanel(EventList<RemoteFileItem> eventList,LibraryState libraryState){
  if (!disposed) {
switch (libraryState) {
case FAILED_TO_LOAD:
      this.eventList=null;
    emptyPanelMessage.setMessageType(MessageTypes.LW_CONNECTION_ERROR);
  if (!isSharingCardShown()) {
    showEmptyCard();
  }
break;
case LOADED:
if (eventList.size() == 0) {
emptyPanelMessage.setMessageType(MessageTypes.LW_NO_FILES);
if (!isSharingCardShown()) {
  showEmptyCard();
}
}
 else {
setLibraryCard(factory.createFriendLibrary(friend,friendFileList,eventList,this));
if (isEmptyCardShown()) {
  showLibraryCard();
}
}
break;
case LOADING:
if (this.eventList != eventList) {
this.eventList=eventList;
}
if (eventList.size() == 0) {
emptyPanelMessage.setMessageType(MessageTypes.LW_LOADING);
if (!isSharingCardShown()) {
showEmptyCard();
}
}
 else {
setLibraryCard(factory.createFriendLibrary(friend,friendFileList,eventList,this));
if (isEmptyCardShown()) {
showLibraryCard();
}
}
break;
}
}
}

Fixed version (ground truth):
public void updateLibraryPanel(EventList<RemoteFileItem> eventList,LibraryState libraryState){
  if (!disposed) {
switch (libraryState) {
case FAILED_TO_LOAD:
      this.eventList=null;
    emptyPanelMessage.setMessageType(MessageTypes.LW_CONNECTION_ERROR);
  if (!isSharingCardShown()) {
    showEmptyCard();
  }
break;
case LOADED:
if (this.eventList != eventList) {
this.eventList=eventList;
}
if (eventList.size() == 0) {
emptyPanelMessage.setMessageType(MessageTypes.LW_NO_FILES);
if (!isSharingCardShown()) {
showEmptyCard();
}
}
 else {
setLibraryCard(factory.createFriendLibrary(friend,friendFileList,eventList,this));
if (isEmptyCardShown()) {
super.showLibraryCard();
}
}
break;
case LOADING:
if (this.eventList != eventList) {
this.eventList=eventList;
}
if (eventList.size() == 0) {
emptyPanelMessage.setMessageType(MessageTypes.LW_LOADING);
if (!isSharingCardShown()) {
showEmptyCard();
}
}
 else {
setLibraryCard(factory.createFriendLibrary(friend,friendFileList,eventList,this));
if (isEmptyCardShown()) {
super.showLibraryCard();
}
}
break;
}
}
}
Program: 3894
Project: 3894
Buggy source:
private void configureTable(EventList<VisualSearchResult> eventList,final ResultsTableFormat<VisualSearchResult> tableFormat,Navigator navigator,PropertiesFactory<VisualSearchResult> properties){
  CollectionList<VisualSearchResult,VisualSearchResult> explodedParentResults=new CollectionList<VisualSearchResult,VisualSearchResult>(eventList,new CollectionList.Model<VisualSearchResult,VisualSearchResult>(){
    @Override public List<VisualSearchResult> getChildren(    VisualSearchResult parent){
      return parent.getSimilarResults();
    }
  }
);
  CompositeList<VisualSearchResult> allTogetherList=new CompositeList<VisualSearchResult>(eventList.getPublisher(),eventList.getReadWriteLock());
  allTogetherList.addMemberList(eventList);
  allTogetherList.addMemberList(explodedParentResults);
  SortedList<VisualSearchResult> sortedList=new SortedList<VisualSearchResult>(allTogetherList);
  resultsTable=new ConfigurableTable<VisualSearchResult>(sortedList,tableFormat,true);
  EventListJXTableSorting.install(resultsTable,sortedList);
  setupCellRenderers(tableFormat);
  resultsTable.setPopupHandler(new SearchPopupHandler(resultsTable,this,properties));
  resultsTable.setDoubleClickHandler(new ClassicDoubleClickHandler(resultsTable,this,navigator,libraryNavigator));
  resultsTable.setRowHeight(TABLE_ROW_HEIGHT);
  resultsTable.setupColumnHandler();
  TableColors tableColors=new TableColors();
  resultsTable.addHighlighter(new ColorHighlighter(new DownloadedHighlightPredicate(sortedList),null,tableColors.getDisabledForegroundColor(),null,tableColors.getDisabledForegroundColor()));
}

Fixed version (ground truth):
private void configureTable(EventList<VisualSearchResult> eventList,final ResultsTableFormat<VisualSearchResult> tableFormat,Navigator navigator,PropertiesFactory<VisualSearchResult> properties){
  SortedList<VisualSearchResult> sortedList=new SortedList<VisualSearchResult>(eventList);
  resultsTable=new ConfigurableTable<VisualSearchResult>(sortedList,tableFormat,true);
  EventListJXTableSorting.install(resultsTable,sortedList);
  setupCellRenderers(tableFormat);
  resultsTable.setPopupHandler(new SearchPopupHandler(resultsTable,this,properties));
  resultsTable.setDoubleClickHandler(new ClassicDoubleClickHandler(resultsTable,this,navigator,libraryNavigator));
  resultsTable.setRowHeight(TABLE_ROW_HEIGHT);
  resultsTable.setupColumnHandler();
  TableColors tableColors=new TableColors();
  resultsTable.addHighlighter(new ColorHighlighter(new DownloadedHighlightPredicate(sortedList),null,tableColors.getDisabledForegroundColor(),null,tableColors.getDisabledForegroundColor()));
}
Program: 3895
Project: 3895
Buggy source:
public void run(){
  reviewBug(info);
}

Fixed version (ground truth):
public void run(){
  dialog.dispose();
  System.exit(1);
}
Program: 3896
Project: 3896
Buggy source:
public void actionPerformed(ActionEvent e){
  String userComments=userCommentsTextArea.getText();
  if (!userComments.equals(defaultDesc))   info.addUserComments(userComments);
  sendToServlet(info);
  dialog.dispose();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  String userComments=userCommentsTextArea.getText();
  if (!userComments.equals(defaultDesc))   info.addUserComments(userComments);
  sendButton.setEnabled(false);
  sendButton.setText("String_Node_Str");
  new Thread("String_Node_Str"){
    public void run(){
      try {
        sendToServlet(info);
      }
  finally {
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            dialog.dispose();
            System.exit(1);
          }
        }
);
      }
    }
  }
.start();
}
Program: 3899
Project: 3899
Buggy source:
@Override public FriendFileList getOrCreateFriendShareList(Friend friend){
  LOG.debugf("String_Node_Str",friend.getId());
  if (friendLocalFileLists.containsKey(friend.getId())) {
    LOG.debugf("String_Node_Str",friend.getId());
    return friendLocalFileLists.get(friend.getId());
  }
  FriendFileListImpl newList=new FriendFileListImpl(fileManager,friend.getId());
  FriendFileList existing=friendLocalFileLists.putIfAbsent(friend.getId(),newList);
  if (existing == null) {
    LOG.debugf("String_Node_Str",friend.getId());
    newList.commit();
    friendShareListEventListener.handleEvent(new FriendShareListEvent(FriendShareListEvent.Type.FRIEND_SHARE_LIST_ADDED,newList,friend));
    return newList;
  }
 else {
    LOG.debugf("String_Node_Str",friend.getId());
    newList.dispose();
    return existing;
  }
}

Fixed version (ground truth):
@Override public FriendFileList getOrCreateFriendShareList(Friend friend){
  LOG.debugf("String_Node_Str",friend.getId());
  FriendFileList list=friendLocalFileLists.get(friend.getId());
  if (list != null) {
    LOG.debugf("String_Node_Str",friend.getId());
    return list;
  }
  FriendFileListImpl newList=new FriendFileListImpl(fileManager,friend.getId());
  FriendFileList existing=friendLocalFileLists.putIfAbsent(friend.getId(),newList);
  if (existing == null) {
    LOG.debugf("String_Node_Str",friend.getId());
    newList.commit();
    friendShareListEventListener.handleEvent(new FriendShareListEvent(FriendShareListEvent.Type.FRIEND_SHARE_LIST_ADDED,newList,friend));
    return newList;
  }
 else {
    LOG.debugf("String_Node_Str",friend.getId());
    newList.dispose();
    return existing;
  }
}
Program: 3900
Project: 3900
Buggy source:
public RemoteFileItem create(FriendPresence presence,FileMetaData fileMetaData) throws InvalidDataException, SaveLocationException {
  RemoteFileDesc remoteFileDesc=createRfdFromChatResult(presence,fileMetaData);
  RemoteFileDescAdapter remoteFileDescAdapter=new RemoteFileDescAdapter(remoteFileDescDeserializer.createClone(remoteFileDesc,(XMPPAddress)((AddressFeature)presence.getFeature(AddressFeature.ID)).getFeature()),IpPort.EMPTY_SET,presence);
  return new CoreRemoteFileItem(remoteFileDescAdapter);
}

Fixed version (ground truth):
public RemoteFileItem create(FriendPresence presence,FileMetaData fileMetaData) throws InvalidDataException, SaveLocationException {
  XMPPAddress presenceAddress=getAddressFromPresence(presence);
  RemoteFileDesc remoteFileDesc=createRfdFromChatResult(presenceAddress,fileMetaData);
  RemoteFileDescAdapter remoteFileDescAdapter=new RemoteFileDescAdapter(remoteFileDescDeserializer.createClone(remoteFileDesc,presenceAddress),IpPort.EMPTY_SET,presence);
  return new CoreRemoteFileItem(remoteFileDescAdapter);
}
Program: 3901
Project: 3901
Buggy source:
private RemoteFileDesc createRfdFromChatResult(FriendPresence presence,FileMetaData fileMeta) throws SaveLocationException, InvalidDataException {
  Address address=((AddressFeature)presence.getFeature(AddressFeature.ID)).getFeature();
  byte[] clientGuid=DataUtils.EMPTY_GUID;
  Set<String> urnsAsString=fileMeta.getURNsAsString();
  Set<URN> urns=new HashSet<URN>();
  for (  String urnStr : urnsAsString) {
    try {
      urns.add(URN.createUrnFromString(urnStr));
    }
 catch (    IOException iox) {
      throw new InvalidDataException(iox);
    }
  }
  return remoteFileDescFactory.createRemoteFileDesc(address,fileMeta.getIndex(),fileMeta.getName(),fileMeta.getSize(),clientGuid,0,false,0,true,null,urns,false,null,fileMeta.getCreateTime().getTime());
}

Fixed version (ground truth):
private RemoteFileDesc createRfdFromChatResult(XMPPAddress address,FileMetaData fileMeta) throws SaveLocationException, InvalidDataException {
  byte[] clientGuid=DataUtils.EMPTY_GUID;
  Set<String> urnsAsString=fileMeta.getURNsAsString();
  Set<URN> urns=new HashSet<URN>();
  for (  String urnStr : urnsAsString) {
    try {
      urns.add(URN.createUrnFromString(urnStr));
    }
 catch (    IOException iox) {
      throw new InvalidDataException(iox);
    }
  }
  return remoteFileDescFactory.createRemoteFileDesc(address,fileMeta.getIndex(),fileMeta.getName(),fileMeta.getSize(),clientGuid,0,false,0,true,null,urns,false,null,fileMeta.getCreateTime().getTime());
}
Program: 3902
Project: 3902
Buggy source:
public static void assertFileRenameFails(String reason,ManagedFileList fileList,File old,File newFile) throws Exception {
  FileDesc oldFd=fileList.getFileDesc(old);
  Future<FileDesc> future=fileList.fileRenamed(old,newFile);
  try {
    future.get(1,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException expected) {
    assertInstanceof(FileListChangeFailedException.class,expected.getCause());
    FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
    assertEquals(FileListChangedEvent.Type.CHANGE_FAILED,cause.getEvent().getType());
    assertEquals(old,cause.getEvent().getOldFile());
    assertEquals(newFile,cause.getEvent().getFile());
    assertEquals(oldFd,cause.getEvent().getOldValue());
    assertEquals(reason,cause.getReason());
  }
}

Fixed version (ground truth):
public static void assertFileRenameFails(String reason,ManagedFileList fileList,File old,File newFile) throws Exception {
  FileDesc oldFd=fileList.getFileDesc(old);
  Future<FileDesc> future=fileList.fileRenamed(old,newFile);
  try {
    future.get(1,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException expected) {
    assertInstanceof(FileListChangeFailedException.class,expected.getCause());
    FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
    assertEquals(FileListChangedEvent.Type.CHANGE_FAILED,cause.getEvent().getType());
    assertEquals(old,cause.getEvent().getOldFile());
    assertEquals(newFile,cause.getEvent().getFile());
    assertEquals(oldFd,cause.getEvent().getOldValue());
    assertEquals(reason,cause.getReason().toString());
  }
}
Program: 3903
Project: 3903
Buggy source:
public static void assertFileChangedFails(String reason,ManagedFileList fileList,File file) throws Exception {
  FileDesc oldFd=fileList.getFileDesc(file);
  Future<FileDesc> future=fileList.fileChanged(file,LimeXMLDocument.EMPTY_LIST);
  try {
    future.get(1,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException expected) {
    assertInstanceof(FileListChangeFailedException.class,expected.getCause());
    FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
    assertEquals(FileListChangedEvent.Type.CHANGE_FAILED,cause.getEvent().getType());
    assertEquals(file,cause.getEvent().getOldFile());
    assertEquals(file,cause.getEvent().getFile());
    assertEquals(oldFd,cause.getEvent().getOldValue());
    assertEquals(reason,cause.getReason());
  }
}

Fixed version (ground truth):
public static void assertFileChangedFails(String reason,ManagedFileList fileList,File file) throws Exception {
  FileDesc oldFd=fileList.getFileDesc(file);
  Future<FileDesc> future=fileList.fileChanged(file,LimeXMLDocument.EMPTY_LIST);
  try {
    future.get(1,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  ExecutionException expected) {
    assertInstanceof(FileListChangeFailedException.class,expected.getCause());
    FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
    assertEquals(FileListChangedEvent.Type.CHANGE_FAILED,cause.getEvent().getType());
    assertEquals(file,cause.getEvent().getOldFile());
    assertEquals(file,cause.getEvent().getFile());
    assertEquals(oldFd,cause.getEvent().getOldValue());
    assertEquals(reason,cause.getReason().toString());
  }
}
Program: 3904
Project: 3904
Buggy source:
public static void assertAddFails(String reason,FileList fileList,File... files) throws Exception {
  for (  File file : files) {
    try {
      FileDesc fd=fileList.add(file).get(5,TimeUnit.SECONDS);
      fail("String_Node_Str" + fd);
    }
 catch (    ExecutionException expected) {
      assertInstanceof(FileListChangeFailedException.class,expected.getCause());
      FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
      assertEquals(FileListChangedEvent.Type.ADD_FAILED,cause.getEvent().getType());
      assertEquals(file,cause.getEvent().getFile());
      assertEquals(reason,cause.getReason());
    }
  }
}

Fixed version (ground truth):
public static void assertAddFails(String reason,FileList fileList,File... files) throws Exception {
  for (  File file : files) {
    try {
      FileDesc fd=fileList.add(file).get(5,TimeUnit.SECONDS);
      fail("String_Node_Str" + fd);
    }
 catch (    ExecutionException expected) {
      assertInstanceof(FileListChangeFailedException.class,expected.getCause());
      FileListChangeFailedException cause=(FileListChangeFailedException)expected.getCause();
      assertEquals(FileListChangedEvent.Type.ADD_FAILED,cause.getEvent().getType());
      assertEquals(file,cause.getEvent().getFile());
      assertEquals(reason,cause.getReason().toString());
    }
  }
}
Program: 3905
Project: 3905
Buggy source:
private void initManualPanel(){
  RootLibraryManagerItem root=new RootLibraryManagerItem(AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData));
  Collection<File> autoManage=AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData);
  for (  File file : autoManage) {
    root.addChild(new LibraryManagerItemImpl(root,libraryData,file,false));
  }
  if (shouldKeepExistingDirectorySettings) {
    for (    File file : libraryData.getDirectoriesToManageRecursively()) {
      root.addChild(new LibraryManagerItemImpl(root,libraryData,file,false));
    }
  }
  treeTable.setTreeTableModel(new LibraryManagerModel(root));
}

Fixed version (ground truth):
private void initManualPanel(){
  RootLibraryManagerItem root=new RootLibraryManagerItem(AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData));
  Set<File> totalList=new HashSet<File>();
  totalList.addAll(AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData));
  if (shouldKeepExistingDirectorySettings) {
    totalList.addAll(libraryData.getDirectoriesToManageRecursively());
  }
  for (  File file : totalList) {
    root.addChild(new LibraryManagerItemImpl(root,libraryData,file,false));
  }
  treeTable.setTreeTableModel(new LibraryManagerModel(root));
}
Program: 3907
Project: 3907
Buggy source:
@Override public void applySettings(){
  InstallSettings.SCAN_FILES.setValue(true);
  Collection<File> manage;
  Collection<File> exclude;
  if (manualButton.isSelected()) {
    LibraryManagerModel model=treeTable.getLibraryModel();
    manage=model.getRootChildrenAsFiles();
    exclude=model.getAllExcludedSubfolders();
  }
 else {
    manage=AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData);
    exclude=Collections.emptySet();
  }
  libraryData.setManagedOptions(manage,exclude,libraryData.getManagedCategories());
}

Fixed version (ground truth):
@Override public void applySettings(){
  InstallSettings.SCAN_FILES.setValue(true);
  Collection<File> manage;
  Collection<File> exclude=new HashSet<File>();
  if (manualButton.isSelected()) {
    LibraryManagerModel model=treeTable.getLibraryModel();
    manage=model.getRootChildrenAsFiles();
    exclude.addAll(model.getAllExcludedSubfolders());
  }
 else {
    manage=new HashSet<File>();
    manage.addAll(AutoDirectoryManageConfig.getDefaultManagedDirectories(libraryData));
    manage.addAll(libraryData.getDirectoriesToManageRecursively());
  }
  exclude.addAll(libraryData.getDirectoriesToExcludeFromManaging());
  libraryData.setManagedOptions(manage,exclude,libraryData.getManagedCategories());
}
Program: 3908
Project: 3908
Buggy source:
private Painter<JTextField> createStatusBackgroundPainter(){
  CompoundPainter<JTextField> compoundPainter=new CompoundPainter<JTextField>();
  RectanglePainter<JTextField> painter=new RectanglePainter<JTextField>();
  painter.setRounded(true);
  painter.setFillPaint(innerBackground);
  painter.setRoundWidth(this.arcWidth);
  painter.setRoundHeight(this.arcHeight);
  painter.setInsets(new Insets(2,2,2,2));
  painter.setBorderPaint(null);
  painter.setFillVertical(true);
  painter.setFillHorizontal(true);
  painter.setAntialiasing(true);
  painter.setCacheable(true);
  compoundPainter.setPainters(painter,new BorderPainter<JTextField>(this.arcWidth,this.arcHeight,this.innerBorder,this.bevelLeft,this.bevelTop1,this.bevelTop2,this.bevelRight,this.bevelBottom,AccentType.SHADOW));
  compoundPainter.setCacheable(true);
  return compoundPainter;
}

Fixed version (ground truth):
private Painter<JXPanel> createStatusBackgroundPainter(){
  CompoundPainter<JXPanel> compoundPainter=new CompoundPainter<JXPanel>();
  RectanglePainter<JXPanel> painter=new RectanglePainter<JXPanel>();
  painter.setRounded(true);
  painter.setFillPaint(innerBackground);
  painter.setRoundWidth(this.arcWidth);
  painter.setRoundHeight(this.arcHeight);
  painter.setInsets(new Insets(2,2,2,2));
  painter.setBorderPaint(null);
  painter.setFillVertical(true);
  painter.setFillHorizontal(true);
  painter.setAntialiasing(true);
  painter.setCacheable(true);
  compoundPainter.setPainters(painter,new BorderPainter<JXPanel>(this.arcWidth,this.arcHeight,this.innerBorder,this.bevelLeft,this.bevelTop1,this.bevelTop2,this.bevelRight,this.bevelBottom,AccentType.SHADOW));
  compoundPainter.setCacheable(true);
  return compoundPainter;
}
Program: 3910
Project: 3910
Buggy source:
private JComboBox createLanguageDropDown(Font normalFont){
  final JComboBox languageDropDown=new JComboBox();
  Locale[] locales=LanguageUtils.getLocales(normalFont);
  languageDropDown.setRenderer(new LocaleRenderer());
  languageDropDown.setFont(normalFont);
  languageDropDown.setModel(new DefaultComboBoxModel(locales));
  Locale locale=LanguageUtils.guessLocale();
  languageDropDown.setSelectedItem(locale);
  languageDropDown.addItemListener(new ItemListener(){
    @Override public void itemStateChanged(    ItemEvent e){
      if (e.getStateChange() == ItemEvent.SELECTED) {
        Locale locale=(Locale)languageDropDown.getSelectedItem();
        LanguageUtils.setLocale(locale);
        setTextContents();
      }
    }
  }
);
  return languageDropDown;
}

Fixed version (ground truth):
private JComboBox createLanguageDropDown(Font normalFont){
  final JComboBox languageDropDown=new JComboBox();
  Locale[] locales=LanguageUtils.getLocales(normalFont);
  languageDropDown.setRenderer(new LocaleRenderer());
  languageDropDown.setFont(normalFont);
  languageDropDown.setModel(new DefaultComboBoxModel(locales));
  languageDropDown.setSelectedItem(LanguageUtils.guessBestAvailableLocale(locales));
  LanguageUtils.setLocale((Locale)languageDropDown.getSelectedItem());
  languageDropDown.addItemListener(new ItemListener(){
    @Override public void itemStateChanged(    ItemEvent e){
      if (e.getStateChange() == ItemEvent.SELECTED) {
        Locale locale=(Locale)languageDropDown.getSelectedItem();
        LanguageUtils.setLocale(locale);
        setTextContents();
      }
    }
  }
);
  return languageDropDown;
}
Program: 3911
Project: 3911
Buggy source:
public ShapeDialog(){
  super(new MigLayout("String_Node_Str"));
  GuiUtils.assignResources(this);
  setOpaque(false);
  setVisible(false);
  setBackgroundPainter(new DialogShadowPainter());
  addComponentListener(new ComponentAdapter(){
    @Override public void componentShown(    ComponentEvent e){
      addListeners();
    }
    @Override public void componentHidden(    ComponentEvent e){
      removeListeners();
    }
  }
);
  componentListener=new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      setSize(getPreferredSize());
      repaint();
    }
  }
;
}

Fixed version (ground truth):
public ShapeDialog(){
  super(new MigLayout("String_Node_Str"));
  GuiUtils.assignResources(this);
  setOpaque(false);
  setVisible(false);
  setBackgroundPainter(new DialogShadowPainter());
  addComponentListener(new ComponentAdapter(){
    @Override public void componentShown(    ComponentEvent e){
      addListeners();
      resize();
    }
    @Override public void componentHidden(    ComponentEvent e){
      removeListeners();
    }
  }
);
  componentListener=new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      setSize(getPreferredSize());
      repaint();
    }
  }
;
}
Program: 3912
Project: 3912
Buggy source:
/** 
 * @param c the Component shown
 * @param owner the dialog owner.  Dialog will be centered in frame if this is null
 * @param autoClose Dialog will have PopupMenu close behavior (clicking away or pressing esc closes dialog)
 */
public void show(Component c,Component owner,boolean autoClose){
  removeAll();
  int inset=(owner != null && isPositionedRelativeToOwner) ? 0 : SHADOW_INSETS;
  add(c,"String_Node_Str" + inset + "String_Node_Str"+ inset+ "String_Node_Str"+ inset+ "String_Node_Str"+ inset);
  this.component=c;
  this.owner=owner;
  this.isAutoClose=autoClose;
  setVisible(true);
  resize();
}

Fixed version (ground truth):
/** 
 * @param c the Component shown
 * @param owner the dialog owner.  Dialog will be centered in frame if this is null
 * @param autoClose Dialog will have PopupMenu close behavior (clicking away or pressing esc closes dialog)
 */
public void show(Component c,Component owner,boolean autoClose){
  removeAll();
  int inset=(owner != null && isPositionedRelativeToOwner) ? 0 : SHADOW_INSETS;
  add(c,"String_Node_Str" + inset + "String_Node_Str"+ inset+ "String_Node_Str"+ inset+ "String_Node_Str"+ inset);
  this.component=c;
  this.owner=owner;
  this.isAutoClose=autoClose;
  setVisible(true);
}
Program: 3913
Project: 3913
Buggy source:
@Override public void componentShown(ComponentEvent e){
  addListeners();
}

Fixed version (ground truth):
@Override public void componentShown(ComponentEvent e){
  addListeners();
  resize();
}
Program: 3914
Project: 3914
Buggy source:
@Override protected JComponent createCategoryButton(Action action,Category category){
  MySelectionPanel component=new MySelectionPanel(action,new ShareAllAction(category),category,this);
  addNavigation(component.getButton());
  return component;
}

Fixed version (ground truth):
@Override protected JComponent createCategoryButton(Action action,Category category){
  MySelectionPanel component=new MySelectionPanel(action,new ShareCategoryAction(category),category,this);
  addNavigation(component.getButton());
  return component;
}
Program: 3915
Project: 3915
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  categoryShareWidget.setShareable(category);
  categoryShareWidget.show((JComponent)e.getSource());
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (LibrarySettings.SNAPSHOT_SHARING_ENABLED.getValue()) {
  }
 else {
    categoryShareWidget.setShareable(category);
    categoryShareWidget.show((JComponent)e.getSource());
  }
}
Program: 3917
Project: 3917
Buggy source:
/** 
 * Sets the custom default UI color and behavior properties
 */
private void initUIDefaults(){
  if (OSUtils.isAnyMac()) {
    initMacUIDefaults();
  }
  initBackgrounds();
  Paint highlightBackground=new Color(0xdaf2b5);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  Color highlightForeground=Color.BLACK;
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * Sets the custom default UI color and behavior properties
 */
private void initUIDefaults(){
  if (OSUtils.isAnyMac()) {
    initMacUIDefaults();
  }
  initBackgrounds();
  Paint highlightBackground=new Color(0xdaf2b5);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  UIManager.put("String_Node_Str",highlightBackground);
  Color highlightForeground=Color.BLACK;
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",highlightForeground);
  UIManager.put("String_Node_Str",false);
  if (OSUtils.isWindows()) {
    replaceIconIfFailing("String_Node_Str",upFolderVistaFixIcon);
    replaceIconIfFailing("String_Node_Str",detailsViewVistaFixIcon);
    replaceIconIfFailing("String_Node_Str",listViewVistaFixIcon);
    replaceIconIfFailing("String_Node_Str",newFolderVistaFixIcon);
  }
}
Program: 3918
Project: 3918
Buggy source:
public synchronized boolean addDownload(Collection<? extends RemoteFileDesc> c,boolean cache){
  if (stopped || isCompleted())   return false;
  List<RemoteFileDesc> l=new ArrayList<RemoteFileDesc>(c.size());
  for (  RemoteFileDesc rfd : c) {
    if (allowAddition(rfd)) {
      if (hostIsAllowed(rfd)) {
        l.add(rfd);
      }
    }
  }
  return addDownloadForced(l,cache);
}

Fixed version (ground truth):
public synchronized boolean addDownload(Collection<? extends RemoteFileDesc> c,boolean cache){
  if (stopped || isCompleted())   return false;
  List<RemoteFileDesc> l=new ArrayList<RemoteFileDesc>(c.size());
  for (  RemoteFileDesc rfd : c) {
    if (allowAddition(rfd)) {
      if (hostIsAllowed(rfd)) {
        l.add(rfd);
      }
    }
  }
  if (l.size() > 0) {
    return addDownloadForced(l,cache);
  }
 else {
    return false;
  }
}
Program: 3919
Project: 3919
Buggy source:
@Override public void showProperties(RemoteFileItem propertiable){
  icon.setIcon(categoryIconManager.getIcon(propertiable.getCategory()));
  location.setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  location.add(fileLocation);
  populateCommonFields(propertiable);
  populateCopyToClipboard(propertiable);
  fileLocation.setText(propertiable.getSources().get(0).getFriendPresence().getPresenceId());
  showDialog(propertiable.getFileName(),propertiable.getCategory());
}

Fixed version (ground truth):
@Override public void showProperties(RemoteFileItem propertiable){
  icon.setIcon(categoryIconManager.getIcon(propertiable.getCategory()));
  location.setLayout(new MigLayout("String_Node_Str","String_Node_Str","String_Node_Str"));
  location.add(fileLocation,"String_Node_Str");
  populateCommonFields(propertiable);
  populateCopyToClipboard(propertiable);
  fileLocation.setText(propertiable.getSources().get(0).getFriendPresence().getPresenceId());
  showDialog(propertiable.getFileName(),propertiable.getCategory());
}
Program: 3920
Project: 3920
Buggy source:
@Override public void initOptions(){
  String[] bannedWords=FilterSettings.BANNED_EXTENSIONS.getValue();
  eventList.addAll(new ArrayList<String>(Arrays.asList(bannedWords)));
}

Fixed version (ground truth):
@Override public void initOptions(){
  eventList.clear();
  String[] bannedWords=FilterSettings.BANNED_EXTENSIONS.getValue();
  eventList.addAll(new ArrayList<String>(Arrays.asList(bannedWords)));
}
Program: 3921
Project: 3921
Buggy source:
/** 
 * Initializes the components in the container.
 */
private void initComponents(){
  setLayout(new BorderLayout());
  setOpaque(false);
  scrollPane.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
  scrollPane.setPreferredSize(new Dimension(120,295));
  connectionTable.setPopupHandler(new TablePopupHandler(){
    @Override public boolean isPopupShowing(    int row){
      return false;
    }
    @Override public void maybeShowPopup(    Component component,    int x,    int y){
      int row=connectionTable.rowAtPoint(new Point(x,y));
      if ((row >= 0) && !connectionTable.isRowSelected(row)) {
        connectionTable.setRowSelectionInterval(row,row);
      }
      popupMenu.show(component,x,y);
    }
  }
);
  connectionTable.setDoubleClickHandler(new TableDoubleClickHandler(){
    @Override public void handleDoubleClick(    int row){
      if (row >= 0) {
        connectionTable.setRowSelectionInterval(row,row);
      }
      viewLibrary();
    }
  }
);
  JMenuItem menuItem=new JMenuItem(I18n.tr("String_Node_Str"));
  menuItem.addActionListener(new ViewLibraryAction());
  popupMenu.add(menuItem);
  popupMenu.addSeparator();
  menuItem=new JMenuItem(I18n.tr("String_Node_Str"));
  menuItem.addActionListener(new RemoveConnectionAction());
  popupMenu.add(menuItem);
  add(scrollPane,BorderLayout.CENTER);
  scrollPane.setViewportView(connectionTable);
}

Fixed version (ground truth):
/** 
 * Initializes the components in the container.
 */
private void initComponents(){
  setLayout(new BorderLayout());
  setOpaque(false);
  scrollPane.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
  scrollPane.setPreferredSize(new Dimension(120,120));
  connectionTable.setPopupHandler(new TablePopupHandler(){
    @Override public boolean isPopupShowing(    int row){
      return false;
    }
    @Override public void maybeShowPopup(    Component component,    int x,    int y){
      int row=connectionTable.rowAtPoint(new Point(x,y));
      if ((row >= 0) && !connectionTable.isRowSelected(row)) {
        connectionTable.setRowSelectionInterval(row,row);
      }
      popupMenu.show(component,x,y);
    }
  }
);
  connectionTable.setDoubleClickHandler(new TableDoubleClickHandler(){
    @Override public void handleDoubleClick(    int row){
      if (row >= 0) {
        connectionTable.setRowSelectionInterval(row,row);
      }
      viewLibrary();
    }
  }
);
  JMenuItem menuItem=new JMenuItem(I18n.tr("String_Node_Str"));
  menuItem.addActionListener(new ViewLibraryAction());
  popupMenu.add(menuItem);
  popupMenu.addSeparator();
  menuItem=new JMenuItem(I18n.tr("String_Node_Str"));
  menuItem.addActionListener(new RemoveConnectionAction());
  popupMenu.add(menuItem);
  add(scrollPane,BorderLayout.CENTER);
  scrollPane.setViewportView(connectionTable);
}
Program: 3922
Project: 3922
Buggy source:
@Override public boolean isShared(SharingTarget friend){
  for (  LocalFileItem item : fileItems) {
    if (friend.isGnutellaNetwork()) {
      if (!gnutellaList.contains(item.getFile())) {
        return false;
      }
    }
 else {
switch (item.getCategory()) {
case AUDIO:
        if (!shareListManager.getOrCreateFriendShareList(friend.getFriend()).isAddNewAudioAlways()) {
          return false;
        }
      break;
case VIDEO:
    if (!shareListManager.getOrCreateFriendShareList(friend.getFriend()).isAddNewVideoAlways()) {
      return false;
    }
  break;
case IMAGE:
if (!shareListManager.getOrCreateFriendShareList(friend.getFriend()).isAddNewImageAlways()) {
  return false;
}
break;
}
if (shareListManager.getOrCreateFriendShareList(friend.getFriend()).contains(item.getFile())) {
return false;
}
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean isShared(SharingTarget friend){
  return false;
}
Program: 3923
Project: 3923
Buggy source:
protected void populateCommonFields(final PropertiableFile propertiable){
  heading.setText(propertiableHeadings.getHeading(propertiable));
  filename.setText(propertiable.getFileName());
  subheading.setText(propertiableHeadings.getSubHeading(propertiable));
  fileSize.setText(str(propertiable.getProperty(FilePropertyKey.FILE_SIZE)));
  genre.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.GENRE)}));
  rating.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.RATING)}));
  platform.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.PLATFORM)}));
  populateMetadata(propertiable);
  title.setText(str(propertiable.getProperty(FilePropertyKey.TITLE)));
  artist.setText(str(propertiable.getProperty(FilePropertyKey.AUTHOR)));
  author.setText(str(propertiable.getProperty(FilePropertyKey.AUTHOR)));
  company.setText(str(propertiable.getProperty(FilePropertyKey.COMPANY)));
  album.setText(str(propertiable.getProperty(FilePropertyKey.ALBUM)));
  year.setText(str(propertiable.getProperty(FilePropertyKey.YEAR)));
  track.setText(str(propertiable.getProperty(FilePropertyKey.TRACK_NUMBER)));
  description.setText(str(propertiable.getProperty(FilePropertyKey.COMMENTS)));
}

Fixed version (ground truth):
protected void populateCommonFields(final PropertiableFile propertiable){
  heading.setText(propertiableHeadings.getHeading(propertiable));
  filename.setText(propertiable.getFileName());
  subheading.setText(propertiableHeadings.getSubHeading(propertiable));
  fileSize.setText(propertiableHeadings.getFileSize(propertiable));
  genre.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.GENRE)}));
  rating.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.RATING)}));
  platform.setModel(new DefaultComboBoxModel(new Object[]{propertiable.getProperty(FilePropertyKey.PLATFORM)}));
  populateMetadata(propertiable);
  title.setText(str(propertiable.getProperty(FilePropertyKey.TITLE)));
  artist.setText(str(propertiable.getProperty(FilePropertyKey.AUTHOR)));
  author.setText(str(propertiable.getProperty(FilePropertyKey.AUTHOR)));
  company.setText(str(propertiable.getProperty(FilePropertyKey.COMPANY)));
  album.setText(str(propertiable.getProperty(FilePropertyKey.ALBUM)));
  year.setText(str(propertiable.getProperty(FilePropertyKey.YEAR)));
  track.setText(str(propertiable.getProperty(FilePropertyKey.TRACK_NUMBER)));
  description.setText(str(propertiable.getProperty(FilePropertyKey.COMMENTS)));
}
Program: 3924
Project: 3924
Buggy source:
protected void populateMetadata(PropertiableFile propFile){
  Map<String,String> metadata=new LinkedHashMap<String,String>();
switch (propFile.getCategory()) {
case AUDIO:
    addBitrateMetadata(str(propFile.getProperty(FilePropertyKey.BITRATE)),metadata);
  break;
case VIDEO:
addBitrateMetadata(str(propFile.getProperty(FilePropertyKey.BITRATE)),metadata);
addDimensionMetadata(str(propFile.getProperty(FilePropertyKey.WIDTH)),str(propFile.getProperty(FilePropertyKey.HEIGHT)),metadata);
break;
case IMAGE:
addDimensionMetadata(str(propFile.getProperty(FilePropertyKey.WIDTH)),str(propFile.getProperty(FilePropertyKey.HEIGHT)),metadata);
break;
case DOCUMENT:
addDateCreatedMetadata(str(propFile.getProperty(FilePropertyKey.DATE_CREATED)),metadata);
break;
}
addHashMetadata(propFile.getUrn(),metadata);
setMetadataText(metadata);
}

Fixed version (ground truth):
protected void populateMetadata(PropertiableFile propFile){
  Map<String,String> metadata=new LinkedHashMap<String,String>();
switch (propFile.getCategory()) {
case AUDIO:
    addBitrateMetadata(str(propFile.getProperty(FilePropertyKey.BITRATE)),metadata);
  break;
case VIDEO:
addBitrateMetadata(str(propFile.getProperty(FilePropertyKey.BITRATE)),metadata);
addDimensionMetadata(str(propFile.getProperty(FilePropertyKey.WIDTH)),str(propFile.getProperty(FilePropertyKey.HEIGHT)),metadata);
break;
case IMAGE:
addDimensionMetadata(str(propFile.getProperty(FilePropertyKey.WIDTH)),str(propFile.getProperty(FilePropertyKey.HEIGHT)),metadata);
break;
case DOCUMENT:
addDateCreatedMetadata(convertDate(propFile),metadata);
break;
}
addHashMetadata(propFile.getUrn(),metadata);
setMetadataText(metadata);
}
Program: 3926
Project: 3926
Buggy source:
private Long getFileSize(PropertiableFile propertiable){
  return CommonUtils.parseLongNoException(getPropertyString(propertiable,FilePropertyKey.FILE_SIZE));
}

Fixed version (ground truth):
public String getFileSize(PropertiableFile propertiable){
  Long fileSize=getFileSizeLong(propertiable);
  if (fileSize != null) {
    return GuiUtils.toUnitbytes(fileSize);
  }
  return "String_Node_Str";
}
Program: 3927
Project: 3927
Buggy source:
/** 
 * Constructs a new EventListener for list change events. 
 */
protected EventListener<FileListChangedEvent> newEventListener(){
  return new EventListener<FileListChangedEvent>(){
    @Override public void handleEvent(    FileListChangedEvent event){
switch (event.getType()) {
case ADDED:
        addFileDesc(event.getFileDesc());
      break;
case CHANGED:
    changeFileDesc(event.getOldValue(),event.getFileDesc());
  break;
case REMOVED:
removeFileDesc(event.getFileDesc());
break;
case CLEAR:
clearFileDescs();
break;
}
}
}
;
}

Fixed version (ground truth):
/** 
 * Constructs a new EventListener for list change events. 
 */
protected EventListener<FileListChangedEvent> newEventListener(){
  return new EventListener<FileListChangedEvent>(){
    @Override public void handleEvent(    FileListChangedEvent event){
switch (event.getType()) {
case ADDED:
        addFileDesc(event.getFileDesc());
      break;
case CHANGED:
    changeFileDesc(event.getOldValue(),event.getFileDesc());
  break;
case REMOVED:
removeFileDesc(event.getFileDesc());
break;
case CLEAR:
clearFileDescs();
break;
case AUDIO_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.AUDIO_COLLECTION) {
audioCollectionUpdate(event.isShared());
}
break;
case VIDEO_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.VIDEO_COLLECTION) {
videoCollectionUpdate(event.isShared());
}
break;
case IMAGE_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.IMAGE_COLLECTION) {
imageCollectionUpdate(event.isShared());
}
break;
}
}
}
;
}
Program: 3928
Project: 3928
Buggy source:
@Override public void handleEvent(FileListChangedEvent event){
switch (event.getType()) {
case ADDED:
    addFileDesc(event.getFileDesc());
  break;
case CHANGED:
changeFileDesc(event.getOldValue(),event.getFileDesc());
break;
case REMOVED:
removeFileDesc(event.getFileDesc());
break;
case CLEAR:
clearFileDescs();
break;
}
}

Fixed version (ground truth):
@Override public void handleEvent(FileListChangedEvent event){
switch (event.getType()) {
case ADDED:
    addFileDesc(event.getFileDesc());
  break;
case CHANGED:
changeFileDesc(event.getOldValue(),event.getFileDesc());
break;
case REMOVED:
removeFileDesc(event.getFileDesc());
break;
case CLEAR:
clearFileDescs();
break;
case AUDIO_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.AUDIO_COLLECTION) {
audioCollectionUpdate(event.isShared());
}
break;
case VIDEO_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.VIDEO_COLLECTION) {
videoCollectionUpdate(event.isShared());
}
break;
case IMAGE_COLLECTION:
if (event.getType() == FileListChangedEvent.Type.IMAGE_COLLECTION) {
imageCollectionUpdate(event.isShared());
}
break;
}
}
Program: 3929
Project: 3929
Buggy source:
public void setAddNewImageAlways(boolean value){
  getCoreFileList().setAddNewImageAlways(value);
  fireImageCollectionChange(propertyChange,value);
  setSharing(value,Category.IMAGE);
}

Fixed version (ground truth):
public void setAddNewImageAlways(boolean value){
  getCoreFileList().setAddNewImageAlways(value);
  imageCollectionUpdate(value);
}
Program: 3930
Project: 3930
Buggy source:
public void setAddNewAudioAlways(boolean value){
  getCoreFileList().setAddNewAudioAlways(value);
  fireAudioCollectionChange(propertyChange,value);
  setSharing(value,Category.AUDIO);
}

Fixed version (ground truth):
public void setAddNewAudioAlways(boolean value){
  getCoreFileList().setAddNewAudioAlways(value);
  audioCollectionUpdate(value);
}
Program: 3931
Project: 3931
Buggy source:
public void setAddNewVideoAlways(boolean value){
  getCoreFileList().setAddNewVideoAlways(value);
  fireVideoCollectionChange(propertyChange,value);
  setSharing(value,Category.VIDEO);
}

Fixed version (ground truth):
public void setAddNewVideoAlways(boolean value){
  getCoreFileList().setAddNewVideoAlways(value);
  videoCollectionUpdate(value);
}
Program: 3932
Project: 3932
Buggy source:
public FileListChangedEvent(FileList list,Type type,FileDesc oldValue,FileDesc newValue){
}

Fixed version (ground truth):
public FileListChangedEvent(Type type,boolean state){
}
Program: 3933
Project: 3933
Buggy source:
@Override protected void saveChange(File file,boolean added){
  if (isSmartlySharedType(file)) {
    if (!added) {
      stopSmartSharingType(file);
    }
  }
 else {
    data.setSharedWithFriend(file,id,added);
  }
}

Fixed version (ground truth):
@Override protected void saveChange(File file,boolean added){
  data.setSharedWithFriend(file,id,added);
}
Program: 3934
Project: 3934
Buggy source:
/** 
 * Changes the smart sharing value for images. If true, all new images added to the library will be shared with this list, if false, new images added to  the library will not be automatically shared with this list but current images will not be removed.
 */
@Override public void setAddNewImageAlways(boolean value){
  if (value != addNewImagesAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_IMAGES_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_IMAGES_ALWAYS,id);
    }
    addNewImagesAlways=value;
  }
}

Fixed version (ground truth):
/** 
 * Changes the smart sharing value for images. If true, all new images added to the library will be shared with this list, if false, new images added to  the library will not be automatically shared with this list but current images will not be removed.
 */
@Override public void setAddNewImageAlways(boolean value){
  if (value != addNewImagesAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_IMAGES_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_IMAGES_ALWAYS,id);
    }
    fireCollectionEvent(FileListChangedEvent.Type.IMAGE_COLLECTION,value);
    addNewImagesAlways=value;
  }
}
Program: 3935
Project: 3935
Buggy source:
/** 
 * Changes the smart sharing value for audio files. If true, all new audio files added to the library will be shared with this list, if false, new audio files added to  the library will not be automatically shared with this list but current audio files will not be removed.
 */
@Override public void setAddNewAudioAlways(boolean value){
  if (value != addNewAudioAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_AUDIO_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_AUDIO_ALWAYS,id);
    }
    addNewAudioAlways=value;
  }
}

Fixed version (ground truth):
/** 
 * Changes the smart sharing value for audio files. If true, all new audio files added to the library will be shared with this list, if false, new audio files added to  the library will not be automatically shared with this list but current audio files will not be removed.
 */
@Override public void setAddNewAudioAlways(boolean value){
  if (value != addNewAudioAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_AUDIO_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_AUDIO_ALWAYS,id);
    }
    fireCollectionEvent(FileListChangedEvent.Type.AUDIO_COLLECTION,value);
    addNewAudioAlways=value;
  }
}
Program: 3936
Project: 3936
Buggy source:
/** 
 * Changes the smart sharing value for videos. If true, all new videos added to the library will be shared with this list, if false, new videos added to  the library will not be automatically shared with this list but current videos will not be removed.
 */
@Override public void setAddNewVideoAlways(boolean value){
  if (value != addNewVideoAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_VIDEO_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_VIDEO_ALWAYS,id);
    }
    addNewVideoAlways=value;
  }
}

Fixed version (ground truth):
/** 
 * Changes the smart sharing value for videos. If true, all new videos added to the library will be shared with this list, if false, new videos added to  the library will not be automatically shared with this list but current videos will not be removed.
 */
@Override public void setAddNewVideoAlways(boolean value){
  if (value != addNewVideoAlways) {
    if (value == false) {
      LibrarySettings.removeFiendShareNewFiles(LibrarySettings.SHARE_NEW_VIDEO_ALWAYS,id);
    }
 else {
      LibrarySettings.addFriendShareNewFiles(LibrarySettings.SHARE_NEW_VIDEO_ALWAYS,id);
    }
    fireCollectionEvent(FileListChangedEvent.Type.VIDEO_COLLECTION,value);
    addNewVideoAlways=value;
  }
}