Program: 168478
Project: 168478
Buggy source:
public void setFields(HFSPlusCatalogFile cf){
  int i;
  recordTypeField.setText("String_Node_Str" + Util.toHexStringBE(cf.getRecordType()));
  fileLockedBox.setSelected(cf.getFileLockedFlag());
  threadExistsBox.setSelected(cf.getThreadExistsFlag());
  reserved1Field.setText("String_Node_Str" + Util.toHexStringBE(cf.getReserved1()));
  fileIDField.setText(cf.getFileID().toString());
  createDateField.setText(dti.format(cf.getCreateDateAsDate()));
  contentModifyDateField.setText(dti.format(cf.getContentModDateAsDate()));
  attributesModifyDateField.setText(dti.format(cf.getAttributeModDateAsDate()));
  accessDateField.setText(dti.format(cf.getAccessDateAsDate()));
  backupDateField.setText(dti.format(cf.getBackupDateAsDate()));
  HFSPlusBSDInfo bi=cf.getPermissions();
  permissionsOwnerIDField.setText("String_Node_Str" + bi.getOwnerID());
  permissionsGroupIDField.setText("String_Node_Str" + bi.getGroupID());
  permissionsAdminFlagsField.setText("String_Node_Str" + Util.toHexStringBE(bi.getAdminFlags()));
  permissionsAdminFlagsArchivedBox.setSelected(bi.getAdminArchivedFlag());
  permissionsAdminFlagsImmutableBox.setSelected(bi.getAdminImmutableFlag());
  permissionsAdminFlagsAppendBox.setSelected(bi.getAdminAppendFlag());
  permissionsOwnerFlagsField.setText("String_Node_Str" + Util.toHexStringBE(bi.getOwnerFlags()));
  permissionsOwnerFlagsNodumpBox.setSelected(bi.getOwnerNodumpFlag());
  permissionsOwnerFlagsImmutableBox.setSelected(bi.getOwnerImmutableFlag());
  permissionsOwnerFlagsAppendBox.setSelected(bi.getOwnerAppendFlag());
  permissionsOwnerFlagsOpaqueBox.setSelected(bi.getOwnerOpaqueFlag());
  permissionsOwnerFlagsCompressedBox.setSelected(bi.getOwnerCompressedFlag());
  permissionsFileModeField.setText(bi.getFileModeString());
  permissionsFileModeSUIDBox.setSelected(bi.getFileModeSetUserID());
  permissionsFileModeSGIDBox.setSelected(bi.getFileModeSetGroupID());
  permissionsFileModeSTXTBox.setSelected(bi.getFileModeSticky());
  permissionsSpecialField.setText("String_Node_Str" + Util.toHexStringBE(bi.getSpecial()));
  FileInfo ui=cf.getUserInfo();
  userInfoFileTypeField.setText("String_Node_Str" + ui.getFileType().toString() + "String_Node_Str"+ Util.toHexStringBE(ui.getFileType().getOSType().getFourCharCode())+ "String_Node_Str");
  userInfoFileCreatorField.setText("String_Node_Str" + ui.getFileCreator().toString() + "String_Node_Str"+ Util.toHexStringBE(ui.getFileCreator().getOSType().getFourCharCode())+ "String_Node_Str");
  userInfoFinderFlagsIsOnDeskBox.setSelected(ui.getFinderFlagIsOnDesk());
  int[] rgb=ui.getFinderFlagColorRGB();
  if (originalOpaqueness == null)   originalOpaqueness=userInfoFinderFlagsColorField.isOpaque();
  if (originalColor == null)   originalColor=userInfoFinderFlagsColorField.getBackground();
  if (rgb != null) {
    userInfoFinderFlagsColorField.setOpaque(true);
    userInfoFinderFlagsColorField.setBackground(new Color(rgb[0],rgb[1],rgb[2]));
  }
 else {
    userInfoFinderFlagsColorField.setOpaque(originalOpaqueness);
    userInfoFinderFlagsColorField.setBackground(originalColor);
  }
  userInfoFinderFlagsColorField.setText("String_Node_Str" + ui.getFinderFlagColor());
  userInfoFinderFlagsIsSharedBox.setSelected(ui.getFinderFlagIsShared());
  userInfoFinderFlagsHasNoINITsBox.setSelected(ui.getFinderFlagHasNoINITs());
  userInfoFinderFlagsHasBeenInitedBox.setSelected(ui.getFinderFlagHasBeenInited());
  userInfoFinderFlagsHasCustomIconBox.setSelected(ui.getFinderFlagHasCustomIcon());
  userInfoFinderFlagsIsStationeryBox.setSelected(ui.getFinderFlagIsStationery());
  userInfoFinderFlagsNameLockedBox.setSelected(ui.getFinderFlagNameLocked());
  userInfoFinderFlagsHasBundleBox.setSelected(ui.getFinderFlagHasBundle());
  userInfoFinderFlagsIsInvisibleBox.setSelected(ui.getFinderFlagIsInvisible());
  userInfoFinderFlagsIsAliasBox.setSelected(ui.getFinderFlagIsAlias());
  userInfoLocationField.setText(ui.getLocation().toString());
  userInfoReservedField.setText("String_Node_Str" + Util.toHexStringBE(ui.getReservedField()));
  ExtendedFileInfo ei=cf.getFinderInfo();
  finderInfoReserved1Field.setText("String_Node_Str" + Util.toHexStringBE(ei.getReserved1()));
  finderInfoExtendedFinderFlagsExtendedFlagsAreInvalidBox.setSelected(ei.getExtendedFinderFlagExtendedFlagsAreInvalid());
  finderInfoExtendedFinderFlagsExtendedFlagHasCustomBadgeBox.setSelected(ei.getExtendedFinderFlagExtendedFlagHasCustomBadge());
  finderInfoExtendedFinderFlagsExtendedFlagHasRoutingInfoBox.setSelected(ei.getExtendedFinderFlagExtendedFlagHasRoutingInfo());
  finderInfoReserved2Field.setText("String_Node_Str" + Util.toHexStringBE(ei.getReserved2()));
  finderInfoPutAwayFolderIDField.setText("String_Node_Str" + ei.getPutAwayFolderID());
  textEncodingField.setText("String_Node_Str" + cf.getTextEncoding());
  reserved2Field.setText("String_Node_Str" + Util.toHexStringBE(cf.getReserved2()));
  HFSPlusForkData df=cf.getDataFork();
  dataForkLogicalSizeField.setText("String_Node_Str" + df.getLogicalSize() + "String_Node_Str");
  dataForkClumpSizeField.setText("String_Node_Str" + df.getClumpSize() + "String_Node_Str");
  dataForkTotalBlocksField.setText("String_Node_Str" + df.getTotalBlocks());
  dataForkExtentsPanel.setLayout(new javax.swing.BoxLayout(dataForkExtentsPanel,javax.swing.BoxLayout.Y_AXIS));
  i=0;
  for (  HFSPlusExtentDescriptor d : df.getExtents().getExtentDescriptors()) {
    if (d.getBlockCount() == 0) {
      break;
    }
    StructViewPanel p=new StructViewPanel("String_Node_Str" + (i++ + 1),d.getStructElements());
    dataForkExtentsPanel.add(p);
  }
  HFSPlusForkData rf=cf.getResourceFork();
  resForkLogicalSizeField.setText("String_Node_Str" + rf.getLogicalSize() + "String_Node_Str");
  resForkClumpSizeField.setText("String_Node_Str" + rf.getClumpSize() + "String_Node_Str");
  resForkTotalBlocksField.setText("String_Node_Str" + rf.getTotalBlocks());
  dataForkExtentsPanel.setLayout(new javax.swing.BoxLayout(dataForkExtentsPanel,javax.swing.BoxLayout.Y_AXIS));
  i=0;
  for (  HFSPlusExtentDescriptor d : df.getExtents().getExtentDescriptors()) {
    if (d.getBlockCount() == 0) {
      break;
    }
    StructViewPanel p=new StructViewPanel("String_Node_Str" + (i++ + 1),d.getStructElements());
    resourceForkExtentsPanel.add(p);
  }
}

Fixed version (ground truth):
public void setFields(HFSPlusCatalogFile cf){
  int i;
  recordTypeField.setText("String_Node_Str" + Util.toHexStringBE(cf.getRecordType()));
  fileLockedBox.setSelected(cf.getFileLockedFlag());
  threadExistsBox.setSelected(cf.getThreadExistsFlag());
  reserved1Field.setText("String_Node_Str" + Util.toHexStringBE(cf.getReserved1()));
  fileIDField.setText(cf.getFileID().toString());
  createDateField.setText(dti.format(cf.getCreateDateAsDate()));
  contentModifyDateField.setText(dti.format(cf.getContentModDateAsDate()));
  attributesModifyDateField.setText(dti.format(cf.getAttributeModDateAsDate()));
  accessDateField.setText(dti.format(cf.getAccessDateAsDate()));
  backupDateField.setText(dti.format(cf.getBackupDateAsDate()));
  HFSPlusBSDInfo bi=cf.getPermissions();
  permissionsOwnerIDField.setText("String_Node_Str" + bi.getOwnerID());
  permissionsGroupIDField.setText("String_Node_Str" + bi.getGroupID());
  permissionsAdminFlagsField.setText("String_Node_Str" + Util.toHexStringBE(bi.getAdminFlags()));
  permissionsAdminFlagsArchivedBox.setSelected(bi.getAdminArchivedFlag());
  permissionsAdminFlagsImmutableBox.setSelected(bi.getAdminImmutableFlag());
  permissionsAdminFlagsAppendBox.setSelected(bi.getAdminAppendFlag());
  permissionsOwnerFlagsField.setText("String_Node_Str" + Util.toHexStringBE(bi.getOwnerFlags()));
  permissionsOwnerFlagsNodumpBox.setSelected(bi.getOwnerNodumpFlag());
  permissionsOwnerFlagsImmutableBox.setSelected(bi.getOwnerImmutableFlag());
  permissionsOwnerFlagsAppendBox.setSelected(bi.getOwnerAppendFlag());
  permissionsOwnerFlagsOpaqueBox.setSelected(bi.getOwnerOpaqueFlag());
  permissionsOwnerFlagsCompressedBox.setSelected(bi.getOwnerCompressedFlag());
  permissionsFileModeField.setText(bi.getFileModeString());
  permissionsFileModeSUIDBox.setSelected(bi.getFileModeSetUserID());
  permissionsFileModeSGIDBox.setSelected(bi.getFileModeSetGroupID());
  permissionsFileModeSTXTBox.setSelected(bi.getFileModeSticky());
  permissionsSpecialField.setText("String_Node_Str" + Util.toHexStringBE(bi.getSpecial()));
  FileInfo ui=cf.getUserInfo();
  userInfoFileTypeField.setText("String_Node_Str" + ui.getFileType().toString() + "String_Node_Str"+ Util.toHexStringBE(ui.getFileType().getOSType().getFourCharCode())+ "String_Node_Str");
  userInfoFileCreatorField.setText("String_Node_Str" + ui.getFileCreator().toString() + "String_Node_Str"+ Util.toHexStringBE(ui.getFileCreator().getOSType().getFourCharCode())+ "String_Node_Str");
  userInfoFinderFlagsIsOnDeskBox.setSelected(ui.getFinderFlagIsOnDesk());
  int[] rgb=ui.getFinderFlagColorRGB();
  if (originalOpaqueness == null)   originalOpaqueness=userInfoFinderFlagsColorField.isOpaque();
  if (originalColor == null)   originalColor=userInfoFinderFlagsColorField.getBackground();
  if (rgb != null) {
    userInfoFinderFlagsColorField.setOpaque(true);
    userInfoFinderFlagsColorField.setBackground(new Color(rgb[0],rgb[1],rgb[2]));
  }
 else {
    userInfoFinderFlagsColorField.setOpaque(originalOpaqueness);
    userInfoFinderFlagsColorField.setBackground(originalColor);
  }
  userInfoFinderFlagsColorField.setText("String_Node_Str" + ui.getFinderFlagColor());
  userInfoFinderFlagsIsSharedBox.setSelected(ui.getFinderFlagIsShared());
  userInfoFinderFlagsHasNoINITsBox.setSelected(ui.getFinderFlagHasNoINITs());
  userInfoFinderFlagsHasBeenInitedBox.setSelected(ui.getFinderFlagHasBeenInited());
  userInfoFinderFlagsHasCustomIconBox.setSelected(ui.getFinderFlagHasCustomIcon());
  userInfoFinderFlagsIsStationeryBox.setSelected(ui.getFinderFlagIsStationery());
  userInfoFinderFlagsNameLockedBox.setSelected(ui.getFinderFlagNameLocked());
  userInfoFinderFlagsHasBundleBox.setSelected(ui.getFinderFlagHasBundle());
  userInfoFinderFlagsIsInvisibleBox.setSelected(ui.getFinderFlagIsInvisible());
  userInfoFinderFlagsIsAliasBox.setSelected(ui.getFinderFlagIsAlias());
  userInfoLocationField.setText(ui.getLocation().toString());
  userInfoReservedField.setText("String_Node_Str" + Util.toHexStringBE(ui.getReservedField()));
  ExtendedFileInfo ei=cf.getFinderInfo();
  finderInfoReserved1Field.setText("String_Node_Str" + Util.toHexStringBE(ei.getReserved1()));
  finderInfoExtendedFinderFlagsExtendedFlagsAreInvalidBox.setSelected(ei.getExtendedFinderFlagExtendedFlagsAreInvalid());
  finderInfoExtendedFinderFlagsExtendedFlagHasCustomBadgeBox.setSelected(ei.getExtendedFinderFlagExtendedFlagHasCustomBadge());
  finderInfoExtendedFinderFlagsExtendedFlagHasRoutingInfoBox.setSelected(ei.getExtendedFinderFlagExtendedFlagHasRoutingInfo());
  finderInfoReserved2Field.setText("String_Node_Str" + Util.toHexStringBE(ei.getReserved2()));
  finderInfoPutAwayFolderIDField.setText("String_Node_Str" + ei.getPutAwayFolderID());
  textEncodingField.setText("String_Node_Str" + cf.getTextEncoding());
  reserved2Field.setText("String_Node_Str" + Util.toHexStringBE(cf.getReserved2()));
  HFSPlusForkData df=cf.getDataFork();
  dataForkLogicalSizeField.setText("String_Node_Str" + df.getLogicalSize() + "String_Node_Str");
  dataForkClumpSizeField.setText("String_Node_Str" + df.getClumpSize() + "String_Node_Str");
  dataForkTotalBlocksField.setText("String_Node_Str" + df.getTotalBlocks());
  dataForkExtentsPanel.setLayout(new javax.swing.BoxLayout(dataForkExtentsPanel,javax.swing.BoxLayout.Y_AXIS));
  i=0;
  for (  HFSPlusExtentDescriptor d : df.getExtents().getExtentDescriptors()) {
    if (d.getBlockCount() == 0) {
      break;
    }
    StructViewPanel p=new StructViewPanel("String_Node_Str" + (i++ + 1),d.getStructElements());
    dataForkExtentsPanel.add(p);
  }
  HFSPlusForkData rf=cf.getResourceFork();
  resForkLogicalSizeField.setText("String_Node_Str" + rf.getLogicalSize() + "String_Node_Str");
  resForkClumpSizeField.setText("String_Node_Str" + rf.getClumpSize() + "String_Node_Str");
  resForkTotalBlocksField.setText("String_Node_Str" + rf.getTotalBlocks());
  resourceForkExtentsPanel.setLayout(new javax.swing.BoxLayout(resourceForkExtentsPanel,javax.swing.BoxLayout.Y_AXIS));
  i=0;
  for (  HFSPlusExtentDescriptor d : rf.getExtents().getExtentDescriptors()) {
    if (d.getBlockCount() == 0) {
      break;
    }
    StructViewPanel p=new StructViewPanel("String_Node_Str" + (i++ + 1),d.getStructElements());
    resourceForkExtentsPanel.add(p);
  }
}