auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > cache ( com.google.gerrit.extensions.common.ChangeInfo res ) { return com.google.gerrit.extensions.restapi.Response.ok ( res ) . caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 0 , java.util.concurrent.TimeUnit.SECONDS ) . setMustRevalidate ( ) ) ; }

Target:
static com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > cache ( com.google.gerrit.extensions.common.ChangeInfo res ) { return com.google.gerrit.extensions.restapi.Response.ok ( res ) . caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 0 , java.util.concurrent.TimeUnit.SECONDS ) . setMustRevalidate ( ) ) ; }
Source:
public RefUpdate.Result modifyFile ( com.google.gerrit.server.edit.ChangeEdit edit , java.lang.String file , com.google.gerrit.extensions.restapi.RawInput content ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { return modify ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY , edit , file , content ) ; }

Target:
public RefUpdate.Result modifyFile ( com.google.gerrit.server.edit.ChangeEdit edit , java.lang.String file , com.google.gerrit.extensions.restapi.RawInput content ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { return modify ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY , edit , file , null , content ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; com.google.gerrit.testutil.InMemoryModule.createInjector ( lifecycle ) . injectMembers ( this ) ; lifecycle.start ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; new com.google.gerrit.testutil.InMemoryModule ( ) . inject ( this ) ; lifecycle.start ( ) ; }
Source:
public static void deleteChange ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( id ) . delete ( cb ) ; }

Target:
public static void deleteChange ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . delete ( cb ) ; }
Source:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( SignInDialog.Mode.LINK_IDENTIY , new com.google.gerrit.client.rpc.GerritCallback < java.lang.Object > ( ) { public void onSuccess ( final java.lang.Object result ) { refresh ( ) ; } } ) ; d.center ( ) ; }

Target:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( SignInDialog.Mode.LINK_IDENTIY ) ; d.center ( ) ; }
Source:
java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.client.SubmittedTogetherOption > o ) throws com.google.gerrit.extensions.restapi.RestApiException ;

Target:
java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( ) throws com.google.gerrit.extensions.restapi.RestApiException ;
Source:
public void copyAllScoresIfNoChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result patchSet = readyPatchSetForNoChangeRebase ( ) ; codeReview.setCopyAllScoresIfNoChange ( true ) ; saveLabelConfig ( ) ; rebase ( patchSet ) ; assertApproval ( patchSet , 1 ) ; }

Target:
public void copyAllScoresIfNoChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result patchSet = readyPatchSetForNoChangeRebase ( ) ; rebase ( patchSet ) ; assertApproval ( patchSet , 1 ) ; }
Source:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; view.getEditor ( ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; }

Target:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; } }
Source:
public static java.lang.String refsDraftCommentsPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { return com.google.gerrit.reviewdb.client.RefNames.buildRefsPrefix ( com.google.gerrit.reviewdb.client.RefNames.REFS_DRAFT_COMMENTS , accountId.get ( ) ) . toString ( ) ; }

Target:
public static java.lang.String refsDraftCommentsPrefix ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { return com.google.gerrit.reviewdb.client.RefNames.buildRefsPrefix ( com.google.gerrit.reviewdb.client.RefNames.REFS_DRAFT_COMMENTS , changeId.get ( ) ) . toString ( ) ; }
Source:
public static com.google.gerrit.extensions.client.Side fromShort ( short s ) { switch ( s ) { case 0 : return com.google.gerrit.extensions.client.Side.PARENT ; case 1 : return com.google.gerrit.extensions.client.Side.REVISION ; } return null ; }

Target:
public static com.google.gerrit.extensions.client.Side fromShort ( short s ) { if ( s <= 0 ) { return com.google.gerrit.extensions.client.Side.PARENT ; } else if ( s == 1 ) { return com.google.gerrit.extensions.client.Side.REVISION ; } return null ; }
Source:
public final native com.google.gwt.core.client.JavaScriptObject has_use_signed_off_by ( ) ;

Target:
public final native boolean value ( ) ;
Source:
public com.google.gerrit.extensions.api.projects.Projects.ListRequest withAll ( ) { this . all = true ; return this ; }

Target:
public com.google.gerrit.extensions.api.projects.Projects.ListRequest withAll ( boolean all ) { this . all = all ; return this ; }
Source:
private static java.lang.String replace ( java.lang.String project , java.lang.String input ) { return input.replace ( "${project}" , project ) ; }

Target:
private static java.lang.String replace ( java.lang.String project , java.lang.String input ) { return input == null ? input : input.replace ( "${project}" , project ) ; }
Source:
private void grantDelete ( ) throws java.lang.Exception { allow ( Permission.DELETE , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; }

Target:
private void grantDelete ( ) throws java.lang.Exception { allow ( "refs/tags/*" , Permission.DELETE , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) ; }
Source:
protected void set ( java.lang.String newValue ) { uuid = newValue ; }

Target:
public void set ( java.lang.String newValue ) { uuid = newValue ; }
Source:
private static void runGerrit ( java.lang.String ... args ) throws java.lang.Exception { org.junit.Assert.assertEquals ( 0 , com.google.gerrit.launcher.GerritLauncher.mainImpl ( args ) ) ; }

Target:
private static void runGerrit ( java.lang.String ... args ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.launcher.GerritLauncher.mainImpl ( args ) ) . isEqualTo ( 0 ) ; }
Source:
void evictAfterRename ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) throws java.io.IOException ;

Target:
void evictAfterRename ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName ) throws java.io.IOException ;
Source:
void onBeginNegotiate ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.Project project , java.lang.String remoteHost , org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , int cntOffered ) throws com.google.gerrit.server.validators.ValidationException ;

Target:
default void onBeginNegotiate ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.Project project , java.lang.String remoteHost , org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , int cntOffered ) throws com.google.gerrit.server.validators.ValidationException { }
Source:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) { return com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner ) ; }

Target:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) { return com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; }
Source:
protected com.google.gerrit.server.notedb.ChangeNotes newNotes ( com.google.gerrit.reviewdb.client.Change c ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeNotes ( null , repoManager , com.google.gerrit.server.notedb.AbstractChangeNotesTest.MIGRATION , allUsers , c ) . load ( ) ; }

Target:
protected com.google.gerrit.server.notedb.ChangeNotes newNotes ( com.google.gerrit.reviewdb.client.Change c ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , com.google.gerrit.server.notedb.AbstractChangeNotesTest.MIGRATION , allUsers , c.getProject ( ) , c ) . load ( ) ; }
Source:
private static long round ( long n , long unit ) { long rounded = ( n + ( unit / 2 ) ) / unit ; return rounded ; }

Target:
private static long round ( long n , long unit ) { return ( n + ( unit / 2 ) ) / unit ; }
Source:
static boolean dryRun ( com.google.gerrit.server.git.strategy.SubmitDryRun.Arguments args , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( ! ( args.mergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }

Target:
static boolean dryRun ( com.google.gerrit.server.git.strategy.SubmitDryRun.Arguments args , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( ! ( args.mergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( args.mergeUtil.canMerge ( args.mergeSorter , repo , mergeTip , toMerge ) ) ; }
Source:
protected < R extends com.google.gerrit.extensions.restapi.RestResource > com.google.gerrit.extensions.restapi.RestApiModule.ModifyViewBinder < R > post ( com.google.inject.TypeLiteral < com.google.gerrit.extensions.restapi.RestView < R > > viewType ) { return new com.google.gerrit.extensions.restapi.RestApiModule.ModifyViewBinder < R > ( view ( viewType , com.google.gerrit.extensions.restapi.RestApiModule.POST , "/" ) ) ; }

Target:
protected < R extends com.google.gerrit.extensions.restapi.RestResource > com.google.gerrit.extensions.restapi.RestApiModule.ModifyViewBinder < R > post ( com.google.inject.TypeLiteral < com.google.gerrit.extensions.restapi.RestView < R > > viewType ) { return new com.google.gerrit.extensions.restapi.RestApiModule.ModifyViewBinder ( view ( viewType , com.google.gerrit.extensions.restapi.RestApiModule.POST , "/" ) ) ; }
Source:
private static java.lang.String toPatch ( java.lang.String type , com.google.gerrit.reviewdb.client.PatchSet.Id diffBase , com.google.gerrit.reviewdb.client.Patch.Key id ) { return com.google.gerrit.client.Dispatcher.toPatch ( type , diffBase , id.getParentKey ( ) , id.get ( ) ) ; }

Target:
public static java.lang.String toPatch ( java.lang.String type , com.google.gerrit.reviewdb.client.PatchSet.Id diffBase , com.google.gerrit.reviewdb.client.Patch.Key id ) { return com.google.gerrit.client.Dispatcher.toPatch ( type , diffBase , id.getParentKey ( ) , id.get ( ) , null , 0 ) ; }
Source:
private static void dispatchHistoryHooks ( java.lang.String token ) { if ( ( com.google.gerrit.client.Gerrit.signInAnchor ) != null ) { com.google.gerrit.client.Gerrit.signInAnchor.setHref ( com.google.gerrit.client.Gerrit.loginRedirect ( token ) ) ; } com.google.gerrit.client.api.ApiGlue.fireEvent ( "history" , token ) ; }

Target:
private static void dispatchHistoryHooks ( java.lang.String token ) { com.google.gerrit.client.api.ApiGlue.fireEvent ( "history" , token ) ; }
Source:
public void testNonIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a" ) ; assertSame ( in , rewrite ( in ) ) ; }

Target:
public void testNonIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a" ) ; org.junit.Assert.assertSame ( in , rewrite ( in ) ) ; }
Source:
public org.eclipse.jgit.lib.Repository getRepository ( ) throws java.io.IOException { initRepository ( ) ; return repo ; }

Target:
private org.eclipse.jgit.lib.Repository getRepository ( ) throws java.io.IOException { initRepository ( ) ; return repo ; }
Source:
void setLineNumberEmpty ( com.google.gerrit.client.diff.DisplaySide side , int cmLine ) { setLineNumber ( side , cmLine , "&nbsp;" , UnifiedTable.style.unifiedLineNumberEmpty ( ) ) ; }

Target:
void setLineNumberEmpty ( com.google.gerrit.client.diff.DisplaySide side , int cmLine ) { setLineNumber ( side , cmLine , null , UnifiedTable.style.unifiedLineNumberEmpty ( ) ) ; }
Source:
public static org.apache.lucene.index.Term idTerm ( int id ) { return com.google.gerrit.lucene.QueryBuilder.intTerm ( com.google.gerrit.lucene.QueryBuilder.ID_FIELD , id ) ; }

Target:
public static org.apache.lucene.index.Term idTerm ( com.google.gerrit.reviewdb.client.Change.Id id ) { return com.google.gerrit.lucene.QueryBuilder.intTerm ( com.google.gerrit.lucene.QueryBuilder.ID_FIELD , id.get ( ) ) ; }
Source:
private static java.lang.String formatLabelValue ( short value ) { if ( value > 0 ) { return "+" + value ; } else { return java.lang.Short.toString ( value ) ; } }

Target:
private java.lang.String formatLabelValue ( short value ) { if ( value > 0 ) { return "+" + value ; } else { return java.lang.Short.toString ( value ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; }
Source:
void onPreUpload ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.Project project , java.lang.String remoteHost , org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > haves ) throws com.google.gerrit.server.validators.ValidationException ;

Target:
default void onPreUpload ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.Project project , java.lang.String remoteHost , org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > haves ) throws com.google.gerrit.server.validators.ValidationException { }
Source:
public void login ( com.google.gerrit.server.account.AuthResult res , com.google.gerrit.server.account.AuthMethod meth , boolean rememberMe ) ;

Target:
public void login ( com.google.gerrit.server.account.AuthResult res , boolean rememberMe ) ;
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setCurrentPatchSet ( result.info ) ; change.setStatus ( Change.Status.MERGED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setCurrentPatchSet ( info ) ; change.setStatus ( Change.Status.MERGED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; }
Source:
private void removePushFromRefsTags ( ) throws java.lang.Exception { removePermission ( Permission.PUSH , project , "refs/tags/*" ) ; }

Target:
private void removePushFromRefsTags ( ) throws java.lang.Exception { removePermission ( project , "refs/tags/*" , Permission.PUSH ) ; }
Source:
public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; factory ( ChangeDraftUpdate.Factory.class ) ; bind ( com.google.gerrit.server.CurrentUser.class ) . toInstance ( user ) ; }

Target:
public void configure ( ) { bind ( com.google.gerrit.server.CurrentUser.class ) . toInstance ( user ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gitiles.RefServlet.RefJsonData > buildRefJson ( java.lang.String path ) throws java.lang.Exception { return buildJson ( path , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RefServlet.RefJsonData > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.Map < java.lang.String , com.google.gitiles.RefServlet.RefJsonData > buildRefJson ( java.lang.String path ) throws java.lang.Exception { return buildJson ( path , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RefServlet.RefJsonData > > ( ) { } ) ; }
Source:
public static void rebaseEdit ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "edit:rebase" ) . post ( in , cb ) ; }

Target:
public static void rebaseEdit ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "edit:rebase" ) . post ( in , cb ) ; }
Source:
public void onRpcComplete ( final com.google.gwtjsonrpc.client.event.RpcCompleteEvent event ) { if ( ( -- ( activeCalls ) ) == 0 ) { loading.setVisible ( false ) ; } }

Target:
public void onRpcComplete ( ) { if ( ( -- ( activeCalls ) ) == 0 ) { loading.setVisible ( false ) ; } }
Source:
public void setBranch ( final java.lang.String pattern ) { if ( ( pattern != null ) && ( ! ( pattern.isEmpty ( ) ) ) ) { branch = pattern ; } }

Target:
public void setBranch ( final java.lang.String pattern ) { branch = pattern ; }
Source:
boolean canSubmit ( boolean isChangeOwner ) { if ( RefNames.REFS_CONFIG.equals ( refName ) ) { return projectControl.isOwner ( ) ; } return canPerform ( Permission.SUBMIT , isChangeOwner ) ; }

Target:
boolean canSubmit ( boolean isChangeOwner ) { if ( RefNames.REFS_CONFIG.equals ( refName ) ) { return projectControl.isOwner ( ) ; } return canPerform ( Permission.SUBMIT , isChangeOwner , false ) ; }