auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testOnAllNodesReplicated ( ) throws com.google.gwtorm.server.OrmException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent expectedDoneEvent = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( "someProject" , "refs/heads/master" , 5 ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicationDoneEventEquals.eqEvent ( expectedDoneEvent ) , org.easymock.EasyMock.anyObject ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToAllNodes ( "someProject" , "refs/heads/master" , 5 ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }

Target:
public void testOnAllNodesReplicated ( ) throws com.google.gwtorm.server.OrmException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent expectedDoneEvent = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( "someProject" , "refs/heads/master" , 5 ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicationDoneEventEquals.eqEvent ( expectedDoneEvent ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToAllNodes ( "someProject" , "refs/heads/master" , 5 ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }
Source:
private void testPushForNonExistingBranch ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { selectProtocol ( p ) ; java.lang.String branchName = "non-existing" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/" + branchName ) ) ; r.assertErrorStatus ( ( ( "branch " + branchName ) + " not found" ) ) ; }

Target:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String branchName = "non-existing" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/" + branchName ) ) ; r.assertErrorStatus ( ( ( "branch " + branchName ) + " not found" ) ) ; }
Source:
public static boolean canRead ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.data.ProjectCache.Entry e ) { if ( e == null ) { return false ; } final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > myGroups = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( who ) ; return com.google.gerrit.client.rpc.BaseServiceImplementation.canPerform ( myGroups , e , ApprovalCategory.READ , ( ( short ) ( 1 ) ) , true ) ; }

Target:
public static boolean canRead ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.data.ProjectCache.Entry e ) { return com.google.gerrit.client.rpc.BaseServiceImplementation.canPerform ( who , e , ApprovalCategory.READ , ( ( short ) ( 1 ) ) ) ; }
Source:
protected void onUnload ( ) { if ( ( updateAvailable ) != null ) { updateAvailable.hide ( true ) ; updateAvailable = null ; } if ( ( updateCheck ) != null ) { updateCheck.cancel ( ) ; updateCheck = null ; } for ( com.google.gwt.event.shared.HandlerRegistration h : handlers ) { h.removeHandler ( ) ; } handlers.clear ( ) ; super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { if ( ( updateCheck ) != null ) { updateCheck.cancel ( ) ; updateCheck = null ; } for ( com.google.gwt.event.shared.HandlerRegistration h : handlers ) { h.removeHandler ( ) ; } handlers.clear ( ) ; super . onUnload ( ) ; }
Source:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; suggestBox.setText ( com.google.gerrit.client.FormatUtil.nameEmail ( currentAssignee ) ) ; suggestBox.selectAll ( ) ; }

Target:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; if ( ( currentAssignee ) != null ) { suggestBox.setText ( com.google.gerrit.client.FormatUtil.nameEmail ( currentAssignee ) ) ; suggestBox.selectAll ( ) ; } }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; related.registerKeys ( ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; }
Source:
private void applyReview ( final com.google.gerrit.server.project.ChangeControl ctl , final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , final com.google.gerrit.server.change.PostReview.Input review ) throws java.lang.Exception { if ( ! ( review.labels.isEmpty ( ) ) ) { reviewProvider.get ( ) . apply ( new com.google.gerrit.server.change.RevisionResource ( new com.google.gerrit.server.change.ChangeResource ( ctl ) , db.patchSets ( ) . get ( patchSetId ) ) , review ) ; } }

Target:
private void applyReview ( final com.google.gerrit.server.project.ChangeControl ctl , final com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.server.change.PostReview.Input review ) throws java.lang.Exception { if ( ! ( review.labels.isEmpty ( ) ) ) { reviewProvider.get ( ) . apply ( new com.google.gerrit.server.change.RevisionResource ( new com.google.gerrit.server.change.ChangeResource ( ctl ) , patchSet ) , review ) ; } }
Source:
public < T > void put ( com.google.gerrit.server.CurrentUser.PropertyKey < T > key , @ com.google.gerrit.common.Nullable T value ) { com.google.common.cache.Cache < com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > , java.lang.Object > p = properties ( ( value != null ) ) ; if ( ( p != null ) || ( value != null ) ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > k = ( ( com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > ) ( key ) ) ; if ( value != null ) { p.put ( k , value ) ; } else { p.invalidate ( k ) ; } } }

Target:
public < T > void put ( com.google.gerrit.server.CurrentUser.PropertyKey < T > key , @ com.google.gerrit.common.Nullable T value ) { com.google.common.cache.Cache < com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > , java.lang.Object > p = properties ( ( value != null ) ) ; if ( p != null ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > k = ( ( com.google.gerrit.server.CurrentUser.PropertyKey < java.lang.Object > ) ( key ) ) ; if ( value != null ) { p.put ( k , value ) ; } else { p.invalidate ( k ) ; } } }
Source:
private boolean stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } return ! ( unload.isEmpty ( ) ) ; }

