auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.common.collect.Ordering < org.eclipse.jgit.lib.Ref > tagComparator ( final org.eclipse.jgit.revwalk.RevWalk walk ) { return com.google.common.collect.Ordering.natural ( ) . onResultOf ( new com.google.common.base.Function < org.eclipse.jgit.lib.Ref , java.lang.Long > ( ) { @ java.lang.Override public java.lang.Long apply ( org.eclipse.jgit.lib.Ref ref ) { try { return timeCache.getTime ( walk , ref.getObjectId ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.common.util.concurrent.UncheckedExecutionException ( e ) ; } } } ) . reverse ( ) . compound ( RefComparator.INSTANCE ) ; }

Target:
private static < T > java.util.List < T > trim ( java.util.List < T > list ) { return ( list.size ( ) ) > ( com.google.gitiles.RepositoryIndexServlet.REF_LIMIT ) ? list.subList ( 0 , com.google.gitiles.RepositoryIndexServlet.REF_LIMIT ) : list ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = arg2 ; com.googlecode.prolog_cafe.lang.Term term = engine.r1.dereference ( ) ; java.lang.String path = term.toString ( ) ; engine.r3 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.getMatches ( ) . get ( path ) . getOwners ( ) . iterator ( ) ) ; return engine.jtry3 ( gerrit_owners.PRED_matcher_owner_2.OWNER_CHECK , gerrit_owners.PRED_matcher_owner_2.OWNER_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = arg2 ; com.googlecode.prolog_cafe.lang.Term term = engine.r1.dereference ( ) ; java.lang.String path = term.toString ( ) ; engine.r3 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.getFileOwners ( ) . get ( path ) . iterator ( ) ) ; return engine.jtry3 ( gerrit_owners.PRED_matcher_owner_2.OWNER_CHECK , gerrit_owners.PRED_matcher_owner_2.OWNER_NEXT ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.server.permissions.PluginPermission ) { com.google.gerrit.server.permissions.PluginPermission b = ( ( com.google.gerrit.server.permissions.PluginPermission ) ( other ) ) ; return ( pluginName.equals ( b.pluginName ) ) && ( capability.equals ( b.capability ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.extensions.api.access.PluginPermission ) { com.google.gerrit.extensions.api.access.PluginPermission b = ( ( com.google.gerrit.extensions.api.access.PluginPermission ) ( other ) ) ; return ( pluginName.equals ( b.pluginName ) ) && ( capability.equals ( b.capability ) ) ; } return false ; }
Source:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; r.assertOK ( ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }

Target:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; r.assertOK ( ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }
Source:
public static com.google.gerrit.common.data.PermissionRule remove ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . remove ( rule ) ; return rule ; }

Target:
public static com.google.gerrit.common.data.PermissionRule remove ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . remove ( rule ) ; return rule ; }
Source:
public void setMessage ( java.lang.String in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.PutMessage.Input input = new com.google.gerrit.server.change.PutMessage.Input ( ) ; input.message = in ; putMessage.apply ( change , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot edit commit message" , e ) ; } }

Target:
public void setMessage ( com.google.gerrit.extensions.common.CommitMessageInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { putMessage.apply ( change , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot edit commit message" , e ) ; } }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }

Target:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.exactRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }
Source:
public static void validateRegExp ( java.lang.String refPattern ) throws com.google.gerrit.common.errors.InvalidNameException { try { java.util.regex.Pattern.compile ( refPattern.replace ( ( ( "${" + ( com.google.gerrit.server.project.RefPattern.USERNAME ) ) + "}/" ) , "" ) ) ; } catch ( java.util.regex.PatternSyntaxException e ) { throw new com.google.gerrit.common.errors.InvalidNameException ( ( ( refPattern + " " ) + ( e.getMessage ( ) ) ) ) ; } }

Target:
public static void validateRegExp ( java.lang.String refPattern ) throws com.google.gerrit.common.errors.InvalidNameException { try { refPattern = refPattern.replace ( ( ( "${" + ( com.google.gerrit.server.project.RefPattern.USERID_SHARDED ) ) + "}" ) , "" ) ; refPattern = refPattern.replace ( ( ( "${" + ( com.google.gerrit.server.project.RefPattern.USERNAME ) ) + "}" ) , "" ) ; java.util.regex.Pattern.compile ( refPattern ) ; } catch ( java.util.regex.PatternSyntaxException e ) { throw new com.google.gerrit.common.errors.InvalidNameException ( ( ( refPattern + " " ) + ( e.getMessage ( ) ) ) ) ; } }
Source:
protected void init ( ) throws com.google.gerrit.server.mail.EmailException { super . init ( ) ; bccWatchers ( ) ; }

Target:
protected void init ( ) throws com.google.gerrit.server.mail.EmailException { super . init ( ) ; try { com.google.gerrit.server.mail.Watchers matching = getWatches ( NotifyType.NEW_CHANGES ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { if ( isOwnerOfProjectOrBranch ( user ) ) { add ( RecipientType.TO , user ) ; } else { add ( RecipientType.BCC , user ) ; } } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.CreateChangeSender.log.warn ( "Cannot BCC watchers for new change" , err ) ; } }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }
Source:
public void fooSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/foo/" , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( "bar/repo" ) ; com.google.gitiles.RepositoryDescription d = res.get ( "bar/repo" ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ) ; }

Target:
public void fooSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/foo/" , com.google.gitiles.HostIndexServletTest.REPOS ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( "bar/repo" ) ; com.google.gitiles.RepositoryDescription d = res.get ( "bar/repo" ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ) ; }
Source:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( com.google.gerrit.reviewdb.client.Patch.isMagic ( id.get ( ) ) ) { return new com.google.gerrit.server.project.FileResource ( parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; } return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; }

Target:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( com.google.gerrit.reviewdb.client.Patch.isMagic ( id.get ( ) ) ) { return new com.google.gerrit.server.project.FileResource ( parent.getProjectState ( ) , parent.getCommit ( ) , id.get ( ) ) ; } return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProjectState ( ) , parent.getCommit ( ) , id.get ( ) ) ; }
Source:
private static org.eclipse.jgit.revwalk.RevCommit lookup ( org.eclipse.jgit.lib.Repository repository , org.eclipse.jgit.lib.ObjectId commitId ) throws java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repository ) ) { return revWalk.parseCommit ( commitId ) ; } }

Target:
private com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > optionalChangeEdit , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gwtorm.server.OrmException { java.util.Optional < com.google.gerrit.reviewdb.client.PatchSet > editBasePatchSet = optionalChangeEdit.map ( ChangeEdit :: getBasePatchSet ) ; return editBasePatchSet.isPresent ( ) ? editBasePatchSet.get ( ) : lookupCurrentPatchSet ( changeControl ) ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > ( ) { } ; core ( type , com.google.gerrit.httpd.WebSession.CACHE_NAME ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.httpd.WebSession.KeyGenerator.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > ( ) { } ; cache ( type , com.google.gerrit.httpd.WebSession.CACHE_NAME ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.httpd.WebSession.KeyGenerator.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
public void testIsEnabledRefParentNoBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "enforced" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefParentNoBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "true" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public final java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ! ( commandAllowed ) ) { return null ; } if ( ( ( ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.SshScheme ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.HttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousHttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.GitScheme ) ) { java.lang.String url = scheme.getUrl ( project ) ; if ( url != null ) { return getCommand ( url , ref ) ; } else return null ; } else { return null ; } }

Target:
public final java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ( commandAllowed ) && ( com.googlesource.gerrit.plugins.download.command.GitDownloadCommand.isRecognizedScheme ( scheme ) ) ) { java.lang.String url = scheme.getUrl ( project ) ; if ( url != null ) { return getCommand ( url , ref ) ; } } return null ; }
Source:
public java.util.List < com.ruesga.gerrit.plugins.fcm.server.DeviceResource > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( ( self.get ( ) ) == null ) || ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "invalid account!" ) ; } throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported!" ) ; }

Target:
public java.util.List < com.ruesga.gerrit.plugins.fcm.server.DeviceResource > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( config.isEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( "not configured!" ) ; } if ( ( ( self.get ( ) ) == null ) || ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "invalid account!" ) ; } throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported!" ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.extensions.api.changes.FixInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl ctl = rsrc.getControl ( ) ; if ( ( ! ( ctl.isOwner ( ) ) ) && ( ! ( ctl.getProjectControl ( ) . isOwner ( ) ) ) ) { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; } return com.google.gerrit.extensions.restapi.Response.withMustRevalidate ( newChangeJson ( ) . fix ( input ) . format ( rsrc ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.extensions.api.changes.FixInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { if ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( ! ( rsrc.getControl ( ) . getProjectControl ( ) . isOwner ( ) ) ) ) { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; } return com.google.gerrit.extensions.restapi.Response.withMustRevalidate ( newChangeJson ( ) . fix ( input ) . format ( rsrc ) ) ; }
Source:
private void writeObject ( java.io.ObjectOutputStream output ) throws java.io.IOException { java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream ( ) ; try ( java.util.zip.DeflaterOutputStream out = new java.util.zip.DeflaterOutputStream ( buf ) ) { com.google.gerrit.server.ioutil.BasicSerialization.writeString ( out , com.google.common.base.Joiner.on ( '\n' ) . join ( paths ) ) ; } com.google.gerrit.server.ioutil.BasicSerialization.writeBytes ( output , buf.toByteArray ( ) ) ; }

Target:
private void writeObject ( java.io.ObjectOutputStream output ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , paths.length ) ; try ( java.util.zip.DeflaterOutputStream out = new java.util.zip.DeflaterOutputStream ( output ) ) { for ( java.lang.String p : paths ) { com.google.gerrit.server.ioutil.BasicSerialization.writeString ( out , p ) ; } } }
Source:
public java.lang.String getComment ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "" ; } final java.lang.String [ ] parts = s.split ( " " , 3 ) ; if ( ( parts.length ) < 3 ) { return "" ; } return parts [ 2 ] ; }

Target:
public java.lang.String getComment ( ) { return getPublicKeyPart ( 2 , "" ) ; }
Source:
public void suggestReviewersNoResult1 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }

Target:
public void suggestReviewersNoResult3 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , name ( "" ) . substring ( 0 , 1 ) , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
public static java.lang.String joinGroups ( java.lang.Iterable < java.lang.String > groups ) { if ( groups == null ) { return null ; } java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( java.lang.String g : groups ) { if ( ! first ) { sb.append ( ',' ) ; } else { first = false ; } sb.append ( g ) ; } return sb.toString ( ) ; }

Target:
static java.lang.String joinGroups ( java.util.List < java.lang.String > groups ) { if ( groups == null ) { throw new java.lang.IllegalArgumentException ( "groups may not be null" ) ; } java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( java.lang.String g : groups ) { if ( ! first ) { sb.append ( ',' ) ; } else { first = false ; } sb.append ( g ) ; } return sb.toString ( ) ; }
Source:
public void removedAction ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChangeWithTopic ( ) ; r.assertOkStatus ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( r.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( actions.keySet ( ) ) . containsExactly ( "description" ) ; }

Target:
public void removedAction ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createANewChangeWithTopic ( ) ; r.assertOkStatus ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( r.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( actions.keySet ( ) ) . containsExactly ( "description" ) ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void blockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }

Target:
public void blockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
public void commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private org.eclipse.jgit.lib.PersonIdent newIdent ( java.lang.String whenStr , java.lang.String tzStr ) throws java.text.ParseException { whenStr += " " + tzStr ; java.util.Date when = org.eclipse.jgit.util.GitDateParser.parse ( whenStr , null ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( ( "GMT" + tzStr ) ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A User" , "user@example.com" , when , tz ) ; org.junit.Assert.assertEquals ( ( ( "PersonIdent[A User, user@example.com, " + whenStr ) + "]" ) , ident.toString ( ) ) ; return ident ; }

Target:
private org.eclipse.jgit.lib.PersonIdent newIdent ( java.lang.String whenStr , java.lang.String tzStr ) throws java.text.ParseException { whenStr += " " + tzStr ; java.util.Date when = org.eclipse.jgit.util.GitDateParser.parse ( whenStr , null ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( ( "GMT" + tzStr ) ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A User" , "user@example.com" , when , tz ) ; com.google.common.truth.Truth.assertThat ( ident.toString ( ) ) . isEqualTo ( ( ( "PersonIdent[A User, user@example.com, " + whenStr ) + "]" ) ) ; return ident ; }
Source:
private void preMerge ( ) throws com.google.gerrit.server.git.MergeException , com.google.gwtorm.server.OrmException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } }

Target:
private com.google.gerrit.server.git.SubmitStrategy createStrategy ( final com.google.gerrit.reviewdb.client.Project.SubmitType submitType ) throws com.google.gerrit.server.git.MergeException { return submitStrategyFactory.create ( submitType , db , repo , rw , inserter , canMergeFlag , getAlreadyAccepted ( branchTip ) , destBranch , destProject.isUseContentMerge ( ) ) ; }
Source:
public void restoreReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void restoreReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( ) ; restore ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private java.lang.String readBlob ( java.lang.String sequenceName ) throws java.lang.Exception { java.lang.String refName = ( com.google.gerrit.reviewdb.client.RefNames.REFS_SEQUENCES ) + sequenceName ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.lib.ObjectId id = repo.exactRef ( refName ) . getObjectId ( ) ; return new java.lang.String ( rw.getObjectReader ( ) . open ( id ) . getCachedBytes ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } }

Target:
private java.lang.String readBlob ( java.lang.String sequenceName ) throws java.lang.Exception { java.lang.String refName = ( com.google.gerrit.reviewdb.client.RefNames.REFS_SEQUENCES ) + sequenceName ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.lib.ObjectId id = repo.exactRef ( refName ) . getObjectId ( ) ; return new java.lang.String ( rw.getObjectReader ( ) . open ( id ) . getCachedBytes ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { }

Target:
protected void populateProjects ( ) { Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( ) { @ java.lang.Override public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }
Source:
private void commitMurder ( ) { final java.io.PrintWriter p = toPrintWriter ( err ) ; for ( final java.lang.Integer id : taskIds ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > task = workQueue.getTask ( id ) ; if ( task != null ) { task.cancel ( true ) ; } else { p.print ( ( ( "kill: " + ( com.google.gerrit.server.util.IdGenerator.format ( id ) ) ) + ": No such task\n" ) ) ; } } p.flush ( ) ; }

Target:
protected void run ( ) { for ( final java.lang.Integer id : taskIds ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > task = workQueue.getTask ( id ) ; if ( task != null ) { task.cancel ( true ) ; } else { stderr.print ( ( ( "kill: " + ( com.google.gerrit.server.util.IdGenerator.format ( id ) ) ) + ": No such task\n" ) ) ; } } }
Source:
public void hostIndexTwoComponentPrefix ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . setRepositoryPrefix ( "foo/bar" ) . build ( ) ; org.junit.Assert.assertEquals ( "/b/foo/bar/" , view.toUrl ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "host" , "url" , "/b/?format=HTML" ) , com.google.common.collect.ImmutableMap.of ( "text" , "foo" , "url" , "/b/foo/" ) , com.google.common.collect.ImmutableMap.of ( "text" , "bar" , "url" , "/b/foo/bar/" ) ) , view.getBreadcrumbs ( ) ) ; }

Target:
public void hostIndexTwoComponentPrefix ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . setRepositoryPrefix ( "foo/bar" ) . build ( ) ; com.google.common.truth.Truth.assertThat ( view.toUrl ( ) ) . isEqualTo ( "/b/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( view.getBreadcrumbs ( ) ) . containsExactly ( com.google.gitiles.GitilesViewTest.breadcrumb ( "host" , "/b/?format=HTML" ) , com.google.gitiles.GitilesViewTest.breadcrumb ( "foo" , "/b/foo/" ) , com.google.gitiles.GitilesViewTest.breadcrumb ( "bar" , "/b/foo/bar/" ) ) . inOrder ( ) ; }
Source:
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.owners = java.util.Collections.singletonList ( "non-existing-group" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( "/projects/newProject" , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_UNPROCESSABLE_ENTITY ) ; }

Target:
public void testCreateProjectWhenProjectAlreadyExists_Conflict ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = allProjects.get ( ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; }
Source:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( notes.getChange ( ) . getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , notes , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( notes.getProjectName ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , notes , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( accounts.create ( ) . id.get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }

Target:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.mode.ModeInjector ( ) . add ( getContentType ( info.metaA ( ) ) ) . add ( getContentType ( info.metaB ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; if ( Patch.COMMIT_MSG.equals ( path ) ) { line = adjustCommitMessageLine ( line ) ; } java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path , line ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }
Source:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.git.PerThreadRequestScope.Context old = com.google.gerrit.server.git.PerThreadRequestScope.current.get ( ) ; com.google.gerrit.server.git.PerThreadRequestScope.current.set ( ctx ) ; try { return wrapped.call ( ) ; } finally { com.google.gerrit.server.git.PerThreadRequestScope.current.set ( old ) ; } }

Target:
public < T > java.util.concurrent.Callable < T > scope ( com.google.gerrit.server.util.RequestContext requestContext , java.util.concurrent.Callable < T > callable ) { com.google.gerrit.server.git.PerThreadRequestScope.Context ctx = new com.google.gerrit.server.git.PerThreadRequestScope.Context ( ) ; java.util.concurrent.Callable < T > wrapped = context ( requestContext , cleanup ( callable ) ) ; return ( ) -> { com.google.gerrit.server.git.PerThreadRequestScope.Context old = com.google.gerrit.server.git.PerThreadRequestScope.current.get ( ) ; com.google.gerrit.server.git.PerThreadRequestScope.current.set ( ctx ) ; try { return wrapped.call ( ) ; } finally { com.google.gerrit.server.git.PerThreadRequestScope.current.set ( old ) ; } } ; }
Source:
private java.util.Optional < com.google.gerrit.common.data.Permission > findDefaultPermission ( com.google.gerrit.server.git.ProjectConfig config ) { com.google.gerrit.common.data.AccessSection users = config.getAccessSection ( ( ( ( ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) + "${" ) + ( com.google.gerrit.server.project.RefPattern.USERID_SHARDED ) ) + "}" ) , false ) ; if ( users == null ) { return java.util.Optional.empty ( ) ; } com.google.gerrit.common.data.Permission permission = users.getPermission ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , false ) ; return isDefaultPermissionUntouched ( permission ) ? java.util.Optional.of ( permission ) : java.util.Optional.empty ( ) ; }

Target:
private java.util.Optional < com.google.gerrit.common.data.Permission > findDefaultPermission ( com.google.gerrit.server.project.ProjectConfig config ) { com.google.gerrit.common.data.AccessSection users = config.getAccessSection ( ( ( ( ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) + "${" ) + ( com.google.gerrit.server.project.RefPattern.USERID_SHARDED ) ) + "}" ) , false ) ; if ( users == null ) { return java.util.Optional.empty ( ) ; } com.google.gerrit.common.data.Permission permission = users.getPermission ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , false ) ; return isDefaultPermissionUntouched ( permission ) ? java.util.Optional.of ( permission ) : java.util.Optional.empty ( ) ; }
Source:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case REST_API : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo lineOnOther ( com.google.gerrit.client.diff.DisplaySide side , int line ) { return mapper.lineOnOther ( side , line ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes load ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( change.getProject ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { return new com.google.gerrit.server.notedb.ChangeNotes ( repo , change ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } }

Target:
public com.google.gerrit.server.notedb.ChangeNotes load ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( loaded ) ) { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( change.getProject ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { load ( repo ) ; loaded = true ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } } return this ; }
Source:
private java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.api.accounts.SshKeyInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.api.accounts.SshKeyInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.currentUser ( ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account me = db.accounts ( ) . get ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) ) ; me.setFullName ( fullName ) ; me.setPreferredEmail ( emailAddr ) ; me.setContactInformation ( info ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( me ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account me = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; me.setFullName ( fullName ) ; me.setPreferredEmail ( emailAddr ) ; me.setContactInformation ( info ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( me ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public static com.google.common.base.Optional < java.lang.String > getChangeId ( org.eclipse.jgit.junit.TestRepository < ? > tr , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit c = tr.getRevWalk ( ) . parseCommit ( id ) ; tr.getRevWalk ( ) . parseBody ( c ) ; java.util.List < java.lang.String > ids = c.getFooterLines ( FooterConstants.CHANGE_ID ) ; if ( ids.isEmpty ( ) ) { return com.google.common.base.Optional.absent ( ) ; } return com.google.common.base.Optional.of ( ids.get ( ( ( ids.size ( ) ) - 1 ) ) ) ; }

Target:
public static java.util.Optional < java.lang.String > getChangeId ( org.eclipse.jgit.junit.TestRepository < ? > tr , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit c = tr.getRevWalk ( ) . parseCommit ( id ) ; tr.getRevWalk ( ) . parseBody ( c ) ; return com.google.common.collect.Lists.reverse ( c.getFooterLines ( FooterConstants.CHANGE_ID ) ) . stream ( ) . findFirst ( ) ; }
Source:
static com.google.gerrit.server.patch.PatchListEntry empty ( final java.lang.String fileName ) { final java.lang.StringBuilder buf = new java.lang.StringBuilder ( ) ; buf.append ( "diff --git a/" ) ; buf.append ( fileName ) ; buf.append ( " b/" ) ; buf.append ( fileName ) ; buf.append ( "\n\n" ) ; return new com.google.gerrit.server.patch.PatchListEntry ( com.google.gerrit.server.patch.PatchListEntry.parse ( org.spearce.jgit.lib.Constants.encode ( buf.toString ( ) ) ) ) ; }

Target:
static com.google.gerrit.server.patch.PatchListEntry empty ( final java.lang.String fileName ) { return new com.google.gerrit.server.patch.PatchListEntry ( com.google.gerrit.client.reviewdb.Patch.ChangeType.MODIFIED , com.google.gerrit.client.reviewdb.Patch.PatchType.UNIFIED , null , fileName , com.google.gerrit.server.patch.PatchListEntry.EMPTY_HEADER , java.util.Collections.< org.spearce.jgit.diff.Edit > emptyList ( ) ) ; }