nus-yam/ex-repair huggingface dataset:
Program: 62404
Project: 62404
Buggy source:
@Override public <T extends IndexedToscaElement>T getElementInDependencies(Class<T> elementClass,String elementId,Collection<CSARDependency> dependencies){
  if (dependencies == null || dependencies.isEmpty()) {
    return null;
  }
  BoolQueryBuilder boolQueryBuilder=QueryBuilders.boolQuery();
  for (  CSARDependency dependency : dependencies) {
    QueryBuilder idQueryBuilder=QueryBuilders.idsQuery().addIds(elementId + "String_Node_Str" + dependency.getVersion());
    QueryBuilder matchArchiveNameQueryBuilder=QueryBuilders.termQuery("String_Node_Str",dependency.getName());
    boolQueryBuilder.should(QueryBuilders.boolQuery().must(idQueryBuilder).must(matchArchiveNameQueryBuilder));
  }
  List<T> elements=searchDAO.customFindAll(elementClass,boolQueryBuilder);
  if (elements != null && !elements.isEmpty()) {
    Collections.sort(elements,new Comparator<T>(){
      @Override public int compare(      T left,      T right){
        return VersionUtil.parseVersion(left.getArchiveVersion()).compareTo(VersionUtil.parseVersion(right.getArchiveVersion()));
      }
    }
);
    return elements.get(elements.size() - 1);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public <T extends IndexedToscaElement>T getElementInDependencies(Class<T> elementClass,QueryBuilder query,Collection<CSARDependency> dependencies){
  if (dependencies == null || dependencies.isEmpty()) {
    return null;
  }
  BoolQueryBuilder boolQueryBuilder=QueryBuilders.boolQuery();
  for (  CSARDependency dependency : dependencies) {
    QueryBuilder matchArchiveNameQueryBuilder=QueryBuilders.termQuery("String_Node_Str",dependency.getName());
    QueryBuilder matchArchiveVersionQueryBuilder=QueryBuilders.termQuery("String_Node_Str",dependency.getVersion());
    boolQueryBuilder.should(QueryBuilders.boolQuery().must(query).must(matchArchiveNameQueryBuilder).must(matchArchiveVersionQueryBuilder));
  }
  return getLatestVersionOfElement(elementClass,boolQueryBuilder);
}
Program: 62405
Project: 62405
Buggy source:
/** 
 * Get an element from defined dependencies.
 * @param elementClass The element class.
 * @param elementId The TOSCA element id of the element (without archive version).
 * @param dependencies A list of CSAR in which the element may be defined.
 * @return The requested element or null if the element is not found.
 */
<T extends IndexedToscaElement>T getElementInDependencies(Class<T> elementClass,String elementId,Collection<CSARDependency> dependencies);

Fixed version (ground truth):
/** 
 * Get an element matching specified query from given dependencies
 * @param elementClass The element class.
 * @param query query to match element
 * @param dependencies A list of CSAR in which the element may be defined.
 * @param < T > type of the tosca element
 * @return
 */
<T extends IndexedToscaElement>T getElementInDependencies(Class<T> elementClass,QueryBuilder query,Collection<CSARDependency> dependencies);
Program: 62406
Project: 62406
Buggy source:
@Override public void storeCSAR(String name,String version,Path tmpPath) throws CSARVersionAlreadyExistsException {
  if (!Files.isReadable(tmpPath)) {
    throw new CSARStorageFailureException("String_Node_Str" + tmpPath.toString() + "String_Node_Str");
  }
  Path csarDirectoryPath=rootPath.resolve(name).resolve(version);
  String realName=name.concat("String_Node_Str").concat(version).concat("String_Node_Str" + CSAR_EXTENSION);
  createCSARDirectory(csarDirectoryPath,realName);
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tmpPath);
      log.debug("String_Node_Str" + csarDirectoryPath.resolve(realName));
    }
    Path csarTargetPath=csarDirectoryPath.resolve(realName);
    Path expandedPath=csarDirectoryPath.resolve("String_Node_Str");
    if (Files.isRegularFile(tmpPath)) {
      Files.copy(tmpPath,csarTargetPath);
      FileUtil.unzip(csarTargetPath,expandedPath);
    }
 else {
      FileUtil.copy(tmpPath,expandedPath,StandardCopyOption.REPLACE_EXISTING);
    }
    DirectoryJSonWalker.directoryJson(expandedPath,csarDirectoryPath.resolve("String_Node_Str"));
  }
 catch (  IOException e) {
    throw new CSARStorageFailureException("String_Node_Str" + name + "String_Node_Str"+ version+ "String_Node_Str"+ e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public synchronized void storeCSAR(String name,String version,Path tmpPath) throws CSARVersionAlreadyExistsException {
  if (!Files.isReadable(tmpPath)) {
    throw new CSARStorageFailureException("String_Node_Str" + tmpPath.toString() + "String_Node_Str");
  }
  Path csarDirectoryPath=rootPath.resolve(name).resolve(version);
  String realName=name.concat("String_Node_Str").concat(version).concat("String_Node_Str" + CSAR_EXTENSION);
  createCSARDirectory(csarDirectoryPath,realName);
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tmpPath);
      log.debug("String_Node_Str" + csarDirectoryPath.resolve(realName));
    }
    Path csarTargetPath=csarDirectoryPath.resolve(realName);
    Path expandedPath=csarDirectoryPath.resolve("String_Node_Str");
    if (Files.isRegularFile(tmpPath)) {
      Files.copy(tmpPath,csarTargetPath);
      FileUtil.unzip(csarTargetPath,expandedPath);
    }
 else {
      FileUtil.copy(tmpPath,expandedPath,StandardCopyOption.REPLACE_EXISTING);
    }
    DirectoryJSonWalker.directoryJson(expandedPath,csarDirectoryPath.resolve("String_Node_Str"));
  }
 catch (  IOException e) {
    throw new CSARStorageFailureException("String_Node_Str" + name + "String_Node_Str"+ version+ "String_Node_Str"+ e.getMessage(),e);
  }
}
Program: 62407
Project: 62407
Buggy source:
/** 
 * Disable an orchestrator.
 * @param orchestrator The orchestrator to disable.
 * @param force If true the orchestrator is disabled even if some deployments are currently running.
 */
public synchronized boolean disable(Orchestrator orchestrator,boolean force){
  if (force == false) {
    QueryHelper.SearchQueryHelperBuilder searchQueryHelperBuilder=queryHelper.buildSearchQuery(alienDAO.getIndexForType(Deployment.class)).types(Deployment.class).filters(MapUtil.newHashMap(new String[]{"String_Node_Str","String_Node_Str"},new String[][]{new String[]{orchestrator.getId()},new String[]{null}})).fieldSort("String_Node_Str",true);
    GetMultipleDataResult<Object> result=alienDAO.search(searchQueryHelperBuilder,0,1);
    if (result.getData().length > 0) {
      return false;
    }
  }
  try {
    IOrchestratorPlugin orchestratorInstance=(IOrchestratorPlugin)orchestratorPluginService.unregister(orchestrator.getId());
    if (orchestratorInstance != null) {
      IOrchestratorPluginFactory orchestratorFactory=orchestratorService.getPluginFactory(orchestrator);
      orchestratorFactory.destroy(orchestratorInstance);
    }
  }
 catch (  Exception e) {
    log.info("String_Node_Str",e);
  }
 finally {
    orchestrator.setState(OrchestratorState.DISABLED);
    alienDAO.save(orchestrator);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Disable an orchestrator.
 * @param orchestrator The orchestrator to disable.
 * @param force If true the orchestrator is disabled even if some deployments are currently running.
 */
public synchronized boolean disable(Orchestrator orchestrator,boolean force){
  if (!force) {
    QueryHelper.SearchQueryHelperBuilder searchQueryHelperBuilder=queryHelper.buildSearchQuery(alienDAO.getIndexForType(Deployment.class)).types(Deployment.class).filters(MapUtil.newHashMap(new String[]{"String_Node_Str","String_Node_Str"},new String[][]{new String[]{orchestrator.getId()},new String[]{null}})).fieldSort("String_Node_Str",true);
    GetMultipleDataResult<Object> result=alienDAO.search(searchQueryHelperBuilder,0,1);
    if (result.getData().length > 0) {
      return false;
    }
  }
  try {
    IOrchestratorPlugin orchestratorInstance=(IOrchestratorPlugin)orchestratorPluginService.unregister(orchestrator.getId());
    if (orchestratorInstance != null) {
      IOrchestratorPluginFactory orchestratorFactory=orchestratorService.getPluginFactory(orchestrator);
      orchestratorFactory.destroy(orchestratorInstance);
    }
  }
 catch (  Exception e) {
    log.info("String_Node_Str",e);
  }
 finally {
    orchestrator.setState(OrchestratorState.DISABLED);
    alienDAO.save(orchestrator);
  }
  return true;
}
Program: 62408
Project: 62408
Buggy source:
@Override public void run(){
  try {
    load(orchestrator);
  }
 catch (  AlreadyExistException e) {
    log.info("String_Node_Str",orchestrator.getId());
  }
catch (  Throwable t) {
    orchestrator.setState(OrchestratorState.DISABLED);
    alienDAO.save(orchestrator);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    load(orchestrator);
  }
 catch (  AlreadyExistException e) {
    log.info("String_Node_Str",orchestrator.getId());
  }
catch (  Throwable t) {
    log.error("String_Node_Str",t);
    orchestrator.setState(OrchestratorState.DISABLED);
    alienDAO.save(orchestrator);
  }
}
Program: 62409
Project: 62409
Buggy source:
/** 
 * Initialize all orchestrator that have a non-disabled state. Note: Each orchestrator initialization is down in it's own thread so it doesn't impact application startup or other orchestrator connection.
 * @return a list of futures for those who want to wait for task to be done.
 */
public List<Future<?>> initialize(){
  ExecutorService executorService=Executors.newCachedThreadPool();
  List<Future<?>> futures=new ArrayList<Future<?>>();
  List<Orchestrator> enabledOrchestrators=orchestratorService.getAllEnabledOrchestrators();
  if (enabledOrchestrators == null) {
    return futures;
  }
  for (  final Orchestrator orchestrator : enabledOrchestrators) {
    Future<?> future=executorService.submit(new Runnable(){
      @Override public void run(){
        try {
          load(orchestrator);
        }
 catch (        AlreadyExistException e) {
          log.info("String_Node_Str",orchestrator.getId());
        }
catch (        Throwable t) {
          orchestrator.setState(OrchestratorState.DISABLED);
          alienDAO.save(orchestrator);
        }
      }
    }
);
    futures.add(future);
  }
  return futures;
}

Fixed version (ground truth):
/** 
 * Initialize all orchestrator that have a non-disabled state. Note: Each orchestrator initialization is down in it's own thread so it doesn't impact application startup or other orchestrator connection.
 * @return a list of futures for those who want to wait for task to be done.
 */
public List<Future<?>> initialize(){
  ExecutorService executorService=Executors.newCachedThreadPool();
  List<Future<?>> futures=new ArrayList<Future<?>>();
  List<Orchestrator> enabledOrchestrators=orchestratorService.getAllEnabledOrchestrators();
  if (enabledOrchestrators == null) {
    return futures;
  }
  for (  final Orchestrator orchestrator : enabledOrchestrators) {
    Future<?> future=executorService.submit(new Runnable(){
      @Override public void run(){
        try {
          load(orchestrator);
        }
 catch (        AlreadyExistException e) {
          log.info("String_Node_Str",orchestrator.getId());
        }
catch (        Throwable t) {
          log.error("String_Node_Str",t);
          orchestrator.setState(OrchestratorState.DISABLED);
          alienDAO.save(orchestrator);
        }
      }
    }
);
    futures.add(future);
  }
  return futures;
}
Program: 62411
Project: 62411
Buggy source:
@Override public Path getCSAR(String name,String version) throws CSARVersionNotFoundException {
  String realName=name.concat("String_Node_Str").concat(version).concat("String_Node_Str" + CSAR_EXTENSION);
  Path path=rootPath.resolve(name).resolve(version).resolve(realName);
  if (Files.exists(path)) {
    return path;
  }
  throw new CSARVersionNotFoundException("String_Node_Str" + name + "String_Node_Str"+ version+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public Path getCSAR(String name,String version) throws CSARVersionNotFoundException {
  Path csarDir=rootPath.resolve(name).resolve(version);
  Path expandedPath=csarDir.resolve("String_Node_Str");
  Path zippedPath=csarDir.resolve(name.concat("String_Node_Str").concat(version).concat("String_Node_Str" + CSAR_EXTENSION));
  if (Files.exists(zippedPath)) {
    return zippedPath;
  }
 else   if (Files.exists(expandedPath)) {
    try {
      FileUtil.zip(expandedPath,zippedPath);
      return zippedPath;
    }
 catch (    IOException e) {
      log.error("String_Node_Str" + expandedPath,e);
      throw new CSARVersionNotFoundException("String_Node_Str" + name + "String_Node_Str"+ version+ "String_Node_Str");
    }
  }
  throw new CSARVersionNotFoundException("String_Node_Str" + name + "String_Node_Str"+ version+ "String_Node_Str");
}
Program: 62412
Project: 62412
Buggy source:
/** 
 * Checks if the type of a LocationResourceTemplate is matching the expected type.
 * @param nodeTemplate The node template to match.
 * @param nodeType The type of the node template to match.
 * @param candidateType The type of the candidate node.
 * @param candidate The candidate location resource.
 * @param capabilityTypes Map of capability types that may be used by the candidateType.
 * @return True if the candidate is a valid match for the node template.
 */
private boolean isValidCandidate(NodeTemplate nodeTemplate,IndexedNodeType nodeType,LocationResourceTemplate candidate,IndexedNodeType candidateType,Map<String,IndexedCapabilityType> capabilityTypes,Map<String,MatchingConfiguration> matchingConfigurations){
  if (!isCandidateTypeValid(nodeTemplate,candidate,candidateType)) {
    return false;
  }
  MatchingConfiguration matchingConfiguration=matchingConfigurations.get(nodeType.getElementId());
  if (matchingConfiguration == null) {
    return true;
  }
  return isTemplatePropertiesMatchCandidateFilters(nodeTemplate,matchingConfiguration,candidate,candidateType,capabilityTypes);
}

Fixed version (ground truth):
/** 
 * Checks if the type of a LocationResourceTemplate is matching the expected type.
 * @param nodeTemplate The node template to match.
 * @param nodeType The type of the node template to match.
 * @param candidateType The type of the candidate node.
 * @param candidate The candidate location resource.
 * @param capabilityTypes Map of capability types that may be used by the candidateType.
 * @return True if the candidate is a valid match for the node template.
 */
private boolean isValidCandidate(NodeTemplate nodeTemplate,IndexedNodeType nodeType,LocationResourceTemplate candidate,IndexedNodeType candidateType,Map<String,IndexedCapabilityType> capabilityTypes,Map<String,MatchingConfiguration> matchingConfigurations){
  if (!isCandidateTypeValid(nodeTemplate,candidate,candidateType)) {
    return false;
  }
  MatchingConfiguration matchingConfiguration=matchingConfigurations.get(candidateType.getElementId());
  if (matchingConfiguration == null) {
    return true;
  }
  return isTemplatePropertiesMatchCandidateFilters(nodeTemplate,matchingConfiguration,candidate,candidateType,capabilityTypes);
}
Program: 62413
Project: 62413
Buggy source:
@Override public Map<String,String> entries(){
  return new ImmutableMap.Builder<String,String>().putAll(new Protocol.SMTP(this.host,this.port).entries()).put("String_Node_Str",Boolean.TRUE.toString()).put("String_Node_Str",SSLSocketFactory.class.getName()).put("String_Node_Str",Integer.toString(this.port)).put("String_Node_Str","String_Node_Str").build();
}

Fixed version (ground truth):
@Override public Map<String,String> entries(){
  return new ImmutableMap.Builder<String,String>().put("String_Node_Str",Boolean.TRUE.toString()).put("String_Node_Str",this.host).put("String_Node_Str",Integer.toString(this.port)).put("String_Node_Str",Boolean.TRUE.toString()).put("String_Node_Str",SSLSocketFactory.class.getName()).put("String_Node_Str",Integer.toString(this.port)).put("String_Node_Str","String_Node_Str").build();
}
Program: 62414
Project: 62414
Buggy source:
/** 
 * SMTPS postman can send email through SMTPS wire.
 * @throws Exception If fails
 */
@Test public void sendsEmailToThroughSmtps() throws Exception {
  final String bind="String_Node_Str";
  final int received=3;
  final int port=SMTPSTest.port();
  Security.setProperty("String_Node_Str",DummySSLSocketFactory.class.getName());
  final GreenMail server=new GreenMail(ServerSetup.SMTPS);
  server.start();
  try {
    new Postman.Default(new SMTPS(new Token("String_Node_Str","String_Node_Str").access(new Protocol.SMTPS(bind,port)))).send(new Envelope.Safe(new Envelope.MIME().with(new StSender("String_Node_Str")).with(new StRecipient("String_Node_Str","String_Node_Str")).with(new StCC(new InternetAddress("String_Node_Str"))).with(new StBCC("String_Node_Str")).with(new StSubject("String_Node_Str")).with(new EnPlain("String_Node_Str")).with(new EnHTML("String_Node_Str"))));
    final MimeMessage[] messages=server.getReceivedMessages();
    MatcherAssert.assertThat(messages.length,Matchers.is(received));
    for (    final Message msg : messages) {
      MatcherAssert.assertThat(msg.getFrom()[0].toString(),Matchers.containsString("String_Node_Str"));
      MatcherAssert.assertThat(msg.getSubject(),Matchers.containsString("String_Node_Str"));
    }
  }
  finally {
    server.stop();
  }
}

Fixed version (ground truth):
/** 
 * SMTPS postman can send email through SMTPS wire.
 * @throws Exception If fails
 */
@Test public void sendsEmailToThroughSmtps() throws Exception {
  final String bind="String_Node_Str";
  final int received=3;
  final int port=SMTPSTest.port();
  Security.setProperty("String_Node_Str",DummySSLSocketFactory.class.getName());
  final GreenMail server=new GreenMail(new ServerSetup(port,bind,ServerSetup.PROTOCOL_SMTPS));
  server.start();
  try {
    new Postman.Default(new SMTPS(new Token("String_Node_Str","String_Node_Str").access(new Protocol.SMTPS(bind,port)))).send(new Envelope.Safe(new Envelope.MIME().with(new StSender("String_Node_Str")).with(new StRecipient("String_Node_Str","String_Node_Str")).with(new StCC(new InternetAddress("String_Node_Str"))).with(new StBCC("String_Node_Str")).with(new StSubject("String_Node_Str")).with(new EnPlain("String_Node_Str")).with(new EnHTML("String_Node_Str"))));
    final MimeMessage[] messages=server.getReceivedMessages();
    MatcherAssert.assertThat(messages.length,Matchers.is(received));
    for (    final Message msg : messages) {
      MatcherAssert.assertThat(msg.getFrom()[0].toString(),Matchers.containsString("String_Node_Str"));
      MatcherAssert.assertThat(msg.getSubject(),Matchers.containsString("String_Node_Str"));
    }
  }
  finally {
    server.stop();
  }
}
Program: 62415
Project: 62415
Buggy source:
/** 
 * Test for issue #8 (unicode/UTF-8 is broken).
 * @throws Exception Thrown in case of problem of writing a message tostring.
 */
@Test public void handlesUnicodeCorrectly() throws Exception {
  final Envelope.MIME env=new Envelope.MIME().with(new StSender("String_Node_Str")).with(new StRecipient("String_Node_Str","String_Node_Str")).with(new StSubject("String_Node_Str")).with(new EnHTML("String_Node_Str"));
  final ByteArrayOutputStream stream=new ByteArrayOutputStream();
  env.unwrap().writeTo(stream);
  final String msgtxt=stream.toString();
  Assert.assertTrue(msgtxt.contains("String_Node_Str"));
  Assert.assertTrue(msgtxt.contains("String_Node_Str"));
  Assert.assertTrue(msgtxt.contains(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Test for issue #8 (unicode/UTF-8 is broken).
 * @throws Exception Thrown in case of problem of writing a message tostring.
 */
@Test public void handlesUnicodeCorrectly() throws Exception {
  final Envelope env=new Envelope.MIME().with(new StSender("String_Node_Str")).with(new StRecipient("String_Node_Str","String_Node_Str")).with(new StSubject("String_Node_Str")).with(new EnHTML("String_Node_Str"));
  final ByteArrayOutputStream stream=new ByteArrayOutputStream();
  env.unwrap().writeTo(stream);
  final String msgtxt=stream.toString();
  Assert.assertTrue(msgtxt.contains("String_Node_Str"));
  Assert.assertTrue(msgtxt.contains("String_Node_Str"));
  Assert.assertTrue(msgtxt.contains(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str")));
}
Program: 62416
Project: 62416
Buggy source:
@Override public MimeBodyPart part() throws MessagingException {
  final MimeBodyPart mime=new MimeBodyPart();
  mime.setContent(this.text,"String_Node_Str");
  mime.addHeader("String_Node_Str","String_Node_Str");
  return mime;
}

Fixed version (ground truth):
@Override public MimeBodyPart part() throws MessagingException {
  final MimeBodyPart mime=new MimeBodyPart();
  final String ctype="String_Node_Str";
  mime.setContent(this.text,ctype);
  mime.addHeader("String_Node_Str",ctype);
  return mime;
}
Program: 62419
Project: 62419
Buggy source:
private void createPanel(){
  final JPanel textPanel=createTextPanel("String_Node_Str",getInstructions());
  this.add(textPanel,BorderLayout.NORTH);
  productSetPanel=new ProductSetPanel(SnapApp.getDefault().getAppContext(),null,new FileTable(),false,true);
  this.add(productSetPanel,BorderLayout.CENTER);
}

Fixed version (ground truth):
private void createPanel(){
  final JPanel textPanel=createTextPanel("String_Node_Str",getInstructions());
  this.add(textPanel,BorderLayout.NORTH);
  productSetPanel=new ProductSetPanel(SnapApp.getDefault().getAppContext(),null,new FileTable(),true,true);
  this.add(productSetPanel,BorderLayout.CENTER);
}
Program: 62421
Project: 62421
Buggy source:
private void setUIComponentsEnabled(final boolean enable){
  removeButton.setEnabled(enable);
  updateButton.setEnabled(enable);
  repositoryListCombo.setEnabled(enable);
  searchButton.setEnabled(enable);
}

Fixed version (ground truth):
private void setUIComponentsEnabled(final boolean enable){
  removeButton.setEnabled(enable);
  updateButton.setEnabled(enable);
}
Program: 62423
Project: 62423
Buggy source:
public void itemStateChanged(ItemEvent event){
  if (event.getStateChange() == ItemEvent.SELECTED) {
    final RepositoryInterface repo=(RepositoryInterface)repositoryListCombo.getSelectedItem();
    dbPane.setRepository(repo);
    SystemUtils.LOG.info("String_Node_Str" + repo.getName());
  }
}

Fixed version (ground truth):
public void itemStateChanged(ItemEvent event){
  if (event.getStateChange() == ItemEvent.SELECTED) {
    final RepositoryInterface repo=(RepositoryInterface)repositoryListCombo.getSelectedItem();
    dbPane.setRepository(repo);
    SystemUtils.LOG.info("String_Node_Str" + repo.getName());
    searchButton.setEnabled(repo.getName().toLowerCase().contains("String_Node_Str"));
  }
}
Program: 62426
Project: 62426
Buggy source:
public TemplateParameterEditorDialog(AppContext appContext,String helpID,TemplateParameterDescriptor parameter,PropertyMemberUIWrapper fileWrapper,ToolAdapterOperatorDescriptor parent){
  this(appContext,parameter.getName(),helpID);
  this.parameter=parameter;
  this.parentDescriptor=parent;
  try {
    parameter.setTemplateEngine(parentDescriptor.getTemplateEngine());
  }
 catch (  TemplateException e) {
    e.printStackTrace();
    logger.warning(e.getMessage());
  }
  this.fakeOperatorDescriptor=new ToolAdapterOperatorDescriptor("String_Node_Str",ToolAdapterOp.class);
  for (  ToolParameterDescriptor param : parameter.getParameterDescriptors()) {
    this.fakeOperatorDescriptor.getToolParameterDescriptors().add(new ToolParameterDescriptor(param));
  }
  this.fileWrapper=fileWrapper;
  if (this.fileWrapper.getContext().getPropertySet().getProperty(this.parameter.getName()).getValue() == null) {
    try {
      this.fileWrapper.getContext().getPropertySet().getProperty(this.parameter.getName()).setValue(parameter.getTemplate().getTemplatePath());
    }
 catch (    ValidationException e) {
      e.printStackTrace();
      logger.warning(e.getMessage());
    }
  }
  pcListener=evt -> updateFileAreaContent();
  this.fileWrapper.getContext().addPropertyChangeListener(pcListener);
  setContent(createMainPanel());
  pcListener=evt -> updateFileAreaContent();
}

Fixed version (ground truth):
public TemplateParameterEditorDialog(AppContext appContext,TemplateParameterDescriptor parameter,ToolAdapterOperatorDescriptor parent){
  super(appContext.getApplicationWindow(),parameter.getName(),ID_OK_CANCEL,"String_Node_Str");
  this.appContext=appContext;
  EscapeAction.register(getJDialog());
  this.fileContentArea=new AutoCompleteTextArea("String_Node_Str",10,10);
  this.parameter=parameter;
  this.parentDescriptor=parent;
  try {
    PropertyDescriptor propertyDescriptor=ParameterDescriptorFactory.convert(this.parameter,new ParameterDescriptorFactory().getSourceProductMap());
    DefaultPropertySetDescriptor propertySetDescriptor=new DefaultPropertySetDescriptor();
    propertySetDescriptor.addPropertyDescriptor(propertyDescriptor);
    PropertyContainer paramContainer=PropertyContainer.createMapBacked(new HashMap<>(),propertySetDescriptor);
    this.paramContext=new BindingContext(paramContainer);
  }
 catch (  ConversionException e) {
    logger.warning(e.getMessage());
  }
  try {
    parameter.setTemplateEngine(parentDescriptor.getTemplateEngine());
  }
 catch (  TemplateException e) {
    e.printStackTrace();
    logger.warning(e.getMessage());
  }
  this.fakeOperatorDescriptor=new ToolAdapterOperatorDescriptor("String_Node_Str",ToolAdapterOp.class);
  for (  ToolParameterDescriptor param : parameter.getParameterDescriptors()) {
    this.fakeOperatorDescriptor.getToolParameterDescriptors().add(new ToolParameterDescriptor(param));
  }
  PropertyChangeListener pcListener=evt -> updateFileAreaContent();
  this.paramContext.addPropertyChangeListener(pcListener);
  addComponents();
}
Program: 62427
Project: 62427
Buggy source:
public JPanel createParametersPanel(){
  JPanel paramsPanel=new JPanel();
  BoxLayout layout=new BoxLayout(paramsPanel,BoxLayout.PAGE_AXIS);
  paramsPanel.setLayout(layout);
  AbstractButton addParamBut=ToolButtonFactory.createButton(UIUtils.loadImageIcon("String_Node_Str"),false);
  addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(addParamBut);
  paramsTable=new OperatorParametersTable(this.fakeOperatorDescriptor,appContext);
  JScrollPane tableScrollPane=new JScrollPane(paramsTable);
  tableScrollPane.setPreferredSize(new Dimension(500,130));
  tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(tableScrollPane);
  addParamBut.addActionListener((  ActionEvent e) -> paramsTable.addParameterToTable(new ToolParameterDescriptor("String_Node_Str",String.class)));
  TitledBorder title=BorderFactory.createTitledBorder("String_Node_Str");
  paramsPanel.setBorder(title);
  return paramsPanel;
}

Fixed version (ground truth):
private JPanel createParametersPanel(){
  JPanel paramsPanel=new JPanel();
  BoxLayout layout=new BoxLayout(paramsPanel,BoxLayout.PAGE_AXIS);
  paramsPanel.setLayout(layout);
  AbstractButton addParamBut=ToolButtonFactory.createButton(UIUtils.loadImageIcon("String_Node_Str"),false);
  addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(addParamBut);
  this.paramsTable=new OperatorParametersTable(this.fakeOperatorDescriptor,appContext);
  JScrollPane tableScrollPane=new JScrollPane(paramsTable);
  tableScrollPane.setPreferredSize(new Dimension(500,130));
  tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(tableScrollPane);
  addParamBut.addActionListener((  ActionEvent e) -> paramsTable.addParameterToTable());
  TitledBorder title=BorderFactory.createTitledBorder("String_Node_Str");
  paramsPanel.setBorder(title);
  return paramsPanel;
}
Program: 62428
Project: 62428
Buggy source:
private void updateFileAreaContent(){
  String result=null;
  try {
    File file=fileWrapper.getContext().getPropertySet().getProperty(this.parameter.getName()).getValue();
    parameter.getTemplate().setFileName(file.getName());
    if (!file.isAbsolute()) {
      file=parameter.getTemplate().getTemplatePath();
    }
    if (file.exists()) {
      result=new String(Files.readAllBytes(file.toPath()));
    }
  }
 catch (  Exception e) {
    logger.warning(e.getMessage());
    showWarningDialog("String_Node_Str" + e.getMessage());
  }
  if (result != null) {
    fileContentArea.setText(result);
    fileContentArea.setCaretPosition(0);
  }
 else {
    fileContentArea.setText(EMPTY_FILE_CONTENT);
  }
}

Fixed version (ground truth):
private void updateFileAreaContent(){
  String result=null;
  try {
    File file=getProperty().getValue();
    this.parameter.getTemplate().setFileName(file.getName());
    if (!file.isAbsolute()) {
      file=this.parameter.getTemplate().getTemplatePath();
    }
    if (file.exists()) {
      result=new String(Files.readAllBytes(file.toPath()));
    }
  }
 catch (  Exception e) {
    logger.warning(e.getMessage());
    showWarningDialog("String_Node_Str" + e.getMessage());
  }
  if (result != null) {
    this.fileContentArea.setText(result);
    this.fileContentArea.setCaretPosition(0);
  }
 else {
    this.fileContentArea.setText(EMPTY_FILE_CONTENT);
  }
}
Program: 62429
Project: 62429
Buggy source:
@Override protected JPanel createParametersPanel(){
  JPanel paramsPanel=new JPanel();
  BoxLayout layout=new BoxLayout(paramsPanel,BoxLayout.PAGE_AXIS);
  paramsPanel.setLayout(layout);
  AbstractButton addParamBut=ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()),false);
  addParamBut.setText("String_Node_Str");
  addParamBut.setMaximumSize(new Dimension(150,controlHeight));
  addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
  addParamBut.setAlignmentY(Component.TOP_ALIGNMENT);
  paramsPanel.add(addParamBut);
  JScrollPane tableScrollPane=new JScrollPane(paramsTable);
  tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(tableScrollPane);
  addParamBut.addActionListener(e -> {
    paramsTable.addParameterToTable(new TemplateParameterDescriptor("String_Node_Str",String.class));
    int rowIndex=paramsTable.getRowCount() - 1;
    paramsTable.setRowSelectionInterval(rowIndex,rowIndex);
    paramsTable.setEditingRow(rowIndex);
  }
);
  return paramsPanel;
}

Fixed version (ground truth):
@Override protected JPanel createParametersPanel(){
  JPanel paramsPanel=new JPanel();
  BoxLayout layout=new BoxLayout(paramsPanel,BoxLayout.PAGE_AXIS);
  paramsPanel.setLayout(layout);
  AbstractButton addParamBut=ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()),false);
  addParamBut.setText("String_Node_Str");
  addParamBut.setMaximumSize(new Dimension(150,controlHeight));
  addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
  addParamBut.setAlignmentY(Component.TOP_ALIGNMENT);
  paramsPanel.add(addParamBut);
  JScrollPane tableScrollPane=new JScrollPane(paramsTable);
  tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
  paramsPanel.add(tableScrollPane);
  addParamBut.addActionListener(e -> {
    paramsTable.addParameterToTable();
  }
);
  return paramsPanel;
}
Program: 62430
Project: 62430
Buggy source:
protected void executeOperator(Product targetProduct,ProgressHandleMonitor pm) throws Exception {
  final TargetProductSelectorModel model=getTargetProductSelector().getModel();
  Operator execOp=null;
  if (targetProduct.getProductReader() instanceof OperatorProductReader) {
    final OperatorProductReader opReader=(OperatorProductReader)targetProduct.getProductReader();
    Operator operator=opReader.getOperatorContext().getOperator();
    boolean autoWriteDisabled=operator.getSpi().getOperatorDescriptor().isAutoWriteDisabled();
    if (autoWriteDisabled) {
      execOp=operator;
    }
  }
  if (execOp == null) {
    WriteOp writeOp=new WriteOp(targetProduct,model.getProductFile(),model.getFormatName());
    writeOp.setDeleteOutputOnFailure(true);
    writeOp.setWriteEntireTileRows(true);
    writeOp.setClearCacheAfterRowWrite(false);
    execOp=writeOp;
  }
  final OperatorExecutor executor=OperatorExecutor.create(execOp);
  executor.execute(SubProgressMonitor.create(pm,95));
}

Fixed version (ground truth):
protected void executeOperator(Product targetProduct,ProgressHandleMonitor pm) throws Exception {
  final TargetProductSelectorModel model=getTargetProductSelector().getModel();
  if (model.getProductName() == null) {
    model.setProductName(targetProduct.getName());
  }
  Operator execOp=null;
  if (targetProduct.getProductReader() instanceof OperatorProductReader) {
    final OperatorProductReader opReader=(OperatorProductReader)targetProduct.getProductReader();
    Operator operator=opReader.getOperatorContext().getOperator();
    boolean autoWriteDisabled=operator.getSpi().getOperatorDescriptor().isAutoWriteDisabled();
    if (autoWriteDisabled) {
      execOp=operator;
    }
  }
  if (execOp == null) {
    WriteOp writeOp=new WriteOp(targetProduct,model.getProductFile(),model.getFormatName());
    writeOp.setDeleteOutputOnFailure(true);
    writeOp.setWriteEntireTileRows(true);
    writeOp.setClearCacheAfterRowWrite(false);
    execOp=writeOp;
  }
  final OperatorExecutor executor=OperatorExecutor.create(execOp);
  SubProgressMonitor pm2=(SubProgressMonitor)SubProgressMonitor.create(pm,95);
  if (execOp instanceof StoredGraphOp) {
    executor.execute(ProgressMonitor.NULL);
    pm2.beginTask("String_Node_Str",1);
    pm2.worked(1);
  }
 else {
    executor.execute(pm2);
  }
  pm2.done();
}
Program: 62431
Project: 62431
Buggy source:
private void acknowledgeChannel(){
  RasterDataNode channelSource=currentChannelSources[channel];
  final ImageInfoEditorModel3B model=models[channel];
  Continuous1BandGraphicalForm.setDisplayProperties(model,channelSource);
  imageInfoEditor.setModel(model);
  moreOptionsForm.getBindingContext().getBinding(CHANNEL_SOURCE_NAME_PROPERTY).setPropertyValue(channelSource.getName());
  moreOptionsForm.getBindingContext().getBinding(GAMMA_PROPERTY).setPropertyValue(model.getGamma());
}

Fixed version (ground truth):
private void acknowledgeChannel(){
  RasterDataNode channelSource=currentChannelSources[channel];
  final ImageInfoEditorModel3B model=models[channel];
  Continuous1BandGraphicalForm.setDisplayProperties(model,channelSource);
  imageInfoEditor.setModel(model);
  moreOptionsForm.getBindingContext().getBinding(CHANNEL_SOURCE_NAME_PROPERTY).setPropertyValue(channelSource.getName());
  moreOptionsForm.getBindingContext().getBinding(GAMMA_PROPERTY).setPropertyValue(gamma);
}
Program: 62432
Project: 62432
Buggy source:
private void createContextForValueEditor() throws Exception {
  PropertyDescriptor property=ParameterDescriptorFactory.convert(this.parameter,new ParameterDescriptorFactory().getSourceProductMap());
  DefaultPropertySetDescriptor propertySetDescriptor=new DefaultPropertySetDescriptor();
  try {
    property.setDefaultValue(this.parameter.getDefaultValue());
  }
 catch (  Exception ex) {
    logger.warning(ex.getMessage());
  }
  propertySetDescriptor.addPropertyDescriptor(property);
  PropertyContainer container=PropertyContainer.createMapBacked(new HashMap<>(),propertySetDescriptor);
  container.getProperty(property.getName()).setValue(this.parameter.getDefaultValue());
  paramContext=new BindingContext(container);
  this.uiWrapper=PropertyMemberUIWrapperFactory.buildPropertyWrapper("String_Node_Str",this.parameter,null,paramContext,null);
  this.editorComponent=this.uiWrapper.getUIComponent();
}

Fixed version (ground truth):
private void createContextForValueEditor() throws Exception {
  PropertyDescriptor property=ParameterDescriptorFactory.convert(this.parameter,new ParameterDescriptorFactory().getSourceProductMap());
  DefaultPropertySetDescriptor propertySetDescriptor=new DefaultPropertySetDescriptor();
  try {
    property.setDefaultValue(this.parameter.getDefaultValue());
  }
 catch (  Exception ex) {
    logger.warning(ex.getMessage());
  }
  propertySetDescriptor.addPropertyDescriptor(property);
  PropertyContainer container=PropertyContainer.createMapBacked(new HashMap<>(),propertySetDescriptor);
  container.getProperty(property.getName()).setValueFromText(this.parameter.getDefaultValue());
  paramContext=new BindingContext(container);
  this.uiWrapper=PropertyMemberUIWrapperFactory.buildPropertyWrapper("String_Node_Str",this.parameter,null,paramContext,null);
  this.editorComponent=this.uiWrapper.getUIComponent();
}
Program: 62434
Project: 62434
Buggy source:
public SystemDependentVariableEditorDialog(Window parent,SystemDependentVariable variable,String helpID){
  super(parent,String.format("String_Node_Str",variable.getKey()),ID_OK_CANCEL,helpID);
  oldVariable=variable;
  newVariable=(SystemDependentVariable)oldVariable.createCopy();
  newVariable.setTransient(true);
  logger=Logger.getLogger(ToolAdapterEditorDialog.class.getName());
  setContent(createPanel());
  EscapeAction.register(getJDialog());
}

Fixed version (ground truth):
public SystemDependentVariableEditorDialog(Window parent,SystemDependentVariable variable,String helpID){
  super(parent,String.format("String_Node_Str",variable.getKey()),ID_OK_CANCEL,helpID);
  listeners=new ArrayList<>();
  oldVariable=variable;
  newVariable=(SystemDependentVariable)oldVariable.createCopy();
  newVariable.setTransient(true);
  logger=Logger.getLogger(ToolAdapterEditorDialog.class.getName());
  setContent(createPanel());
  EscapeAction.register(getJDialog());
}
Program: 62435
Project: 62435
Buggy source:
@Override protected void onOK(){
  super.onOK();
  oldVariable.setWindows(newVariable.getWindows());
  oldVariable.setLinux(newVariable.getLinux());
  oldVariable.setMacosx(newVariable.getMacosx());
}

Fixed version (ground truth):
@Override protected void onOK(){
  super.onOK();
  oldVariable.setWindows(newVariable.getWindows());
  oldVariable.setLinux(newVariable.getLinux());
  oldVariable.setMacosx(newVariable.getMacosx());
  for (  VariableChangedListener l : listeners) {
    l.variableChanged(null);
  }
}
Program: 62438
Project: 62438
Buggy source:
/** 
 * Constructor.
 */
public SystemDependentVariableCellEditor(Window window,SystemDependentVariable variable,String helpID){
  super(new JTextField());
  setClickCountToStart(CLICK_COUNT_TO_START);
  button=new JButton();
  button.setBackground(Color.white);
  button.setFont(button.getFont().deriveFont(Font.PLAIN));
  button.setBorder(null);
  button.setHorizontalAlignment(SwingConstants.LEFT);
  button.setText(variable.getValue());
  this.variable=variable;
  dialog=new SystemDependentVariableEditorDialog(window,this.variable,helpID);
  button.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      if (e.getClickCount() == CLICK_COUNT_TO_START) {
        dialog.show();
        fireEditingStopped();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public SystemDependentVariableCellEditor(Window window,SystemDependentVariable variable,String helpID){
  super(new JTextField());
  setClickCountToStart(CLICK_COUNT_TO_START);
  button=new JButton();
  button.setBackground(Color.white);
  button.setFont(button.getFont().deriveFont(Font.PLAIN));
  button.setBorder(null);
  button.setHorizontalAlignment(SwingConstants.LEFT);
  button.setText(variable.getValue());
  this.variable=variable;
  dialog=new SystemDependentVariableEditorDialog(window,this.variable,helpID);
  dialog.addListener(this);
  button.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      if (e.getClickCount() == CLICK_COUNT_TO_START) {
        dialog.show();
        fireEditingStopped();
      }
    }
  }
);
}
Program: 62439
Project: 62439
Buggy source:
@Override public TableCellEditor getCellEditor(int row,int column){
switch (column) {
case 0:
case 2:
    return tableRenderer;
case 1:
  return getDefaultEditor(Boolean.class);
default :
return getDefaultEditor(String.class);
}
}

Fixed version (ground truth):
@Override public TableCellEditor getCellEditor(int row,int column){
switch (column) {
case 0:
case 2:
case 3:
    return tableRenderer;
case 1:
  return getDefaultEditor(Boolean.class);
default :
return getDefaultEditor(String.class);
}
}
Program: 62440
Project: 62440
Buggy source:
private void tearDown(Throwable throwable,Product result){
  if (operatorTask != null) {
    operatorTask.cancel();
  }
  if (throwable != null) {
    if (result != null) {
      final Dialogs.Answer answer=Dialogs.requestDecision(Bundle.ExecutionFailed_Text(),String.format(Bundle.ExecutionFailed_Message(),throwable.getMessage()),false,null);
      if (answer == Dialogs.Answer.YES) {
        operatorCompleted(result);
      }
    }
  }
}

Fixed version (ground truth):
private void tearDown(Throwable throwable,Product result){
  if (operatorTask != null) {
    operatorTask.cancel();
  }
  if (throwable != null) {
    if (result != null) {
      final Dialogs.Answer answer=Dialogs.requestDecision(Bundle.ExecutionFailed_Text(),String.format(Bundle.ExecutionFailed_Message(),throwable.getMessage()),false,null);
      if (answer == Dialogs.Answer.YES) {
        operatorCompleted(result);
      }
    }
  }
  displayErrorMessage();
}
Program: 62442
Project: 62442
Buggy source:
public static AbstractAdapterEditor createEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex){
  AbstractAdapterEditor dialog;
  if (useTabsForEditorDialog()) {
    dialog=new ToolAdapterTabbedEditorDialog(appContext,parent,operatorDescriptor,newNameIndex);
  }
 else {
    dialog=new ToolAdapterEditorDialog(appContext,parent,operatorDescriptor,newNameIndex);
  }
  return dialog;
}

Fixed version (ground truth):
public static AbstractAdapterEditor createEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex,OperationType operation){
  AbstractAdapterEditor dialog;
  if (useTabsForEditorDialog()) {
    dialog=new ToolAdapterTabbedEditorDialog(appContext,parent,operatorDescriptor,newNameIndex,operation);
  }
 else {
    dialog=new ToolAdapterEditorDialog(appContext,parent,operatorDescriptor,newNameIndex,operation);
  }
  return dialog;
}
Program: 62443
Project: 62443
Buggy source:
/** 
 * Constructs a new window for editing the operator
 * @param appContext the application context
 * @param operatorDescriptor the descriptor of the operator to be edited
 * @param newNameIndex an integer value representing the suffix for the new operator name; if this value is less than 1, the editing operation of the current operator is executed; if the value is equal to or greater than 1, the operator is duplicated and the index value is used to compute the name of the new operator
 */
public AbstractAdapterEditor(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex){
  this(appContext,parent,operatorDescriptor);
  this.newNameIndex=newNameIndex;
  this.operatorIsNew=this.newNameIndex >= 1;
  if (this.newNameIndex >= 1) {
    this.newOperatorDescriptor.setName(this.oldOperatorDescriptor.getName() + ToolAdapterConstants.OPERATOR_GENERATED_NAME_SEPARATOR + this.newNameIndex);
    this.newOperatorDescriptor.setAlias(this.oldOperatorDescriptor.getAlias() + ToolAdapterConstants.OPERATOR_GENERATED_NAME_SEPARATOR + this.newNameIndex);
  }
  setContent(createMainPanel());
  EscapeAction.register(this.getJDialog());
}

Fixed version (ground truth):
/** 
 * Constructs a new window for editing the operator
 * @param appContext the application context
 * @param operatorDescriptor the descriptor of the operator to be edited
 * @param newNameIndex an integer value representing the suffix for the new operator name; if this value is less than 1, the editing operation of the current operator is executed; if the value is equal to or greater than 1, the operator is duplicated and the index value is used to compute the name of the new operator
 * @param operation is the type of desired operation: NEW/COPY if the operator was not previously registered (so it is a new operator) and EDIT if the operator was registered and the editing operation is requested
 */
public AbstractAdapterEditor(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex,OperationType operation){
  this(appContext,parent,operatorDescriptor);
  this.newNameIndex=newNameIndex;
  this.currentOperation=operation;
  if (this.newNameIndex >= 1) {
    this.newOperatorDescriptor.setName(this.oldOperatorDescriptor.getName() + ToolAdapterConstants.OPERATOR_GENERATED_NAME_SEPARATOR + this.newNameIndex);
    this.newOperatorDescriptor.setAlias(this.oldOperatorDescriptor.getAlias() + ToolAdapterConstants.OPERATOR_GENERATED_NAME_SEPARATOR + this.newNameIndex);
  }
  setContent(createMainPanel());
  EscapeAction.register(this.getJDialog());
}
Program: 62445
Project: 62445
Buggy source:
protected JTextArea createTemplateEditorField(){
  boolean useAutocomplete=Boolean.parseBoolean(NbPreferences.forModule(Dialogs.class).get(ToolAdapterOptionsController.PREFERENCE_KEY_AUTOCOMPLETE,"String_Node_Str"));
  if (useAutocomplete) {
    templateContent=new AutoCompleteTextArea("String_Node_Str",15,9);
  }
 else {
    templateContent=new JTextArea("String_Node_Str",15,9);
  }
  try {
    if (operatorIsNew) {
      if (oldOperatorDescriptor.getTemplateFileLocation() != null) {
        templateContent.setText(ToolAdapterIO.readOperatorTemplate(oldOperatorDescriptor.getName()));
      }
    }
 else {
      templateContent.setText(ToolAdapterIO.readOperatorTemplate(newOperatorDescriptor.getName()));
    }
  }
 catch (  IOException|OperatorException e) {
    logger.warning(e.getMessage());
  }
  templateContent.setInputVerifier(new RequiredFieldValidator(MESSAGE_REQUIRED));
  if (useAutocomplete && templateContent instanceof AutoCompleteTextArea) {
    ((AutoCompleteTextArea)templateContent).setAutoCompleteEntries(getAutocompleteEntries());
    ((AutoCompleteTextArea)templateContent).setTriggerChar('$');
  }
  return templateContent;
}

Fixed version (ground truth):
protected JTextArea createTemplateEditorField(){
  boolean useAutocomplete=Boolean.parseBoolean(NbPreferences.forModule(Dialogs.class).get(ToolAdapterOptionsController.PREFERENCE_KEY_AUTOCOMPLETE,"String_Node_Str"));
  if (useAutocomplete) {
    templateContent=new AutoCompleteTextArea("String_Node_Str",15,9);
  }
 else {
    templateContent=new JTextArea("String_Node_Str",15,9);
  }
  try {
    if ((currentOperation == OperationType.NEW) || (currentOperation == OperationType.COPY)) {
      if (oldOperatorDescriptor.getTemplateFileLocation() != null) {
        templateContent.setText(ToolAdapterIO.readOperatorTemplate(oldOperatorDescriptor.getName()));
      }
    }
 else {
      templateContent.setText(ToolAdapterIO.readOperatorTemplate(newOperatorDescriptor.getName()));
    }
  }
 catch (  IOException|OperatorException e) {
    logger.warning(e.getMessage());
  }
  templateContent.setInputVerifier(new RequiredFieldValidator(MESSAGE_REQUIRED));
  if (useAutocomplete && templateContent instanceof AutoCompleteTextArea) {
    ((AutoCompleteTextArea)templateContent).setAutoCompleteEntries(getAutocompleteEntries());
    ((AutoCompleteTextArea)templateContent).setTriggerChar('$');
  }
  return templateContent;
}
Program: 62446
Project: 62446
Buggy source:
public ToolAdapterEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex){
  super(appContext,parent,operatorDescriptor,newNameIndex);
}

Fixed version (ground truth):
public ToolAdapterEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex,OperationType operation){
  super(appContext,parent,operatorDescriptor,newNameIndex,operation);
}
Program: 62448
Project: 62448
Buggy source:
public ToolAdapterTabbedEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex){
  super(appContext,parent,operatorDescriptor,newNameIndex);
}

Fixed version (ground truth):
public ToolAdapterTabbedEditorDialog(AppContext appContext,JDialog parent,ToolAdapterOperatorDescriptor operatorDescriptor,int newNameIndex,OperationType operation){
  super(appContext,parent,operatorDescriptor,newNameIndex,operation);
}