auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.testutil.FakeAccountByEmailCache accountCache = new com.google.gerrit.testutil.FakeAccountByEmailCache ( ) ; schemaFactory = com.google.gerrit.testutil.InMemoryDatabase.newDatabase ( ) ; schemaFactory.create ( ) ; db = schemaFactory.open ( ) ; repoManager = new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ; checker = new com.google.gerrit.server.change.ConsistencyChecker ( com.google.inject.util.Providers.< com.google.gerrit.reviewdb.server.ReviewDb > of ( db ) , repoManager , com.google.inject.util.Providers.< com.google.gerrit.server.CurrentUser > of ( new com.google.gerrit.server.InternalUser ( null ) ) , com.google.inject.util.Providers.of ( new org.eclipse.jgit.lib.PersonIdent ( "server" , "noreply@example.com" ) ) , new com.google.gerrit.server.patch.PatchSetInfoFactory ( repoManager , accountCache ) ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "repo" ) ; repo = new org.eclipse.jgit.junit.TestRepository ( repoManager.createRepository ( project ) ) ; userId = new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) ; accountCache.putAny ( userId ) ; db.accounts ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) ) ; tip = repo.branch ( "master" ) . commit ( ) . create ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.testutil.FakeAccountByEmailCache accountCache = new com.google.gerrit.testutil.FakeAccountByEmailCache ( ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; schemaFactory = com.google.gerrit.testutil.InMemoryDatabase.newDatabase ( lifecycle ) ; lifecycle.start ( ) ; schemaFactory.create ( ) ; db = schemaFactory.open ( ) ; repoManager = new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ; checker = new com.google.gerrit.server.change.ConsistencyChecker ( com.google.inject.util.Providers.< com.google.gerrit.reviewdb.server.ReviewDb > of ( db ) , repoManager , com.google.inject.util.Providers.< com.google.gerrit.server.CurrentUser > of ( new com.google.gerrit.server.InternalUser ( null ) ) , com.google.inject.util.Providers.of ( new org.eclipse.jgit.lib.PersonIdent ( "server" , "noreply@example.com" ) ) , new com.google.gerrit.server.patch.PatchSetInfoFactory ( repoManager , accountCache ) ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "repo" ) ; repo = new org.eclipse.jgit.junit.TestRepository ( repoManager.createRepository ( project ) ) ; userId = new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) ; accountCache.putAny ( userId ) ; db.accounts ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) ) ; tip = repo.branch ( "master" ) . commit ( ) . create ( ) ; }
Source:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } }

Target:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; com.google.gerrit.reviewdb.client.Account account = args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ; args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , account ) ; } }
Source:
public void insertChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers ) throws com.google.gwtorm.server.OrmException { insertChange ( db , change , null , ps , commit , labelTypes , info , reviewers ) ; }

Target:
com.google.gerrit.server.change.ChangeInserter create ( com.google.gerrit.server.project.RefControl ctl , com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps , org.eclipse.jgit.revwalk.RevCommit rc , com.google.gerrit.reviewdb.client.PatchSetInfo psi ) ;
Source:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { assigneeLink.setText ( ( assignee != null ? assignee.name ( ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? assignee.name ( ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
public void projectAccess ( final com.google.gerrit.reviewdb.Project.NameKey projectName , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > callback ) { projectAccessFactory.create ( projectName ) . to ( callback ) ; }

Target:
public void reviewProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Change.Id > cb ) { org.eclipse.jgit.lib.ObjectId base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; reviewProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }
Source:
public void run ( ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult > res = searcher.doQuery ( q ) ; for ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult docResult : res ) { stdout.println ( java.lang.String.format ( "%s:\n%s%s\n" , docResult.title , url , docResult.url ) ) ; } }

Target:
public void run ( ) throws java.lang.Exception { try { java.util.List < com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult > res = searcher.doQuery ( q ) ; for ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult docResult : res ) { stdout.println ( java.lang.String.format ( "%s:\n%s%s\n" , docResult.title , url , docResult.url ) ) ; } } catch ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocQueryException dqe ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , ( "fatal: " + ( dqe.getMessage ( ) ) ) ) ; } }
Source:
private void decodeReviewers ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { cd.setReviewers ( com.google.gerrit.server.index.change.ChangeField.parseReviewerFieldValues ( com.google.common.collect.FluentIterable.of ( doc.getFields ( com.google.gerrit.lucene.LuceneChangeIndex.REVIEWER_FIELD ) ) . transform ( new com.google.common.base.Function < org.apache.lucene.index.IndexableField , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( org.apache.lucene.index.IndexableField in ) { return in.stringValue ( ) ; } } ) ) ) ; }

Target:
private void decodeReviewers ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { cd.setReviewers ( com.google.gerrit.server.index.change.ChangeField.parseReviewerFieldValues ( com.google.common.collect.FluentIterable.from ( doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.REVIEWER_FIELD ) ) . transform ( new com.google.common.base.Function < org.apache.lucene.index.IndexableField , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( org.apache.lucene.index.IndexableField in ) { return in.stringValue ( ) ; } } ) ) ) ; }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base ; if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } else { base = null ; } changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId getBase ( final java.lang.String baseRevision ) { if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { return org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } return null ; }
Source:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( "foo" ) ) ; assertSame ( b , b.append ( "bar" ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_StringBuilder ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.StringBuilder ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "foo" ) ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "bar" ) ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }

Target:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommit ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
public static Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident ) { java.lang.String email = ident.getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } return null ; }

Target:
public Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = ident.getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; if ( host.equals ( serverId ) ) { java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( id != null ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } } throw com.google.gerrit.server.notedb.ChangeNotes.parseException ( changeId , "invalid identity, expected <id>@%s: %s" , serverId , email ) ; }
Source:
public void bothDateTime ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; params.put ( "t1" , "2013-10-10 10:00:00" ) ; params.put ( "t2" , "2014-10-10 10:00:00" ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; com.google.common.truth.Truth.assertThat ( query ) . isNotEqualTo ( com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.defaultQuery ) ; }

Target:
public void bothDateTime ( ) throws java.lang.Exception { query = queryMaker.formQueryFromRequestParameters ( com.google.common.collect.ImmutableMap.of ( com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.T1 , com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.OLD_DATE , com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.T2 , com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.NEW_DATE ) ) ; com.google.common.truth.Truth.assertThat ( query ) . isNotEqualTo ( defaultQuery ) ; }
Source:
public com.google.gerrit.common.data.Capable canUpload ( ) { com.google.gerrit.common.data.Capable result = projectControl.canPushToAtLeastOneRef ( ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = checkMagicBranchRef ( com.google.gerrit.server.git.ReceiveCommits.NEW_CHANGE ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = checkMagicBranchRef ( com.google.gerrit.server.git.ReceiveCommits.NEW_DRAFT_CHANGE ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = checkMagicBranchRef ( com.google.gerrit.server.git.ReceiveCommits.NEW_PUBLISH_CHANGE ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public com.google.gerrit.common.data.Capable canUpload ( ) { com.google.gerrit.common.data.Capable result = projectControl.canPushToAtLeastOneRef ( ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } return com.google.gerrit.server.util.MagicBranch.checkMagicBranchRefs ( repo , project ) ; }
Source:
public void markReady ( boolean ready ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; com.google.gerrit.lucene.LuceneVersionManager.setReady ( cfg , schema.getVersion ( ) , ready ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public static void setReady ( com.google.gerrit.server.config.SitePaths sitePaths , int version , boolean ready ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; com.google.gerrit.lucene.LuceneVersionManager.setReady ( cfg , version , ready ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 = arg1 ; int idx ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; idx = ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ; engine.internalDB.erase ( idx ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1 ; int idx ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; idx = ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( a1 ) ) . intValue ( ) ; engine.internalDB.erase ( idx ) ; return cont ; }
Source:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String ref , boolean pushTags , boolean force , java.util.List < java.lang.String > pushOptions ) throws org.eclipse.jgit.api.errors.GitAPIException { return com.google.gerrit.acceptance.GitUtil.pushOne ( testRepo , "HEAD" , ref , pushTags , force , pushOptions ) ; }

Target:
public static org.eclipse.jgit.lib.Ref updateAnnotatedTag ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String name , org.eclipse.jgit.lib.PersonIdent tagger ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.TagCommand tc = testRepo.git ( ) . tag ( ) . setName ( name ) ; return tc.setAnnotated ( true ) . setMessage ( name ) . setTagger ( tagger ) . setForceUpdate ( true ) . call ( ) ; }
Source:
private com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context newRequestContext ( com.google.gerrit.acceptance.TestAccount account ) { return atrScope.newContext ( reviewDbProvider , new com.google.gerrit.acceptance.SshSession ( server , account ) , identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , account.getId ( ) ) ) ; }

Target:
protected void deny ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( p ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( p , cfg ) ; }
Source:
public com.google.gerrit.server.project.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < > ( ) ; } com.google.gerrit.server.project.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.project.PermissionCollection relevant = permissionFilter.filter ( access ( ) , refName , user ) ; ctl = new com.google.gerrit.server.project.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }

Target:
public com.google.gerrit.server.permissions.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < > ( ) ; } com.google.gerrit.server.permissions.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.permissions.PermissionCollection relevant = permissionFilter.filter ( access ( ) , refName , user ) ; ctl = new com.google.gerrit.server.permissions.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }
Source:
private static java.lang.String owner ( com.google.gerrit.common.data.AccountInfo ai ) { if ( ( ai.getPreferredEmail ( ) ) != null ) { return ai.getPreferredEmail ( ) ; } else if ( ( ai.getFullName ( ) ) != null ) { return ai.getFullName ( ) ; } return "" + ( ai.getId ( ) . get ( ) ) ; }

Target:
private static java.lang.String owner ( com.google.gerrit.client.changes.AccountInfo ai ) { if ( ( ai.email ( ) ) != null ) { return ai.email ( ) ; } else if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } else if ( ( ai._account_id ( ) ) != 0 ) { return "" + ( ai._account_id ( ) ) ; } else { return "" ; } }
Source:
public void setSearchIndex ( I index ) { I old = searchIndex.getAndSet ( index ) ; if ( ( ( old != null ) && ( old != index ) ) && ( ! ( writeIndexes.contains ( old ) ) ) ) { old.close ( ) ; } }

Target:
public void setSearchIndex ( I index , boolean closeOld ) { I old = searchIndex.getAndSet ( index ) ; if ( ( ( closeOld && ( old != null ) ) && ( old != index ) ) && ( ! ( writeIndexes.contains ( old ) ) ) ) { old.close ( ) ; } }
Source:
public void want ( final com.google.gerrit.reviewdb.Account.Id id ) { if ( ( id != null ) && ( ! ( out.containsKey ( id ) ) ) ) { out.put ( id , accountCache.get ( id ) . getAccount ( ) ) ; } }

Target:
public void want ( final com.google.gerrit.reviewdb.Account.Id id ) { if ( id != null ) { wants.add ( id ) ; } }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { char c = event.getCharCode ( ) ; if ( ( c < '0' ) || ( '9' < c ) ) { final int nativeCode = event.getNativeEvent ( ) . getKeyCode ( ) ; switch ( nativeCode ) { case com.google.gwt.event.dom.client.KeyCodes.KEY_BACKSPACE : case com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT : case com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT : case com.google.gwt.event.dom.client.KeyCodes.KEY_HOME : case com.google.gwt.event.dom.client.KeyCodes.KEY_END : case com.google.gwt.event.dom.client.KeyCodes.KEY_TAB : case com.google.gwt.event.dom.client.KeyCodes.KEY_DELETE : break ; default : if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { event.preventDefault ( ) ; } break ; } } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { int charCode = event.getCharCode ( ) ; int keyCode = event.getNativeEvent ( ) . getKeyCode ( ) ; onKey ( event , charCode , keyCode ) ; }
Source:
private void loadDiff ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { com.google.gerrit.client.diff.DiffApi.list ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( null , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { files.markReviewed ( result ) ; }
Source:
public void insertedWhitespaceIsRecognizedInIdenticalLines ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n int *foobar\n" ; java.lang.String b = " int * foobar\n int * foobar\n" ; java.util.List < org.eclipse.jgit.diff.Edit > expected = new org.eclipse.jgit.diff.EditList ( ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 6 , 6 , 6 , 7 ) ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 19 , 19 , 20 , 21 ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( expected ) ; }

Target:
com.google.gerrit.server.patch.IntraLineLoaderTest.Reference replace ( java.lang.String a , java.lang.String b ) { int lenA = a.length ( ) ; int lenB = b.length ( ) ; edits.add ( new org.eclipse.jgit.diff.Edit ( posA , ( ( posA ) + lenA ) , posB , ( ( posB ) + lenB ) ) ) ; posA += lenA ; posB += lenB ; return this ; }
Source:
private void renderRevisionInfo ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actionMap ) { initRevisionsAction ( info , revision , actionMap ) ; commit.setParentNotCurrent ( ( ( actionMap.containsKey ( "rebase" ) ) && ( actionMap.get ( "rebase" ) . enabled ( ) ) ) ) ; actions.reloadRevisionActions ( actionMap ) ; }

Target:
private void renderRevisionInfo ( com.google.gerrit.client.info.ChangeInfo info , com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actionMap ) { initRevisionsAction ( info , revision , actionMap ) ; commit.setParentNotCurrent ( ( ( actionMap.containsKey ( "rebase" ) ) && ( actionMap.get ( "rebase" ) . enabled ( ) ) ) ) ; actions.reloadRevisionActions ( actionMap ) ; }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; commentVisibilityStrategy.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; commentVisibilityStrategy.setEnabled ( on ) ; diffView.setEnabled ( on ) ; }
Source:
public com.google.gerrit.client.reviewdb.ApprovalCategoryValue getValue ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { if ( ( byValue ) == null ) { byValue = new java.util.HashMap < java.lang.Short , com.google.gerrit.client.reviewdb.ApprovalCategoryValue > ( ) ; for ( final com.google.gerrit.client.reviewdb.ApprovalCategoryValue acv : values ) { byValue.put ( acv.getValue ( ) , acv ) ; } } return byValue.get ( ca.getValue ( ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.ApprovalCategoryValue getValue ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { initByValue ( ) ; return byValue.get ( ca.getValue ( ) ) ; }
Source:
static java.lang.String getTimestampBranch ( java.lang.String refName ) { if ( ( refName.startsWith ( org.eclipse.jgit.lib.Constants.R_HEADS ) ) || ( refName.startsWith ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) ) { return java.lang.String.format ( "%s-%s" , ( ( com.googlesource.gerrit.plugins.refprotection.BackupRef.R_BACKUPS ) + ( refName.replaceFirst ( org.eclipse.jgit.lib.Constants.R_REFS , "" ) ) ) , new java.text.SimpleDateFormat ( "YYYYMMdd-HHmmss" ) . format ( new java.util.Date ( ) ) ) ; } return refName ; }

Target:
static java.lang.String getTimestampBranch ( java.lang.String refName ) { if ( ( refName.startsWith ( org.eclipse.jgit.lib.Constants.R_HEADS ) ) || ( refName.startsWith ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) ) { return java.lang.String.format ( "%s-%s" , ( ( com.googlesource.gerrit.plugins.refprotection.BackupRef.R_BACKUPS ) + ( refName.replaceFirst ( org.eclipse.jgit.lib.Constants.R_REFS , "" ) ) ) , new java.text.SimpleDateFormat ( "yyyyMMdd-HHmmss" ) . format ( new java.util.Date ( ) ) ) ; } return refName ; }
Source:
public < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Exception { try { return executeWithAttemptCount ( actionType , action , opts , exceptionPredicate ) ; } catch ( java.lang.Throwable t ) { com.google.common.base.Throwables.throwIfUnchecked ( t ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , java.lang.Exception.class ) ; throw new java.lang.IllegalStateException ( t ) ; } }

Target:
public java.time.Duration getDefaultTimeout ( com.google.gerrit.server.update.RetryHelper.ActionType actionType ) { return defaultTimeouts.get ( actionType ) ; }
Source:
private java.lang.String createGroup ( java.lang.String name ) throws java.lang.Exception { name = name ( name ) ; com.google.gerrit.extensions.api.groups.GroupInput in = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; in.name = name ; in.ownerId = "Administrators" ; gApi.groups ( ) . create ( in ) ; return name ; }

Target:
private java.lang.String createGroup ( java.lang.String name , java.lang.String owner ) throws java.lang.Exception { name = name ( name ) ; com.google.gerrit.extensions.api.groups.GroupInput in = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; in.name = name ; in.ownerId = owner ; gApi.groups ( ) . create ( in ) ; return name ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.server.project.SetDashboard.Input in = new com.google.gerrit.server.project.SetDashboard.Input ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.extensions.common.SetDashboardInput in = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }
Source:
private void checkGlobalCapabilityPermissions ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( allProjects.equals ( projectName ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Cannot edit global capabilities for projects other than " + ( allProjects.get ( ) ) ) ) ; } if ( ! ( identifiedUser.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( "Editing global capabilities requires " + ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) ) ; } }

Target:
private void checkGlobalCapabilityPermissions ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ! ( allProjects.equals ( projectName ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Cannot edit global capabilities for projects other than " + ( allProjects.get ( ) ) ) ) ; } permissionBackend.user ( identifiedUser ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString msg ) { setEnabled ( true ) ; if ( ( msg != null ) && ( ! ( msg.asString ( ) . isEmpty ( ) ) ) ) { com.google.gwt.user.client.Window.alert ( msg.asString ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString msg ) { setEnabled ( true ) ; if ( ( msg != null ) && ( ! ( msg.asString ( ) . isEmpty ( ) ) ) ) { com.google.gwt.user.client.Window.alert ( msg.asString ( ) ) ; } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( changeId ) ) ; }
Source:
private com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String what , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return getDialect ( ) . convertError ( op , what , err ) ; }

Target:
protected long nextLong ( final java.lang.String query ) throws com.google.gwtorm.client.OrmException { return getDialect ( ) . nextLong ( getConnection ( ) , query ) ; }
Source:
private void padLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.closeTd ( ) ; }

Target:
private void appendLineNumberForSideA ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int idx ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; m.append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( ( "<a href=\"javascript:void(0)\">" + ( idx + 1 ) ) + "</a>" ) ) ) ; m.closeTd ( ) ; }
Source:
public void testHashCode ( ) { org.junit.Assert.assertTrue ( ( ( com.google.gerrit.server.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) == ( com.google.gerrit.server.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) ) ) ; org.junit.Assert.assertFalse ( ( ( com.google.gerrit.server.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) == ( com.google.gerrit.server.query.Predicate.not ( f ( "a" , "a" ) ) . hashCode ( ) ) ) ) ; }

Target:
public void testHashCode ( ) { org.junit.Assert.assertTrue ( ( ( com.google.gerrit.index.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) == ( com.google.gerrit.index.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) ) ) ; org.junit.Assert.assertFalse ( ( ( com.google.gerrit.index.query.Predicate.not ( f ( "a" , "b" ) ) . hashCode ( ) ) == ( com.google.gerrit.index.query.Predicate.not ( f ( "a" , "a" ) ) . hashCode ( ) ) ) ) ; }
Source:
public void testFollowMasterBranch ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String gitmodules = ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = localpath-to-a\n" ) + "url = ssh://localhost/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = master\n" ; cfg.fromText ( gitmodules ) ; java.lang.String thisServer = com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , thisServer , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "localpath-to-a" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testFollowMasterBranch ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = localpath-to-a\n" ) + "url = ssh://localhost/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = master\n" ) ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "localpath-to-a" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }
Source:
private void renderCommands ( ) { com.google.gerrit.client.changes.ChangeInfo.FetchInfo info = fetch.get ( scheme.getValue ( scheme.getSelectedIndex ( ) ) ) ; checkout ( info ) ; cherryPick ( info ) ; pull ( info ) ; patch ( info ) ; repo ( info ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { fetch = result.revision ( revision ) . fetch ( ) ; renderScheme ( ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( 1 ) ) ; bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; bind ( com.google.gerrit.server.index.Index.class ) . toInstance ( new com.google.gerrit.server.index.change.DummyChangeIndex ( ) ) ; bind ( ChangeIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyChangeIndexFactory ( ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( 1 ) ) ; bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; bind ( com.google.gerrit.server.index.Index.class ) . toInstance ( new com.google.gerrit.server.index.change.DummyChangeIndex ( ) ) ; bind ( AccountIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyAccountIndexFactory ( ) ) ; bind ( ChangeIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyChangeIndexFactory ( ) ) ; }
Source:
private void initCreateButton ( ) { create = new com.google.gwt.user.client.ui.Button ( Util.C.buttonCreateProject ( ) ) ; create.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { doCreateProject ( ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { int top = ( grid.getAbsoluteTop ( ) ) - 50 ; int left = 5 + ( java.lang.Math.max ( ( ( grid.getAbsoluteLeft ( ) ) + ( grid.getOffsetWidth ( ) ) ) , ( ( suggestedParentsTab.getAbsoluteLeft ( ) ) + ( suggestedParentsTab.getOffsetWidth ( ) ) ) ) ) ; projectsPopup.setPreferredCoordinates ( top , left ) ; projectsPopup.displayPopup ( ) ; }
Source:
public byte [ ] getHtmlFromMarkdown ( byte [ ] data , java.lang.String charEnc ) throws java.io.UnsupportedEncodingException { java.lang.String decodedData = org.eclipse.jgit.util.RawParseUtils.decode ( java.nio.charset.Charset.forName ( charEnc ) , data ) ; java.lang.String formatted = new org.pegdown.PegDownProcessor ( org.pegdown.Extensions.ALL ) . markdownToHtml ( decodedData ) ; data = formatted.getBytes ( charEnc ) ; return data ; }

Target:
public byte [ ] getHtmlFromMarkdown ( byte [ ] data , java.lang.String charEnc ) throws java.io.UnsupportedEncodingException { return new org.pegdown.PegDownProcessor ( ( ( org.pegdown.Extensions.ALL ) & ( ~ ( org.pegdown.Extensions.HARDWRAPS ) ) ) ) . markdownToHtml ( org.eclipse.jgit.util.RawParseUtils.decode ( java.nio.charset.Charset.forName ( charEnc ) , data ) ) . getBytes ( charEnc ) ; }
Source:
public void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroup > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup group : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , group ) ; } }

Target:
public int compare ( com.google.gerrit.client.groups.GroupInfo a , com.google.gerrit.client.groups.GroupInfo b ) { return a.name ( ) . compareTo ( b.name ( ) ) ; }
Source:
private void killTask_NotFound ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( "/config/server/tasks/" ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; r.consume ( ) ; com.google.common.truth.Truth.assertThat ( result.size ( ) ) . isGreaterThan ( 0 ) ; userSession.delete ( ( "/config/server/tasks/" + ( result.get ( 0 ) . id ) ) ) . assertNotFound ( ) ; }

Target:
private void killTask_NotFound ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( "/config/server/tasks/" ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; r.consume ( ) ; com.google.common.truth.Truth.assertThat ( result.size ( ) ) . isGreaterThan ( 0 ) ; userRestSession.delete ( ( "/config/server/tasks/" + ( result.get ( 0 ) . id ) ) ) . assertNotFound ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > r = com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) ) ) ; if ( resource.isCacheable ( ) ) { r.caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; } return r ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > r = com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) , resource.getChange ( ) . getProject ( ) , addLinks ) ) ; if ( resource.isCacheable ( ) ) { r.caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; } return r ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }
Source:
void process ( com.google.gerrit.server.notedb.rebuild.Event e ) { if ( sorted.contains ( e ) ) { return ; } if ( deps.get ( e ) . isEmpty ( ) ) { sorted.add ( e ) ; for ( com.google.gerrit.server.notedb.rebuild.Event w : waiting.get ( e ) ) { deps.get ( w ) . remove ( e ) ; process ( w ) ; } } }

