auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , com.google.common.base.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) , true ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , java.util.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) , true ) ; }
Source:
public void cleanup ( ) { db.close ( ) ; }

Target:
public void restore ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . abandon ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . restore ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.IncludedInInfo apply ( com.google.gerrit.server.project.CommitResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rsrc.getCommit ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProject ( ) . getProject ( ) . getNameKey ( ) ; return includedIn.apply ( project , commit.getId ( ) . getName ( ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.IncludedInInfo apply ( com.google.gerrit.server.project.CommitResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rsrc.getCommit ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProjectState ( ) . getProject ( ) . getNameKey ( ) ; return includedIn.apply ( project , commit.getId ( ) . getName ( ) ) ; }
Source:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { assertCanEdit ( changeControl ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( changeControl ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , changeControl.getId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( changeControl ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEdit ( repository , changeControl , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { assertCanEdit ( notes ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( notes ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , notes.getChangeId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( notes ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEdit ( repository , notes , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , currentUser.getAccountId ( ) , null ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , com.google.gerrit.reviewdb.client.Account.Id pullRequestAuthorId , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , pullRequestAuthorId , null ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }
Source:
protected TestRepository < ? > . CommitBuilder amendBuilder ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId head = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; TestRepository < ? > . CommitBuilder b = testRepo.amendRef ( "HEAD" ) ; com.google.common.base.Optional < java.lang.String > id = com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , head ) ; if ( id.isPresent ( ) ) { b.insertChangeId ( id.get ( ) . substring ( 1 ) ) ; } else { b.insertChangeId ( ) ; } return b ; }

Target:
protected TestRepository < ? > . CommitBuilder amendBuilder ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId head = repo ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ; TestRepository < ? > . CommitBuilder b = testRepo.amendRef ( "HEAD" ) ; com.google.common.base.Optional < java.lang.String > id = com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , head ) ; if ( id.isPresent ( ) ) { b.insertChangeId ( id.get ( ) . substring ( 1 ) ) ; } else { b.insertChangeId ( ) ; } return b ; }
Source:
public void assertCanDelete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { if ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project has subscribed submodules." ) ; } if ( db.submoduleSubscriptions ( ) . bySubmoduleProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project is subscribed by other projects." ) ; } }

Target:
public void atomicDelete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { super . atomicDelete ( project ) ; db.submoduleSubscriptions ( ) . delete ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anonymousUsers = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( Q.getName ( ) ) , ( - 1 ) , 1 , anonymousUsers , "refs/heads/*" ) ; saveProjectConfig ( cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anonymousUsers = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( Q.getName ( ) ) , ( - 1 ) , 1 , anonymousUsers , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( P.getName ( ) ) , 0 , 1 , anonymousUsers , "refs/heads/*" ) ; saveProjectConfig ( cfg ) ; }
Source:
private static < T > java.util.List < T > decodeProtos ( com.google.gson.JsonObject doc , java.lang.String fieldName , com.google.gwtorm.protobuf.ProtobufCodec < T > codec ) { return com.google.common.collect.FluentIterable.from ( doc.getAsJsonArray ( fieldName ) ) . transform ( ( i ) -> codec.decode ( org.apache.commons.codec.binary.Base64.decodeBase64 ( i.toString ( ) ) ) ) . toList ( ) ; }

Target:
private static < T > java.util.List < T > decodeProtos ( com.google.gson.JsonObject doc , java.lang.String fieldName , com.google.gwtorm.protobuf.ProtobufCodec < T > codec ) { com.google.gson.JsonArray field = doc.getAsJsonArray ( fieldName ) ; if ( field == null ) { return null ; } return com.google.common.collect.FluentIterable.from ( field ) . transform ( ( i ) -> codec.decode ( org.apache.commons.codec.binary.Base64.decodeBase64 ( i.toString ( ) ) ) ) . toList ( ) ; }
Source:
public void byOwner ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChangeForUser ( repo , userId ) ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChangeForUser ( repo , user2 ) ) ; assertQuery ( ( "owner:" + ( userId.get ( ) ) ) , change1 ) ; assertQuery ( ( "owner:" + user2 ) , change2 ) ; }

Target:
public void byOwner ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) , userId ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) , user2 ) ; assertQuery ( ( "owner:" + ( userId.get ( ) ) ) , change1 ) ; assertQuery ( ( "owner:" + user2 ) , change2 ) ; }
Source:
public static org.eclipse.jgit.lib.Config newDefaultConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; return cfg ; }