Target:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }
Source:
private static com.google.gson.Gson newGson ( com.google.common.collect.Multimap < java.lang.String , java.lang.String > config , @ javax.annotation.Nullable javax.servlet.http.HttpServletRequest req ) { com.google.gson.GsonBuilder gb = OutputFormat.JSON_COMPACT.newGsonBuilder ( ) . setFieldNamingPolicy ( com.google.gerrit.httpd.restapi.RestApiServlet.NAMING ) ; com.google.gerrit.httpd.restapi.RestApiServlet.enablePrettyPrint ( gb , config , req ) ; com.google.gerrit.httpd.restapi.RestApiServlet.enablePartialGetFields ( gb , config ) ; return gb.create ( ) ; }

Target:
private static com.google.gson.Gson newGson ( com.google.common.collect.Multimap < java.lang.String , java.lang.String > config , @ javax.annotation.Nullable javax.servlet.http.HttpServletRequest req ) { com.google.gson.GsonBuilder gb = OutputFormat.JSON_COMPACT.newGsonBuilder ( ) ; com.google.gerrit.httpd.restapi.RestApiServlet.enablePrettyPrint ( gb , config , req ) ; com.google.gerrit.httpd.restapi.RestApiServlet.enablePartialGetFields ( gb , config ) ; return gb.create ( ) ; }
Source:
private void addMergedMessage ( com.google.gerrit.reviewdb.client.PatchSetApproval submitter , com.google.gerrit.reviewdb.client.ChangeMessage msg ) { if ( msg != null ) { if ( ( submitter != null ) && ( ( msg.getAuthor ( ) ) == null ) ) { msg.setAuthor ( submitter.getAccountId ( ) ) ; } try { db.changeMessages ( ) . insert ( java.util.Collections.singleton ( msg ) ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.git.MergeOp.log.warn ( "Cannot store message on change" , err ) ; } } }

Target:
private void addMergedMessage ( com.google.gerrit.reviewdb.client.PatchSetApproval submitter , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { if ( msg != null ) { if ( ( submitter != null ) && ( ( msg.getAuthor ( ) ) == null ) ) { msg.setAuthor ( submitter.getAccountId ( ) ) ; } db.changeMessages ( ) . insert ( java.util.Collections.singleton ( msg ) ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try { com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { return java.util.Collections.unmodifiableList ( db.accountGroups ( ) . all ( ) . toList ( ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return java.util.Collections.unmodifiableList ( db.accountGroups ( ) . all ( ) . toList ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( java.io.IOException | com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { return api.create ( name ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } }
Source:
protected void setName ( final java.lang.String name ) { if ( Util.C.defaultAccountGroupName ( ) . equals ( name ) ) { nameTxt.addStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } else { nameTxt.removeStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } nameTxt.setText ( name ) ; }

Target:
protected void setName ( final java.lang.String name ) { nameTxt.setText ( name ) ; }
Source:
private void unlink ( com.google.gerrit.reviewdb.client.Account.Id id , final java.lang.String mailAddress ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { manager.unlink ( id , com.google.gerrit.server.account.AuthRequest.forEmail ( mailAddress ) ) ; } catch ( com.google.gerrit.server.account.AccountException ex ) { throw die ( ex.getMessage ( ) ) ; } }

Target:
private void unlink ( com.google.gerrit.reviewdb.client.Account.Id id , final java.lang.String mailAddress ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { manager.unlink ( id , com.google.gerrit.server.account.AuthRequest.forEmail ( mailAddress ) ) ; } catch ( com.google.gerrit.server.account.AccountException ex ) { throw die ( ex.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException ex ) { throw die ( ex.getMessage ( ) ) ; } }
Source:
private void closeRepository ( ) { if ( ( inserter ) != null ) { inserter.close ( ) ; } if ( ( rw ) != null ) { rw.close ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } }

Target:
private void closeRepository ( ) { if ( ( inserter ) != null ) { inserter.close ( ) ; inserter = null ; } if ( ( rw ) != null ) { rw.close ( ) ; rw = null ; } if ( ( repo ) != null ) { repo.close ( ) ; repo = null ; } }
Source:
public void testUSER_NoPreferredEmailUser ( ) { setFrom ( "USER" ) ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( "A U. Thor" , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( ident.getName ( ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testUSER_NoPreferredEmailUser ( ) { setFrom ( "USER" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( name , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void testDuplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR status:draft) bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testDuplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR status:draft) bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }
Source:
public void setValue ( final int pComplete ) { assert ( 0 <= pComplete ) && ( pComplete <= 100 ) ; value = pComplete ; bar.setWidth ( ( ( "" + ( 2 * pComplete ) ) + "px" ) ) ; msg.setText ( ( ( ( callerText ) + pComplete ) + "%" ) ) ; }

Target:
public void setValue ( final int pComplete ) { assert ( 0 <= pComplete ) && ( pComplete <= 100 ) ; value = pComplete ; bar.setWidth ( ( ( 2 * pComplete ) + "px" ) ) ; msg.setText ( ( ( ( callerText ) + pComplete ) + "%" ) ) ; }
Source:
private java.util.List < org.eclipse.jgit.dircache.DirCacheEditor.PathEdit > getPathEdits ( org.eclipse.jgit.lib.Repository repository ) throws java.io.IOException { java.util.List < org.eclipse.jgit.dircache.DirCacheEditor.PathEdit > pathEdits = new java.util.LinkedList < > ( ) ; for ( com.google.gerrit.server.edit.tree.TreeModification treeModification : treeModifications ) { pathEdits.addAll ( treeModification.getPathEdits ( repository , baseCommit ) ) ; } return pathEdits ; }

Target:
private java.util.List < org.eclipse.jgit.dircache.DirCacheEditor.PathEdit > getPathEdits ( org.eclipse.jgit.lib.Repository repository ) throws java.io.IOException { java.util.List < org.eclipse.jgit.dircache.DirCacheEditor.PathEdit > pathEdits = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.edit.tree.TreeModification treeModification : treeModifications ) { pathEdits.addAll ( treeModification.getPathEdits ( repository , baseCommit ) ) ; } return pathEdits ; }
Source:
private java.lang.String replaceInUrl ( java.lang.String placeholder , java.lang.String url , java.lang.String replacement ) { if ( ( url == null ) || ( ! ( url.contains ( placeholder ) ) ) ) { return url ; } return url.replace ( placeholder , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }

Target:
private java.lang.String replaceInUrl ( java.lang.String placeholder , java.lang.String url , java.lang.String replacement ) { if ( ( ( url == null ) || ( replacement == null ) ) || ( ! ( url.contains ( placeholder ) ) ) ) { return url ; } return url.replace ( placeholder , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }
Source:
public void testPreformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }
Source:
public void testHeadRefReplicated ( ) throws com.google.gwtorm.server.OrmException , java.net.URISyntaxException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicatedEvent expectedEvent = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( "someProject" , "refs/heads/master" , "someHost" , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicatedEventEquals.eqEvent ( expectedEvent ) , org.easymock.EasyMock.anyObject ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToOneNode ( "someProject" , "refs/heads/master" , new org.eclipse.jgit.transport.URIish ( "git://someHost/someProject.git" ) , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }

Target:
public void testHeadRefReplicated ( ) throws com.google.gwtorm.server.OrmException , java.net.URISyntaxException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicatedEvent expectedEvent = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( "someProject" , "refs/heads/master" , "someHost" , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicatedEventEquals.eqEvent ( expectedEvent ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToOneNode ( "someProject" , "refs/heads/master" , new org.eclipse.jgit.transport.URIish ( "git://someHost/someProject.git" ) , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }
Source:
private boolean equals ( com.google.gerrit.reviewdb.client.PatchSet p , java.lang.String id ) { boolean exact = ( getField ( ) ) == ( com.google.gerrit.server.index.change.ChangeField.EXACT_COMMIT ) ; java.lang.String rev = ( ( p.getRevision ( ) ) != null ) ? p.getRevision ( ) . get ( ) : null ; return ( exact && ( id.equals ( rev ) ) ) || ( ( ( ! exact ) && ( rev != null ) ) && ( rev.startsWith ( id ) ) ) ; }

Target:
protected boolean equals ( com.google.gerrit.reviewdb.client.PatchSet p , java.lang.String id ) { boolean exact = ( getField ( ) ) == ( com.google.gerrit.server.index.change.ChangeField.EXACT_COMMIT ) ; java.lang.String rev = ( ( p.getRevision ( ) ) != null ) ? p.getRevision ( ) . get ( ) : null ; return ( exact && ( id.equals ( rev ) ) ) || ( ( ( ! exact ) && ( rev != null ) ) && ( rev.startsWith ( id ) ) ) ; }
Source:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.extensions.common.ProjectInfo > projectInfoList = com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) ; org.junit.Assert.assertTrue ( ( ( projectInfoList.size ( ) ) == 1 ) ) ; }

Target:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.extensions.common.ProjectInfo > projectInfoList = com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) ; org.junit.Assert.assertTrue ( ( ( projectInfoList.size ( ) ) == 2 ) ) ; }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = com.google.gwt.http.client.URL.decode ( screen.getToken ( 4 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 4 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }
Source:
private java.util.List < java.lang.String > validate ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit c , boolean verbose , com.google.gerrit.server.config.PluginConfig cfg ) throws java.lang.Exception { com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.MockedEmails myEmails = new com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.MockedEmails ( ) ; com.googlesource.gerrit.plugins.findowners.OwnersValidator validator = new com.googlesource.gerrit.plugins.findowners.OwnersValidator ( null , null , null , myEmails ) ; java.lang.String ownersFileName = com.googlesource.gerrit.plugins.findowners.OwnersValidator.getOwnersFileName ( cfg ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , c , rw , ownersFileName , verbose ) ; return com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.transformMessages ( m ) ; }

Target:
private java.util.List < java.lang.String > validate ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit c , boolean verbose , com.google.gerrit.server.config.PluginConfig cfg ) throws java.lang.Exception { com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.MockedEmails myEmails = new com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.MockedEmails ( ) ; com.googlesource.gerrit.plugins.findowners.OwnersValidator validator = new com.googlesource.gerrit.plugins.findowners.OwnersValidator ( null , null , null , myEmails ) ; java.lang.String ownersFileName = com.googlesource.gerrit.plugins.findowners.OwnersValidator.getOwnersFileName ( cfg ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( c , rw , ownersFileName , verbose ) ; return com.googlesource.gerrit.plugins.findowners.OwnersValidatorTest.transformMessages ( m ) ; }
Source:
public void close ( ) throws java.io.IOException { try { java.io.Reader reader = getReader ( ) ; if ( reader != null ) { while ( ( reader.read ( ) ) != ( - 1 ) ) ; } } finally { response.close ( ) ; } }

Target:
public void close ( ) throws java.io.IOException { try { java.io.Reader reader = getReader ( ) ; if ( reader != null ) { while ( ( reader.read ( ) ) != ( - 1 ) ) { } } } finally { response.close ( ) ; } }
Source:
public void messagesNotReturnedByDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; postMessage ( changeId , "Some nits need to be fixed." ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChange ( ( "p~master~" + changeId ) , java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ) ; org.junit.Assert.assertNull ( c.messages ) ; }

Target:
public void messagesNotReturnedByDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; postMessage ( changeId , "Some nits need to be fixed." ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChange ( ( "p~master~" + changeId ) ) ; org.junit.Assert.assertNull ( c.messages ) ; }
Source:
public void testUnsupportedIndexOperator ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:merged file:a" ) ; assertEquals ( query ( in ) , rewrite ( in ) ) ; indexes.setSearchIndex ( new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V1 ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertTrue ( ( out instanceof com.google.gerrit.server.query.AndPredicate ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testUnsupportedIndexOperator ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:merged file:a" ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite ( in ) ) ; indexes.setSearchIndex ( new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V1 ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertTrue ( ( out instanceof com.google.gerrit.server.query.AndPredicate ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }
Source:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.projects.ProjectMap > ( this , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result , subname ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ) ; }

Target:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper ( this , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result , subname ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ) ; }
Source:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cache.start ( ) ; } } ) ; cleanup.schedule ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cache.prune ( cleanup ) ; } } , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }

Target:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( cache :: start ) ; cleanup.schedule ( ( ) -> cache.prune ( cleanup ) , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }
Source:
private static boolean isUnreasonableName ( java.lang.String name ) { if ( ( name.charAt ( ( ( name.length ( ) ) - 1 ) ) ) == '/' ) return true ; if ( ( name.indexOf ( '\\' ) ) >= 0 ) return true ; if ( name.startsWith ( "../" ) ) return true ; if ( name.contains ( "/../" ) ) return true ; if ( name.contains ( "/./" ) ) return true ; if ( name.contains ( "//" ) ) return true ; return false ; }

Target:
private static boolean isUnreasonableName ( java.lang.String name ) { if ( ( name.length ( ) ) < 1 ) return true ; if ( ( name.indexOf ( '\\' ) ) >= 0 ) return true ; if ( name.startsWith ( "../" ) ) return true ; if ( name.contains ( "/../" ) ) return true ; if ( name.contains ( "/./" ) ) return true ; if ( name.contains ( "//" ) ) return true ; return false ; }
Source:
protected void tearDown ( ) { if ( ( executor ) != null ) { executor.close ( ) ; } executor = null ; if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }

Target:
public void tearDown ( ) { if ( ( executor ) != null ) { executor.close ( ) ; } executor = null ; if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? extends java.util.Set < java.lang.String > > apply ( com.google.gerrit.server.change.ChangeResource req ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = control.getNotes ( ) . load ( ) ; java.util.Set < java.lang.String > hashtags = notes.getHashtags ( ) ; if ( hashtags == null ) { hashtags = java.util.Collections.emptySet ( ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( new java.util.TreeSet < java.lang.String > ( hashtags ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? extends java.util.Set < java.lang.String > > apply ( com.google.gerrit.server.change.ChangeResource req ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = control.getNotes ( ) . load ( ) ; java.util.Set < java.lang.String > hashtags = notes.getHashtags ( ) ; if ( hashtags == null ) { hashtags = java.util.Collections.emptySet ( ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( hashtags ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; project1 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project1.get ( ) ) ; project2 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project2.get ( ) ) ; sshSession.close ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { project1 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project1.get ( ) ) ; project2 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project2.get ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.GerritApi.class ) . to ( com.google.gerrit.server.api.GerritApiImpl.class ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.GerritApi.class ) . to ( com.google.gerrit.server.api.GerritApiImpl.class ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; }
Source:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; com.google.gerrit.extensions.api.changes.ChangeApi cApi = gApi.changes ( ) . id ( r.getChangeId ( ) ) ; cApi.addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , com.google.gerrit.acceptance.api.change.ChangeIT.getReviewers ( cApi.get ( ) ) ) ; }

Target:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , getReviewers ( r.getChangeId ( ) ) ) ; }
Source:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return cache.get ( key , new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , repo ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Repository repo , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return cache.get ( key , new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , repo , rw ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.bc.BcPGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
public void setup ( ) { user = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.IdentifiedUser.class ) ; org.easymock.EasyMock.replay ( user ) ; backends = new com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.server.account.GroupBackend > ( ) ; backends.add ( new com.google.gerrit.server.group.SystemGroupBackend ( ) ) ; backend = new com.google.gerrit.server.account.UniversalGroupBackend ( backends ) ; }

Target:
public void setup ( ) { user = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.IdentifiedUser.class ) ; org.easymock.EasyMock.replay ( user ) ; backends = new com.google.gerrit.extensions.registration.DynamicSet ( ) ; backends.add ( new com.google.gerrit.server.group.SystemGroupBackend ( ) ) ; backend = new com.google.gerrit.server.account.UniversalGroupBackend ( backends ) ; }
Source:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( java.lang.String.format ( "Cancelling replication event %s" , r ) ) ; } cnt = pool.shutdownNow ( ) . size ( ) ; pool.unregisterWorkQueue ( ) ; pool = null ; } return cnt ; }

Target:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( java.lang.String.format ( "Cancelling replication event %s" , r ) ) ; } cnt = pool.shutdownNow ( ) . size ( ) ; pool = null ; } return cnt ; }
Source:
private int adjustCommitMessageLine ( int line ) { int offset = 6 ; if ( diff.textB ( ) . startsWith ( "Merge" ) ) { offset += 1 ; } if ( line <= offset ) { return 1 ; } else { return line - offset ; } }

Target:
private int adjustCommitMessageLine ( int line ) { int offset = 6 ; if ( diff.textB ( ) . startsWith ( "Merge" ) ) { offset += 1 ; } if ( line <= offset ) { return 1 ; } return line - offset ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.httpd.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.httpd.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.project.ProjectModule ( ) ) ; }
Source:
public void testToString ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "bob" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate c = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "charlie" ) ; assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.server.query.Predicate.or ( a , b ) . toString ( ) ) ; assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.server.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }

Target:
public void testToString ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "bob" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate c = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "charlie" ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.server.query.Predicate.or ( a , b ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.server.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic , when ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.TopicEdited.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic , java.sql.Timestamp when ) { com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic , when ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.TopicEdited.log , e ) ; } } }
Source:
void invalidateAll ( ) { com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c = null ; try { c = acquire ( ) ; java.sql.Statement s = c.conn.createStatement ( ) ; try { s.executeUpdate ( "DELETE FROM data" ) ; } finally { s.close ( ) ; } bloomFilter = newBloomFilter ( ) ; } catch ( java.sql.SQLException e ) { com.google.gerrit.server.cache.h2.H2CacheImpl.log.warn ( ( "Cannot invalidate cache " + ( url ) ) , e ) ; c = close ( c ) ; } finally { release ( c ) ; } }

Target:
void invalidateAll ( ) { com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c = null ; try { c = acquire ( ) ; try ( java.sql.Statement s = c.conn.createStatement ( ) ) { s.executeUpdate ( "DELETE FROM data" ) ; } bloomFilter = newBloomFilter ( ) ; } catch ( java.sql.SQLException e ) { com.google.gerrit.server.cache.h2.H2CacheImpl.log.warn ( ( "Cannot invalidate cache " + ( url ) ) , e ) ; c = close ( c ) ; } finally { release ( c ) ; } }
Source:
public com.google.gerrit.server.query.Predicate < T > copy ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.server.query.VariablePredicate < T > ( getName ( ) , children.iterator ( ) . next ( ) ) ; }

Target:
public com.google.gerrit.server.query.Predicate < T > copy ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.server.query.VariablePredicate ( getName ( ) , children.iterator ( ) . next ( ) ) ; }