auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } } }

Target:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } } }
Source:
private void printCommits ( java.util.List < java.lang.String > commits , java.lang.String message ) { if ( org.apache.commons.collections.CollectionUtils.isNotEmpty ( commits ) ) { stdout.print ( ( message + ":\n" ) ) ; stdout.print ( com.google.common.base.Joiner.on ( ",\n" ) . join ( commits ) ) ; stdout.print ( "\n\n" ) ; } }

Target:
private void printCommits ( java.util.List < java.lang.String > commits , java.lang.String message ) { if ( ( commits != null ) && ( ! ( commits.isEmpty ( ) ) ) ) { stdout.print ( ( message + ":\n" ) ) ; stdout.print ( com.google.common.base.Joiner.on ( ",\n" ) . join ( commits ) ) ; stdout.print ( "\n\n" ) ; } }
Source:
public void shouldNotCallRemoteWhenEventIsForwarded ( ) throws java.lang.Exception { org.easymock.EasyMock.reset ( poolMock ) ; replayAll ( ) ; com.ericsson.gerrit.plugins.syncindex.Context.setForwardedEvent ( true ) ; indexEventHandler.onChangeIndexed ( cd ) ; indexEventHandler.onChangeDeleted ( id ) ; com.ericsson.gerrit.plugins.syncindex.Context.unsetForwardedEvent ( ) ; verifyAll ( ) ; }

Target:
public void shouldNotCallRemoteWhenEventIsForwarded ( ) throws java.lang.Exception { org.easymock.EasyMock.reset ( poolMock ) ; replayAll ( ) ; com.ericsson.gerrit.plugins.syncindex.Context.setForwardedEvent ( true ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; indexEventHandler.onChangeDeleted ( id.get ( ) ) ; com.ericsson.gerrit.plugins.syncindex.Context.unsetForwardedEvent ( ) ; verifyAll ( ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > getIncludedGroups ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > groups = com.google.common.collect.Maps.newHashMap ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupById g : db.accountGroupById ( ) . byGroup ( groupId ) ) { groups.put ( g.getIncludeUUID ( ) , g ) ; } return groups ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > getIncludedGroups ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > groups = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById g : db.get ( ) . accountGroupById ( ) . byGroup ( groupId ) ) { groups.put ( g.getIncludeUUID ( ) , g ) ; } return groups ; }
Source:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , rw , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }

Target:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , repo , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , other ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountGroupMember > getMembers ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountGroupMember > members = com.google.common.collect.Maps.newHashMap ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupMember m : db.accountGroupMembers ( ) . byGroup ( groupId ) ) { members.put ( m.getAccountId ( ) , m ) ; } return members ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountGroupMember > getMembers ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountGroupMember > members = com.google.common.collect.Maps.newHashMap ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupMember m : db.get ( ) . accountGroupMembers ( ) . byGroup ( groupId ) ) { members.put ( m.getAccountId ( ) , m ) ; } return members ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > toAccountInfoList ( java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.common.AccountInfo > result = new java.util.LinkedList < > ( ) ; com.google.gerrit.server.account.AccountLoader loader = infoFactory.create ( true ) ; for ( com.google.gerrit.reviewdb.client.Account.Id accId : accountIds ) { result.add ( loader.get ( accId ) ) ; } loader.fill ( ) ; return result ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > toAccountInfoList ( java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.common.AccountInfo > result = new java.util.ArrayList < > ( ) ; com.google.gerrit.server.account.AccountLoader loader = infoFactory.create ( true ) ; for ( com.google.gerrit.reviewdb.client.Account.Id accId : accountIds ) { result.add ( loader.get ( accId ) ) ; } loader.fill ( ) ; return result ; }
Source:
protected com.google.gitiles.GitilesAccess getAccess ( javax.servlet.http.HttpServletRequest req ) { com.google.gitiles.GitilesAccess access = ( ( com.google.gitiles.GitilesAccess ) ( req.getAttribute ( com.google.gitiles.BaseServlet.ACCESS_ATTRIBUTE ) ) ) ; if ( access == null ) { access = accessFactory.forRequest ( req ) ; req.setAttribute ( com.google.gitiles.BaseServlet.ACCESS_ATTRIBUTE , access ) ; } return access ; }

Target:
protected com.google.gitiles.GitilesAccess getAccess ( javax.servlet.http.HttpServletRequest req ) { return com.google.gitiles.GitilesAccess.getAccess ( req , accessFactory ) ; }
Source:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; if ( ! ( env.execute ( Prolog.BUILTIN , "call" , head ) ) ) { fail ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) ; } }

Target:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; if ( ! ( env.execute ( Prolog.BUILTIN , "call" , head ) ) ) { org.junit.Assert.fail ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) ; } }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public Change.Id getId ( ) { return notes.getChangeId ( ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > currentApprovals ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else if ( ( allApprovals ) != null ) { return allApprovals.get ( c.currentPatchSetId ( ) ) ; } else { currentApprovals = com.google.common.collect.ImmutableList.copyOf ( approvalsUtil.byPatchSet ( db , changeControl ( ) , c.currentPatchSetId ( ) ) ) ; } } return currentApprovals ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > currentApprovals ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else { currentApprovals = com.google.common.collect.ImmutableList.copyOf ( approvalsUtil.byPatchSet ( db , changeControl ( ) , c.currentPatchSetId ( ) ) ) ; } } return currentApprovals ; }
Source:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 'a' ) ) ; assertSame ( b , b.append ( 'b' ) ) ; assertEquals ( "ab" , b.asString ( ) ) ; }

Target:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 'a' ) ) ; org.junit.Assert.assertSame ( b , b.append ( 'b' ) ) ; org.junit.Assert.assertEquals ( "ab" , b.asString ( ) ) ; }
Source:
private static boolean valid ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( ( state.getChange ( ) . getStatus ( ) ) != ( Change.Status.NEW ) ) { return false ; } for ( final com.google.gerrit.client.data.ApprovalType t : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { return false ; } } return true ; }

Target:
private static boolean valid ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( ( state.getChange ( ) . getStatus ( ) ) != ( Change.Status.NEW ) ) { return false ; } for ( final com.google.gerrit.client.data.ApprovalType t : state.getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { return false ; } } return true ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.util.List < java.lang.Void > > apply ( java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < java.lang.Void > > result = com.google.common.collect.Lists.newArrayListWithCapacity ( changes.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change c : changes ) { result.add ( executor.submit ( new com.google.gerrit.server.index.ReindexAfterUpdate.Index ( event , c.getId ( ) ) ) ) ; } return com.google.common.util.concurrent.Futures.allAsList ( result ) ; }

Target:
public void onSuccess ( java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) { for ( com.google.gerrit.reviewdb.client.Change c : changes ) { executor.submit ( new com.google.gerrit.server.index.ReindexAfterUpdate.Index ( event , c.getId ( ) ) ) ; } }
Source:
public com.google.gerrit.server.account.AccountSshKey addKey ( java.lang.String pub ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; int seq = ( keys.isEmpty ( ) ) ? 1 : ( keys.size ( ) ) + 1 ; com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( accountId , seq ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.VersionedAuthorizedKeys.SimpleSshKeyCreator ( ) . create ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return key ; }

Target:
public com.google.gerrit.server.account.AccountSshKey addKey ( java.lang.String pub ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; int seq = ( keys.isEmpty ( ) ) ? 1 : ( keys.size ( ) ) + 1 ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.VersionedAuthorizedKeys.SimpleSshKeyCreator ( ) . create ( accountId , seq , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return key ; }
Source:
public void createBranch_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; }

Target:
public void createBranch_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }
Source:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { ensureAuthenticatedAndPermitted ( changeControl ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( changeControl ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , changeControl.getId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( changeControl ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEditReference ( repository , changeControl , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { ensureAuthenticatedAndPermitted ( changeControl ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( changeControl ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , changeControl.getId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( changeControl ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEdit ( repository , changeControl , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.notes , n.patchsetId ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.patchsetId ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.notes ( ) , n.patchsetId ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.patchsetId ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
public void isoWithUtc ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( com.google.common.base.Optional.of ( java.util.TimeZone.getTimeZone ( "UTC" ) ) , Format.ISO ) ; org.junit.Assert.assertEquals ( "2006-01-02 22:04:05" , df.format ( ident ) ) ; }

Target:
public void isoWithUtc ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( com.google.common.base.Optional.of ( java.util.TimeZone.getTimeZone ( "UTC" ) ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 22:04:05" ) ; }
Source:
private byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encode ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }

Target:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encode ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }
Source:
public java.lang.Boolean load ( java.lang.String groupDn ) throws java.lang.Exception { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { javax.naming.Name compositeGroupName = new javax.naming.CompositeName ( ) . add ( groupDn ) ; try { ctx.getAttributes ( compositeGroupName ) ; return true ; } catch ( javax.naming.NamingException e ) { return false ; } } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }

Target:
public java.lang.Boolean load ( java.lang.String groupDn ) throws java.lang.Exception { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { javax.naming.Name compositeGroupName = new javax.naming.CompositeName ( ) . add ( groupDn ) ; try { ctx.getAttributes ( compositeGroupName ) ; return true ; } catch ( javax.naming.NamingException e ) { return false ; } } finally { helper.close ( ctx ) ; } }
Source:
public int compareTo ( com.google.gerrit.server.notedb.rebuild.Event other ) { return com.google.common.collect.ComparisonChain.start ( ) . compareFalseFirst ( this . isFinalUpdates ( ) , other.isFinalUpdates ( ) ) . compare ( this . when , other.when ) . compareTrueFirst ( isPatchSet ( ) , isPatchSet ( ) ) . compareTrueFirst ( this . predatesChange , other.predatesChange ) . compare ( this . who , other.who , com.google.gerrit.reviewdb.server.ReviewDbUtil.intKeyOrdering ( ) ) . compare ( this . psId , other.psId , com.google.gerrit.reviewdb.server.ReviewDbUtil.intKeyOrdering ( ) . nullsLast ( ) ) . result ( ) ; }

Target:
public int compareTo ( com.google.gerrit.server.notedb.rebuild.Event other ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( this . when , other.when ) . compareTrueFirst ( isPatchSet ( ) , isPatchSet ( ) ) . compareTrueFirst ( this . predatesChange , other.predatesChange ) . compare ( this . who , other.who , com.google.gerrit.reviewdb.server.ReviewDbUtil.intKeyOrdering ( ) ) . compare ( this . psId , other.psId , com.google.gerrit.reviewdb.server.ReviewDbUtil.intKeyOrdering ( ) . nullsLast ( ) ) . result ( ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String id , java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; com.google.gerrit.common.data.LabelType type = new com.google.gerrit.common.data.LabelType ( name , values ) ; type.setId ( id ) ; return type ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
public com.google.gerrit.server.account.GetPreferences.PreferenceInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ; try { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; return new com.google.gerrit.server.account.GetPreferences.PreferenceInfo ( null , p , git ) ; } finally { git.close ( ) ; } }

Target:
public com.google.gerrit.server.account.GetPreferences.PreferenceInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; return new com.google.gerrit.server.account.GetPreferences.PreferenceInfo ( null , p , git ) ; } }
Source:
public void returnsAncestors ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c1_1 = commitBuilder ( ) . add ( "a.txt" , "1" ) . message ( "subject: 1" ) . create ( ) ; java.lang.String id1 = getChangeId ( c1_1 ) ; org.eclipse.jgit.revwalk.RevCommit c2_1 = commitBuilder ( ) . add ( "b.txt" , "2" ) . message ( "subject: 2" ) . create ( ) ; java.lang.String id2 = getChangeId ( c2_1 ) ; com.google.gerrit.acceptance.GitUtil.pushHead ( testRepo , "refs/for/master" , false ) ; assertSubmittedTogether ( id1 , id1 ) ; assertSubmittedTogether ( id2 , id2 , id1 ) ; }

Target:
public void returnsAncestors ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c1_1 = commitBuilder ( ) . add ( "a.txt" , "1" ) . message ( "subject: 1" ) . create ( ) ; java.lang.String id1 = getChangeId ( c1_1 ) ; org.eclipse.jgit.revwalk.RevCommit c2_1 = commitBuilder ( ) . add ( "b.txt" , "2" ) . message ( "subject: 2" ) . create ( ) ; java.lang.String id2 = getChangeId ( c2_1 ) ; com.google.gerrit.acceptance.GitUtil.pushHead ( testRepo , "refs/for/master" , false ) ; assertSubmittedTogether ( id1 ) ; assertSubmittedTogether ( id2 , id2 , id1 ) ; }
Source:
public java.lang.String fetch ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { final org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; org.eclipse.jgit.revwalk.RevCommit commit = revWalk.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId ) ) ; return commit.getFullMessage ( ) ; } finally { repo.close ( ) ; } }

Target:
public java.lang.String fetch ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ) { try ( org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = revWalk.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId ) ) ; return commit.getFullMessage ( ) ; } } }
Source:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Change change ) { com.google.gerrit.reviewdb.Project.NameKey name = change.getProject ( ) ; try { return repoManager.openRepository ( name.get ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }

Target:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Project.NameKey name ) { try { return repoManager.openRepository ( name.get ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }
Source:
private com.google.gerrit.extensions.common.AccountInfo GET_ONE ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.AccountInfo GET_ONE ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( endpoint ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ; }
Source:
private void addProperty ( com.google.gson.JsonObject obj , java.lang.String key , java.lang.String [ ] values ) { if ( ( values.length ) > 0 ) { com.google.gson.JsonArray list = new com.google.gson.JsonArray ( ) ; for ( java.lang.String v : values ) { list.add ( new com.google.gson.JsonPrimitive ( v ) ) ; } obj.add ( key , list ) ; } }

Target:
private void addProperty ( com.google.gson.JsonObject obj , java.lang.String key , java.util.List < java.lang.String > values ) { if ( ! ( values.isEmpty ( ) ) ) { com.google.gson.JsonArray list = new com.google.gson.JsonArray ( ) ; for ( java.lang.String v : values ) { list.add ( new com.google.gson.JsonPrimitive ( v ) ) ; } obj.add ( key , list ) ; } }
Source:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) . get ( ) ) ; } } return m ; }

Target:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) ) ; } } return m ; }
Source:
private java.util.List < com.google.gwtexpui.globalkey.client.KeyCommand > sort ( final com.google.gwtexpui.globalkey.client.KeyCommandSet set ) { final java.util.List < com.google.gwtexpui.globalkey.client.KeyCommand > keys = new java.util.ArrayList < com.google.gwtexpui.globalkey.client.KeyCommand > ( set.getKeys ( ) ) ; java.util.Collections.sort ( keys , new java.util.Comparator < com.google.gwtexpui.globalkey.client.KeyCommand > ( ) { @ java.lang.Override public int compare ( com.google.gwtexpui.globalkey.client.KeyCommand arg0 , com.google.gwtexpui.globalkey.client.KeyCommand arg1 ) { return arg0.getHelpText ( ) . compareTo ( arg1.getHelpText ( ) ) ; } } ) ; return keys ; }

Target:
private java.util.List < com.google.gwtexpui.globalkey.client.KeyCommand > sort ( final com.google.gwtexpui.globalkey.client.KeyCommandSet set ) { final java.util.List < com.google.gwtexpui.globalkey.client.KeyCommand > keys = new java.util.ArrayList ( set.getKeys ( ) ) ; java.util.Collections.sort ( keys , new java.util.Comparator < com.google.gwtexpui.globalkey.client.KeyCommand > ( ) { @ java.lang.Override public int compare ( com.google.gwtexpui.globalkey.client.KeyCommand arg0 , com.google.gwtexpui.globalkey.client.KeyCommand arg1 ) { return arg0.getHelpText ( ) . compareTo ( arg1.getHelpText ( ) ) ; } } ) ; return keys ; }
Source:
public static < T > void setOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicSet.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicSetProvider < T > ( member ) ) . in ( Scopes.SINGLETON ) ; }

Target:
public static < T > void setOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicSet.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicSetProvider ( member ) ) . in ( Scopes.SINGLETON ) ; }
Source:
public void run ( ) { if ( ! ( prefs.renderEntireFile ( ) ) ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; } render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void offlineUponStart ( ) throws java.lang.Exception { setUpClientMock ( ) ; eventsDb.createDBIfNotCreated ( ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . once ( ) ; eventsDb.queryOne ( ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.sql.SQLException ( ) ) ; easyMock.replayAll ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock ) ; store.start ( ) ; easyMock.verifyAll ( ) ; }

Target:
public void offlineUponStart ( ) throws java.lang.Exception { setUpClientMock ( true ) ; eventsDb.createDBIfNotCreated ( ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . once ( ) ; eventsDb.queryOne ( ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.sql.SQLException ( ) ) ; easyMock.replayAll ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock ) ; store.start ( ) ; easyMock.verifyAll ( ) ; }
Source:
protected com.google.gerrit.extensions.restapi.Response < ? > applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return publish.apply ( updateFactory , rsrc.getControl ( ) . getUser ( ) , rsrc.getChange ( ) , rsrc.getChange ( ) . currentPatchSetId ( ) , null ) ; }

Target:
protected com.google.gerrit.extensions.restapi.Response < ? > applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return publish.apply ( updateFactory , rsrc.getUser ( ) , rsrc.getChange ( ) , rsrc.getChange ( ) . currentPatchSetId ( ) , null ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) { com.google.gerrit.sshd.SshScope.Context ctx = context.subContext ( newSession ( ) , context.getCommandLine ( ) ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { startThread ( new com.google.gerrit.sshd.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.AbstractGitCommand.this . service ( ) ; } } ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }

Target:
public void run ( ) throws java.lang.Exception { this . service ( ) ; }
Source:
private boolean replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } boolean differs = ! ( section.equals ( config.getAccessSection ( section.getName ( ) ) ) ) ; config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; return differs ; }

Target:
private void replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.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 ( result.info ) ; change.setStatus ( Change.Status.MERGED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; }
Source:
public void testReplaceOneLink ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; assertNotSame ( o , n ) ; assertEquals ( "A\n<a href=\"?42\">issue 42</a>\nB" , n.asString ( ) ) ; }

Target:
public void testReplaceOneLink ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( "A\n<a href=\"?42\">issue 42</a>\nB" , n.asString ( ) ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ; if ( p == null ) { p = com.google.gerrit.reviewdb.client.AccountDiffPreference.createDefault ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setAccountDiffPreference ( p ) ; } } ) ; close ( ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ; if ( p == null ) { p = com.google.gerrit.reviewdb.client.AccountDiffPreference.createDefault ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setAccountDiffPreference ( p ) ; } } ) ; if ( ( view ) != null ) { close ( ) ; } }
Source:
private static void assertOnlyChild ( java.lang.String o , com.google.gerrit.server.query.Predicate < java.lang.String > c , com.google.gerrit.server.query.Predicate < java.lang.String > p ) { assertEquals ( ( o + " did not affect child" ) , 1 , p.getChildCount ( ) ) ; assertSame ( ( o + " did not affect child" ) , c , p.getChild ( 0 ) ) ; }

Target:
private static void assertOnlyChild ( java.lang.String o , com.google.gerrit.server.query.Predicate < java.lang.String > c , com.google.gerrit.server.query.Predicate < java.lang.String > p ) { org.junit.Assert.assertEquals ( ( o + " did not affect child" ) , 1 , p.getChildCount ( ) ) ; org.junit.Assert.assertSame ( ( o + " did not affect child" ) , c , p.getChild ( 0 ) ) ; }
Source:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; final com.google.gwt.user.client.ui.Label keyHelp = new com.google.gwt.user.client.ui.Label ( com.google.gerrit.client.Gerrit.C.keyHelp ( ) ) ; keyHelp.setStyleName ( "gerrit-keyhelp" ) ; btmmenu.add ( keyHelp ) ; }

Target:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final com.google.gwt.user.client.ui.Label keyHelp = new com.google.gwt.user.client.ui.Label ( com.google.gerrit.client.Gerrit.C.keyHelp ( ) ) ; keyHelp.setStyleName ( "gerrit-keyhelp" ) ; btmmenu.add ( keyHelp ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > publishedByChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.PatchLineCommentsUtil.sort ( com.google.gerrit.server.PatchLineCommentsUtil.byCommentStatus ( db.patchComments ( ) . byChange ( notes.getChangeId ( ) ) , Status.PUBLISHED ) ) ; } notes.load ( ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > comments = com.google.common.collect.Lists.newArrayList ( ) ; comments.addAll ( notes.getComments ( ) . values ( ) ) ; return com.google.gerrit.server.PatchLineCommentsUtil.sort ( comments ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > publishedByChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.PatchLineCommentsUtil.sort ( com.google.gerrit.server.PatchLineCommentsUtil.byCommentStatus ( db.patchComments ( ) . byChange ( notes.getChangeId ( ) ) , Status.PUBLISHED ) ) ; } notes.load ( ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > comments = new java.util.ArrayList < > ( ) ; comments.addAll ( notes.getComments ( ) . values ( ) ) ; return com.google.gerrit.server.PatchLineCommentsUtil.sort ( comments ) ; }
Source:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }

Target:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; stop ( ) ; }
Source:
public java.util.Set < java.lang.String > getLegalValues ( com.j2bugzilla.rpc.GetLegalValues.Fields field ) throws com.j2bugzilla.base.BugzillaException { if ( ( com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.get ( field ) ) == null ) { com.j2bugzilla.rpc.GetLegalValues getValues = new com.j2bugzilla.rpc.GetLegalValues ( field ) ; connector.executeMethod ( getValues ) ; com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.put ( field , getValues.getLegalValues ( ) ) ; } return com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.get ( field ) ; }

Target:
private java.util.Set < java.lang.String > getLegalValues ( com.j2bugzilla.rpc.GetLegalValues.Fields field ) throws com.j2bugzilla.base.BugzillaException { if ( ( com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.get ( field ) ) == null ) { com.j2bugzilla.rpc.GetLegalValues getValues = new com.j2bugzilla.rpc.GetLegalValues ( field ) ; connector.executeMethod ( getValues ) ; com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.put ( field , getValues.getLegalValues ( ) ) ; } return com.googlesource.gerrit.plugins.hooks.bz.BugzillaClient.legalFieldValues.get ( field ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; }