auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin = loginProvider.get ( ) ; if ( ! ( hubLogin.isLoggedIn ( Scope.USER ) ) ) { hubLogin.login ( request , response , Scope.USER ) ; return ; } else { chain.doFilter ( request , response ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin = loginProvider.get ( ) ; if ( ! ( hubLogin.isLoggedIn ( authScopes ) ) ) { hubLogin.login ( request , response , authScopes ) ; return ; } else { chain.doFilter ( request , response ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( webLink.getBranchWebLink ( project , branch ) ) ; } return links ; }
Source:
private void setLabelValues ( com.google.gerrit.common.data.LabelType type , com.google.gerrit.server.change.LabelInfo label ) { label.values = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( com.google.gerrit.common.data.LabelValue v : type.getValues ( ) ) { label.values.put ( v.formatValue ( ) , v.getText ( ) ) ; } if ( com.google.gerrit.server.change.ChangeJson.isOnlyZero ( label.values.keySet ( ) ) ) { label.values = null ; } }

Target:
private void setLabelValues ( com.google.gerrit.common.data.LabelType type , com.google.gerrit.server.change.ChangeJson.LabelInfo label ) { label.values = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( com.google.gerrit.common.data.LabelValue v : type.getValues ( ) ) { label.values.put ( v.formatValue ( ) , v.getText ( ) ) ; } if ( com.google.gerrit.server.change.ChangeJson.isOnlyZero ( label.values.keySet ( ) ) ) { label.values = null ; } }
Source:
public void run ( ) { try { com.google.gerrit.git.PushQueue.notifyStarting ( this ) ; pushImpl ( ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.git.PushOp.log.error ( "Unexpected error during replication" , e ) ; } catch ( java.lang.Error e ) { com.google.gerrit.git.PushOp.log.error ( "Unexpected error during replication" , e ) ; } }

Target:
void addRef ( final java.lang.String ref ) { if ( com.google.gerrit.git.PushOp.MIRROR_ALL.equals ( ref ) ) { delta.clear ( ) ; mirror = true ; } else if ( ! ( mirror ) ) { delta.add ( ref ) ; } }
Source:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accountCreator.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }

Target:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accountCreator.create ( "missing" ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( owner.getId ( ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }
Source:
private void loadCommit ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.is_edit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.CommitInfo info ) { rev.set_commit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
private void loadCommit ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.isEdit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }
Source:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.owner , sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { com.google.gerrit.common.changes.Side side = ( cm == ( cmA ) ) ? com.google.gerrit.common.changes.Side.PARENT : com.google.gerrit.common.changes.Side.REVISION ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , ( line + 1 ) , null , null ) ; return addDraftBox ( info , false ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createLine ( path , getSideFromCm ( cm ) , ( line + 1 ) , null , null ) ) ; }
Source:
public static boolean isStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.gerrit.reviewdb.client.Change indexChange , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Change reviewDbChange , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { return ( com.google.gerrit.server.index.change.StalenessChecker.reviewDbChangeIsStale ( indexChange , reviewDbChange ) ) || ( com.google.gerrit.server.index.change.StalenessChecker.refsAreStale ( repoManager , id , states , patterns ) ) ; }

Target:
public static boolean isStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.gerrit.reviewdb.client.Change indexChange , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Change reviewDbChange , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { return ( com.google.gerrit.server.index.change.StalenessChecker.reviewDbChangeIsStale ( indexChange , reviewDbChange ) ) || ( com.google.gerrit.server.index.change.StalenessChecker.refsAreStale ( repoManager , id , states , patterns ) ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; 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_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInNoteDb ( ) 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%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { createLuceneIndex ( ) ; } else { ui.message ( ( "The index must be built before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) ) ; initFlags.autoStart = false ; } }

Target:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( site , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , true ) ; } else { ui.message ( ( "The index must be built before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) ) ; initFlags.autoStart = false ; } }
Source:
public java.lang.Runnable doScroll ( final net.codemirror.lib.CodeMirror cm ) { final net.codemirror.lib.CodeMirror other = ( cm == ( cmA ) ) ? cmB : cmA ; return new java.lang.Runnable ( ) { public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; } } ; }

Target:
private net.codemirror.lib.CodeMirror otherCM ( net.codemirror.lib.CodeMirror me ) { return me == ( cmA ) ? cmB : cmA ; }
Source:
public void manualCertificationMatchesExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "myId" , null ) ; assertNoProblems ( com.google.gerrit.gpg.testutil.TestKey.key5 ( ) ) ; }

Target:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }
Source:
private void review ( java.lang.String changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy strategy , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.NotifyHandling notify ) throws java.lang.Exception { com.google.gerrit.extensions.client.GeneralPreferencesInfo prefs = gApi.accounts ( ) . self ( ) . getPreferences ( ) ; prefs.emailStrategy = strategy ; gApi.accounts ( ) . self ( ) . setPreferences ( prefs ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ; in.notify = notify ; gApi.changes ( ) . id ( changeId ) . revision ( "current" ) . review ( in ) ; }

Target:
private void review ( com.google.gerrit.acceptance.TestAccount account , java.lang.String changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy strategy , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.NotifyHandling notify ) throws java.lang.Exception { setEmailStrategy ( account , strategy ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ; in.notify = notify ; gApi.changes ( ) . id ( changeId ) . revision ( "current" ) . review ( in ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException { try { com.google.gerrit.reviewdb.client.PatchSet patchSet = psUtil.get ( db , notes , psId ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( psId.getParentKey ( ) ) ; return get ( change , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.patch.PatchSetInfoNotAvailableException ( e ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException { try { com.google.gerrit.reviewdb.client.PatchSet patchSet = psUtil.get ( db , notes , psId ) ; return get ( notes.getProjectName ( ) , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.patch.PatchSetInfoNotAvailableException ( e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( currentUserProviderMock.get ( ) ) . thenReturn ( currentUserMock ) ; HEAD ( 3452000.0 ) ; com.ericsson.gerrit.plugins.highavailability.health.Update bazlets ; com.ericsson.gerrit.plugins.highavailability.health.latest revision = ( stable ) - 2.15 ; org.mockito.Mockito.when ( permissionBackendMock.user ( currentUserMock ) ) . thenReturn ( withUserMock ) ; org.mockito.Mockito.when ( withUserMock.testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) . thenReturn ( true ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( currentUserProviderMock , permissionBackendMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( currentUserProviderMock.get ( ) ) . thenReturn ( currentUserMock ) ; org.mockito.Mockito.when ( permissionBackendMock.user ( currentUserMock ) ) . thenReturn ( withUserMock ) ; org.mockito.Mockito.when ( withUserMock.testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) . thenReturn ( true ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( currentUserProviderMock , permissionBackendMock , tempFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
private void updateSubmoduleSubscriptions ( com.google.gerrit.server.git.MergeOp.OpenBranch ob , com.google.gerrit.server.git.SubmoduleOp subOp ) { com.google.gerrit.server.git.CodeReviewCommit branchTip = ob.oldTip ; com.google.gerrit.server.git.MergeTip mergeTip = ob.mergeTip ; }

Target:
private void updateSubmoduleSubscriptions ( com.google.gerrit.server.git.MergeOp.OpenBranch ob , com.google.gerrit.server.git.SubmoduleOp subOp ) { com.google.gerrit.server.git.CodeReviewCommit branchTip = ob.oldTip ; com.google.gerrit.server.git.MergeTip mergeTip = ob.mergeTip ; if ( ( mergeTip != null ) && ( ( branchTip == null ) || ( branchTip != ( mergeTip.getCurrentTip ( ) ) ) ) ) { logDebug ( "Updating submodule subscriptions for branch {}" , ob.name ) ; try { subOp.updateSubmoduleSubscriptions ( db , ob.name ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The submodule subscriptions were not updated according" + "to the .gitmodules files" ) , e ) ; } } }
Source:
public void testUpsertTwoFirstExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 2 ) ; }

Target:
public void testUpsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
private void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { java.util.concurrent.atomic.AtomicInteger accountGroupIdLock = getAndIncrementAccountGroupIdLock ( uuid ) ; synchronized ( accountGroupIdLock ) { indexer.index ( uuid ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexGroupRestApiServlet.logger.debug ( "Group successfully indexed" , uuid ) ; } if ( ( accountGroupIdLock.decrementAndGet ( ) ) == 0 ) { removeAccountGroupIdLock ( uuid ) ; } }

Target:
void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.Operation operation ) throws java.io.IOException { indexer.index ( uuid ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexGroupRestApiServlet.logger.debug ( "Group successfully indexed" , uuid ) ; }
Source:
protected void onInitUI ( ) { table = new com.google.gerrit.client.changes.DashboardTable ( params ) { @ java.lang.Override protected void onLoad ( ) { super . onLoad ( ) ; display ( ) ; } } ; super . onInitUI ( ) ; java.lang.String title = table.getTitle ( ) ; if ( title != null ) { setWindowTitle ( title ) ; setPageTitle ( title ) ; } add ( table ) ; }

Target:
public void finishDisplay ( ) { super . finishDisplay ( ) ; display ( ) ; }
Source:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) throws java.io.IOException { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.actions = com.google.gerrit.server.edit.ChangeEditJson.fillActions ( edit ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }

Target:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) throws java.io.IOException { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.baseRevision = edit.getBasePatchSet ( ) . getRevision ( ) . get ( ) ; out.actions = com.google.gerrit.server.edit.ChangeEditJson.fillActions ( edit ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }
Source:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . timeToIdle ( 12 , java.util.concurrent.TimeUnit.HOURS ) . timeToLive ( 0 , java.util.concurrent.TimeUnit.SECONDS ) ; bind ( com.google.gerrit.server.http.WebSessionManager.class ) ; bind ( com.google.gerrit.server.http.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }

Target:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . timeToIdle ( 12 , java.util.concurrent.TimeUnit.HOURS ) . timeToLive ( com.google.gerrit.server.cache.NamedCacheBinding.INFINITE , java.util.concurrent.TimeUnit.HOURS ) ; bind ( com.google.gerrit.server.http.WebSessionManager.class ) ; bind ( com.google.gerrit.server.http.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.AccountInfo > result ) { final java.util.ArrayList < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.AccountInfo p : result ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.AccountInfo > in ) { java.util.List < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( in.length ( ) ) ; for ( com.google.gerrit.client.account.AccountInfo p : com.google.gerrit.client.rpc.Natives.asList ( in ) ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
public com.google.gerrit.reviewdb.Project getProject ( ) { return getConfig ( ) . getProject ( ) ; }

Target:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.compiler.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getProject ( ) . getNameKey ( ) , config.getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }
Source:
private static java.util.List < com.google.gerrit.extensions.common.TagInfo > toTagInfoList ( com.google.gerrit.acceptance.RestResponse r ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.TagInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.TagInfo > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private com.google.gerrit.extensions.api.projects.TagInfo getTag ( java.lang.String ref ) throws java.lang.Exception { return gApi.projects ( ) . name ( project.get ( ) ) . tag ( ref ) . get ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { mergeResults = com.google.common.collect.Maps.newHashMap ( ) ; com.google.gerrit.server.CurrentUser listenerUser = factory.create ( user.id ) ; source.addEventListener ( new com.google.gerrit.common.EventListener ( ) { @ java.lang.Override public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.get ( ) . number , changeMergedEvent.newRev ) ; } } } , listenerUser ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mergeResults = com.google.common.collect.Maps.newHashMap ( ) ; com.google.gerrit.server.CurrentUser listenerUser = factory.create ( user.id ) ; eventListener = new com.google.gerrit.common.EventListener ( ) { @ java.lang.Override public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.get ( ) . number , changeMergedEvent.newRev ) ; } } } ; source.addEventListener ( eventListener , listenerUser ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term topicTerm = com.googlecode.prolog_cafe.lang.Prolog.Nil ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE.get ( engine ) ; java.lang.String topic = change.getTopic ( ) ; if ( topic != null ) { topicTerm = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( topic ) ; } if ( ! ( a1.unify ( topicTerm , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term topicTerm = com.googlecode.prolog_cafe.lang.Prolog.Nil ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; java.lang.String topic = change.getTopic ( ) ; if ( topic != null ) { topicTerm = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( topic ) ; } if ( ! ( a1.unify ( topicTerm , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void addApprovals ( com.google.gerrit.server.events.PatchSetAttribute p , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > all , com.google.gerrit.common.data.LabelTypes labelTypes ) { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > list = all.get ( id ) ; if ( list != null ) { addApprovals ( p , list , labelTypes ) ; } }

Target:
public void addApprovals ( com.google.gerrit.server.data.PatchSetAttribute p , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > all , com.google.gerrit.common.data.LabelTypes labelTypes ) { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > list = all.get ( id ) ; if ( list != null ) { addApprovals ( p , list , labelTypes ) ; } }
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , new com.google.gerrit.server.project.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }

Target:
private com.google.gerrit.server.permissions.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.permissions.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , new com.google.gerrit.server.permissions.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }
Source:
static < T > void invoke ( final com.google.gwtjsonrpc.client.JsonSerializer < T > resultSerializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback , final java.lang.Object encoded ) { final T resobj ; try { resobj = ( encoded != null ) ? resultSerializer.fromJson ( encoded ) : null ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON response" , e ) ) ; return ; } callback.onSuccess ( resobj ) ; }

Target:
static < T > void invoke ( final com.google.gwtjsonrpc.client.JsonSerializer < T > resultSerializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback , final java.lang.Object encoded ) { final T resobj ; try { resobj = ( encoded != null ) ? resultSerializer.fromJson ( encoded ) : null ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON Response" , e ) ) ; return ; } callback.onSuccess ( resobj ) ; }
Source:
public void onLoad ( ) { if ( ( descriptionPanel ) == null ) { initUI ( ) ; } displayTitle ( ( ( changeInfo ) != null ? changeInfo.getSubject ( ) : null ) ) ; super . onLoad ( ) ; Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { display ( r ) ; } } } ) ; }

Target:
public void refresh ( ) { Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { display ( r ) ; } } } ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { renderSubmitType ( result.asString ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { if ( com.google.gerrit.client.Gerrit.getConfig ( ) . testChangeMerge ( ) ) { if ( canSubmit ) { actions.setSubmitEnabled ( changeInfo.mergeable ( ) ) ; if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; } renderSubmitType ( result.asString ( ) ) ; }
Source:
private static void addDiffLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final com.google.gerrit.client.patches.PatchScreen.TopView tv ) { m.addItem ( new com.google.gerrit.client.ui.LinkMenuItem ( text , "" ) { @ java.lang.Override public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } } ) ; }

Target:
public void onError ( com.google.gwt.http.client.Request request , java.lang.Throwable e ) { cb.onFailure ( e ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "change edit doesn't exist" ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.IdentifiedUser caller = ( ( com.google.gerrit.server.IdentifiedUser ) ( control.getUser ( ) ) ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.IdentifiedUser caller = control.getUser ( ) . asIdentifiedUser ( ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public void testUpsertTwoSecondExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 ) ; }

Target:
public void testUpsertTwoUpdateCountsAreNull ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , null ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }
Source:
public com.google.gerrit.extensions.api.projects.ChildProjectApi child ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return childApi.create ( children.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( name ) ) ) ; } catch ( java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse child project" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ChildProjectApi child ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return childApi.create ( children.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( name ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse child project" , e ) ; } }
Source:
public com.google.gerrit.extensions.common.DiffInfo diff ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.setBase ( base ) . apply ( file ) . value ( ) ; } catch ( java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve diff" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.DiffInfo diff ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.setBase ( base ) . apply ( file ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve diff" , e ) ; } }
Source:
private static java.lang.String missingUserIds ( java.util.Set < java.lang.String > allowedUserIds ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ( "Key must contain a valid" + " certification for one of the following identities:\n" ) ) ; java.util.Iterator < java.lang.String > sorted = allowedUserIds.stream ( ) . sorted ( ) . iterator ( ) ; while ( sorted.hasNext ( ) ) { sb.append ( " " ) . append ( sorted.next ( ) ) ; if ( sorted.hasNext ( ) ) { sb.append ( '\n' ) ; } } return sb.toString ( ) ; }

Target:
private static java.lang.String missingUserIds ( java.util.Set < java.lang.String > allowedUserIds ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Key must contain a valid certification for one of the following identities:\n" ) ; java.util.Iterator < java.lang.String > sorted = allowedUserIds.stream ( ) . sorted ( ) . iterator ( ) ; while ( sorted.hasNext ( ) ) { sb.append ( " " ) . append ( sorted.next ( ) ) ; if ( sorted.hasNext ( ) ) { sb.append ( '\n' ) ; } } return sb.toString ( ) ; }
Source:
public com.google.gerrit.extensions.common.SshKeyInfo addSshKey ( java.lang.String key ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.SshKeyInput in = new com.google.gerrit.extensions.common.SshKeyInput ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( key ) ; try { return addSshKey.apply ( account , in ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot add SSH key" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.SshKeyInfo addSshKey ( java.lang.String key ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.accounts.SshKeyInput in = new com.google.gerrit.extensions.api.accounts.SshKeyInput ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( key ) ; try { return addSshKey.apply ( account , in ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot add SSH key" , e ) ; } }
Source:
protected void run ( ) throws com.googlesource.gerrit.plugins.verifystatus.UnloggedFailure { try { checkPermission ( ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.googlesource.gerrit.plugins.verifystatus.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } final com.googlesource.gerrit.plugins.verifystatus.VerifyStatusQueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }

Target:
protected void run ( ) { final com.googlesource.gerrit.plugins.verifystatus.VerifyStatusQueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }
Source:
public void run ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = database.open ( ) ) { for ( ; ; ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = next ( ) ; if ( extId == null ) { break ; } convertLocalUserToLowerCase ( db , extId ) ; synchronized ( monitor ) { monitor.update ( 1 ) ; } } } catch ( com.google.gwtorm.server.OrmException e ) { e.printStackTrace ( ) ; } }

Target:
public void run ( ) { final com.google.gerrit.reviewdb.server.ReviewDb db ; try { db = database.open ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { e.printStackTrace ( ) ; return ; } try { for ( ; ; ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = next ( ) ; if ( extId == null ) { break ; } convertLocalUserToLowerCase ( db , extId ) ; synchronized ( monitor ) { monitor.update ( 1 ) ; } } } finally { db.close ( ) ; } }
Source:
public void operationComplete ( org.apache.mina.core.future.IoFuture future ) { final com.google.gerrit.sshd.SshScope.Context ctx = new com.google.gerrit.sshd.SshScope.Context ( sd ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { log.onLogout ( ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }

Target:
public void operationComplete ( org.apache.mina.core.future.IoFuture future ) { final com.google.gerrit.sshd.SshScope.Context ctx = new com.google.gerrit.sshd.SshScope.Context ( sd , null ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { log.onLogout ( ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }
Source:
private void innerTest ( ) { try { outer ( ) ; org.junit.Assert.fail ( "should throw" ) ; } catch ( java.lang.IllegalStateException e ) { java.lang.StackTraceElement [ ] trimmed = com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.trimStack ( e.getStackTrace ( ) , java.lang.Thread.currentThread ( ) . getStackTrace ( ) [ 1 ] ) ; java.lang.String str = java.util.Arrays.toString ( trimmed ) ; com.google.common.truth.Truth.assertThat ( str ) . doesNotContain ( "trimStackTrace" ) ; com.google.common.truth.Truth.assertThat ( str ) . contains ( "innerTest" ) ; } }

Target:
private void innerTest ( ) throws java.lang.Exception { try { outer ( ) ; fail ( "should throw" ) ; } catch ( java.lang.IllegalStateException e ) { java.lang.StackTraceElement [ ] trimmed = com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.trimStack ( e.getStackTrace ( ) , java.lang.Thread.currentThread ( ) . getStackTrace ( ) [ 1 ] ) ; java.lang.String str = java.util.Arrays.toString ( trimmed ) ; com.google.common.truth.Truth.assertThat ( str ) . doesNotContain ( "trimStackTrace" ) ; com.google.common.truth.Truth.assertThat ( str ) . contains ( "innerTest" ) ; } }
Source:
public void setCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id , java.lang.String pushCert ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( id ) ; rw.parseBody ( commit ) ; this . commit = commit ; subject = commit.getShortMessage ( ) ; this . pushCert = pushCert ; }

Target:
public void setCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id , java.lang.String pushCert ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( id ) ; rw.parseBody ( commit ) ; this . commit = commit.name ( ) ; subject = commit.getShortMessage ( ) ; this . pushCert = pushCert ; }
Source:
public int getLineCount ( final int file ) throws com.google.gerrit.client.rpc.CorruptEntityException , com.google.gerrit.client.rpc.NoDifferencesException , com.google.gerrit.client.rpc.NoSuchEntityException , com.google.gwtorm.client.OrmException , java.io.IOException { final byte [ ] c = getFileContent ( file ) ; final org.spearce.jgit.util.IntList m = getLineMap ( file ) ; final int n = m.size ( ) ; if ( ( n > 0 ) && ( ( m.get ( ( n - 1 ) ) ) == ( c.length ) ) ) { return n - 1 ; } return n ; }

Target:
public int getLineCount ( final int file ) throws com.google.gerrit.client.rpc.CorruptEntityException , com.google.gerrit.client.rpc.NoDifferencesException , com.google.gerrit.client.rpc.NoSuchEntityException , com.google.gwtorm.client.OrmException , java.io.IOException { return ( getLineMap ( file ) . size ( ) ) - 2 ; }
Source:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = ( queryBuilder.hasLimit ( s ) ) ? queryBuilder.getLimit ( s ) : maxLimit ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n ; }

Target:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = ( queryBuilder.hasLimit ( s ) ) ? queryBuilder.getLimit ( s ) : maxLimit ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n + 1 ; }
Source:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = configFile ( req ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; java.io.InputStream in = new java.io.FileInputStream ( f ) ; try { com.google.common.io.ByteStreams.copy ( in , out ) ; } finally { in.close ( ) ; } }

Target:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = configFile ( req ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( f ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }