auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setType ( newType ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setExternalNameKey ( bindTo ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
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 ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > in ) { java.util.List < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( in.length ( ) ) ; for ( com.google.gerrit.client.info.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 void testShow ( ) throws java.lang.Exception { assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=commit" ) ) ; assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=commit;p=test" ) ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.revision ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . setRevision ( commit ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( ( "a=commit;p=test&h=" + ( org.eclipse.jgit.lib.ObjectId.toString ( commit ) ) ) ) ) ; }

Target:
public void show ( ) throws java.lang.Exception { assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=commit" ) ) ; assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=commit;p=test" ) ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.revision ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . setRevision ( commit ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( ( "a=commit;p=test&h=" + ( org.eclipse.jgit.lib.ObjectId.toString ( commit ) ) ) ) ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo addRevisionActions ( com.google.gerrit.extensions.common.RevisionInfo to , com.google.gerrit.server.change.RevisionResource rsrc ) { to.actions = toActionMap ( rsrc ) ; return to ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo addRevisionActions ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo to , com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.api.changes.ActionVisitor > visitors = visitors ( ) ; if ( ! ( visitors.isEmpty ( ) ) ) { if ( changeInfo != null ) { changeInfo = copy ( visitors , changeInfo ) ; } else { changeInfo = changeJson ( ) . format ( rsrc ) ; } } to.actions = toActionMap ( rsrc , visitors , changeInfo , copy ( visitors , to ) ) ; return to ; }
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.info.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.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }
Source:
private Change.Id insertPatchSet ( org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , org.eclipse.jgit.revwalk.RevCommit cherryPickCommit , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { patchSetInserterFactory.create ( git , revWalk , refControl , change , cherryPickCommit ) . setMessage ( buildChangeMessage ( patchSetId , change ) ) . insert ( ) ; return change.getId ( ) ; }

Target:
private Change.Id insertPatchSet ( org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , org.eclipse.jgit.revwalk.RevCommit cherryPickCommit , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { patchSetInserterFactory.create ( git , revWalk , refControl , currentUser , change , cherryPickCommit ) . setMessage ( buildChangeMessage ( patchSetId , change ) ) . insert ( ) ; return change.getId ( ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > index ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.util.RequestScopePropagator prop ) { java.lang.Runnable task = new com.google.gerrit.server.index.ChangeIndexerImpl.Task ( change ) ; if ( prop != null ) { task = prop.wrap ( task ) ; } return executor.submit ( task ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > index ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.util.RequestScopePropagator prop ) { java.util.concurrent.Callable < ? > task = new com.google.gerrit.server.index.ChangeIndexerImpl.Task ( change ) ; if ( prop != null ) { task = prop.wrap ( task ) ; } return executor.submit ( task ) ; }
Source:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; boolean forceDev = options.forcePolyGerritDev ( ) ; if ( forceDev ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } return forceDev || ( ( p.warFs ) == null ) ? p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) : p.warFs.getPath ( "/polygerrit_ui" ) ; }

Target:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( options.forcePolyGerritDev ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } return isDev ( ) ? p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) : p.warFs.getPath ( "/polygerrit_ui" ) ; }
Source:
private java.lang.String extractWhat ( java.lang.String commandName , java.lang.String [ ] args ) { java.lang.String result = commandName ; if ( "gerrit" . equals ( commandName ) ) { if ( ( args.length ) > 1 ) result = ( "gerrit" + "." ) + ( args [ 1 ] ) ; } return result ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; if ( ( args.length ) > 1 ) { return ( commandName + "." ) + ( args [ 1 ] ) ; } else { return commandName ; } }
Source:
private java.lang.String parseOneFooter ( org.eclipse.jgit.revwalk.RevCommit commit , org.eclipse.jgit.revwalk.FooterKey footerKey ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > footerLines = commit.getFooterLines ( footerKey ) ; if ( footerLines.isEmpty ( ) ) { return null ; } else if ( ( footerLines.size ( ) ) > 1 ) { throw expectedOneFooter ( footerKey , footerLines ) ; } return footerLines.get ( 0 ) ; }

Target:
private java.lang.String parseOneFooter ( com.google.gerrit.server.notedb.ChangeNotesCommit commit , org.eclipse.jgit.revwalk.FooterKey footerKey ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > footerLines = commit.getFooterLineValues ( footerKey ) ; if ( footerLines.isEmpty ( ) ) { return null ; } else if ( ( footerLines.size ( ) ) > 1 ) { throw expectedOneFooter ( footerKey , footerLines ) ; } return footerLines.get ( 0 ) ; }
Source:
public static com.google.common.base.Optional < java.util.TimeZone > getTimeZone ( org.eclipse.jgit.lib.Config config , java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String id = config.getString ( section , subsection , name ) ; return id != null ? com.google.common.base.Optional.of ( java.util.TimeZone.getTimeZone ( id ) ) : com.google.common.base.Optional.< java.util.TimeZone > absent ( ) ; }

Target:
public static java.util.Optional < java.util.TimeZone > getTimeZone ( org.eclipse.jgit.lib.Config config , java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String id = config.getString ( section , subsection , name ) ; return id != null ? java.util.Optional.of ( java.util.TimeZone.getTimeZone ( id ) ) : java.util.Optional.empty ( ) ; }
Source:
protected static java.util.List < java.lang.Integer > query ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query ) throws java.lang.Exception { return com.google.common.collect.FluentIterable.from ( query.get ( ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.ChangeInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.ChangeInfo in ) { return in._number ; } } ) . toList ( ) ; }

Target:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( ids.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
public void patchScript ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gerrit.client.data.PatchScriptSettings s , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchScriptAction ( server , registry , patchKey , psa , psb , s ) ) ; }

Target:
public void patchScript ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gerrit.client.data.PatchScriptSettings s , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchScriptAction ( server , registry , diffCache , patchKey , psa , psb , s ) ) ; }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl control , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( control.getProjectState ( ) , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl pctl , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( pctl.getProjectState ( ) , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }
Source:
public com.google.gerrit.server.config.GetServerInfo.ServerInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.net.MalformedURLException { com.google.gerrit.server.config.GetServerInfo.ServerInfo info = new com.google.gerrit.server.config.GetServerInfo.ServerInfo ( ) ; info.auth = new com.google.gerrit.server.config.GetServerInfo.AuthInfo ( authConfig , realm ) ; info.change = getChangeInfo ( config ) ; info.contactStore = getContactStoreInfo ( ) ; info.download = new com.google.gerrit.server.config.GetServerInfo.DownloadInfo ( downloadSchemes , downloadCommands , archiveFormats ) ; info.gerrit = getGerritInfo ( config , allProjectsName , allUsersName ) ; info.gitWeb = getGitWebInfo ( gitWebConfig ) ; info.suggest = getSuggestInfo ( config ) ; info.user = getUserInfo ( anonymousCowardName ) ; return info ; }

Target:
public com.google.gerrit.server.config.GetServerInfo.ServerInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.net.MalformedURLException { com.google.gerrit.server.config.GetServerInfo.ServerInfo info = new com.google.gerrit.server.config.GetServerInfo.ServerInfo ( ) ; info.auth = getAuthInfo ( authConfig , realm ) ; info.change = getChangeInfo ( config ) ; info.contactStore = getContactStoreInfo ( ) ; info.download = getDownloadInfo ( downloadSchemes , downloadCommands , archiveFormats ) ; info.gerrit = getGerritInfo ( config , allProjectsName , allUsersName ) ; info.gitWeb = getGitWebInfo ( gitWebConfig ) ; info.suggest = getSuggestInfo ( config ) ; info.user = getUserInfo ( anonymousCowardName ) ; return info ; }
Source:
public java.lang.String getComment ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { final org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; org.eclipse.jgit.revwalk.RevCommit commit = revWalk.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId ) ) ; return commit.getFullMessage ( ) ; } finally { repo.close ( ) ; } }

Target:
public java.lang.String getComment ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { return commitMessageFetcher.fetch ( projectName , commitId ) ; }
Source:
private static com.google.gerrit.client.rpc.RestApi queryWithParameter ( java.lang.String query ) { return new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) . addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( query ) ) ; }

Target:
public static void query ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } call.send ( callback ) ; }
Source:
public void add ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { approvals.add ( ca ) ; final java.sql.Timestamp g = ca.getGranted ( ) ; if ( ( g != null ) && ( ( g.compareTo ( sortOrder ) ) < 0 ) ) { sortOrder = g ; } if ( ( ca.getValue ( ) ) != 0 ) { hasNonZero = 1 ; } }

Target:
public void add ( final com.google.gerrit.client.reviewdb.PatchSetApproval ca ) { approvals.add ( ca ) ; final java.sql.Timestamp g = ca.getGranted ( ) ; if ( ( g != null ) && ( ( g.compareTo ( sortOrder ) ) < 0 ) ) { sortOrder = g ; } if ( ( ca.getValue ( ) ) != 0 ) { hasNonZero = 1 ; } }
Source:
private java.lang.String configurationToString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( ( ( "number of configuration entries: " + ( config.size ( ) ) ) + "\n" ) ) ; for ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.ConfigEntry c : config ) { b.append ( ( ( c.toString ( ) ) + "\n" ) ) ; } return b.toString ( ) ; }

Target:
private java.lang.String configurationToString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( ( ( "Supermanifest config (" + ( config.size ( ) ) ) + ") {\n" ) ) ; for ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.ConfigEntry c : config ) { b.append ( " " ) ; b.append ( c.toString ( ) ) ; b.append ( "\n" ) ; } b.append ( "}\n" ) ; return b.toString ( ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( SaveDraft.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( PatchScriptFactory.Factory.class ) ; factory ( SaveDraft.Factory.class ) ; } } ) ; bind ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.class ) ; rpc ( com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.class ) ; }
Source:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = tempSiteDir.newFolder ( "plugins" ) . toPath ( ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; sshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.get ( "/config/server/info/" ) ; com.google.gerrit.server.config.GetServerInfo.ServerInfo i = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.config.GetServerInfo.ServerInfo.class ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }

Target:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = tempSiteDir.newFolder ( "plugins" ) . toPath ( ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( "/config/server/info/" ) ; com.google.gerrit.server.config.GetServerInfo.ServerInfo i = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.config.GetServerInfo.ServerInfo.class ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , final com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return injector.createChildInjector ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; bind ( com.google.gerrit.server.IdentifiedUser.class ) . toInstance ( user ) ; } } ) . getInstance ( ChangeUpdate.Factory.class ) . create ( stubChangeControl ( c , user ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , com.google.common.collect.Ordering.< java.lang.String > natural ( ) ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return com.google.gerrit.testutil.TestChanges.newUpdate ( injector , repoManager , c , user ) ; }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change\nሴ<Owner>" , "\n\nx<@>gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
com.google.gerrit.client.diff.DraftBox addReply ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.common.changes.Side side = replyTo.side ( ) ; int line = replyTo.line ( ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , line , replyTo.id ( ) , initMessage ) ; return addDraftBox ( info , doSave ) ; }

Target:
public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { diffTable.getElement ( ) . getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; }
Source:
private java.io.File getSiteFromReviewDb ( java.sql.Connection conn ) { try ( java.sql.Statement stmt = conn.createStatement ( ) ; java.sql.ResultSet rs = stmt.executeQuery ( "SELECT site_path FROM system_config" ) ) { if ( rs.next ( ) ) { return new java.io.File ( rs.getString ( 1 ) ) ; } } catch ( java.sql.SQLException e ) { return null ; } return null ; }

Target:
private java.nio.file.Path getSiteFromReviewDb ( java.sql.Connection conn ) { try ( java.sql.Statement stmt = conn.createStatement ( ) ; java.sql.ResultSet rs = stmt.executeQuery ( "SELECT site_path FROM system_config" ) ) { if ( rs.next ( ) ) { return java.nio.file.Paths.get ( rs.getString ( 1 ) ) ; } } catch ( java.sql.SQLException e ) { return null ; } return null ; }
Source:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.deleteContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
private void setReviewed ( com.google.gerrit.client.diff.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , sitePath , "--headless" } ) ; if ( rc != 0 ) { java.lang.System.out.println ( ( ( "Failed to start Gerrit daemon. Check " + sitePath ) + "/logs/error_log" ) ) ; serverStarted.reset ( ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , site.getPath ( ) , "--headless" } ) ; if ( rc != 0 ) { java.lang.System.out.println ( ( ( "Failed to start Gerrit daemon. Check " + ( site.getPath ( ) ) ) + "/logs/error_log" ) ) ; serverStarted.reset ( ) ; } return null ; }
Source:
private void appendLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int idx , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( ( "<a href=\"javascript:void(0)\">" + ( idx + 1 ) ) + "</a>" ) ) ) ; m.closeTd ( ) ; }

Target:
private void padLineNumberForSideB ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.closeTd ( ) ; }
Source:
public void newPatchSetOnReviewableWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file.getText ( ) , content.getText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( id.getParentKey ( ) ) ) ; hide ( ) ; } } ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeEditApi.put ( id.getParentKey ( ) . get ( ) , file.getText ( ) , content.getText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( id.getParentKey ( ) ) ) ; hide ( ) ; } } ) ; }
Source:
protected void initName ( final java.lang.String fieldName , final com.google.gwtorm.client.Column col ) throws com.google.gwtorm.client.OrmException { if ( col == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Field " + fieldName ) + " is missing " ) + ( com.google.gwtorm.client.Column.class . getName ( ) ) ) + " annotation" ) ) ; } column = col ; origName = com.google.gwtorm.schema.Util.any ( column.name ( ) , fieldName ) ; columnName = origName ; }

Target:
protected void initName ( final java.lang.String fieldName , final com.google.gwtorm.client.Column col ) throws com.google.gwtorm.client.OrmException { if ( col == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Field " + fieldName ) + " is missing " ) + ( com.google.gwtorm.client.Column.class . getName ( ) ) ) + " annotation" ) ) ; } column = col ; origName = com.google.gwtorm.schema.Util.any ( column.name ( ) , com.google.gwtorm.schema.Util.makeSqlFriendly ( fieldName ) ) ; columnName = origName ; }
Source:
public static synchronized void schedule ( final java.lang.Runnable task , final long delay , final java.util.concurrent.TimeUnit unit ) { if ( ( com.google.gerrit.git.WorkQueue.pool ) == null ) { com.google.gerrit.git.WorkQueue.pool = new java.util.concurrent.ScheduledThreadPoolExecutor ( 1 ) ; com.google.gerrit.git.WorkQueue.pool.setKeepAliveTime ( 60 , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.WorkQueue.pool.setMaximumPoolSize ( 5 ) ; } com.google.gerrit.git.WorkQueue.pool.schedule ( task , delay , unit ) ; }

Target:
private static synchronized com.google.gerrit.git.WorkQueue.Executor getPool ( final boolean autoStart ) { if ( autoStart && ( ( com.google.gerrit.git.WorkQueue.pool ) == null ) ) { com.google.gerrit.git.WorkQueue.pool = new com.google.gerrit.git.WorkQueue.Executor ( 1 ) ; com.google.gerrit.git.WorkQueue.pool.setKeepAliveTime ( 60 , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.WorkQueue.pool.setMaximumPoolSize ( 5 ) ; } return com.google.gerrit.git.WorkQueue.pool ; }
Source:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( final org.eclipse.jgit.lib.Ref r : repo.getAllRefs ( ) . values ( ) ) { if ( com.google.gerrit.reviewdb.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }
Source:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.common.Side side , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; if ( range != null ) { n.line ( range.end_line ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; if ( range != null ) { n.line ( range.end_line ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }
Source:
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 ( ) , getConfig ( ) . getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }

Target:
public com.google.gerrit.server.account.CapabilityCollection getCapabilityCollection ( ) { return capabilities ; }
Source:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }

Target:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( ! ( jar.getName ( ) . endsWith ( ".disabled" ) ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }
Source:
public void allRefsVisibleWithRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/meta/config" ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/02/2/1" , "refs/heads/branch" , "refs/heads/master" ) ; }

Target:
public void allRefsVisibleNoRefsMetaConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.PROJECT_OWNERS , "refs/meta/config" ) ; com.google.gerrit.server.project.Util.doNotInherit ( cfg , Permission.READ , "refs/meta/config" ) ; saveProjectConfig ( project , cfg ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/02/2/1" , "refs/heads/branch" , "refs/heads/master" ) ; }
Source:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.common.changes.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , psId ) ; accountLoader.fill ( ) ; return res ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.common.changes.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }
Source:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { try { setUnhealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set unhealthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }

Target:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = false ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public int compare ( com.google.gerrit.reviewdb.client.Project o1 , com.google.gerrit.reviewdb.client.Project o2 ) { return o1.getName ( ) . compareTo ( o2.getName ( ) ) ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents ( ) { java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState ps = projectCache.get ( p ) ; if ( ps != null ) { com.google.gerrit.reviewdb.client.Project.NameKey parent = ps.getProject ( ) . getParent ( ) ; if ( parent != null ) { parents.add ( parent ) ; } } } parents.add ( allProjects ) ; return parents ; }
Source:
private void assertAdminsAreOwnersAndDevsAreNot ( ) { com.google.gerrit.server.project.ProjectControl uBlah = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; com.google.common.truth.Truth.assertThat ( uBlah.isOwner ( ) ) . named ( "not owner" ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( uAdmin.isOwner ( ) ) . named ( "is owner" ) . isTrue ( ) ; }

Target:
private void assertAdminsAreOwnersAndDevsAreNot ( ) { com.google.gerrit.server.project.ProjectControl uBlah = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( local , com.google.gerrit.server.project.testing.Util.DEVS , com.google.gerrit.server.project.testing.Util.ADMIN ) ; com.google.common.truth.Truth.assertThat ( uBlah.isOwner ( ) ) . named ( "not owner" ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( uAdmin.isOwner ( ) ) . named ( "is owner" ) . isTrue ( ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerInReviewDb ( ) 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" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . notTo ( sc.owner , sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwner ( ) throws java.lang.Exception { 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 ) . notSent ( ) ; }
Source:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.project.ProjectState > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneProjectIndex.PROJECTS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }

Target:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.index.Schema < com.google.gerrit.server.project.ProjectData > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneProjectIndex.PROJECTS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }
Source:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( "ChangeMessage{" + "key=" ) + ( key ) ) + ", author=" ) + ( author ) ) + ", writtenOn=" ) + ( writtenOn ) ) + ", patchset=" ) + ( patchset ) ) + ", tag=" ) + ( tag ) ) + ", message=[" ) + ( message ) ) + "]}" ; }

Target:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( "ChangeMessage{" + "key=" ) + ( key ) ) + ", author=" ) + ( author ) ) + ", realAuthor=" ) + ( realAuthor ) ) + ", writtenOn=" ) + ( writtenOn ) ) + ", patchset=" ) + ( patchset ) ) + ", tag=" ) + ( tag ) ) + ", message=[" ) + ( message ) ) + "]}" ; }
Source:
public void indexChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }

Target:
public void indexChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; adminSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) . assertNoContent ( ) ; }
Source:
public com.googlesource.gerrit.plugins.hooks.its.ItsIssue call ( ) throws java.lang.Exception { com.j2bugzilla.base.Bug bug = client ( ) . getBug ( bugId ) ; com.googlesource.gerrit.plugins.hooks.its.ItsIssue result = ( bug == null ) ? null : new com.googlesource.gerrit.plugins.hooks.its.ItsIssue ( bugId , bug ) ; log.debug ( ( ( ( "Got issue " + bugId ) + ", " ) + result ) ) ; return result ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { return ( client ( ) . getBug ( bugId ) ) != null ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c ; try { c = db.get ( ) . changes ( ) . get ( id ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ! ( has ( com.google.gerrit.extensions.common.ListChangesOption.CHECK ) ) ) { throw e ; } return checkOnly ( changeDataFactory.create ( db.get ( ) , id ) ) ; } return format ( changeDataFactory.create ( db.get ( ) , c ) ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c ; try { c = db.get ( ) . changes ( ) . get ( id ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ! ( has ( com.google.gerrit.extensions.client.ListChangesOption.CHECK ) ) ) { throw e ; } return checkOnly ( changeDataFactory.create ( db.get ( ) , id ) ) ; } return format ( changeDataFactory.create ( db.get ( ) , c ) ) ; }
Source:
public void afterUpdateRepos ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { try { markCleanMerges ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Change.Id > alreadyMerged = checkCommitStatus ( ) ; findUnmergedChanges ( alreadyMerged ) ; } catch ( com.google.gerrit.server.git.IntegrationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) , e ) ; } }

Target:
public void afterUpdateRepos ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { try { markCleanMerges ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Change.Id > alreadyMerged = checkCommitStatus ( ) ; findUnmergedChanges ( alreadyMerged ) ; } catch ( com.google.gerrit.server.submit.IntegrationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) , e ) ; } }
Source:
public com.google.gerrit.extensions.common.PushCertificateInfo checkPushCertificate ( java.lang.String certStr , com.google.gerrit.server.IdentifiedUser expectedUser ) throws com.google.gerrit.server.GpgException { try { org.eclipse.jgit.transport.PushCertificate cert = org.eclipse.jgit.transport.PushCertificateParser.fromString ( certStr ) ; com.google.gerrit.gpg.PushCertificateChecker.Result result = pushCertCheckerFactory.create ( expectedUser , false ) . check ( cert ) ; com.google.gerrit.extensions.common.PushCertificateInfo info = new com.google.gerrit.extensions.common.PushCertificateInfo ( ) ; info.certificate = certStr ; info.key = com.google.gerrit.gpg.server.GpgKeys.toJson ( result.getPublicKey ( ) , result.getCheckResult ( ) ) ; return info ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }

Target:
public com.google.gerrit.extensions.common.PushCertificateInfo checkPushCertificate ( java.lang.String certStr , com.google.gerrit.server.IdentifiedUser expectedUser ) throws com.google.gerrit.server.GpgException { try { org.eclipse.jgit.transport.PushCertificate cert = org.eclipse.jgit.transport.PushCertificateParser.fromString ( certStr ) ; com.google.gerrit.gpg.PushCertificateChecker.Result result = pushCertCheckerFactory.create ( expectedUser ) . setCheckNonce ( false ) . check ( cert ) ; com.google.gerrit.extensions.common.PushCertificateInfo info = new com.google.gerrit.extensions.common.PushCertificateInfo ( ) ; info.certificate = certStr ; info.key = com.google.gerrit.gpg.server.GpgKeys.toJson ( result.getPublicKey ( ) , result.getCheckResult ( ) ) ; return info ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }