auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getNonExistingCommit_NotFound ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NOT_FOUND , r.getStatusCode ( ) ) ; }

Target:
public void getMergedCommit_NotFound ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.branch ( "master" ) . commit ( ) . message ( "Create\n\nNew commit\n" ) . create ( ) ) ; assertNotFound ( commit ) ; }
Source:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.ui.Widget link = table.getWidget ( row , com.google.gerrit.client.changes.PatchTable.MyTable.C_PATH ) ; if ( link instanceof com.google.gwt.user.client.ui.FlowPanel ) { link = ( ( com.google.gwt.user.client.ui.FlowPanel ) ( link ) ) . getWidget ( 0 ) ; } if ( link instanceof com.google.gerrit.client.ui.DirectScreenLink ) { ( ( com.google.gerrit.client.ui.DirectScreenLink ) ( link ) ) . go ( ) ; } }

Target:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.ui.Widget link = table.getWidget ( row , com.google.gerrit.client.changes.PatchTable.MyTable.C_PATH ) ; if ( link instanceof com.google.gwt.user.client.ui.FlowPanel ) { link = ( ( com.google.gwt.user.client.ui.FlowPanel ) ( link ) ) . getWidget ( 0 ) ; } if ( link instanceof com.google.gerrit.client.ui.InlineHyperlink ) { ( ( com.google.gerrit.client.ui.InlineHyperlink ) ( link ) ) . go ( ) ; } }
Source:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "changeId" , changeId ) . add ( "commit" , com.google.gerrit.server.change.GetRelated.ChangeAndCommit.toString ( commit ) ) . add ( "_changeNumber" , _changeNumber ) . add ( "_revisionNumber" , _revisionNumber ) . add ( "_currentRevisionNumber" , _currentRevisionNumber ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "changeId" , changeId ) . add ( "commit" , com.google.gerrit.server.change.GetRelated.ChangeAndCommit.toString ( commit ) ) . add ( "_changeNumber" , _changeNumber ) . add ( "_revisionNumber" , _revisionNumber ) . add ( "_currentRevisionNumber" , _currentRevisionNumber ) . add ( "status" , status ) . toString ( ) ; }
Source:
public java.util.Optional < com.google.gerrit.server.group.InternalGroup > load ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { return groupQueryProvider.get ( ) . byId ( key ) ; }

Target:
public java.util.Optional < com.google.gerrit.server.group.InternalGroup > load ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { if ( hasGroupIndex ) { return groupQueryProvider.get ( ) . byId ( key ) ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getGroup ( db , key ) ; } }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > files = object.currentFilePaths ( ) ; if ( files != null ) { return ( java.util.Collections.binarySearch ( files , value ) ) >= 0 ; } else { return true ; } }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.index.ChangeField.getFileParts ( object ) . contains ( value ) ; }
Source:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; java.lang.String t = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) , comment.line ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( t ) ; } else { com.google.gerrit.client.Gerrit.display ( t ) ; } }

Target:
void onFix ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; java.lang.String t = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) , comment.line ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( t ) ; } else { com.google.gerrit.client.Gerrit.display ( t ) ; } }
Source:
public void listBranchesHeadHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/master" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; pushTo ( "refs/heads/dev" ) ; java.lang.String devCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( java.util.Collections.singletonList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/dev" , devCommit , false ) ) , result ) ; }

Target:
public void listBranchesHeadHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/master" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; pushTo ( "refs/heads/dev" ) ; java.lang.String devCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( java.util.Collections.singletonList ( new com.google.gerrit.server.project.ListBranches.BranchInfo ( "refs/heads/dev" , devCommit , false ) ) , com.google.gerrit.acceptance.rest.project.ListBranchesIT.toBranchInfoList ( r ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , headless , slave , polyGerritDev ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
public void hostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; org.junit.Assert.assertEquals ( Type.HOST_INDEX , view.getType ( ) ) ; org.junit.Assert.assertEquals ( "test-host" , view.getHostName ( ) ) ; org.junit.Assert.assertNull ( view.getRepositoryName ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getRevision ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; org.junit.Assert.assertNull ( view.getPathPart ( ) ) ; }

Target:
public void hostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; com.google.common.truth.Truth.assertThat ( view.getType ( ) ) . isEqualTo ( Type.HOST_INDEX ) ; com.google.common.truth.Truth.assertThat ( view.getHostName ( ) ) . isEqualTo ( "test-host" ) ; com.google.common.truth.Truth.assertThat ( view.getRepositoryName ( ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( view.getRevision ( ) ) . isEqualTo ( Revision.NULL ) ; com.google.common.truth.Truth.assertThat ( view.getOldRevision ( ) ) . isEqualTo ( Revision.NULL ) ; com.google.common.truth.Truth.assertThat ( view.getPathPart ( ) ) . isNull ( ) ; }
Source:
public void newPatchSetByOwnerOnReviewableChangeInNoteDb ( ) 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" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOwnerOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( c , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( c , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; if ( notesMigration.readChanges ( ) ) { ctx.getNotes ( ) . load ( ) ; } return ctx ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event e = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { l.onTopicEdited ( e ) ; } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.warn ( "Error in event listener" , e ) ; } } }
Source:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ApproveCommand.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.AdminCreateProject.class ) ; command ( gerrit , "gsql" ) . to ( com.google.gerrit.sshd.commands.AdminQueryShell.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.Receive.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.AdminReplicate.class ) ; }

Target:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ApproveCommand.class ) ; command ( gerrit , "create-account" ) . to ( com.google.gerrit.sshd.commands.AdminCreateAccount.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.AdminCreateProject.class ) ; command ( gerrit , "gsql" ) . to ( com.google.gerrit.sshd.commands.AdminQueryShell.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.Receive.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.AdminReplicate.class ) ; }
Source:
public void release ( ) { }

Target:
public static org.eclipse.jgit.lib.ObjectInserter createDryRunInserter ( org.eclipse.jgit.lib.Repository db ) { final org.eclipse.jgit.lib.ObjectInserter delegate = db.newObjectInserter ( ) ; return new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return delegate ; } @ java.lang.Override public org.eclipse.jgit.transport.PackParser newPackParser ( java.io.InputStream in ) throws java.io.IOException { throw new java.lang.UnsupportedOperationException ( ) ; } @ java.lang.Override public void flush ( ) throws java.io.IOException { } } ; }
Source:
private com.google.gerrit.reviewdb.client.Comment publishComment ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.Comment c , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { c.writtenOn = ctx.getWhen ( ) ; c.tag = in.tag ; com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , patchListCache , ctx.getChange ( ) , com.google.common.base.Preconditions.checkNotNull ( ps ) ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Comment publishComment ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.Comment c , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { c.writtenOn = ctx.getWhen ( ) ; c.tag = in.tag ; ctx.getUser ( ) . updateRealAccountId ( c :: setRealAuthor ) ; com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , patchListCache , ctx.getChange ( ) , com.google.common.base.Preconditions.checkNotNull ( ps ) ) ; return c ; }
Source:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kh = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyH ( ) ) ; com.google.gerrit.gpg.testutil.TestKey ki = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyI ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; assertProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }

Target:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kh = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyH ( ) ) ; com.google.gerrit.gpg.testutil.TestKey ki = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyI ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; assertNoProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( queue.replicateAllOnPluginStart ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( ) ; pushAllFuture.set ( pushAll.create ( null , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( ) ; pushAllFuture.set ( pushAll.create ( null , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
public void update ( final int completed ) { count += completed ; if ( ( total ) != ( com.google.gerrit.server.git.MultiProgressMonitor.UNKNOWN ) ) { int percent = ( ( count ) * 100 ) / ( total ) ; if ( percent > ( lastPercent ) ) { lastPercent = percent ; wakeUp ( ) ; } } }

Target:
public void end ( ) { if ( ( ( total ) == ( com.google.gerrit.server.git.MultiProgressMonitor.UNKNOWN ) ) && ( ( getCount ( ) ) > 0 ) ) { wakeUp ( ) ; } }
Source:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "restricted to members of Modify Accounts" ) ; } return com.google.gerrit.server.account.GetEditPreferences.readFromGit ( rsrc.getUser ( ) . getAccountId ( ) , gitMgr , allUsersName , null ) ; }

Target:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "requires Modify Account capability" ) ; } return com.google.gerrit.server.account.GetEditPreferences.readFromGit ( rsrc.getUser ( ) . getAccountId ( ) , gitMgr , allUsersName , null ) ; }
Source:
public java.lang.String get ( ) { java.lang.String canonicalUrl = super . get ( ) ; if ( canonicalUrl != null ) { return canonicalUrl ; } if ( ( requestProvider ) != null ) { final javax.servlet.http.HttpServletRequest req ; try { req = requestProvider.get ( ) ; } catch ( com.google.inject.ProvisionException noWeb ) { if ( ( noWeb.getCause ( ) ) instanceof com.google.inject.OutOfScopeException ) { return null ; } throw noWeb ; } return com.google.gerrit.httpd.CanonicalWebUrl.computeFromRequest ( req ) ; } return null ; }

Target:
private java.util.Optional < java.lang.String > guessUrlFromHttpRequest ( ) { if ( ( requestProvider ) == null ) { return java.util.Optional.empty ( ) ; } final javax.servlet.http.HttpServletRequest req ; try { req = requestProvider.get ( ) ; } catch ( com.google.inject.ProvisionException noWeb ) { if ( ( noWeb.getCause ( ) ) instanceof com.google.inject.OutOfScopeException ) { return java.util.Optional.empty ( ) ; } throw noWeb ; } return java.util.Optional.of ( com.google.gerrit.httpd.CanonicalWebUrl.computeFromRequest ( req ) ) ; }
Source:
protected void bccWatchesNotifyAllComments ( ) { try { for ( final com.google.gerrit.reviewdb.client.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotify ( NotifyType.ALL_COMMENTS ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.server.OrmException err ) { } }

Target:
protected void bccWatches ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { add ( RecipientType.BCC , user ) ; } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { if ( oldName != null ) { byName.invalidate ( oldName.get ( ) ) ; } if ( newName != null ) { byName.invalidate ( newName.get ( ) ) ; } }

Target:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) throws java.io.IOException { if ( oldName != null ) { byName.invalidate ( oldName.get ( ) ) ; } if ( newName != null ) { byName.invalidate ( newName.get ( ) ) ; } indexer.get ( ) . index ( get ( newName ) . getGroupUUID ( ) ) ; }
Source:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ListChangeEdits.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; factory ( ChangeEdits.DeleteEdit.Factory.class ) ; }
Source:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( ) throws java.lang.Exception { return createChangeWithTopic ( testRepo , "foo2" , "a message" , "a.txt" , "content\n" ) ; }
Source:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { checkUpdate ( update ) ; update.setChangeMessage ( message.getMessage ( ) ) ; setTopic ( update ) ; }

Target:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { checkUpdate ( update ) ; update.setChangeMessage ( message.getMessage ( ) ) ; setTopic ( update ) ; if ( status.isPresent ( ) ) { com.google.gerrit.reviewdb.client.Change.Status s = status.get ( ) ; update.fixStatus ( s ) ; noteDbChange.setStatus ( s ) ; if ( s == ( Change.Status.MERGED ) ) { update.setSubmissionId ( change.getSubmissionId ( ) ) ; noteDbChange.setSubmissionId ( change.getSubmissionId ( ) ) ; } } }
Source:
public void testQuote1 ( ) { java.lang.String comment = "> I\'m happy\n > with quotes!\n\nSee above." ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "I\'m happy\nwith quotes!" ) ; assertBlock ( result , 1 , BlockType.PARAGRAPH , "See above." ) ; }

Target:
public void testQuote2 ( ) { java.lang.String comment = "See this said:\n\n > a quoted\n > string block\n\nOK?" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 3 ) ; assertBlock ( result , 0 , BlockType.PARAGRAPH , "See this said:" ) ; assertQuoteBlock ( result , 1 , 1 ) ; assertBlock ( result.get ( 1 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "a quoted\nstring block" ) ; assertBlock ( result , 2 , BlockType.PARAGRAPH , "OK?" ) ; }
Source:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.server.notedb.ReviewerState , com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.ApprovalsUtil.getReviewers ( db.patchSetApprovals ( ) . byChange ( changeId ) ) ; }

Target:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.server.notedb.ReviewerState , com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.getReviewers ( db.patchSetApprovals ( ) . byChange ( notes.getChangeId ( ) ) ) ; } return notes.load ( ) . getReviewers ( ) ; }
Source:
protected boolean canDeletePrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return ( user.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) ; }

Target:
protected com.google.gerrit.extensions.conditions.BooleanCondition canDeletePrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return com.google.gerrit.extensions.conditions.BooleanCondition.or ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) , user.testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ; }
Source:
public void set ( com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.client.change.ChangeScreen2.Style style , com.google.gwt.user.client.ui.Widget editButton , com.google.gwt.user.client.ui.Widget replyButton , boolean editExists ) { this . base = base ; this . curr = curr ; this . style = style ; this . editButton = editButton ; this . replyButton = replyButton ; this . editExists = editExists ; }

Target:
public void set ( com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.client.change.ChangeScreen2.Style style , com.google.gwt.user.client.ui.Widget editButton , com.google.gwt.user.client.ui.Widget replyButton , com.google.gerrit.client.change.FileTable.Mode mode , boolean editExists ) { this . base = base ; this . curr = curr ; this . style = style ; this . editButton = editButton ; this . replyButton = replyButton ; this . mode = mode ; this . editExists = editExists ; }
Source:
private synchronized void runHook ( org.eclipse.jgit.lib.Repository repo , java.io.File hook , java.util.List < java.lang.String > args ) { if ( repo != null ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( repo , hook , args ) ) ; } else { repo.close ( ) ; } } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Submit Revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Submit revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }
Source:
private void setStarred ( final boolean s ) { com.google.gerrit.common.data.ChangeDetail detail = cache.getChangeDetailCache ( ) . get ( ) ; if ( detail != null ) { detail.setStarred ( s ) ; } }

Target:
private void setStarred ( final boolean s ) { com.google.gerrit.common.data.ChangeDetail detail = cache.getChangeDetailCache ( ) . get ( ) ; if ( detail != null ) { detail.setStarred ( s ) ; } com.google.gerrit.common.data.ChangeInfo info = cache.getChangeInfoCache ( ) . get ( ) ; if ( info != null ) { info.setStarred ( s ) ; } }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : case DESCRIBE : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; case ARCHIVE : case BLAME : case DIFF : case DOC : case LOG : case PATH : case REVISION : case ROOTED_DOC : case SHOW : default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }
Source:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { try { final net.sf.ehcache.config.CacheConfiguration c ; c = mgr.getDefaultCacheConfiguration ( ) . clone ( ) ; c.setName ( name ) ; return c ; } catch ( java.lang.CloneNotSupportedException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot configure cache " + name ) , e ) ; } }

Target:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { net.sf.ehcache.config.CacheConfiguration c = newConfiguration ( ) ; c.setName ( name ) ; return c ; }
Source:
public void listBranchesOfNonVisibleProject_NotFound ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; com.google.common.truth.Truth.assertThat ( userSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) . getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NOT_FOUND ) ; }

Target:
public void listBranchesOfNonVisibleProject_NotFound ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; setApiUser ( user ) ; try { gApi.projects ( ) . name ( project.get ( ) ) . branches ( ) . get ( ) ; org.junit.Assert.fail ( "Expected ResourceNotFoundException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException expected ) { } }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > assignee = com.google.common.base.Optional.fromNullable ( rsrc.getChange ( ) . getAssignee ( ) ) ; if ( assignee.isPresent ( ) ) { com.google.gerrit.reviewdb.client.Account account = accountInfo.create ( ) . get ( assignee.get ( ) ) ; return com.google.gerrit.extensions.restapi.Response.ok ( com.google.gerrit.server.account.AccountJson.toAccountInfo ( account ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > assignee = java.util.Optional.ofNullable ( rsrc.getChange ( ) . getAssignee ( ) ) ; if ( assignee.isPresent ( ) ) { com.google.gerrit.reviewdb.client.Account account = accountInfo.create ( ) . get ( assignee.get ( ) ) ; return com.google.gerrit.extensions.restapi.Response.ok ( com.google.gerrit.server.account.AccountJson.toAccountInfo ( account ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public boolean isIdentityTrustable ( java.util.Collection < com.google.gerrit.server.account.ExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : case OAUTH : return true ; case OPENID_SSO : return true ; case OPENID : for ( com.google.gerrit.server.account.ExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }

Target:
public boolean isIdentityTrustable ( java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : case OAUTH : return true ; case OPENID_SSO : return true ; case OPENID : for ( com.google.gerrit.server.account.externalids.ExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }

Target:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.bz.BugzillaModule.log.info ( "Bugzilla is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.bz.BugzillaItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.bz.BugzillaModule.log.info ( "Bugzilla is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.bz.BugzillaItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
protected static boolean isJsonBody ( final com.google.gwt.http.client.Response rsp ) { java.lang.String type = rsp.getHeader ( "Content-Type" ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonUtil.JSONRPC20_ACCEPT_CTS.contains ( type ) ; }

Target:
protected static boolean isJsonBody ( final com.google.gwt.http.client.Response rsp ) { java.lang.String type = rsp.getHeader ( "Content-Type" ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonConstants.JSONRPC20_ACCEPT_CTS.contains ( type ) ; }
Source:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendRaw ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gerrit.client.rpc.HttpCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpImpl < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpImpl ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_TYPE ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendText ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gerrit.client.rpc.HttpCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpImpl < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpImpl ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_UTF8 ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
private static int getInt ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
private static int getInt ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed to retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.SshKeyInfo > result ) { keys.display ( com.google.gerrit.client.rpc.Natives.asList ( result ) ) ; if ( ( ( result.length ( ) ) == 0 ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 1 ) ; results = query ( "status:closed" ) ; com.google.common.truth.Truth.assertThat ( results.isEmpty ( ) ) . isTrue ( ) ; }

Target:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 1 ) ; results = query ( "status:closed" ) ; com.google.common.truth.Truth.assertThat ( results ) . isEmpty ( ) ; }
Source:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( patchKey.getParentKey ( ) . getParentKey ( ) , getUser ( ) ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( getDb ( ) , patchKey.getParentKey ( ) . getParentKey ( ) , getUser ( ) ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }
Source:
public static void doSignOut ( ) { com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) && ( com.google.gerrit.client.Gerrit.currentScreen.isRequiresSignIn ( ) ) ) { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } }

Target:
public static void doSignOut ( ) { com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) && ( com.google.gerrit.client.Gerrit.currentScreen.isRequiresSignIn ( ) ) ) { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } }
Source:
public static void setUsername ( java.lang.String account , java.lang.String username , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeString > cb ) { com.google.gerrit.client.account.AccountApi.UsernameInput input = com.google.gerrit.client.account.AccountApi.UsernameInput.create ( ) ; input.username ( username ) ; com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "username" ) . put ( input , cb ) ; }

Target:
public static void setUsername ( java.lang.String account , java.lang.String username , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeString > cb ) { com.google.gerrit.client.account.AccountApi.UsernameInput input = com.google.gerrit.client.account.AccountApi.UsernameInput.create ( ) ; input.username ( username ) ; new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "username" ) . put ( input , cb ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toInstance ( new com.google.gerrit.server.config.AllProjectsName ( "All-Projects" ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . toInstance ( new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; bind ( com.google.gerrit.server.schema.DataSourceType.class ) . to ( com.google.gerrit.testutil.InMemoryH2Type.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toInstance ( new com.google.gerrit.server.config.AllProjectsName ( "All-Projects" ) ) ; bind ( com.google.gerrit.server.config.AllUsersName.class ) . toInstance ( new com.google.gerrit.server.config.AllUsersName ( "All-Users" ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . toInstance ( new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; bind ( com.google.gerrit.server.schema.DataSourceType.class ) . to ( com.google.gerrit.testutil.InMemoryH2Type.class ) ; }