Target:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; }
Source:
private com.google.gerrit.server.query.Predicate operator ( final java.lang.String name , final java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { final com.google.gerrit.server.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( value ) ; }

Target:
private com.google.gerrit.server.query.Predicate < T > operator ( final java.lang.String name , final java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { final com.google.gerrit.server.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( this , value ) ; }
Source:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
private static boolean preferUnified ( ) { return ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( DiffView.UNIFIED_DIFF.equals ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) ) ) ; }
Source:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }

Target:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { com.google.gerrit.server.project.ProjectControl ctl = resource.getControl ( ) ; return setDefault.get ( ) . apply ( new com.google.gerrit.server.project.DashboardResource ( ctl , null , null , null , null , true ) , input ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }
Source:
public static void revert ( int changeId , java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > callback ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.setMessage ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( message ) ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + changeId ) + "/revert" ) ) . data ( input ) . post ( callback ) ; }

Target:
public static void revert ( int id , java.lang.String msg , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "revert" ) . data ( input ) . post ( cb ) ; }
Source:
public boolean isSystemPath ( java.lang.String name ) { name = name.replace ( '/' , '.' ) ; return ( super . isSystemPath ( name ) ) || ( name.startsWith ( "org.bouncycastle." ) ) ; }

Target:
protected java.lang.Class < ? > findClass ( java.lang.String name ) throws java.lang.ClassNotFoundException { if ( ctx.isSystemClass ( name.replace ( '/' , '.' ) ) ) { try { return systemClassLoader.loadClass ( name ) ; } catch ( java.lang.ClassNotFoundException e ) { } } return super . findClass ( name ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.change.ChangeKindCacheImpl.Key ) { com.google.gerrit.server.change.ChangeKindCacheImpl.Key k = ( ( com.google.gerrit.server.change.ChangeKindCacheImpl.Key ) ( o ) ) ; return ( ( com.google.common.base.Objects.equal ( prior , k.prior ) ) && ( com.google.common.base.Objects.equal ( next , k.next ) ) ) && ( com.google.common.base.Objects.equal ( strategyName , k.strategyName ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.change.ChangeKindCacheImpl.Key ) { com.google.gerrit.server.change.ChangeKindCacheImpl.Key k = ( ( com.google.gerrit.server.change.ChangeKindCacheImpl.Key ) ( o ) ) ; return ( ( java.util.Objects.equals ( prior , k.prior ) ) && ( java.util.Objects.equals ( next , k.next ) ) ) && ( java.util.Objects.equals ( strategyName , k.strategyName ) ) ; } return false ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ProjectMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; refresh ( ) ; }
Source:
private java.lang.String expandTabs ( java.lang.String html ) { java.lang.StringBuilder tmp = new java.lang.StringBuilder ( ) ; int i = 0 ; if ( diffPrefs.isShowTabs ( ) ) { i = 1 ; } for ( ; i < ( diffPrefs.getTabSize ( ) ) ; i ++ ) { tmp.append ( "&nbsp;" ) ; } return html.replaceAll ( "\t" , tmp.toString ( ) ) ; }

Target:
private java.lang.String expandTabs ( java.lang.String html ) { java.lang.StringBuilder tmp = new java.lang.StringBuilder ( ) ; int i = 0 ; if ( diffPrefs.showTabs ) { i = 1 ; } for ( ; i < ( diffPrefs.tabSize ) ; i ++ ) { tmp.append ( "&nbsp;" ) ; } return html.replaceAll ( "\t" , tmp.toString ( ) ) ; }
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 ) { 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 ( ) ; } }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
public void testUnblockInLocal_Fails ( ) { grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void createChangeWithPrivateByDefaultDisabled ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo info = gApi.changes ( ) . create ( new com.google.gerrit.extensions.common.ChangeInput ( project.get ( ) , "master" , "empty change" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( info.isPrivate ) . isNull ( ) ; }

Target:
public void createChangeWithPrivateByDefaultInherited ( ) throws java.lang.Exception { setPrivateByDefault ( project1 , InheritableBoolean.TRUE ) ; com.google.gerrit.extensions.common.ChangeInfo info = gApi.changes ( ) . create ( new com.google.gerrit.extensions.common.ChangeInput ( project2.get ( ) , "master" , "empty change" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( info.isPrivate ) . isTrue ( ) ; }
Source:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.multimaster.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ; }

Target:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.multimaster.HttpResponseHandler.HttpResult result = httpSession.post ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ; }
Source:
public static com.google.gerrit.client.changes.CommentInfo createRange ( java.lang.String path , com.google.gerrit.common.changes.Side side , int line , java.lang.String in_reply_to , java.lang.String message , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.createFile ( path , side , in_reply_to , message ) ; info.setRange ( range ) ; info.setLine ( ( range == null ? line : range.end_line ( ) ) ) ; return info ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.common.changes.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:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.AccountResource rsrc ) { com.google.gerrit.server.account.CapabilityControl cc = rsrc.getUser ( ) . getCapabilities ( ) ; for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( cc.canPerform ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( cc.getRange ( name ) ) ) ; } } }

Target:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.AccountResource rsrc ) { com.google.gerrit.server.account.CapabilityControl cc = rsrc.getUser ( ) . getCapabilities ( ) ; for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( cc.hasExplicitRange ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( cc.getRange ( name ) ) ) ; } } }
Source:
public java.util.List < com.google.gerrit.common.data.PermissionRange > getLabelRanges ( ) { java.util.List < com.google.gerrit.common.data.PermissionRange > r = new java.util.ArrayList < com.google.gerrit.common.data.PermissionRange > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < com.google.gerrit.common.data.PermissionRule > > e : permissions ( ) . entrySet ( ) ) { if ( com.google.gerrit.common.data.Permission.isLabel ( e.getKey ( ) ) ) { r.add ( com.google.gerrit.server.project.RefControl.toRange ( e.getKey ( ) , e.getValue ( ) ) ) ; } } return r ; }

Target:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutStatus.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to set status" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutStatus.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
private void callback ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; final java.lang.String token = req.getParameter ( com.google.gerrit.server.rpc.OpenIdServiceImpl.P_TOKEN ) ; if ( ( token != null ) && ( ! ( token.startsWith ( "SignInFailure," ) ) ) ) { rdr.append ( '#' ) ; rdr.append ( token ) ; } rsp.sendRedirect ( rdr.toString ( ) ) ; }

Target:
private void callback ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; final java.lang.String token = req.getParameter ( com.google.gerrit.server.openid.OpenIdServiceImpl.P_TOKEN ) ; if ( ( token != null ) && ( ! ( token.startsWith ( "SignInFailure," ) ) ) ) { rdr.append ( '#' ) ; rdr.append ( token ) ; } rsp.sendRedirect ( rdr.toString ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.Change > allChanges ( ) { com.google.gerrit.reviewdb.server.ReviewDb db = null ; try { db = database.open ( ) ; return db.changes ( ) . all ( ) . toList ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { stderr.print ( ( "Cannot read changes from database " + ( e.getMessage ( ) ) ) ) ; return java.util.Collections.emptyList ( ) ; } finally { if ( db != null ) { db.close ( ) ; } } }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.Change > allChanges ( ) { com.google.gerrit.reviewdb.server.ReviewDb db = null ; try { db = database.open ( ) ; return db.changes ( ) . all ( ) . toList ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { stderr.println ( ( "Cannot read changes from database " + ( e.getMessage ( ) ) ) ) ; return java.util.Collections.emptyList ( ) ; } finally { if ( db != null ) { db.close ( ) ; } } }
Source:
public static < T > void invoke ( final com.google.gwtjsonrpc.client.impl.ResultDeserializer < T > resultDeserializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback , final com.google.gwt.core.client.JavaScriptObject rpcResult ) { final T result ; try { result = resultDeserializer.fromResult ( rpcResult ) ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON Response" , e ) ) ; return ; } callback.onSuccess ( result ) ; }

Target:
public static < T > void invoke ( final com.google.gwtjsonrpc.client.impl.ResultDeserializer < T > resultDeserializer , final com.google.gwtjsonrpc.common.AsyncCallback < T > callback , final com.google.gwt.core.client.JavaScriptObject rpcResult ) { final T result ; try { result = resultDeserializer.fromResult ( rpcResult ) ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON Response" , e ) ) ; return ; } callback.onSuccess ( result ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public static void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet.Id dest ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > sourceApprovals = db.patchSetApprovals ( ) . byPatchSet ( source ) ; com.google.gerrit.server.ApprovalsUtil.copyLabels ( db , labelTypes , sourceApprovals , source , dest ) ; }

Target:
public static void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet dest , boolean trivialRebase ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > sourceApprovals = db.patchSetApprovals ( ) . byPatchSet ( source ) ; com.google.gerrit.server.ApprovalsUtil.copyLabels ( db , labelTypes , sourceApprovals , source , dest , trivialRebase ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { local = new com.google.gerrit.server.git.ProjectConfig ( localKey ) ; local.load ( com.google.gerrit.testutil.InMemoryRepositoryManager.newRepository ( localKey ) ) ; util.add ( local ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { parent = new com.google.gerrit.server.git.ProjectConfig ( parentKey ) ; parent.load ( com.google.gerrit.testutil.InMemoryRepositoryManager.newRepository ( parentKey ) ) ; util.add ( parent ) ; local = new com.google.gerrit.server.git.ProjectConfig ( localKey ) ; local.load ( com.google.gerrit.testutil.InMemoryRepositoryManager.newRepository ( localKey ) ) ; util.add ( local ) ; local.getProject ( ) . setParentName ( parentKey ) ; }
Source:
private void display ( com.google.gerrit.reviewdb.client.AccountExternalId id ) { java.lang.String user ; java.lang.String pass ; if ( id != null ) { user = id.getSchemeRest ( ) ; pass = id.getPassword ( ) ; } else { user = null ; pass = null ; } this . id = id ; com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( user ) ; password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) { display ( null ) ; display ( ) ; } else { super . onFailure ( caught ) ; } }
Source:
public void unblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }

Target:
public void unblockForceEditTopicName ( ) { com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can edit topic name" ) . isTrue ( ) ; }
Source:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshItems = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicItemsOf ( injector ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"old-school\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; org.junit.Assert.assertTrue ( html.contains ( "<a name=\"debug\"><h1>Section</h1></a>" ) ) ; org.junit.Assert.assertTrue ( html.contains ( "<a name=\"old-school\"><h1>Other</h1></a>" ) ) ; }

Target:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"old-school\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; org.junit.Assert.assertTrue ( html.contains ( ( "<h1>" + ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "Section</h1>" ) ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( "<h1>" + ( "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" + "Other</h1>" ) ) ) ) ; }
Source:
private boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return false ; }

Target:
private boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return false ; }
Source:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }

Target:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; computeAllowed ( am , pe.getLocalRights ( ) ) ; computeAllowed ( am , pe.getInheritedRights ( ) ) ; }
Source:
protected static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > noLabelQuery ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ( 2 * ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ) ) ; for ( int i = 1 ; i <= ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ; i ++ ) { r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , i ) ) ; r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , ( - i ) ) ) ; } return not ( or ( r ) ) ; }

Target:
protected static com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > noLabelQuery ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label ) { java.util.List < com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ( 2 * ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ) ) ; for ( int i = 1 ; i <= ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ; i ++ ) { r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , i ) ) ; r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , ( - i ) ) ) ; } return not ( or ( r ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }
Source:
public void assertCanDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { try { pcHandler.assertCanDelete ( rsrc ) ; dbHandler.assertCanDelete ( rsrc.getControl ( ) . getProject ( ) ) ; } catch ( com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } }

Target:
public void assertCanDelete ( com.google.gerrit.server.project.ProjectResource rsrc , com.googlesource.gerrit.plugins.deleteproject.DeleteProject.Input input ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { try { pcHandler.assertCanDelete ( rsrc ) ; dbHandler.assertCanDelete ( rsrc.getControl ( ) . getProject ( ) ) ; fsHandler.assertCanDelete ( rsrc , ( input == null ? false : input.preserve ) ) ; } catch ( com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } }
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" , "refs/meta/config" ) ; }

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/01/1/meta" , "refs/changes/02/2/1" , "refs/changes/02/2/meta" , "refs/heads/branch" , "refs/heads/master" ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setSuggest ( true ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }