auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void importGit ( ) throws com.google.gwtorm.client.OrmException , java.io.IOException { if ( flags.importProjects ) { java.lang.System.err.println ( ( "Scanning " + ( repositoryManager.getBasePath ( ) ) ) ) ; gitProjectImporter.run ( new com.google.gerrit.server.git.GitProjectImporter.Messages ( ) { @ java.lang.Override public void warning ( java.lang.String msg ) { java.lang.System.err.println ( msg ) ; java.lang.System.err.flush ( ) ; } } ) ; } }

Target:
void importGit ( ) throws com.google.gwtorm.client.OrmException , java.io.IOException { if ( flags.importProjects ) { gitProjectImporter.run ( new com.google.gerrit.server.git.GitProjectImporter.Messages ( ) { @ java.lang.Override public void info ( java.lang.String msg ) { java.lang.System.err.println ( msg ) ; java.lang.System.err.flush ( ) ; } @ java.lang.Override public void warning ( java.lang.String msg ) { info ( msg ) ; } } ) ; } }
Source:
private void fireHook ( ) { final java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , messageText , changed ) ; }

Target:
private void fireHook ( ) { final java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , patchSet , messageText , changed ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( submissionId ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( submissionId ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , notes , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }
Source:
private int getPort ( java.net.URL originalUrl ) { java.lang.String protocol = originalUrl.getProtocol ( ) . toLowerCase ( ) ; int port = originalUrl.getPort ( ) ; if ( port == ( - 1 ) ) { return protocol.equals ( "https" ) ? 443 : 80 ; } else { return port ; } }

Target:
private int getPort ( java.net.URL originalUrl ) { java.lang.String protocol = originalUrl.getProtocol ( ) . toLowerCase ( ) ; int port = originalUrl.getPort ( ) ; if ( port == ( - 1 ) ) { return protocol.equals ( "https" ) ? 443 : 80 ; } return port ; }
Source:
public void mergeByOtherNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOtherNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }
Source:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; assertNotNull ( r ) ; assertEquals ( ident.getName ( ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ident.getName ( ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void commitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit root = repo.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit master = repo.commit ( ) . parent ( root ) . create ( ) ; org.junit.Assert.assertEquals ( ( ( start ) + 1 ) , getTime ( root ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( master ) ) ; }

Target:
public void commitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit root = repo.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit master = repo.commit ( ) . parent ( root ) . create ( ) ; com.google.common.truth.Truth.assertThat ( getTime ( root ) ) . isEqualTo ( ( ( start ) + 1 ) ) ; com.google.common.truth.Truth.assertThat ( getTime ( master ) ) . isEqualTo ( ( ( start ) + 2 ) ) ; }
Source:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }
Source:
public java.lang.String fetch ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { final org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; org.eclipse.jgit.revwalk.RevCommit commit = revWalk.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId ) ) ; return commit.getFullMessage ( ) ; } finally { repo.close ( ) ; } }

Target:
public java.lang.String fetch ( java.lang.String projectName , java.lang.String commitId ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = revWalk.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId ) ) ; return commit.getFullMessage ( ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { com.google.gerrit.client.change.History.AuthorRevision b = ( ( com.google.gerrit.client.change.History.AuthorRevision ) ( o ) ) ; return ( ( author ) == ( b.author ) ) && ( ( revision ) == ( b.revision ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ! ( o instanceof com.google.gerrit.client.change.History.AuthorRevision ) ) { return false ; } com.google.gerrit.client.change.History.AuthorRevision b = ( ( com.google.gerrit.client.change.History.AuthorRevision ) ( o ) ) ; return ( ( author ) == ( b.author ) ) && ( ( revision ) == ( b.revision ) ) ; }
Source:
public void getChildProject ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.reviewdb.client.Project.NameKey child = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; createProject ( child.get ( ) ) ; sshSession.close ( ) ; com.google.gerrit.extensions.common.ProjectInfo childInfo = gApi.projects ( ) . name ( allProjects.get ( ) ) . child ( child.get ( ) ) . get ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectCache.get ( child ) . getProject ( ) , childInfo ) ; }

Target:
public void getChildProject ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey child = createProject ( "p1" ) ; com.google.gerrit.extensions.common.ProjectInfo childInfo = gApi.projects ( ) . name ( allProjects.get ( ) ) . child ( child.get ( ) ) . get ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectCache.get ( child ) . getProject ( ) , childInfo ) ; }
Source:
public synchronized < F1 > com.google.gerrit.metrics.Timer1 < F1 > newTimer ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkTimerDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.TimerImpl1 < F1 > m = new com.google.gerrit.metrics.dropwizard.TimerImpl1 ( this , name , desc , field1 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.timer ( ) ; }

Target:
public synchronized < F1 > com.google.gerrit.metrics.Timer1 < F1 > newTimer ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkTimerDescription ( name , desc ) ; com.google.gerrit.metrics.dropwizard.TimerImpl1 < F1 > m = new com.google.gerrit.metrics.dropwizard.TimerImpl1 ( this , name , desc , field1 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.timer ( ) ; }
Source:
private static void assertSingleWord ( final java.lang.String name , final java.lang.String value , final org.antlr.runtime.tree.Tree r ) { assertEquals ( QueryParser.FIELD_NAME , r.getType ( ) ) ; assertEquals ( name , r.getText ( ) ) ; assertEquals ( 1 , r.getChildCount ( ) ) ; final org.antlr.runtime.tree.Tree c = r.getChild ( 0 ) ; assertEquals ( QueryParser.SINGLE_WORD , c.getType ( ) ) ; assertEquals ( value , c.getText ( ) ) ; assertEquals ( 0 , c.getChildCount ( ) ) ; }

Target:
private static void assertSingleWord ( final java.lang.String name , final java.lang.String value , final org.antlr.runtime.tree.Tree r ) { org.junit.Assert.assertEquals ( QueryParser.FIELD_NAME , r.getType ( ) ) ; org.junit.Assert.assertEquals ( name , r.getText ( ) ) ; org.junit.Assert.assertEquals ( 1 , r.getChildCount ( ) ) ; final org.antlr.runtime.tree.Tree c = r.getChild ( 0 ) ; org.junit.Assert.assertEquals ( QueryParser.SINGLE_WORD , c.getType ( ) ) ; org.junit.Assert.assertEquals ( value , c.getText ( ) ) ; org.junit.Assert.assertEquals ( 0 , c.getChildCount ( ) ) ; }
Source:
public void testPrefixReducesSearchSpace ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a/b/.*\\.[ch]" ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.res" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "source.res" ) ) ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/a.a" , "a/b/a.d" , "a/b/a.h" ) ) ) ; }

Target:
public void testPrefixReducesSearchSpace ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a/b/.*\\.[ch]" ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.res" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "source.res" ) ) ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/a.a" , "a/b/a.d" , "a/b/a.h" ) ) ) ; }
Source:
void commitNotes ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.ConcurrentRefUpdateException { try { if ( ( serviceUserNotes ) == null ) { return ; } message.insert ( 0 , "Update notes for service user commits\n\n" ) ; notesBranchUtilFactory.create ( project , git , inserter ) . commitAllNotes ( serviceUserNotes , com.googlesource.gerrit.plugins.serviceuser.CreateServiceUserNotes.REFS_NOTES_SERVICEUSER , gerritServerIdent , message.toString ( ) ) ; } finally { if ( ( inserter ) != null ) { inserter.release ( ) ; } } }

Target:
void commitNotes ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.ConcurrentRefUpdateException { try { if ( ( serviceUserNotes ) == null ) { return ; } message.insert ( 0 , "Update notes for service user commits\n\n" ) ; notesBranchUtilFactory.create ( project , git , inserter ) . commitAllNotes ( serviceUserNotes , com.googlesource.gerrit.plugins.serviceuser.CreateServiceUserNotes.REFS_NOTES_SERVICEUSER , gerritServerIdent , message.toString ( ) ) ; } finally { if ( ( inserter ) != null ) { inserter.close ( ) ; } } }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
public void testHashCode ( ) { assertTrue ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) ) ) ; assertFalse ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "alice" ) . hashCode ( ) ) ) ) ; }

Target:
public void testHashCode ( ) { org.junit.Assert.assertTrue ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) ) ) ; org.junit.Assert.assertFalse ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "alice" ) . hashCode ( ) ) ) ) ; }
Source:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = git.getRepository ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null , admin ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }

Target:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null , admin ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }
Source:
private static com.google.gerrit.server.change.GetRelated.ChangeAndCommit changeAndCommit ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , org.eclipse.jgit.lib.ObjectId commitId , int currentRevisionNum ) { com.google.gerrit.server.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.change.GetRelated.ChangeAndCommit ( ) ; result._changeNumber = psId.getParentKey ( ) . get ( ) ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = psId.get ( ) ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }

Target:
private com.google.gerrit.server.change.GetRelated.ChangeAndCommit changeAndCommit ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , org.eclipse.jgit.lib.ObjectId commitId , int currentRevisionNum ) { com.google.gerrit.server.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.change.GetRelated.ChangeAndCommit ( ) ; result.project = project.get ( ) ; result._changeNumber = psId.getParentKey ( ) . get ( ) ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = psId.get ( ) ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }
Source:
protected void configure ( ) { if ( ! ( com.google.gerrit.gpg.BouncyCastleUtil.havePGP ( ) ) ) { throw new com.google.inject.ProvisionException ( "Bouncy Castle PGP not installed" ) ; } bind ( com.google.gerrit.gpg.PublicKeyChecker.class ) . to ( com.google.gerrit.gpg.GerritPublicKeyChecker.class ) ; bind ( com.google.gerrit.gpg.PublicKeyStore.class ) . toProvider ( com.google.gerrit.gpg.SignedPushModule.StoreProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.gpg.SignedPushModule.Initializer.class ) ; }

Target:
protected void configure ( ) { if ( ! ( com.google.gerrit.gpg.BouncyCastleUtil.havePGP ( ) ) ) { throw new com.google.inject.ProvisionException ( "Bouncy Castle PGP not installed" ) ; } bind ( com.google.gerrit.gpg.PublicKeyStore.class ) . toProvider ( com.google.gerrit.gpg.SignedPushModule.StoreProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.gpg.SignedPushModule.Initializer.class ) ; }
Source:
public static void put ( int id , java.lang.String path , java.lang.String content , com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > cb ) { if ( Patch.COMMIT_MSG.equals ( path ) ) { com.google.gerrit.client.changes.ChangeEditApi.putMessage ( id , content , cb ) ; } else { com.google.gerrit.client.changes.ChangeEditApi.editFile ( id , path ) . put ( content , cb ) ; } }

Target:
public static void put ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String path , java.lang.String content , com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > cb ) { if ( Patch.COMMIT_MSG.equals ( path ) ) { com.google.gerrit.client.changes.ChangeEditApi.putMessage ( project , id , content , cb ) ; } else { com.google.gerrit.client.changes.ChangeEditApi.editFile ( project , id , path ) . put ( content , cb ) ; } }
Source:
private java.util.Optional < com.google.gerrit.server.group.InternalGroup > toInternalGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . getInternalGroup ( uuid ) ; }

Target:
private java.util.Optional < com.google.gerrit.server.group.InternalGroup > toInternalGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) ; }
Source:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( ( change ) != null ) && ( autoRebuild ) ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.areDraftsUpToDate ( new com.google.gerrit.server.git.RepoRefCache ( repo ) , author ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }

Target:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( ( change ) != null ) && ( autoRebuild ) ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ! ( com.google.gerrit.server.notedb.NoteDbChangeState.areDraftsUpToDate ( state , new com.google.gerrit.server.git.RepoRefCache ( repo ) , getChangeId ( ) , author ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }
Source:
private java.lang.String getRedirectUrl ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; org.junit.Assert.assertEquals ( 302 , result.getResponse ( ) . getStatus ( ) ) ; return result.getResponse ( ) . getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ; }

Target:
private java.lang.String getRedirectUrl ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; com.google.common.truth.Truth.assertThat ( result.getResponse ( ) . getStatus ( ) ) . isEqualTo ( 302 ) ; return result.getResponse ( ) . getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; factory ( LuceneChangeIndex.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
protected void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.client.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.Change c = cd.change ( db ) ; if ( ( c != null ) && ( changeControl.controlFor ( c ) . forUser ( user ) . isVisible ( ) ) ) { cd.cacheVisibleTo ( user ) ; return true ; } else { return false ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.client.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.Change c = cd.change ( db ) ; if ( ( c != null ) && ( changeControl.controlFor ( c , user ) . isVisible ( ) ) ) { cd.cacheVisibleTo ( user ) ; return true ; } else { return false ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }
Source:
private com.google.gerrit.extensions.common.ApprovalInfo getVote ( com.google.gerrit.extensions.api.changes.ChangeApi change , java.lang.String label ) throws com.google.gerrit.extensions.restapi.RestApiException { return change.get ( java.util.EnumSet.of ( ListChangesOption.DETAILED_LABELS ) ) . labels.get ( label ) . all.get ( 0 ) ; }

Target:
private com.google.gerrit.extensions.common.ApprovalInfo getVote ( com.google.gerrit.extensions.api.changes.ChangeApi change , java.lang.String label ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.List < com.google.gerrit.extensions.common.ApprovalInfo > approvals = change.get ( java.util.EnumSet.of ( ListChangesOption.DETAILED_LABELS ) ) . labels.get ( label ) . all ; return approvals.get ( ( ( approvals.size ( ) ) - 1 ) ) ; }
Source:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { java.lang.String lineStr = getLine ( fileData , side , line ) ; cmts.append ( ( ( ( ( "Line " + line ) + ": " ) + lineStr ) + "\n" ) ) ; }

Target:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { java.lang.String lineStr = getLine ( fileData , side , line ) ; cmts.append ( "Line " ) . append ( line ) . append ( ": " ) . append ( lineStr ) . append ( "\n" ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( com.google.gerrit.server.account.AccountResource account , java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { com.google.gerrit.gpg.server.PostGpgKeys.Input in = new com.google.gerrit.gpg.server.PostGpgKeys.Input ( ) ; in.add = add ; in.delete = delete ; try { return postGpgKeys.apply ( account , in ) ; } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( com.google.gerrit.server.account.AccountResource account , java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { com.google.gerrit.gpg.server.PostGpgKeys.Input in = new com.google.gerrit.gpg.server.PostGpgKeys.Input ( ) ; in.add = add ; in.delete = delete ; try { return postGpgKeys.get ( ) . apply ( account , in ) ; } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , new com.google.gerrit.server.query.change.BasicChangeRewrites ( null , indexes ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , new com.google.gerrit.server.query.change.BasicChangeRewrites ( null ) ) ; }
Source:
public void byKey ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }

Target:
public void byKey ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChange ( repo ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }
Source:
public static java.util.List < com.google.gitiles.blame.Region > loadBlame ( com.google.gitiles.blame.BlameCacheImpl.Key key ) throws java.io.IOException { try { org.eclipse.jgit.blame.BlameGenerator gen = new org.eclipse.jgit.blame.BlameGenerator ( key.repo , key.path ) ; try { gen.push ( null , key.commitId ) ; return com.google.gitiles.blame.BlameCacheImpl.loadRegions ( gen ) ; } finally { gen.release ( ) ; } } finally { key.repo = null ; } }

Target:
public static java.util.List < com.google.gitiles.blame.Region > loadBlame ( com.google.gitiles.blame.BlameCacheImpl.Key key ) throws java.io.IOException { try ( org.eclipse.jgit.blame.BlameGenerator gen = new org.eclipse.jgit.blame.BlameGenerator ( key.repo , key.path ) ) { gen.push ( null , key.commitId ) ; return com.google.gitiles.blame.BlameCacheImpl.loadRegions ( gen ) ; } finally { key.repo = null ; } }
Source:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( git , "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; org.junit.Assert.assertEquals ( 0 , related.size ( ) ) ; }

Target:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( git , "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }
Source:
public void bind ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t.isVariable ( ) ) { com.googlecode.prolog_cafe.lang.VariableTerm v = ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) ; if ( ( v.timeStamp ) >= ( this . timeStamp ) ) { v.val = this ; if ( ( v.timeStamp ) < ( trail.timeStamp ) ) trail.push ( v ) ; return ; } } val = t ; if ( ( timeStamp ) < ( trail.timeStamp ) ) trail.push ( this ) ; }

Target:
public void bind ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) { com.googlecode.prolog_cafe.lang.VariableTerm v = ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) ; if ( ( v.timeStamp ) >= ( this . timeStamp ) ) { v.val = this ; if ( ( v.timeStamp ) < ( trail.timeStamp ) ) trail.push ( v ) ; return ; } } val = t ; if ( ( timeStamp ) < ( trail.timeStamp ) ) trail.push ( this ) ; }
Source:
public static < T > void mapOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicMap < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicMap < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicMap.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicMapProvider < T > ( member ) ) . in ( Scopes.SINGLETON ) ; }

Target:
public static < T > void mapOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicMap < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicMap < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicMap.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicMapProvider ( member ) ) . in ( Scopes.SINGLETON ) ; }
Source:
private void applyReview ( final com.google.gerrit.server.project.ChangeControl ctl , final com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.server.change.PostReview.Input review ) throws java.lang.Exception { if ( ! ( review.labels.isEmpty ( ) ) ) { reviewProvider.get ( ) . apply ( new com.google.gerrit.server.change.RevisionResource ( new com.google.gerrit.server.change.ChangeResource ( ctl ) , patchSet ) , review ) ; } }

Target:
private void applyReview ( final com.google.gerrit.server.project.ChangeControl ctl , final com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.server.change.PostReview.Input review ) throws java.lang.Exception { reviewProvider.get ( ) . apply ( new com.google.gerrit.server.change.RevisionResource ( new com.google.gerrit.server.change.ChangeResource ( ctl ) , patchSet ) , review ) ; }
Source:
private com.google.gerrit.extensions.restapi.BinaryResult wrapBlob ( com.google.gerrit.server.project.ProjectState project , java.lang.String path , final org.eclipse.jgit.lib.ObjectLoader obj , byte [ ] raw , eu.medsea.mimeutil.MimeType contentType , @ com.google.gerrit.common.Nullable java.lang.String suffix ) { return com.google.gerrit.server.change.FileContentUtil.asBinaryResult ( raw , obj ) . setContentType ( contentType.toString ( ) ) . setAttachmentName ( com.google.gerrit.server.change.FileContentUtil.safeFileName ( path , suffix ) ) ; }

Target:
private com.google.gerrit.extensions.restapi.BinaryResult wrapBlob ( java.lang.String path , final org.eclipse.jgit.lib.ObjectLoader obj , byte [ ] raw , eu.medsea.mimeutil.MimeType contentType , @ com.google.gerrit.common.Nullable java.lang.String suffix ) { return com.google.gerrit.server.change.FileContentUtil.asBinaryResult ( raw , obj ) . setContentType ( contentType.toString ( ) ) . setAttachmentName ( com.google.gerrit.server.change.FileContentUtil.safeFileName ( path , suffix ) ) ; }
Source:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = ( projectPrefix ) + nameSuffix ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }

Target:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }
Source:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { if ( ( b.getKey ( ) . getAnnotation ( ) ) != null ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) ) ; } } } return m ; }

Target:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { if ( ( b.getKey ( ) . getAnnotation ( ) ) != null ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) ) ; } } } return m ; }
Source:
private static boolean isStaticResource ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String requestURI = httpRequest.getRequestURI ( ) ; java.lang.String pathExt = org.apache.commons.lang.StringUtils.substringAfterLast ( requestURI , "." ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( pathExt ) ) { return false ; } boolean staticResource = com.googlesource.gerrit.plugins.github.oauth.OAuthFilter.GERRIT_STATIC_RESOURCES_EXTS.contains ( pathExt.toLowerCase ( ) ) ; java.lang.System.out.println ( ( ( ( ( ( "requestUri: " + requestURI ) + " pathExt: " ) + pathExt ) + " static: " ) + staticResource ) ) ; return staticResource ; }

Target:
private static boolean isStaticResource ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String requestURI = httpRequest.getRequestURI ( ) ; java.lang.String pathExt = org.apache.commons.lang.StringUtils.substringAfterLast ( requestURI , "." ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( pathExt ) ) { return false ; } boolean staticResource = com.googlesource.gerrit.plugins.github.oauth.OAuthFilter.GERRIT_STATIC_RESOURCES_EXTS.contains ( pathExt.toLowerCase ( ) ) ; return staticResource ; }
Source:
private com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return schema.getDialect ( ) . convertError ( op , com.google.gwtorm.jdbc.JdbcAccess.getRelationName ( ) , err ) ; }

Target:
protected com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return schema.getDialect ( ) . convertError ( op , com.google.gwtorm.jdbc.JdbcAccess.getRelationName ( ) , err ) ; }
Source:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; org.junit.Assert.assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; org.junit.Assert.assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }
Source:
private void rename ( java.lang.String path , java.lang.String newPath ) { hide ( ) ; com.google.gerrit.client.changes.ChangeEditApi.rename ( changeId.get ( ) , path , newPath , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( changeId ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
private void rename ( java.lang.String path , java.lang.String newPath ) { hide ( ) ; com.google.gerrit.client.changes.ChangeEditApi.rename ( project.get ( ) , changeId.get ( ) , path , newPath , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( project , changeId ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) . orElse ( null ) ; privilegedUser = accountCreator.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = group ( createGroup ( "privilegedGroup" ) ) ; privilegedUser = accountCreator.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }