auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void performAction ( final java.lang.String bugId , final java.lang.String actionName , final java.lang.String actionValue ) throws com.j2bugzilla.base.BugzillaException { com.j2bugzilla.base.Bug bug = getBug ( bugId ) ; if ( validateAction ( actionName , actionValue ) ) { if ( actionName.equals ( "status" ) ) { bug.setStatus ( actionValue ) ; } } connector.executeMethod ( new com.j2bugzilla.rpc.UpdateBug ( bug ) ) ; }

Target:
public void performAction ( final java.lang.String bugId , final java.lang.String actionName , final java.lang.String actionValue ) throws com.j2bugzilla.base.BugzillaException { com.j2bugzilla.base.Bug bug = getBug ( bugId ) ; if ( validateAction ( actionName , actionValue ) ) { if ( actionName.equals ( "status" ) ) { bug.setStatus ( actionValue ) ; } else if ( actionName.equals ( "resolution" ) ) { bug.setResolution ( actionValue ) ; } } connector.executeMethod ( new com.j2bugzilla.rpc.UpdateBug ( bug ) ) ; }
Source:
public void testCreate_Empty ( ) throws java.io.FileNotFoundException { final java.io.File root = random ( ) ; try { assertTrue ( root.mkdir ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; } finally { root.delete ( ) ; } }

Target:
public void testCreate_Empty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { assertTrue ( root.mkdir ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; } finally { root.delete ( ) ; } }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return getProjectControl ( ) . getCurrentUser ( ) ; }

Target:
public com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( getRefName ( ) ) ; } else { return new com.google.gerrit.server.project.RefControl ( newCtl , getRefName ( ) , relevant ) ; } }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }
Source:
public void dateOneOnly ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; java.lang.String oldDate = "1990-10-10 10:00:00" ; params.put ( "t1" , oldDate ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; com.google.common.truth.Truth.assertThat ( query ) . contains ( java.lang.String.format ( "'%s' and " , oldDate ) ) ; }

Target:
public void dateOneOnly ( ) 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.google.common.truth.Truth.assertThat ( query ) . contains ( java.lang.String.format ( "'%s' and " , com.ericsson.gerrit.plugins.eventslog.sql.QueryMakerTest.OLD_DATE ) ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }

Target:
private java.sql.Timestamp getSubmittedOn ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSetApproval > s = cd.getSubmitApproval ( ) ; return s.isPresent ( ) ? s.get ( ) . getGranted ( ) : null ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerInNoteDb ( ) 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%notify=OWNER" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertPatchSet ( c ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; deleteRef ( refName ) ; assertProblems ( c , ( "Ref missing: " + refName ) ) ; }

Target:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , ctl.getNotes ( ) ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = ctl.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }
Source:
private static void putApprovals ( com.google.gerrit.server.notedb.ChangeUpdate update , java.util.Map < java.lang.String , com.google.common.base.Optional < java.lang.Short > > approvals ) { for ( java.util.Map.Entry < java.lang.String , com.google.common.base.Optional < java.lang.Short > > e : approvals.entrySet ( ) ) { if ( e.getValue ( ) . isPresent ( ) ) { update.putApproval ( e.getKey ( ) , e.getValue ( ) . get ( ) ) ; } else { update.removeApproval ( e.getKey ( ) ) ; } } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetApproval apply ( com.google.gerrit.reviewdb.client.PatchSetApproval in ) { if ( in.getPatchSetId ( ) . equals ( psId ) ) { return in ; } else { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( psId , in ) ; } }
Source:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } com.googlesource.gerrit.plugins.replication.PushOne.repLog.info ( ( ( ( "Push to " + ( uri ) ) + " references: " ) + todo ) ) ; return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }

Target:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( ( ( "Push to " + ( uri ) ) + " references: " ) + todo ) ) ; return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }
Source:
private void cleanInBackground ( ) { int cnt = java.lang.Math.max ( 0 , ( ( cleanupHandles.size ( ) ) - ( running.size ( ) ) ) ) ; if ( 0 < cnt ) { cleaner.get ( ) . clean ( cnt ) ; } }

Target:
private void cleanInBackground ( ) { int cnt = toCleanup.size ( ) ; if ( 0 < cnt ) { cleaner.get ( ) . clean ( cnt ) ; } }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "reviewers" ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reviewers" , null , ProjectConfigEntry.Type.ARRAY , null , false , "Users or groups can be provided as reviewers" ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "reviewer" ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reviewers" , null , ProjectConfigEntry.Type.ARRAY , null , false , "Users or groups can be provided as reviewers" ) ) ; }
Source:
private boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . all ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }

Target:
private boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { cd = ( cd != null ) ? cd : changeDataFactory.create ( db , notes ) ; java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = cd.reviewers ( ) . all ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }
Source:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { for ( final com.google.gerrit.reviewdb.client.Account.Id id : authors ) { add ( rt , id ) ; } }
Source:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = null ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , new com.google.gerrit.reviewdb.Project ( parent ) , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; return ps ; }

Target:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = new com.google.gerrit.reviewdb.Project.NameKey ( "-- All Projects --" ) ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.reviewdb.Project project = new com.google.gerrit.reviewdb.Project ( parent ) ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , project , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; return ps ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor , final org.eclipse.jgit.lib.Repository changeRepo ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , changeRepo ) ; return null ; } } ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { rebuild ( db , id ) ; } return null ; } } ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index -- ; index > ( - 1 ) ; index -- ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; if ( link != null ) { return link ; } } return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( previousPatchIndex , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; return link ; }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { java.lang.String oauthToken = token.getToken ( ) ; org.kohsuke.github.GitHub hub = org.kohsuke.github.GitHub.connectUsingOAuth ( oauthToken ) ; org.kohsuke.github.GHMyself myself = hub.getMyself ( ) ; java.lang.String login = myself.getLogin ( ) ; return new com.google.gerrit.extensions.auth.oauth.OAuthUserInfo ( ( ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT ) + login ) , login , myself.getEmail ( ) , myself.getName ( ) , null ) ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { java.lang.String oauthToken = token.getToken ( ) ; org.kohsuke.github.GitHub hub = org.kohsuke.github.GitHub.connectUsingOAuth ( oauthToken ) ; org.kohsuke.github.GHMyself myself = hub.getMyself ( ) ; java.lang.String login = myself.getLogin ( ) ; return new com.google.gerrit.extensions.auth.oauth.OAuthUserInfo ( ( ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GERRIT ) + login ) , login , myself.getEmail ( ) , myself.getName ( ) , null ) ; }
Source:
private void assertMembers ( java.lang.String group , com.google.gerrit.acceptance.TestAccount ... members ) throws java.lang.Exception { com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfos ( java.util.Arrays.asList ( members ) , gApi.groups ( ) . id ( group ) . members ( ) ) ; }

Target:
private void assertMembers ( java.lang.String group , com.google.gerrit.acceptance.TestAccount ... expectedMembers ) throws java.lang.Exception { assertMembers ( gApi.groups ( ) . id ( group ) . members ( ) , com.google.gerrit.acceptance.TestAccount.names ( expectedMembers ) . toArray ( java.lang.String.class ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfos ( java.util.Arrays.asList ( expectedMembers ) , gApi.groups ( ) . id ( group ) . members ( ) ) ; }
Source:
public void testUpsertTwoBothExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }

Target:
public void upsertTwoBothExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.Action < T > action , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> action.call ( ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }

Target:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> action.call ( ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( actionType ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }
Source:
private boolean recursiveDelete ( java.io.File file ) { if ( file.isDirectory ( ) ) { java.io.File [ ] contents = file.listFiles ( ) ; if ( contents == null ) { return false ; } for ( java.io.File f : contents ) { if ( ! ( recursiveDelete ( f ) ) ) { return false ; } } } return file.delete ( ) ; }

Target:
public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException e ) throws java.io.IOException { if ( e != null ) { throw e ; } java.nio.file.Files.delete ( dir ) ; return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; replication = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; sshProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; replication = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) { return com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public java.util.Collection < java.lang.String > getWarnings ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.Collection < java.lang.String > ret = com.google.common.collect.Lists.newArrayList ( ) ; com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.Change > openChanges = db.changes ( ) . byProjectOpenAll ( project.getNameKey ( ) ) ; if ( openChanges.iterator ( ) . hasNext ( ) ) { ret.add ( ( ( project.getName ( ) ) + " has open changes" ) ) ; } return ret ; }

Target:
public java.util.Collection < java.lang.String > getWarnings ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.Collection < java.lang.String > ret = com.google.common.collect.Lists.newArrayList ( ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > openChanges = queryProvider.get ( ) . byProjectOpen ( project.getNameKey ( ) ) ; if ( openChanges.iterator ( ) . hasNext ( ) ) { ret.add ( ( ( project.getName ( ) ) + " has open changes" ) ) ; } return ret ; }
Source:
com.google.gerrit.client.account.DiffPreferences getPrefs ( ) { return prefs ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; com.google.gerrit.client.JumpKeys.enable ( false ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } resizeHandler = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; } } ) ; }
Source:
public boolean retryRequest ( java.io.IOException exception , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( ( executionCount > ( cfg.getMaxTries ( ) ) ) || ( exception instanceof javax.net.ssl.SSLException ) ) { return false ; } logRetry ( exception.getMessage ( ) ) ; try { java.lang.Thread.sleep ( cfg.getRetryInterval ( ) ) ; } catch ( java.lang.InterruptedException e ) { com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.log.debug ( "Ignoring InterruptedException" , e ) ; } return true ; }

Target:
public boolean retryRequest ( java.io.IOException exception , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( ( executionCount > ( cfg.getMaxTries ( ) ) ) || ( exception instanceof javax.net.ssl.SSLException ) ) { return false ; } logRetry ( exception.getMessage ( ) ) ; try { java.lang.Thread.sleep ( cfg.getRetryInterval ( ) ) ; } catch ( java.lang.InterruptedException e ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; return false ; } return true ; }
Source:
public void execute ( ) { java.lang.String orig = strings.get ( tb ) ; if ( orig == null ) { orig = "" ; } if ( ! ( orig.equals ( tb.getText ( ) ) ) ) { widget.setEnabled ( true ) ; } }

Target:
public void execute ( ) { java.lang.String orig = strings.get ( tb ) ; if ( orig == null ) { orig = "" ; } if ( ! ( orig.equals ( tb.getText ( ) . trim ( ) ) ) ) { widget.setEnabled ( true ) ; } }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
boolean wouldPushProject ( final com.google.gerrit.reviewdb.client.Project.NameKey project ) { if ( ! ( isVisible ( project ) ) ) { return false ; } java.lang.String [ ] projects = config.getProjects ( ) ; if ( ( projects.length ) < 1 ) { return true ; } return new com.googlesource.gerrit.plugins.replication.ReplicationFilter ( java.util.Arrays.asList ( projects ) ) . matches ( project ) ; }

Target:
boolean isSingleProjectMatch ( ) { java.util.List < java.lang.String > projects = config.getProjects ( ) ; boolean ret = ( projects.size ( ) ) == 1 ; if ( ret ) { java.lang.String projectMatch = projects.get ( 0 ) ; if ( ( com.googlesource.gerrit.plugins.replication.ReplicationFilter.getPatternType ( projectMatch ) ) != ( ReplicationFilter.PatternType.EXACT_MATCH ) ) { ret = false ; } } return ret ; }
Source:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.metaA ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.metaB ( ) ) ) ; } }
Source:
java.util.Map < eu.medsea.mimeutil.MimeType , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter > getMimeTypes ( ) { java.util.Map < eu.medsea.mimeutil.MimeType , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter > mimeTypes = new java.util.HashMap < > ( ) ; for ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter f : com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter.values ( ) ) { for ( java.lang.String mimeType : cfg.getStringList ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , f.name ( ) , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE ) ) { mimeTypes.put ( new eu.medsea.mimeutil.MimeType ( mimeType ) , f ) ; } } return mimeTypes ; }

Target:
static void initialize ( org.eclipse.jgit.lib.Config cfg ) { cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , MarkdownFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/x-markdown" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , PlainTextFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/plain" ) ; }
Source:
private void sendHtml ( javax.servlet.http.HttpServletResponse res , org.w3c.dom.Document doc ) throws java.io.IOException { byte [ ] bin = com.google.gerrit.httpd.HtmlDomUtil.toUTF8 ( doc ) ; res.setStatus ( HttpServletResponse.SC_UNAUTHORIZED ) ; res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( "UTF-8" ) ; res.setContentLength ( bin.length ) ; try ( javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ) { out.write ( bin ) ; } }

Target:
private void sendHtml ( javax.servlet.http.HttpServletResponse res , org.w3c.dom.Document doc ) throws java.io.IOException { byte [ ] bin = com.google.gerrit.httpd.HtmlDomUtil.toUTF8 ( doc ) ; res.setStatus ( HttpServletResponse.SC_UNAUTHORIZED ) ; res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; res.setContentLength ( bin.length ) ; try ( javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ) { out.write ( bin ) ; } }
Source:
private static java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > myOwnedGroups ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > r = new java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroupMember m : db.accountGroupMembers ( ) . owned ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) ) ) { r.add ( m.getAccountGroupId ( ) ) ; } return r ; }

Target:
private static java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > ids ( final java.util.Collection < com.google.gerrit.client.reviewdb.AccountGroup > groupList ) { final java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > r = new java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup group : groupList ) { r.add ( group.getId ( ) ) ; } return r ; }
Source:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { com.google.gerrit.client.Dispatcher.select ( result.url ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "/dashboard/" , result.url ( ) ) ) { java.lang.String rest = com.google.gerrit.client.Dispatcher.skip ( result.url ( ) ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.CustomDashboardScreen ( rest.substring ( 1 ) ) ) ; } }
Source:
public void testParseComplex ( ) throws java.lang.Exception { com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , com.google.gerrit.server.git.DestinationListTest.L_COMPLEX , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . contains ( com.google.gerrit.server.git.DestinationListTest.B_COMPLEX ) ; }

Target:
public void testParseComplex ( ) throws java.lang.Exception { com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , com.google.gerrit.server.account.DestinationListTest.L_COMPLEX , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . contains ( com.google.gerrit.server.account.DestinationListTest.B_COMPLEX ) ; }
Source:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , commit , "submit" ) . data ( in ) . post ( cb ) ; }

Target:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . data ( in ) . post ( cb ) ; }
Source:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( "A Anonymous Coward B" , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NullUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ident.getName ( ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void setCurrentPatchSet ( final com.google.gerrit.reviewdb.client.PatchSetInfo ps ) { currentPatchSetId = ps.getKey ( ) . get ( ) ; subject = ps.getSubject ( ) ; }

Target:
public void setCurrentPatchSet ( final com.google.gerrit.reviewdb.client.PatchSetInfo ps ) { if ( ( ( originalSubject ) == null ) && ( ( subject ) != null ) ) { originalSubject = subject ; } currentPatchSetId = ps.getKey ( ) . get ( ) ; subject = ps.getSubject ( ) ; if ( ( originalSubject ) == null ) { originalSubject = subject ; } }
Source:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( java.lang.String reason , org.eclipse.jgit.lib.ObjectInserter inserter ) throws java.io.IOException , java.io.UnsupportedEncodingException { java.lang.String noteContent = ( reason != null ) ? reason : "" ; if ( ( ( noteContent.length ( ) ) > 0 ) && ( ! ( noteContent.endsWith ( "\n" ) ) ) ) { noteContent = noteContent + "\n" ; } return inserter.insert ( Constants.OBJ_BLOB , noteContent.getBytes ( "UTF-8" ) ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( java.lang.String reason , org.eclipse.jgit.lib.ObjectInserter inserter ) throws java.io.IOException { java.lang.String noteContent = ( reason != null ) ? reason : "" ; if ( ( ( noteContent.length ( ) ) > 0 ) && ( ! ( noteContent.endsWith ( "\n" ) ) ) ) { noteContent = noteContent + "\n" ; } return inserter.insert ( Constants.OBJ_BLOB , noteContent.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest req , javax.servlet.ServletResponse rsp , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { if ( ! ( user.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { ( ( javax.servlet.http.HttpServletResponse ) ( rsp ) ) . sendError ( HttpServletResponse.SC_NOT_FOUND , "Not Found" ) ; return ; } chain.doFilter ( req , rsp ) ; }

Target:
public void doFilter ( javax.servlet.ServletRequest req , javax.servlet.ServletResponse rsp , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { try { permissionBackend.user ( user ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { ( ( javax.servlet.http.HttpServletResponse ) ( rsp ) ) . sendError ( HttpServletResponse.SC_NOT_FOUND , "Not Found" ) ; return ; } chain.doFilter ( req , rsp ) ; }
Source:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.History.newItem ( com.google.gerrit.client.Dispatcher.toGroup ( getRowItem ( row ) . getGroupId ( ) ) ) ; }

Target:
protected void onOpenRow ( final int row ) { com.google.gerrit.client.groups.GroupInfo groupInfo = getRowItem ( row ) ; if ( isInteralGroup ( groupInfo ) ) { com.google.gwt.user.client.History.newItem ( com.google.gerrit.client.Dispatcher.toGroup ( groupInfo.getGroupId ( ) ) ) ; } else if ( ( groupInfo.url ( ) ) != null ) { com.google.gwt.user.client.Window.open ( groupInfo.url ( ) , "_self" , null ) ; } }
Source:
public static com.google.gerrit.reviewdb.AccountExternalId mostRecent ( java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > all ) { com.google.gerrit.reviewdb.AccountExternalId mostRecent = null ; for ( final com.google.gerrit.reviewdb.AccountExternalId e : all ) { final java.sql.Timestamp lastUsed = e.getLastUsedOn ( ) ; if ( lastUsed == null ) { continue ; } if ( e.isScheme ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_MAILTO ) ) { continue ; } if ( ( mostRecent == null ) || ( ( lastUsed.getTime ( ) ) > ( mostRecent.getLastUsedOn ( ) . getTime ( ) ) ) ) { mostRecent = e ; } } return mostRecent ; }

Target:
public void setCanDelete ( final boolean t ) { canDelete = t ; }
Source:
public com.google.gerrit.extensions.client.DiffPreferencesInfo 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 ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "restricted to administrator" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.gerrit.server.account.GetDiffPreferences.readFromGit ( id , gitMgr , allUsersName.get ( ) , null ) ; }

Target:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.gerrit.server.account.GetDiffPreferences.readFromGit ( id , gitMgr , allUsersName.get ( ) , null ) ; }
Source:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { add ( rt , change.getOwner ( ) ) ; if ( ( patchSet ) != null ) { add ( rt , patchSet.getUploader ( ) ) ; } if ( ( patchSetInfo ) != null ) { add ( rt , patchSetInfo.getAuthor ( ) ) ; add ( rt , patchSetInfo.getCommitter ( ) ) ; } }

Target:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { for ( final com.google.gerrit.reviewdb.Account.Id id : authors ) { add ( rt , id ) ; } }
Source:
public int compare ( com.googlecode.prolog_cafe.builtin.Term t1 , com.googlecode.prolog_cafe.builtin.Term t2 ) { com.googlecode.prolog_cafe.builtin.Term arg1 = ( ( com.googlecode.prolog_cafe.builtin.StructureTerm ) ( t1 ) ) . args ( ) [ 0 ] . dereference ( ) ; com.googlecode.prolog_cafe.builtin.Term arg2 = ( ( com.googlecode.prolog_cafe.builtin.StructureTerm ) ( t2 ) ) . args ( ) [ 0 ] . dereference ( ) ; return arg1.compareTo ( arg2 ) ; }

Target:
public int compare ( com.googlecode.prolog_cafe.lang.Term t1 , com.googlecode.prolog_cafe.lang.Term t2 ) { com.googlecode.prolog_cafe.lang.Term arg1 = ( ( com.googlecode.prolog_cafe.lang.StructureTerm ) ( t1 ) ) . args ( ) [ 0 ] . dereference ( ) ; com.googlecode.prolog_cafe.lang.Term arg2 = ( ( com.googlecode.prolog_cafe.lang.StructureTerm ) ( t2 ) ) . args ( ) [ 0 ] . dereference ( ) ; return arg1.compareTo ( arg2 ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "repo" ) ) ) ; servlet = com.google.gitiles.TestGitilesServlet.create ( repo ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.eclipse.jgit.junit.MockSystemReader mockSystemReader = new org.eclipse.jgit.junit.MockSystemReader ( ) ; org.eclipse.jgit.util.SystemReader.setInstance ( mockSystemReader ) ; org.eclipse.jgit.internal.storage.dfs.DfsRepository r = new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "repo" ) ) ; repo = new org.eclipse.jgit.junit.TestRepository ( r , new org.eclipse.jgit.revwalk.RevWalk ( r ) , mockSystemReader ) ; servlet = com.google.gitiles.TestGitilesServlet.create ( repo ) ; }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.LOG.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , scopesString , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }

Target:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.LOG.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; response.sendRedirect ( getAuthorizationUrl ( scopesString , ( ( me ( ) ) + ( request.getRequestURI ( ) . toString ( ) ) ) ) ) ; }
Source:
public static void rebase ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "rebase" ) . post ( in , cb ) ; }

Target:
public static void rebase ( int id , java.lang.String commit , java.lang.String base , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.RebaseInput rebaseInput = com.google.gerrit.client.changes.ChangeApi.RebaseInput.create ( ) ; rebaseInput.setBase ( base ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "rebase" ) . post ( rebaseInput , cb ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAgreements ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.AgreementInfo > ( this ) { @ java.lang.Override public void preDisplay ( final com.google.gerrit.common.data.AgreementInfo result ) { agreements.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountApi.getAgreements ( "self" , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.AgreementInfo > > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.AgreementInfo > result ) { agreements.display ( com.google.gerrit.client.rpc.Natives.asList ( result ) ) ; } } ) ; }
Source:
private void assertBranches ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { java.util.List < java.lang.String > expected = com.google.common.collect.Lists.newArrayList ( "HEAD" , RefNames.REFS_CONFIG , "refs/heads/master" ) ; expected.addAll ( branches ) ; com.google.gerrit.acceptance.rest.project.RefAssert.assertRefNames ( expected , project ( ) . branches ( ) . get ( ) ) ; }

Target:
private void assertBranches ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { java.util.List < java.lang.String > expected = com.google.common.collect.Lists.newArrayList ( "HEAD" , RefNames.REFS_CONFIG , "refs/heads/master" ) ; expected.addAll ( branches.stream ( ) . map ( ( b ) -> prefixRef ( b ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; com.google.gerrit.acceptance.rest.project.RefAssert.assertRefNames ( expected , project ( ) . branches ( ) . get ( ) ) ; }
Source:
public com.google.gerrit.server.change.PatchSetInserter setRefControl ( com.google.gerrit.server.project.RefControl refControl ) { this . refControl = refControl ; return this ; }

Target:
private void init ( ) { if ( ( sshInfo ) == null ) { sshInfo = new com.google.gerrit.server.ssh.NoSshInfo ( ) ; } if ( ( patchSet ) == null ) { patchSet = new com.google.gerrit.reviewdb.client.PatchSet ( com.google.gerrit.server.ChangeUtil.nextPatchSetId ( git , change.currentPatchSetId ( ) ) ) ; patchSet.setCreatedOn ( new java.sql.Timestamp ( java.lang.System.currentTimeMillis ( ) ) ) ; patchSet.setUploader ( change.getOwner ( ) ) ; patchSet.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( commit.name ( ) ) ) ; } }