nus-yam/ex-repair huggingface dataset:
Program: 47409
Project: 47409
Buggy source:
private void addCatalogs(IPentahoSession session,IOlapService olapService){
  for (  Properties properties : olap4jConnectionList) {
    try {
      olapService.addOlap4jCatalog(properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),getPassword(properties.getProperty("String_Node_Str")),new Properties(),true,session);
    }
 catch (    Exception e) {
      Logger.warn(this,Messages.getInstance().getString("String_Node_Str",properties.getProperty("String_Node_Str")),e);
    }
  }
}

Fixed version (ground truth):
private void addCatalogs(final IPentahoSession session,final IOlapService olapService){
  for (  final Properties properties : olap4jConnectionList) {
    try {
      SecurityHelper.getInstance().runAsSystem(new Callable<Void>(){
        public Void call() throws Exception {
          final String password=properties.getProperty("String_Node_Str");
          olapService.addOlap4jCatalog(properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),password == null ? null : getPassword(password),new Properties(),true,session);
          return null;
        }
      }
);
    }
 catch (    Exception e) {
      Logger.warn(this,Messages.getInstance().getString("String_Node_Str",properties.getProperty("String_Node_Str")),e);
    }
  }
}
Program: 47410
Project: 47410
Buggy source:
private void removeCatalogs(IPentahoSession session,IOlapService olapService){
  for (  String catalogName : removeList) {
    try {
      olapService.removeCatalog(catalogName,session);
    }
 catch (    Exception e) {
      Logger.warn(this,Messages.getInstance().getString("String_Node_Str",catalogName),e);
    }
  }
}

Fixed version (ground truth):
private void removeCatalogs(final IPentahoSession session,final IOlapService olapService){
  for (  final String catalogName : removeList) {
    try {
      SecurityHelper.getInstance().runAsSystem(new Callable<Void>(){
        public Void call() throws Exception {
          olapService.removeCatalog(catalogName,session);
          return null;
        }
      }
);
    }
 catch (    Exception e) {
      Logger.warn(this,Messages.getInstance().getString("String_Node_Str",catalogName),e);
    }
  }
}
Program: 47411
Project: 47411
Buggy source:
public boolean connect(Properties props){
  String url=props.getProperty("String_Node_Str");
  String driver=props.getProperty("String_Node_Str");
  try {
    if (connection != null) {
      connection.close();
    }
    if (driver.equals("String_Node_Str")) {
      Util.PropertyList connectProperties=Util.parseConnectString(url);
      MDXConnection.mapPlatformRolesToMondrianRolesHelper(connectProperties);
      url=connectProperties.toString();
    }
    Class.forName(driver);
    java.sql.Connection sqlConnection=DriverManager.getConnection(url);
    connection=sqlConnection.unwrap(org.olap4j.OlapConnection.class);
  }
 catch (  Exception e) {
    log.error(Messages.getInstance().getErrorString("String_Node_Str","String_Node_Str" + driver + "String_Node_Str"+ url),e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean connect(Properties props){
  String url=props.getProperty("String_Node_Str");
  String driver=props.getProperty("String_Node_Str");
  String user=props.getProperty("String_Node_Str",null);
  String password=props.getProperty("String_Node_Str",null);
  try {
    if (connection != null) {
      connection.close();
    }
    if (driver.equals("String_Node_Str")) {
      Util.PropertyList connectProperties=Util.parseConnectString(url);
      MDXConnection.mapPlatformRolesToMondrianRolesHelper(connectProperties);
      url=connectProperties.toString();
    }
    Class.forName(driver);
    java.sql.Connection sqlConnection=DriverManager.getConnection(url,user,password);
    connection=sqlConnection.unwrap(org.olap4j.OlapConnection.class);
  }
 catch (  Exception e) {
    log.error(Messages.getInstance().getErrorString("String_Node_Str","String_Node_Str" + driver + "String_Node_Str"+ url),e);
    return false;
  }
  return true;
}
Program: 47412
Project: 47412
Buggy source:
public void deleteOlap4jServer(String name){
  final RepositoryFile serverNode=repository.getFile(ETC_OLAP_SERVERS_JCR_FOLDER + RepositoryFile.SEPARATOR + name);
  if (serverNode != null) {
    repository.deleteFile(serverNode,"String_Node_Str" + name);
  }
}

Fixed version (ground truth):
public void deleteOlap4jServer(String name){
  final RepositoryFile serverNode=repository.getFile(ETC_OLAP_SERVERS_JCR_FOLDER + RepositoryFile.SEPARATOR + name);
  if (serverNode != null) {
    repository.deleteFile(serverNode.getId(),"String_Node_Str" + name);
  }
}
Program: 47413
Project: 47413
Buggy source:
public boolean hasAccess(final String catalogName,final EnumSet<RepositoryFilePermission> perms,IPentahoSession session){
  final String path;
  if (!getHostedCatalogs().contains(catalogName) && !getOlap4jServers().contains(catalogName) && perms.contains(RepositoryFilePermission.WRITE)) {
    path=isHosted(catalogName) ? ETC_MONDRIAN_JCR_FOLDER : ETC_OLAP_SERVERS_JCR_FOLDER;
  }
 else {
    path=makePath(catalogName);
  }
  try {
    return SecurityHelper.getInstance().runAsUser(session.getName(),new Callable<Boolean>(){
      public Boolean call() throws Exception {
        return repository.hasAccess(path,perms);
      }
    }
);
  }
 catch (  Exception e) {
    throw new IOlapServiceException(e);
  }
}

Fixed version (ground truth):
public boolean hasAccess(final String catalogName,final EnumSet<RepositoryFilePermission> perms,IPentahoSession session){
  final String path;
  if (!getHostedCatalogs().contains(catalogName) && !getOlap4jServers().contains(catalogName) && perms.contains(RepositoryFilePermission.WRITE)) {
    path=isHosted(catalogName) ? ETC_MONDRIAN_JCR_FOLDER : ETC_OLAP_SERVERS_JCR_FOLDER;
  }
 else {
    path=makePath(catalogName);
  }
  final IPentahoSession origSession=PentahoSessionHolder.getSession();
  PentahoSessionHolder.setSession(session);
  try {
    return repository.hasAccess(path,perms);
  }
 catch (  Exception e) {
    throw new IOlapServiceException(e);
  }
 finally {
    PentahoSessionHolder.setSession(origSession);
  }
}
Program: 47414
Project: 47414
Buggy source:
private Olap4jServerInfo(RepositoryFile source){
  final NodeRepositoryFileData data=repository.getDataForRead(source.getId(),NodeRepositoryFileData.class);
  this.name=data.getNode().getProperty("String_Node_Str").getString();
  this.className=data.getNode().getProperty("String_Node_Str").getString();
  this.URL=data.getNode().getProperty("String_Node_Str").getString();
  this.user=data.getNode().getProperty("String_Node_Str").getString();
  this.password=data.getNode().getProperty("String_Node_Str").getString();
  this.properties=new Properties();
  final String propertiesXml=data.getNode().getProperty("String_Node_Str").getString();
  try {
    properties.loadFromXML(new ByteArrayInputStream(propertiesXml.getBytes("String_Node_Str")));
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private Olap4jServerInfo(RepositoryFile source){
  final NodeRepositoryFileData data=repository.getDataForRead(source.getId(),NodeRepositoryFileData.class);
  this.name=data.getNode().getProperty("String_Node_Str").getString();
  this.className=data.getNode().getProperty("String_Node_Str").getString();
  this.URL=data.getNode().getProperty("String_Node_Str").getString();
  final DataProperty userProp=data.getNode().getProperty("String_Node_Str");
  this.user=userProp == null ? null : userProp.toString();
  final DataProperty passwordProp=data.getNode().getProperty("String_Node_Str");
  this.password=passwordProp == null ? null : passwordProp.toString();
  this.properties=new Properties();
  final String propertiesXml=data.getNode().getProperty("String_Node_Str").getString();
  try {
    properties.loadFromXML(new ByteArrayInputStream(propertiesXml.getBytes("String_Node_Str")));
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 47415
Project: 47415
Buggy source:
/** 
 * Get the localized display name of action for a specific locale. If null is passed then default locale will be used
 * @param locale 
 * @return localized name
 */
String getLocalizedDisplayName(String locale);

Fixed version (ground truth):
/** 
 * Get the localized display name of action for a specific locale. If null is passed then default locale will be used
 * @param locale
 * @return localized name
 */
String getLocalizedDisplayName(String locale);
Program: 47416
Project: 47416
Buggy source:
public RepositoryFileAdapter(RepositoryRequest repositoryRequest){
  if (repositoryRequest.getExcludeMemberSet() != null && !repositoryRequest.getExcludeMemberSet().isEmpty()) {
    this.exclude=true;
    this.membersSet=repositoryRequest.getExcludeMemberSet();
  }
 else {
    this.exclude=false;
    this.membersSet=repositoryRequest.getIncludeMemberSet();
    this.includeAcls=repositoryRequest.isIncludeAcls();
  }
}

Fixed version (ground truth):
public RepositoryFileAdapter(RepositoryRequest repositoryRequest){
  if (repositoryRequest.getExcludeMemberSet() != null && !repositoryRequest.getExcludeMemberSet().isEmpty()) {
    this.exclude=true;
    this.membersSet=repositoryRequest.getExcludeMemberSet();
  }
 else {
    this.exclude=false;
    this.membersSet=repositoryRequest.getIncludeMemberSet();
  }
  this.includeAcls=repositoryRequest.isIncludeAcls();
}
Program: 47417
Project: 47417
Buggy source:
public RepositoryFileTreeAdapter(RepositoryRequest repositoryRequest){
  if (repositoryRequest.getExcludeMemberSet() != null && !repositoryRequest.getExcludeMemberSet().isEmpty()) {
    this.exclude=true;
    this.membersSet=repositoryRequest.getExcludeMemberSet();
  }
 else {
    this.exclude=false;
    this.membersSet=repositoryRequest.getIncludeMemberSet();
    this.includeAcls=repositoryRequest.isIncludeAcls();
  }
}

Fixed version (ground truth):
public RepositoryFileTreeAdapter(RepositoryRequest repositoryRequest){
  if (repositoryRequest.getExcludeMemberSet() != null && !repositoryRequest.getExcludeMemberSet().isEmpty()) {
    this.exclude=true;
    this.membersSet=repositoryRequest.getExcludeMemberSet();
  }
 else {
    this.exclude=false;
    this.membersSet=repositoryRequest.getIncludeMemberSet();
  }
  this.includeAcls=repositoryRequest.isIncludeAcls();
}
Program: 47418
Project: 47418
Buggy source:
private void onSolutionBrowserEvent(ISolutionBrowserEvent event){
  FileItem selectedItem=null;
  if (event.getFileItems() != null && event.getFileItems().size() > 0) {
    selectedItem=event.getFileItems().get(0);
  }
  handleSolutionBrowserEvent(event.getWidget(),selectedItem);
  if (event.getWidget() != null) {
    main.removeOverlays(((IFrameTabPanel)event.getWidget()).getOverlayIds());
  }
}

Fixed version (ground truth):
private void onSolutionBrowserEvent(ISolutionBrowserEvent event){
  FileItem selectedItem=null;
  if (event.getFileItems() != null && event.getFileItems().size() > 0) {
    selectedItem=event.getFileItems().get(0);
  }
  try {
    handleSolutionBrowserEvent(event.getWidget(),selectedItem);
  }
 catch (  Throwable t) {
    MantleApplication.log(t.getMessage());
  }
  if (event.getWidget() != null) {
    main.removeOverlays(((IFrameTabPanel)event.getWidget()).getOverlayIds());
  }
}
Program: 47419
Project: 47419
Buggy source:
/** 
 * Hold an object instance by key name.
 * @param key the key to retrieval of this object
 * @param instance the actual instance that is served back to you when requested.
 * @return the current {@link MicroPlatform} instance, for chaining
 */
public PentahoSystemBoot define(String key,Object instance){
  if (factory instanceof IPentahoDefinableObjectFactory) {
    IPentahoDefinableObjectFactory definableFactory=(IPentahoDefinableObjectFactory)getFactory();
    definableFactory.defineInstance(key,instance);
  }
 else {
    throw new NoSuchMethodError("String_Node_Str");
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Hold an object instance by key name.
 * @param key the key to retrieval of this object
 * @param instance the actual instance that is served back to you when requested.
 * @return the current MicroPlatform instance, for chaining
 */
public PentahoSystemBoot define(String key,Object instance){
  if (factory instanceof IPentahoDefinableObjectFactory) {
    IPentahoDefinableObjectFactory definableFactory=(IPentahoDefinableObjectFactory)getFactory();
    definableFactory.defineInstance(key,instance);
  }
 else {
    throw new NoSuchMethodError("String_Node_Str");
  }
  return this;
}
Program: 47420
Project: 47420
Buggy source:
public static Node createFolderNode(final Session session,final PentahoJcrConstants pentahoJcrConstants,final Serializable parentFolderId,final RepositoryFile folder) throws RepositoryException {
  checkName(folder.getName());
  Node parentFolderNode;
  if (parentFolderId != null) {
    parentFolderNode=session.getNodeByIdentifier(parentFolderId.toString());
  }
 else {
    parentFolderNode=session.getRootNode();
  }
  Assert.notNull(parentFolderNode);
  Node folderNode=parentFolderNode.addNode(folder.getName(),pentahoJcrConstants.getPHO_NT_PENTAHOFOLDER());
  folderNode.setProperty(pentahoJcrConstants.getPHO_HIDDEN(),folder.isHidden());
  Node localeNodes=null;
  if (folder.getTitle() != folder.getName()) {
    localeNodes=folderNode.addNode(pentahoJcrConstants.getPHO_LOCALES(),pentahoJcrConstants.getPHO_NT_LOCALE());
    Map<String,Properties> localPropertiesMap=new HashMap<String,Properties>();
    String defaultLocale=LocaleHelper.getLocale().toString();
    Properties titleProps=new Properties();
    titleProps.put("String_Node_Str",folder.getTitle());
    localPropertiesMap.put(defaultLocale,titleProps);
    setLocalePropertiesMap(session,pentahoJcrConstants,localeNodes,localPropertiesMap);
  }
  if (folder.isVersioned()) {
    folderNode.addMixin(pentahoJcrConstants.getPHO_MIX_VERSIONABLE());
  }
  folderNode.addNode(pentahoJcrConstants.getPHO_METADATA(),JcrConstants.NT_UNSTRUCTURED);
  folderNode.addMixin(pentahoJcrConstants.getMIX_REFERENCEABLE());
  return folderNode;
}

Fixed version (ground truth):
public static Node createFolderNode(final Session session,final PentahoJcrConstants pentahoJcrConstants,final Serializable parentFolderId,final RepositoryFile folder) throws RepositoryException {
  checkName(folder.getName());
  Node parentFolderNode;
  if (parentFolderId != null) {
    parentFolderNode=session.getNodeByIdentifier(parentFolderId.toString());
  }
 else {
    parentFolderNode=session.getRootNode();
  }
  Assert.notNull(parentFolderNode);
  Node folderNode=parentFolderNode.addNode(folder.getName(),pentahoJcrConstants.getPHO_NT_PENTAHOFOLDER());
  folderNode.setProperty(pentahoJcrConstants.getPHO_HIDDEN(),folder.isHidden());
  Node localeNodes=null;
  if (folder.getTitle() != folder.getName()) {
    localeNodes=folderNode.addNode(pentahoJcrConstants.getPHO_LOCALES(),pentahoJcrConstants.getPHO_NT_LOCALE());
    Map<String,Properties> localPropertiesMap=new HashMap<String,Properties>();
    String defaultLocale=LocalizationUtil.DEFAULT;
    Properties titleProps=new Properties();
    titleProps.put("String_Node_Str",folder.getTitle());
    localPropertiesMap.put(defaultLocale,titleProps);
    setLocalePropertiesMap(session,pentahoJcrConstants,localeNodes,localPropertiesMap);
  }
  if (folder.isVersioned()) {
    folderNode.addMixin(pentahoJcrConstants.getPHO_MIX_VERSIONABLE());
  }
  folderNode.addNode(pentahoJcrConstants.getPHO_METADATA(),JcrConstants.NT_UNSTRUCTURED);
  folderNode.addMixin(pentahoJcrConstants.getMIX_REFERENCEABLE());
  return folderNode;
}
Program: 47422
Project: 47422
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(NodeRepositoryFileData.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return IRepositoryFileData.NODE_CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(NodeRepositoryFileData.class);
}
Program: 47423
Project: 47423
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return CONTENT_TYPE;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return IRepositoryFileData.NODE_CONTENT_TYPE;
}
Program: 47424
Project: 47424
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(SampleRepositoryFileData.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return IRepositoryFileData.SAMPLE_CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(SampleRepositoryFileData.class);
}
Program: 47425
Project: 47425
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return CONTENT_TYPE;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return IRepositoryFileData.SAMPLE_CONTENT_TYPE;
}
Program: 47426
Project: 47426
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(SimpleRepositoryFileData.class);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean canRead(final String contentType,final Class<? extends IRepositoryFileData> clazz){
  return IRepositoryFileData.SIMPLE_CONTENT_TYPE.equals(contentType) && clazz.isAssignableFrom(SimpleRepositoryFileData.class);
}
Program: 47427
Project: 47427
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return CONTENT_TYPE;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getContentType(){
  return IRepositoryFileData.SIMPLE_CONTENT_TYPE;
}
Program: 47430
Project: 47430
Buggy source:
private void replacePermissionsWithAll(Element ace,Document fileInfo){
  NodeList perms=ace.getElementsByTagName(PERMISSIONS_ELEMENT_NAME);
  int childCount=perms.getLength();
  for (int i=0; i < childCount; i++) {
    Node perm=perms.item(0);
    ace.removeChild(perm);
  }
  Element newPerm=fileInfo.createElement(PERMISSIONS_ELEMENT_NAME);
  Text textNode=fileInfo.createTextNode(Integer.toString(PERM_ALL));
  newPerm.appendChild(textNode);
  ace.appendChild(newPerm);
}

Fixed version (ground truth):
private void replacePermissionsWithAll(Element ace,Document fileInfo){
  NodeList perms=ace.getElementsByTagName(PERMISSIONS_ELEMENT_NAME);
  int childCount=perms.getLength();
  for (int i=0; i < childCount; i++) {
    Node perm=perms.item(i);
    ace.removeChild(perm);
  }
  Element newPerm=fileInfo.createElement(PERMISSIONS_ELEMENT_NAME);
  Text textNode=fileInfo.createTextNode(Integer.toString(PERM_ALL));
  newPerm.appendChild(textNode);
  ace.appendChild(newPerm);
}
Program: 47431
Project: 47431
Buggy source:
public void fetchAllRoles(final ArrayList<String> existing){
  try {
    final String url=GWT.getHostPageBaseURL() + "String_Node_Str";
    RequestBuilder requestBuilder=new RequestBuilder(RequestBuilder.GET,url);
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable caught){
        MessageDialogBox dialogBox=new MessageDialogBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,false,true);
        dialogBox.center();
      }
      public void onResponseReceived(      Request request,      Response response){
        JsArrayString roles=parseRolesJson(JsonUtils.escapeJsonForEval(response.getText()));
        rolesListBox.clear();
        for (int i=0; i < roles.length(); i++) {
          String role=roles.get(i);
          if (!existing.contains(role)) {
            rolesListBox.addItem(role);
          }
        }
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert(e.getMessage());
  }
}

Fixed version (ground truth):
public void fetchAllRoles(final ArrayList<String> existing){
  try {
    final String url=GWT.getHostPageBaseURL() + "String_Node_Str";
    RequestBuilder requestBuilder=new RequestBuilder(RequestBuilder.GET,url);
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable caught){
        MessageDialogBox dialogBox=new MessageDialogBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,false,true);
        dialogBox.center();
      }
      public void onResponseReceived(      Request request,      Response response){
        JsArrayString roles=parseRolesJson(JsonUtils.escapeJsonForEval(response.getText()));
        rolesListBox.clear();
        for (int i=0; i < roles.length(); i++) {
          String role=roles.get(i);
          if (!existing.contains(role)) {
            rolesListBox.addItem(role);
          }
        }
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert(e.getMessage());
  }
}
Program: 47432
Project: 47432
Buggy source:
public void fetchAllUsers(final ArrayList<String> existing){
  try {
    final String url=GWT.getHostPageBaseURL() + "String_Node_Str";
    RequestBuilder requestBuilder=new RequestBuilder(RequestBuilder.GET,url);
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable caught){
        MessageDialogBox dialogBox=new MessageDialogBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,false,true);
        dialogBox.center();
      }
      public void onResponseReceived(      Request request,      Response response){
        JsArrayString users=parseUsersJson(JsonUtils.escapeJsonForEval(response.getText()));
        usersListBox.clear();
        for (int i=0; i < users.length(); i++) {
          String user=users.get(i);
          if (!existing.contains(user)) {
            usersListBox.addItem(user);
          }
        }
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert(e.getMessage());
  }
}

Fixed version (ground truth):
public void fetchAllUsers(final ArrayList<String> existing){
  try {
    final String url=GWT.getHostPageBaseURL() + "String_Node_Str";
    RequestBuilder requestBuilder=new RequestBuilder(RequestBuilder.GET,url);
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.setHeader("String_Node_Str","String_Node_Str");
    requestBuilder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable caught){
        MessageDialogBox dialogBox=new MessageDialogBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,false,true);
        dialogBox.center();
      }
      public void onResponseReceived(      Request request,      Response response){
        JsArrayString users=parseUsersJson(JsonUtils.escapeJsonForEval(response.getText()));
        usersListBox.clear();
        for (int i=0; i < users.length(); i++) {
          String user=users.get(i);
          if (!existing.contains(user)) {
            usersListBox.addItem(user);
          }
        }
      }
    }
);
  }
 catch (  RequestException e) {
    Window.alert(e.getMessage());
  }
}
Program: 47433
Project: 47433
Buggy source:
@Before public void setUp() throws Exception {
  MicroPlatform microPlatform=new MicroPlatform();
  Mockery context=new Mockery();
  Map<String,String> mimeMap=new HashMap<String,String>();
  mimeMap.put("String_Node_Str","String_Node_Str");
  microPlatform.defineInstance(NameBaseMimeResolver.class,new NameBaseMimeResolver(mimeMap));
  IPlatformImportMimeResolver nameBaseMimeResolver=context.mock(IPlatformImportMimeResolver.class);
  microPlatform.defineInstance(IPlatformImportMimeResolver.class,nameBaseMimeResolver);
  List<String> allowedArtifacts=new ArrayList<String>();
  allowedArtifacts.add("String_Node_Str");
  allowedArtifacts.add("String_Node_Str");
  LocaleImportHandler localeImportHandler=new LocaleImportHandler(allowedArtifacts);
  Map<String,IPlatformImportHandler> handlers=new HashMap<String,IPlatformImportHandler>();
  handlers.put("String_Node_Str",localeImportHandler);
  Map<String,String> mimes=new HashMap<String,String>();
  mimes.put("String_Node_Str","String_Node_Str");
  importer=new PentahoPlatformImporter(handlers,new NameBaseMimeResolver(mimes));
  importer.setRepositoryImportLogger(new Log4JRepositoryImportLogger());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  MicroPlatform microPlatform=new MicroPlatform();
  Mockery context=new Mockery();
  Map<String,String> mimeMap=new HashMap<String,String>();
  mimeMap.put("String_Node_Str","String_Node_Str");
  microPlatform.defineInstance(NameBaseMimeResolver.class,new NameBaseMimeResolver(mimeMap));
  IPlatformImportMimeResolver nameBaseMimeResolver=context.mock(IPlatformImportMimeResolver.class);
  microPlatform.defineInstance(IPlatformImportMimeResolver.class,nameBaseMimeResolver);
  List<String> allowedArtifacts=new ArrayList<String>();
  allowedArtifacts.add("String_Node_Str");
  allowedArtifacts.add("String_Node_Str");
  List<String> approvedExtensionsList=new ArrayList<String>();
  allowedArtifacts.add("String_Node_Str");
  allowedArtifacts.add("String_Node_Str");
  List<String> hiddenExtensionsList=new ArrayList<String>();
  allowedArtifacts.add("String_Node_Str");
  allowedArtifacts.add("String_Node_Str");
  LocaleImportHandler localeImportHandler=new LocaleImportHandler(allowedArtifacts,approvedExtensionsList,hiddenExtensionsList);
  Map<String,IPlatformImportHandler> handlers=new HashMap<String,IPlatformImportHandler>();
  handlers.put("String_Node_Str",localeImportHandler);
  Map<String,String> mimes=new HashMap<String,String>();
  mimes.put("String_Node_Str","String_Node_Str");
  importer=new PentahoPlatformImporter(handlers,new NameBaseMimeResolver(mimes));
  importer.setRepositoryImportLogger(new Log4JRepositoryImportLogger());
}
Program: 47434
Project: 47434
Buggy source:
public void onResponseReceived(Request request,Response response){
  WaitPopup.getInstance().setVisible(false);
  if (response.getStatusCode() == Response.SC_OK) {
    final boolean hasParams=Boolean.parseBoolean(response.getText());
    if (jsJob != null) {
      jsJob.setJobName(scheduleNameTextBox.getText());
      jsJob.setOutputPath(scheduleLocationTextBox.getText());
      if (recurrenceDialog == null) {
        recurrenceDialog=new ScheduleRecurrenceDialog(NewScheduleDialog.this,jsJob,callback,hasParams,isEmailConfValid,ScheduleDialogType.SCHEDULER);
      }
    }
 else     if (recurrenceDialog == null) {
      recurrenceDialog=new ScheduleRecurrenceDialog(NewScheduleDialog.this,filePath,scheduleLocationTextBox.getText(),scheduleNameTextBox.getText(),callback,hasParams,isEmailConfValid);
    }
 else {
      recurrenceDialog.scheduleName=scheduleNameTextBox.getText();
      recurrenceDialog.outputLocation=scheduleLocationTextBox.getText();
    }
    recurrenceDialog.setParentDialog(NewScheduleDialog.this);
    recurrenceDialog.center();
    NewScheduleDialog.super.onOk();
  }
}

Fixed version (ground truth):
public void onResponseReceived(Request request,Response response){
  WaitPopup.getInstance().setVisible(false);
  if (response.getStatusCode() == Response.SC_OK) {
    final boolean hasParams=Boolean.parseBoolean(response.getText());
    if (jsJob != null) {
      jsJob.setJobName(scheduleNameTextBox.getText());
      jsJob.setOutputPath(scheduleLocationTextBox.getText(),scheduleNameTextBox.getText());
      if (recurrenceDialog == null) {
        recurrenceDialog=new ScheduleRecurrenceDialog(NewScheduleDialog.this,jsJob,callback,hasParams,isEmailConfValid,ScheduleDialogType.SCHEDULER);
      }
    }
 else     if (recurrenceDialog == null) {
      recurrenceDialog=new ScheduleRecurrenceDialog(NewScheduleDialog.this,filePath,scheduleLocationTextBox.getText(),scheduleNameTextBox.getText(),callback,hasParams,isEmailConfValid);
    }
 else {
      recurrenceDialog.scheduleName=scheduleNameTextBox.getText();
      recurrenceDialog.outputLocation=scheduleLocationTextBox.getText();
    }
    recurrenceDialog.setParentDialog(NewScheduleDialog.this);
    recurrenceDialog.center();
    NewScheduleDialog.super.onOk();
  }
}
Program: 47436
Project: 47436
Buggy source:
public final void setOutputPath(String outputPath){
  JsJobParam resource=getJobParam("String_Node_Str");
  resource.setValue("String_Node_Str" + getFullResourceName() + "String_Node_Str"+ outputPath);
}

