auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > commit ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.lang.String id ) { return new com.google.gerrit.server.query.change.CommitPredicate ( schema , id ) ; }

Target:
private static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > commit ( java.lang.String id ) { return new com.google.gerrit.server.query.change.CommitPredicate ( id ) ; }
Source:
private com.google.gerrit.server.account.AuthResult auth ( final com.google.gerrit.reviewdb.Account account ) { return account != null ? new com.google.gerrit.server.account.AuthResult ( account.getId ( ) , false ) : null ; }

Target:
private com.google.gerrit.server.account.AuthResult auth ( final com.google.gerrit.reviewdb.Account account ) { if ( account != null ) { return new com.google.gerrit.server.account.AuthResult ( account.getId ( ) , null , false ) ; } return null ; }
Source:
public void testGcNotAllowed_Forbidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException { org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , new com.google.gerrit.acceptance.RestSession ( accounts.create ( "user" , "user@example.com" , "User" ) ) . post ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) . getStatusCode ( ) ) ; }

Target:
public void testGcNotAllowed_Forbidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException { org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) . post ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) . getStatusCode ( ) ) ; }
Source:
public int compare ( final com.google.gerrit.reviewdb.PatchSetApproval a , final com.google.gerrit.reviewdb.PatchSetApproval b ) { return a.getGranted ( ) . compareTo ( b.getGranted ( ) ) ; }

Target:
public int compare ( final com.google.gerrit.reviewdb.client.PatchSetApproval a , final com.google.gerrit.reviewdb.client.PatchSetApproval b ) { return a.getGranted ( ) . compareTo ( b.getGranted ( ) ) ; }
Source:
private void publishEvent ( com.google.gerrit.server.events.Event event ) { session.publish ( gson.toJson ( event ) ) ; }

Target:
private boolean publishEvent ( com.google.gerrit.server.events.Event event ) { return session.publish ( gson.toJson ( event ) ) ; }
Source:
public T get ( I input , com.google.gerrit.server.index.FieldDef.FillArgs args ) throws com.google.gwtorm.server.OrmException { try { return getter.get ( input , args ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public T get ( I input ) throws com.google.gwtorm.server.OrmException { try { return getter.get ( input ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; rescan ( ) ; scanner.start ( ) ; }

Target:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; rescan ( false ) ; scanner.start ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( changeId ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( project , changeId ) ) ; }
Source:
private com.cisco.gerrit.plugins.slack.config.ProjectConfig getConfig ( boolean publishOnPatchSetCreated , boolean ignoreUnchangedPatchSet ) throws java.lang.Exception { return getConfig ( "^WIP.*" , publishOnPatchSetCreated , ignoreUnchangedPatchSet ) ; }

Target:
private com.cisco.gerrit.plugins.slack.config.ProjectConfig getConfig ( boolean publishOnPatchSetCreated ) throws java.lang.Exception { return getConfig ( "^WIP.*" , publishOnPatchSetCreated , true , true , true ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { return webScanner.getEntry ( resourcePath ) ; }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) throws java.io.IOException { return webScanner.getEntry ( resourcePath ) ; }
Source:
public com.google.gerrit.server.IdentifiedUser create ( final com.google.gerrit.reviewdb.client.Account.Id id ) { return create ( ( ( java.net.SocketAddress ) ( null ) ) , id ) ; }

Target:
public com.google.gerrit.server.IdentifiedUser create ( com.google.gerrit.reviewdb.client.Account.Id id ) { return create ( ( ( java.net.SocketAddress ) ( null ) ) , id ) ; }
Source:
void syncScroll ( com.google.gerrit.client.diff.DisplaySide masterSide ) { scrollSynchronizer.syncScroll ( masterSide ) ; }

Target:
void syncScroll ( com.google.gerrit.client.diff.DisplaySide masterSide ) { if ( ( scrollSynchronizer ) != null ) { scrollSynchronizer.syncScroll ( masterSide ) ; } }
Source:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return input.getAccountId ( ) . equals ( rsrc.getUser ( ) . getAccountId ( ) ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; }
Source:
private javax.servlet.http.HttpServletRequest enrichAuthenticatedRequest ( javax.servlet.http.HttpServletRequest httpRequest , com.googlesource.gerrit.plugins.github.oauth.OAuthCookie authCookie ) { httpRequest = ( authCookie == null ) ? httpRequest : new com.googlesource.gerrit.plugins.github.oauth.AuthenticatedHttpRequest ( httpRequest , config.httpHeader , authCookie.user , config.httpDisplaynameHeader , authCookie.fullName , config.httpEmailHeader , authCookie.email ) ; return httpRequest ; }

Target:
private javax.servlet.http.HttpServletRequest enrichAuthenticatedRequest ( javax.servlet.http.HttpServletRequest httpRequest , com.googlesource.gerrit.plugins.github.oauth.OAuthCookie authCookie ) { httpRequest = ( authCookie == null ) ? httpRequest : new com.googlesource.gerrit.plugins.github.oauth.AuthenticatedHttpRequest ( httpRequest , config.httpHeader , authCookie.user ) ; return httpRequest ; }
Source:
public void setChange ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { this . changeId = changeId ; }

Target:
public void setChange ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) { this . project = project ; this . changeId = changeId ; }
Source:
private void save ( ) { try { com.googlesource.gerrit.plugins.secureconfig.SecureConfigStore.saveSecure ( sec ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( "Cannot save secure.config" , e ) ; } }

Target:
private void save ( ) { try { saveSecure ( sec ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( "Cannot save secure.config" , e ) ; } }
Source:
public void testWithoutSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; org.junit.Assert.assertEquals ( 0 , m.size ( ) ) ; }

Target:
public void testWithoutSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; }
Source:
private void deletePatchSet ( java.lang.String changeId , com.google.gerrit.reviewdb.client.PatchSet ps ) throws java.lang.Exception { gApi.changes ( ) . id ( changeId ) . revision ( ps.getId ( ) . get ( ) ) . delete ( ) ; }

Target:
private void deletePatchSet ( java.lang.String changeId , com.google.gerrit.reviewdb.client.PatchSet ps ) throws java.lang.Exception { deletePatchSet ( changeId , ps.getId ( ) . get ( ) ) ; }
Source:
public void release ( ) { }

Target:
public void close ( ) { }
Source:
protected void submit ( java.lang.String changeId ) throws java.lang.Exception { submit ( changeId , new com.google.gerrit.extensions.api.changes.SubmitInput ( ) , null , null ) ; }

Target:
protected void submit ( java.lang.String changeId ) throws java.lang.Exception { submit ( changeId , new com.google.gerrit.extensions.api.changes.SubmitInput ( ) , null , null , true ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( event.getValue ( ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { com.google.gerrit.client.Gerrit.display ( event.getValue ( ) ) ; }
Source:
public java.lang.String getShortName ( ) { final java.lang.String n = getName ( ) ; if ( n.startsWith ( "refs/heads/" ) ) { return n.substring ( "refs/heads/" . length ( ) ) ; } return n ; }

Target:
public java.lang.String getShortName ( ) { final java.lang.String n = get ( ) ; if ( n.startsWith ( "refs/heads/" ) ) { return n.substring ( "refs/heads/" . length ( ) ) ; } return n ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; blockRead ( project , "refs/*" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; blockRead ( "refs/*" ) ; }
Source:
public com.google.gerrit.client.reviewdb.PatchLineComment.Side getSide ( ) { return com.google.gerrit.client.reviewdb.PatchLineComment.Side.forCode ( side ) ; }

Target:
public short getSide ( ) { return side ; }
Source:
private boolean isEmpty ( ) { return ( deleteComments.isEmpty ( ) ) && ( upsertComments.isEmpty ( ) ) ; }

Target:
public boolean isEmpty ( ) { return ( deleteComments.isEmpty ( ) ) && ( upsertComments.isEmpty ( ) ) ; }
Source:
public com.google.gerrit.server.account.CapabilityControl getCapabilities ( ) { com.google.gerrit.server.account.CapabilityControl ctl = capabilities ; if ( ctl == null ) { ctl = capabilityControlFactory.create ( this ) ; capabilities = ctl ; } return ctl ; }

Target:
public com.google.gerrit.server.account.CapabilityControl getCapabilities ( ) { if ( ( capabilities ) == null ) { capabilities = capabilityControlFactory.create ( this ) ; } return capabilities ; }
Source:
public boolean apply ( com.google.gerrit.server.git.ReceiveCommits.CreateRequest input ) { return ( input.getChange ( ) ) != null ; }

Target:
public boolean apply ( com.google.gerrit.server.git.ReceiveCommits.CreateRequest input ) { return ( input.change ) != null ; }
Source:
private boolean error ( java.lang.String msg , java.lang.Throwable t ) { problem ( msg ) ; com.google.gerrit.server.change.ConsistencyChecker.log.warn ( ( "Error in consistency check of change " + ( change.getId ( ) ) ) , t ) ; return false ; }

Target:
private boolean error ( java.lang.String msg , java.lang.Throwable t ) { problem ( msg ) ; warn ( t ) ; return false ; }
Source:
private static void h ( final java.lang.StringBuffer r , final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { com.google.gerrit.client.data.GitwebLink.var ( r , "h" , branch.get ( ) ) ; }

Target:
private static void h ( final java.lang.StringBuilder r , final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { com.google.gerrit.client.data.GitwebLink.var ( r , "h" , branch.get ( ) ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotes newNotes ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { return notesFactory.create ( db , change ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes newNotes ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { return notesFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; }
Source:
private synchronized com.google.gitiles.Linkifier linkifier ( ) { if ( ( linkifier ) == null ) { com.google.common.base.Preconditions.checkState ( ( ( urls ) != null ) , "GitilesUrls not yet set" ) ; linkifier = new com.google.gitiles.Linkifier ( urls ) ; } return linkifier ; }

Target:
private synchronized com.google.gitiles.Linkifier linkifier ( ) { if ( ( linkifier ) == null ) { com.google.common.base.Preconditions.checkState ( ( ( urls ) != null ) , "GitilesUrls not yet set" ) ; linkifier = new com.google.gitiles.Linkifier ( urls , config ) ; } return linkifier ; }
Source:
public void nameEscaperDoesNotEscapeSlashes ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "foo/bar" , com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo/bar" ) ) ; }

Target:
public void nameEscaperDoesNotEscapeSlashes ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo/bar" ) ) . isEqualTo ( "foo/bar" ) ; }
Source:
private static void h ( final java.lang.StringBuffer r , final com.google.gerrit.client.reviewdb.PatchSet ps ) { com.google.gerrit.client.data.GitwebLink.var ( r , "h" , ps.getRevision ( ) ) ; }

Target:
private static void h ( final java.lang.StringBuilder r , final com.google.gerrit.client.reviewdb.PatchSet ps ) { com.google.gerrit.client.data.GitwebLink.var ( r , "h" , ps.getRevision ( ) ) ; }