Target:
void process ( com.google.gerrit.server.notedb.rebuild.Event e , java.util.PriorityQueue < com.google.gerrit.server.notedb.rebuild.Event > todo ) { if ( sorted.contains ( e ) ) { return ; } if ( ! ( deps.get ( e ) . isEmpty ( ) ) ) { return ; } sorted.add ( e ) ; for ( com.google.gerrit.server.notedb.rebuild.Event w : waiting.get ( e ) ) { deps.get ( w ) . remove ( e ) ; todo.add ( w ) ; } }
Source:
public java.lang.String getVersion ( ) { java.lang.String fileName = getSrcFile ( ) . getName ( ) ; int firstDash = fileName.indexOf ( "-" ) ; if ( firstDash > 0 ) { return fileName.substring ( ( firstDash + 1 ) , fileName.lastIndexOf ( ".js" ) ) ; } return "" ; }

Target:
public java.lang.String getVersion ( ) { java.lang.String fileName = getSrcFile ( ) . getFileName ( ) . toString ( ) ; int firstDash = fileName.indexOf ( "-" ) ; if ( firstDash > 0 ) { return fileName.substring ( ( firstDash + 1 ) , fileName.lastIndexOf ( ".js" ) ) ; } return "" ; }
Source:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.asUser ( user.get ( ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.match ( changeData ) ; }

Target:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.asUser ( user.get ( ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.asMatchable ( ) . match ( changeData ) ; }
Source:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createEvent ( com.google.gerrit.extensions.events.UsageDataPublishedListener.MetaData metaData , com.google.common.cache.Cache < com.google.gerrit.reviewdb.client.Project.NameKey , java.util.concurrent.atomic.AtomicLong > cache ) { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( metaData ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { java.util.concurrent.atomic.AtomicLong count = cache.getIfPresent ( p ) ; if ( count != null ) { long currentCount = count.getAndSet ( 0 ) ; if ( currentCount != 0 ) { event.addData ( currentCount , p.get ( ) ) ; } } } return event ; }

Target:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createEvent ( com.google.gerrit.extensions.events.UsageDataPublishedListener.MetaData metaData , com.googlesource.gerrit.plugins.quota.PersistentCounter counts ) { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( metaData ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { long currentCount = counts.getAndReset ( p ) ; if ( currentCount != 0 ) { event.addData ( currentCount , p.get ( ) ) ; } } return event ; }