Fixed version (ground truth):
public final void setOutputPath(String outputPath,String outputFileName){
  JsJobParam resource=getJobParam("String_Node_Str");
  resource.setValue("String_Node_Str" + getFullResourceName() + "String_Node_Str"+ outputPath+ "String_Node_Str"+ outputFileName+ "String_Node_Str");
}
Program: 47438
Project: 47438
Buggy source:
@SuppressWarnings("String_Node_Str") public static String pathToId(String path){
  String id=path.replace("String_Node_Str","String_Node_Str");
  if (!id.startsWith("String_Node_Str")) {
    id="String_Node_Str" + id;
  }
  if (id.endsWith("String_Node_Str")) {
    id=id.substring(0,id.length() - 2);
  }
  return id;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static String pathToId(String path){
  String id=path.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  id=id.replace("String_Node_Str","String_Node_Str");
  if (!id.startsWith("String_Node_Str")) {
    id="String_Node_Str" + id;
  }
  if (id.endsWith("String_Node_Str")) {
    id=id.substring(0,id.length() - 2);
  }
  return id;
}
Program: 47440
Project: 47440
Buggy source:
public void execute(){
  if (popupMenu != null) {
    popupMenu.hide();
  }
  SolutionBrowserPanel sbp=SolutionBrowserPanel.getInstance();
  if (mode == COMMAND.PROPERTIES) {
    new FilePropertiesCommand(repositoryFile,FilePropertiesDialog.Tabs.GENERAL).execute();
  }
 else   if (mode == COMMAND.DELETE) {
    TreeItem item=sbp.getSolutionTree().getSelectedItem();
    RepositoryFileTree tree=(RepositoryFileTree)item.getUserObject();
    new DeleteFolderCommand(tree.getFile()).execute();
  }
 else   if (mode == COMMAND.CREATE_FOLDER) {
    TreeItem item=sbp.getSolutionTree().getSelectedItem();
    RepositoryFileTree tree=(RepositoryFileTree)item.getUserObject();
    new NewFolderCommand(tree.getFile()).execute();
  }
 else   if (mode == COMMAND.EXPORT) {
    new ExportFileCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.IMPORT) {
    new ImportFileCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.PASTE) {
    new PasteFilesCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.EMPTY_TRASH) {
    new DeletePermanentFileCommand(sbp.getSolutionTree().getTrashItems()).execute();
  }
}

Fixed version (ground truth):
public void execute(){
  if (popupMenu != null) {
    popupMenu.hide();
  }
  SolutionBrowserPanel sbp=SolutionBrowserPanel.getInstance();
  if (mode == COMMAND.PROPERTIES) {
    new FilePropertiesCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.DELETE) {
    TreeItem item=sbp.getSolutionTree().getSelectedItem();
    RepositoryFileTree tree=(RepositoryFileTree)item.getUserObject();
    new DeleteFolderCommand(tree.getFile()).execute();
  }
 else   if (mode == COMMAND.CREATE_FOLDER) {
    TreeItem item=sbp.getSolutionTree().getSelectedItem();
    RepositoryFileTree tree=(RepositoryFileTree)item.getUserObject();
    new NewFolderCommand(tree.getFile()).execute();
  }
 else   if (mode == COMMAND.EXPORT) {
    new ExportFileCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.IMPORT) {
    new ImportFileCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.PASTE) {
    new PasteFilesCommand(repositoryFile).execute();
  }
 else   if (mode == COMMAND.EMPTY_TRASH) {
    new DeletePermanentFileCommand(sbp.getSolutionTree().getTrashItems()).execute();
  }
}
Program: 47441
Project: 47441
Buggy source:
public void onError(Request request,Throwable exception){
  FilePropertiesDialog dialog=new FilePropertiesDialog(item,new MantleTabPanel(),null,FilePropertiesDialog.Tabs.PERMISSION,false);
  dialog.showTab(FilePropertiesDialog.Tabs.PERMISSION);
  dialog.center();
  event.setMessage(exception.getMessage());
  EventBusUtil.EVENT_BUS.fireEvent(event);
}

Fixed version (ground truth):
public void onError(Request request,Throwable exception){
  FilePropertiesDialog dialog=new FilePropertiesDialog(item,new PentahoTabPanel(),null,defaultTab,false);
  dialog.showTab(defaultTab);
  dialog.center();
  event.setMessage(exception.getMessage());
  EventBusUtil.EVENT_BUS.fireEvent(event);
}
Program: 47443
Project: 47443
Buggy source:
public void execute(){
  final SolutionBrowserPanel sbp=SolutionBrowserPanel.getInstance();
  selectedList=(sbp.getFilesListPanel().getRepositoryFiles() != null) ? sbp.getFilesListPanel().getRepositoryFiles() : new ArrayList<RepositoryFile>();
  if (this.getSolutionPath() != null) {
    sbp.getFile(this.getSolutionPath(),new SolutionFileHandler(){
      @Override public void handle(      RepositoryFile repositoryFile){
        selectedList.add(repositoryFile);
        performOperation();
      }
    }
);
  }
 else {
    performOperation();
  }
}

Fixed version (ground truth):
public void execute(){
  final SolutionBrowserPanel sbp=SolutionBrowserPanel.getInstance();
  if (this.getSolutionPath() != null) {
    selectedList=new ArrayList<RepositoryFile>();
    sbp.getFile(this.getSolutionPath(),new SolutionFileHandler(){
      @Override public void handle(      RepositoryFile repositoryFile){
        selectedList.add(repositoryFile);
        performOperation();
      }
    }
);
  }
 else {
    selectedList=sbp.getFilesListPanel().getRepositoryFiles();
    performOperation();
  }
}
Program: 47444
Project: 47444
Buggy source:
public void onResponseReceived(Request request,Response response){
  FilePropertiesDialog dialog=new FilePropertiesDialog(item,new MantleTabPanel(),null,FilePropertiesDialog.Tabs.PERMISSION,Boolean.parseBoolean(response.getText()));
  dialog.showTab(FilePropertiesDialog.Tabs.PERMISSION);
  dialog.center();
  event.setMessage("String_Node_Str");
  EventBusUtil.EVENT_BUS.fireEvent(event);
}

Fixed version (ground truth):
public void onResponseReceived(Request request,Response response){
  FilePropertiesDialog dialog=new FilePropertiesDialog(item,new PentahoTabPanel(),null,defaultTab,Boolean.parseBoolean(response.getText()));
  dialog.showTab(FilePropertiesDialog.Tabs.PERMISSION);
  dialog.center();
  event.setMessage("String_Node_Str");
  EventBusUtil.EVENT_BUS.fireEvent(event);
}
Program: 47446
Project: 47446
Buggy source:
public void enableDrag(){
  setWidget(0,0,dropIndicator);
  addStyleName("String_Node_Str");
  setDroppable(false);
  dropIndicator=invalidDrop;
}

Fixed version (ground truth):
public void enableDrag(){
  setWidget(0,0,dropIndicator);
  addStyleName("String_Node_Str");
  setDroppable(false);
  dropIndicator.removeStyleName("String_Node_Str");
  dropIndicator.addStyleName("String_Node_Str");
}
Program: 47447
Project: 47447
Buggy source:
public void setDroppable(boolean canDrop){
  if (this.canDrop == canDrop) {
    return;
  }
  if (canDrop) {
    dropIndicator=validDrop;
    addStyleName("String_Node_Str");
  }
 else {
    dropIndicator=invalidDrop;
    removeStyleName("String_Node_Str");
  }
  this.canDrop=canDrop;
}

Fixed version (ground truth):
public void setDroppable(boolean canDrop){
  if (this.canDrop == canDrop) {
    return;
  }
  if (canDrop) {
    dropIndicator.addStyleName("String_Node_Str");
    dropIndicator.removeStyleName("String_Node_Str");
    addStyleName("String_Node_Str");
  }
 else {
    dropIndicator.removeStyleName("String_Node_Str");
    dropIndicator.addStyleName("String_Node_Str");
    removeStyleName("String_Node_Str");
  }
  this.canDrop=canDrop;
}
Program: 47448
Project: 47448
Buggy source:
private SolutionBrowserPanel(){
  RootPanel.get().getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  dragController=new SolutionBrowserDragController(contentTabPanel);
  instance=this;
  ExecuteUrlInNewTabCommand.setupNativeHooks();
  SolutionBrowserPanel.setupNativeHooks(this);
  solutionTree.addTreeListener(treeListener);
  initializeExecutableFileTypes();
  buildUI();
}

Fixed version (ground truth):
private SolutionBrowserPanel(){
  RootPanel.get().getElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  dragController=new SolutionBrowserDragController(contentTabPanel);
  instance=this;
  ExecuteUrlInNewTabCommand.setupNativeHooks();
  SolutionBrowserPanel.setupNativeHooks(this);
  solutionTree.addTreeListener(treeListener);
  initializeExecutableFileTypes();
  buildUI();
  EventBusUtil.EVENT_BUS.addHandler(SolutionBrowserSelectEvent.TYPE,new SolutionBrowserSelectEventHandler(){
    public void onTabSelected(    SolutionBrowserSelectEvent event){
      adjustContentPanelSize();
    }
  }
);
}
Program: 47449
Project: 47449
Buggy source:
public CustomDropDown(String labelText,MenuBar menuBar){
  this.menuBar=menuBar;
  sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS);
  setText(labelText);
  label.setStyleName("String_Node_Str");
  add(label);
  Label dropDownArrow=new Label();
  add(dropDownArrow);
  setCellWidth(dropDownArrow,"String_Node_Str");
  dropDownArrow.getElement().getParentElement().addClassName("String_Node_Str");
  ElementUtils.preventTextSelection(getElement());
  ElementUtils.preventTextSelection(label.getElement());
  popup.setStyleName("String_Node_Str");
  popup.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      pressed=false;
      if (enabled) {
        removeStyleDependentName("String_Node_Str");
        removeStyleDependentName("String_Node_Str");
      }
    }
  }
);
  setStyleName(STYLE);
}

Fixed version (ground truth):
public CustomDropDown(String labelText,MenuBar menuBar){
  this.menuBar=menuBar;
  sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.KEYEVENTS);
  setText(labelText);
  label.setStyleName("String_Node_Str");
  add(label);
  Label dropDownArrow=new Label();
  add(dropDownArrow);
  setCellWidth(dropDownArrow,"String_Node_Str");
  dropDownArrow.getElement().getParentElement().addClassName("String_Node_Str");
  ElementUtils.preventTextSelection(getElement());
  ElementUtils.preventTextSelection(label.getElement());
  popup.setStyleName("String_Node_Str");
  popup.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      pressed=false;
      if (enabled) {
        removeStyleDependentName("String_Node_Str");
        removeStyleDependentName("String_Node_Str");
      }
    }
  }
);
  setStyleName(STYLE);
}
Program: 47450
Project: 47450
Buggy source:
/** 
 * Runs code as system with full privileges.
 */
public <T>T runAsSystem(final Callable<T> callable) throws Exception {
  String singleTenantAdmin=PentahoSystem.get(String.class,"String_Node_Str",null);
  IPentahoSession origSession=PentahoSessionHolder.getSession();
  if (singleTenantAdmin.equals(origSession.getName())) {
    return callable.call();
  }
 else {
    Authentication origAuth=SecurityContextHolder.getContext().getAuthentication();
    StandaloneSession session=null;
    try {
      session=new StandaloneSession(singleTenantAdmin);
      session.setAuthenticated(singleTenantAdmin);
      PentahoSessionHolder.setSession(session);
      Authentication auth=createAuthentication(singleTenantAdmin);
      SecurityContextHolder.getContext().setAuthentication(auth);
      return callable.call();
    }
  finally {
      if (session != null) {
        try {
          session.destroy();
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
      PentahoSessionHolder.setSession(origSession);
      SecurityContextHolder.getContext().setAuthentication(origAuth);
    }
  }
}

Fixed version (ground truth):
/** 
 * Runs code as system with full privileges.
 */
public <T>T runAsSystem(final Callable<T> callable) throws Exception {
  String singleTenantAdmin=PentahoSystem.get(String.class,"String_Node_Str",null);
  IPentahoSession origSession=PentahoSessionHolder.getSession();
  Authentication origAuth=SecurityContextHolder.getContext().getAuthentication();
  StandaloneSession session=null;
  try {
    session=new StandaloneSession(singleTenantAdmin);
    session.setAuthenticated(singleTenantAdmin);
    PentahoSessionHolder.setSession(session);
    Authentication auth=createAuthentication(singleTenantAdmin);
    SecurityContextHolder.getContext().setAuthentication(auth);
    return callable.call();
  }
  finally {
    if (session != null) {
      try {
        session.destroy();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
    PentahoSessionHolder.setSession(origSession);
    SecurityContextHolder.getContext().setAuthentication(origAuth);
  }
}
Program: 47451
Project: 47451
Buggy source:
/** 
 * @return a list of TimeZones ensuring that the server (default) timezone is at the top of the list (0th element)
 */
@GET @Path("String_Node_Str") @Produces({APPLICATION_JSON,APPLICATION_XML}) public TimeZoneWrapper getTimeZones(){
  Map<String,String> timeZones=new HashMap<String,String>();
  for (  String tzId : TimeZone.getAvailableIDs()) {
    if (!tzId.toLowerCase().contains("String_Node_Str")) {
      timeZones.put(tzId,TimeZone.getTimeZone(tzId).getDisplayName(true,TimeZone.LONG) + "String_Node_Str" + tzId+ "String_Node_Str");
    }
  }
  return new TimeZoneWrapper(timeZones,TimeZone.getDefault().getID());
}

Fixed version (ground truth):
/** 
 * @return a list of TimeZones ensuring that the server (default) timezone is at the top of the list (0th element)
 */
@GET @Path("String_Node_Str") @Produces({APPLICATION_JSON,APPLICATION_XML}) public TimeZoneWrapper getTimeZones(){
  Map<String,String> timeZones=new HashMap<String,String>();
  for (  String tzId : TimeZone.getAvailableIDs()) {
    if (!tzId.toLowerCase().contains("String_Node_Str")) {
      int offset=TimeZone.getTimeZone(tzId).getOffset(System.currentTimeMillis());
      String text=String.format("String_Node_Str",offset >= 0 ? "String_Node_Str" : "String_Node_Str",offset / 3600000,(offset / 60000) % 60);
      timeZones.put(tzId,TimeZone.getTimeZone(tzId).getDisplayName(true,TimeZone.LONG) + "String_Node_Str" + text+ "String_Node_Str");
    }
  }
  return new TimeZoneWrapper(timeZones,TimeZone.getDefault().getID());
}
Program: 47452
Project: 47452
Buggy source:
@Override public void onError(Request request,Throwable exception){
}

Fixed version (ground truth):
public void onError(Request request,Throwable exception){
}
Program: 47453
Project: 47453
Buggy source:
public void setSelectedPermissions(){
  int selectedIndex=rolesListBox.getSelectedIndex();
  if (selectedIndex >= 0) {
    String roleName=rolesListBox.getItemText(selectedIndex);
    List<String> logicalRoleAssignments=newRoleAssignments.get(roleName);
    if (logicalRoleAssignments == null) {
      logicalRoleAssignments=masterRoleMap.get(roleName);
    }
    for (    LogicalRoleInfo logicalRoleInfo : logicalRoles.values()) {
      logicalRoleInfo.checkBox.setValue((logicalRoleAssignments != null) && logicalRoleAssignments.contains(logicalRoleInfo.roleName));
    }
  }
}

Fixed version (ground truth):
public void setSelectedPermissions(){
  Timer t=new Timer(){
    public void run(){
      int selectedIndex=rolesListBox.getSelectedIndex();
      if (selectedIndex >= 0) {
        String roleName=rolesListBox.getItemText(selectedIndex);
        List<String> logicalRoleAssignments=newRoleAssignments.get(roleName);
        if (logicalRoleAssignments == null) {
          logicalRoleAssignments=masterRoleMap.get(roleName);
        }
        for (        LogicalRoleInfo logicalRoleInfo : logicalRoles.values()) {
          logicalRoleInfo.checkBox.setValue((logicalRoleAssignments != null) && logicalRoleAssignments.contains(logicalRoleInfo.roleName));
        }
      }
    }
  }
;
  t.scheduleRepeating(100);
}
Program: 47454
Project: 47454
Buggy source:
@Override public void onResponseReceived(Request request,Response response){
  if (response.getStatusCode() == 200) {
    masterRoleMap.putAll(newRoleAssignments);
    newRoleAssignments.clear();
  }
}

Fixed version (ground truth):
public void onResponseReceived(Request request,Response response){
  if (response.getStatusCode() == 200) {
    masterRoleMap.putAll(newRoleAssignments);
    newRoleAssignments.clear();
  }
}
Program: 47455
Project: 47455
Buggy source:
private void saveSecuritySettings(){
  JSONObject jsNewRoleAssignments=new JSONObject();
  JSONArray jsLogicalRoleAssignments=new JSONArray();
  int x=0;
  for (  Map.Entry<String,List<String>> roleAssignment : newRoleAssignments.entrySet()) {
    JSONArray jsLogicalRoles=new JSONArray();
    int y=0;
    for (    String logicalRoleName : roleAssignment.getValue()) {
      jsLogicalRoles.set(y++,new JSONString(logicalRoleName));
    }
    JSONObject jsRoleAssignment=new JSONObject();
    jsRoleAssignment.put("String_Node_Str",new JSONString(roleAssignment.getKey()));
    jsRoleAssignment.put("String_Node_Str",jsLogicalRoles);
    jsLogicalRoleAssignments.set(x++,jsRoleAssignment);
  }
  jsNewRoleAssignments.put("String_Node_Str",jsLogicalRoleAssignments);
  RequestBuilder saveSettingRequestBuilder=new RequestBuilder(RequestBuilder.PUT,GWT.getHostPageBaseURL() + "String_Node_Str");
  saveSettingRequestBuilder.setHeader("String_Node_Str","String_Node_Str");
  try {
    saveSettingRequestBuilder.sendRequest(jsNewRoleAssignments.toString(),new RequestCallback(){
      @Override public void onError(      Request request,      Throwable exception){
      }
      @Override public void onResponseReceived(      Request request,      Response response){
        if (response.getStatusCode() == 200) {
          masterRoleMap.putAll(newRoleAssignments);
          newRoleAssignments.clear();
        }
      }
    }
);
  }
 catch (  RequestException e) {
  }
}

Fixed version (ground truth):
private void saveSecuritySettings(){
  JSONObject jsNewRoleAssignments=new JSONObject();
  JSONArray jsLogicalRoleAssignments=new JSONArray();
  int x=0;
  for (  Map.Entry<String,List<String>> roleAssignment : newRoleAssignments.entrySet()) {
    JSONArray jsLogicalRoles=new JSONArray();
    int y=0;
    for (    String logicalRoleName : roleAssignment.getValue()) {
      jsLogicalRoles.set(y++,new JSONString(logicalRoleName));
    }
    JSONObject jsRoleAssignment=new JSONObject();
    jsRoleAssignment.put("String_Node_Str",new JSONString(roleAssignment.getKey()));
    jsRoleAssignment.put("String_Node_Str",jsLogicalRoles);
    jsLogicalRoleAssignments.set(x++,jsRoleAssignment);
  }
  jsNewRoleAssignments.put("String_Node_Str",jsLogicalRoleAssignments);
  RequestBuilder saveSettingRequestBuilder=new RequestBuilder(RequestBuilder.PUT,GWT.getHostPageBaseURL() + "String_Node_Str");
  saveSettingRequestBuilder.setHeader("String_Node_Str","String_Node_Str");
  try {
    saveSettingRequestBuilder.sendRequest(jsNewRoleAssignments.toString(),new RequestCallback(){
      public void onError(      Request request,      Throwable exception){
      }
      public void onResponseReceived(      Request request,      Response response){
        if (response.getStatusCode() == 200) {
          masterRoleMap.putAll(newRoleAssignments);
          newRoleAssignments.clear();
        }
      }
    }
);
  }
 catch (  RequestException e) {
  }
}
Program: 47456
Project: 47456
Buggy source:
public PermissionsPanel(ListBox rolesListBox){
  add(new Label(Messages.getString("String_Node_Str")));
  this.rolesListBox=rolesListBox;
  initializeLogicalRoleMappings();
}

Fixed version (ground truth):
public PermissionsPanel(ListBox rolesListBox){
  add(new Label(Messages.getString("String_Node_Str")));
  this.rolesListBox=rolesListBox;
}