auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; return true ; } return false ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; update.setStatus ( change.getStatus ( ) ) ; return true ; } return false ; }
Source:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }

Target:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts , com.google.gerrit.client.change.FileTable.Mode mode ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts , mode ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }
Source:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; 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/drafts/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }

Target:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; 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/drafts/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/drafts/master" ) . canPerform ( com.google.gerrit.common.data.Permission.PUSH ) ) . isFalse ( ) ; }
Source:
private static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref ) { project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . add ( rule ) ; return rule ; }

Target:
private static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref , boolean exclusive ) { com.google.gerrit.common.data.Permission permission = project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) ; if ( exclusive ) { permission.setExclusiveGroup ( exclusive ) ; } permission.add ( rule ) ; return rule ; }
Source:
public boolean isVisible ( ) { return ( getProjectControl ( ) . visibleForReplication ( ) ) || ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.READ , ( ( short ) ( 1 ) ) ) ) ; }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . isAdministrator ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }
Source:
private RefUpdate.Result store ( org.eclipse.jgit.lib.ObjectId oldId , int val ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectId newId ; try ( org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ) { newId = ins.insert ( org.eclipse.jgit.lib.Constants.OBJ_BLOB , java.lang.Integer.toString ( val ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; ins.flush ( ) ; } org.eclipse.jgit.lib.RefUpdate ru = repo.updateRef ( refName ) ; ru.setExpectedOldObjectId ( oldId ) ; ru.setNewObjectId ( newId ) ; ru.setForceUpdate ( true ) ; return ru.update ( rw ) ; }

Target:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( batchSize ) ) ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.common.base.Throwables.propagateIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; throw e ; } }

Target:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.common.base.Throwables.propagateIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; throw e ; } }
Source:
private void initTopicLink ( com.google.gerrit.client.changes.ChangeInfo info ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.project_name_key ( ) , info.status ( ) , info.branch ( ) , info.topic ( ) ) ) ) ; }

Target:
private void initTopicLink ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( ( info.topic ( ) ) != null ) && ( ! ( info.topic ( ) . isEmpty ( ) ) ) ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.op ( "topic" , info.topic ( ) ) ) ) ; } }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { final com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , p.getAccountId ( ) ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . values ( ) ) { com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , accountId ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }
Source:
com.google.gerrit.server.notedb.ChangeDraftUpdate createDraftUpdateIfNull ( ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( getNotes ( ) , accountId , authorIdent , when ) ; } return draftUpdate ; }

Target:
com.google.gerrit.server.notedb.ChangeDraftUpdate createDraftUpdateIfNull ( ) { if ( ( draftUpdate ) == null ) { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ) ; if ( notes != null ) { draftUpdate = draftUpdateFactory.create ( notes , accountId , authorIdent , when ) ; } else { draftUpdate = draftUpdateFactory.create ( getChange ( ) , accountId , authorIdent , when ) ; } } return draftUpdate ; }
Source:
public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup in ) { return in.getName ( ) ; }

Target:
private com.google.gerrit.acceptance.TestAccount user ( java.lang.String name , java.lang.String fullName , java.lang.String emailName , com.google.gerrit.reviewdb.client.AccountGroup ... groups ) throws java.lang.Exception { java.lang.String [ ] groupNames = java.util.Arrays.stream ( groups ) . map ( AccountGroup :: getName ) . toArray ( java.lang.String [ ] :: new ) ; return accounts.create ( name ( name ) , ( ( name ( emailName ) ) + "@example.com" ) , fullName , groupNames ) ; }
Source:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { BRANCH ( 9.0 ) ; com.google.gerrit.sshd.commands.d0e0 SSH ; commands : Set = $missing$ ; com.google.gerrit.sshd.commands.task name ; }

Target:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { gApi.changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) . revision ( patchSet.getRevision ( ) . get ( ) ) . review ( review ) ; }
Source:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . 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 ) ; }

Target:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }

Target:
public void parseChangeId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Change-id: I159532ef4844d7c18f7f3fd37a0b275590d41b1b" ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey name ) { if ( name == null ) { return null ; } try { return byName.get ( name.get ( ) ) . orNull ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , name.get ( ) ) , e ) ; return null ; } }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey name ) { if ( name == null ) { return null ; } try { return byName.get ( name.get ( ) ) . orElse ( null ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , name.get ( ) ) , e ) ; return null ; } }
Source:
public void execute ( ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.setOption ( "viewportMargin" , 10 ) ; } }

Target:
public void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } resizeCodeMirror ( ) ; }
Source:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( options.forcePolyGerritDev ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } return isDev ( ) ? p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) : p.warFs.getPath ( "/polygerrit_ui" ) ; }

Target:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( options.forcePolyGerritDev ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } if ( p.isDev ( ) ) { return p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) ; } return ( p.warFs ) != null ? p.warFs.getPath ( "/polygerrit_ui" ) : p.unpackedWar.resolve ( "polygerrit_ui" ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.Revision ) { com.google.gitiles.Revision r = ( ( com.google.gitiles.Revision ) ( o ) ) ; return ( ( ( ( com.google.common.base.Objects.equal ( name , r.name ) ) && ( com.google.common.base.Objects.equal ( id , r.id ) ) ) && ( com.google.common.base.Objects.equal ( type , r.type ) ) ) && ( com.google.common.base.Objects.equal ( peeledId , r.peeledId ) ) ) && ( com.google.common.base.Objects.equal ( peeledType , r.peeledType ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.Revision ) { com.google.gitiles.Revision r = ( ( com.google.gitiles.Revision ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( name , r.name ) ) && ( java.util.Objects.equals ( id , r.id ) ) ) && ( java.util.Objects.equals ( type , r.type ) ) ) && ( java.util.Objects.equals ( peeledId , r.peeledId ) ) ) && ( java.util.Objects.equals ( peeledType , r.peeledType ) ) ; } return false ; }
Source:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKey.key5 ( ) ; assertProblems ( com.google.gerrit.gpg.testutil.TestKey.key5 ( ) , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; assertNoProblems ( key ) ; }

Target:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }
Source:
private java.util.concurrent.atomic.AtomicInteger getAndIncrementChangeIdLock ( com.google.gerrit.reviewdb.client.Change.Id id ) { synchronized ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet.changeIdLocks ) { java.util.concurrent.atomic.AtomicInteger changeIdLock = com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet.changeIdLocks.get ( id ) ; if ( changeIdLock == null ) { changeIdLock = new java.util.concurrent.atomic.AtomicInteger ( 1 ) ; com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet.changeIdLocks.put ( id , changeIdLock ) ; } else { changeIdLock.incrementAndGet ( ) ; } return changeIdLock ; } }

Target:
private java.util.concurrent.atomic.AtomicInteger getAndIncrementChangeIdLock ( com.google.gerrit.reviewdb.client.Change.Id id ) { synchronized ( com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServlet.changeIdLocks ) { java.util.concurrent.atomic.AtomicInteger changeIdLock = com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServlet.changeIdLocks.get ( id ) ; if ( changeIdLock == null ) { changeIdLock = new java.util.concurrent.atomic.AtomicInteger ( 1 ) ; com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServlet.changeIdLocks.put ( id , changeIdLock ) ; } else { changeIdLock.incrementAndGet ( ) ; } return changeIdLock ; } }
Source:
public void deleteEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }

Target:
public void deleteEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.common.RawInputUtil.create ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }
Source:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.Multimap < java.lang.String , java.lang.String > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }

Target:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.ListMultimap < java.lang.String , java.lang.String > map = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }
Source:
public void keyExpiringInFuture ( ) throws java.lang.Exception { assertProblems ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ) ; }

Target:
public void keyExpiringInFuture ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2015-07-10 12:00:00 -0400" ) ) ; assertProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2075-07-10 12:00:00 -0400" ) ) ; assertProblems ( checker , k , "Key is expired" ) ; }
Source:
public void execute ( ) { for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignIn ( ) ; } }

Target:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct , final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignIn ( ) ; } if ( ac != null ) { ac.onSuccess ( null ) ; } }
Source:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
public void doImport ( org.eclipse.jgit.lib.ProgressMonitor progress ) throws java.lang.Exception { progress.beginTask ( "Setting up Gerrit replication" , 2 ) ; java.lang.String repositoryName = ( ( getOrganisation ( ) ) + "/" ) + ( getRepository ( ) ) ; progress.update ( 1 ) ; replicationConfig.addSecureCredentials ( getOrganisation ( ) , authUsername , authToken ) ; progress.update ( 1 ) ; replicationConfig.addReplicationRemote ( getOrganisation ( ) , ( ( gitHubUrl ) + "/${name}.git" ) , repositoryName ) ; progress.endTask ( ) ; }

Target:
public void doImport ( org.eclipse.jgit.lib.ProgressMonitor progress ) throws java.lang.Exception { progress.beginTask ( "Setting up Gerrit replication" , 2 ) ; java.lang.String repositoryName = ( ( getOrganisation ( ) ) + "/" ) + ( getRepositoryName ( ) ) ; progress.update ( 1 ) ; replicationConfig.addSecureCredentials ( getOrganisation ( ) , authUsername , authToken ) ; progress.update ( 1 ) ; replicationConfig.addReplicationRemote ( getOrganisation ( ) , ( ( gitHubUrl ) + "/${name}.git" ) , repositoryName ) ; progress.endTask ( ) ; }
Source:
public static java.lang.String keyToString ( org.bouncycastle.openpgp.PGPPublicKey key ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > it = key.getUserIDs ( ) ; return java.lang.String.format ( "%s %s(%s)" , com.google.gerrit.server.git.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) , ( it.hasNext ( ) ? ( it.next ( ) ) + " " : "" ) , com.google.gerrit.server.git.gpg.Fingerprint.toString ( key.getFingerprint ( ) ) ) ; }

Target:
public static java.lang.String keyToString ( org.bouncycastle.openpgp.PGPPublicKey key ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > it = key.getUserIDs ( ) ; return java.lang.String.format ( "%s %s(%s)" , com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) , ( it.hasNext ( ) ? ( it.next ( ) ) + " " : "" ) , com.google.gerrit.gpg.Fingerprint.toString ( key.getFingerprint ( ) ) ) ; }
Source:
protected void initColumnHeaders ( ) { table.setText ( 0 , 1 , Util.C.projectName ( ) ) ; table.setText ( 0 , 2 , Util.C.projectDescription ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( 0 , 1 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; fmt.addStyleName ( 0 , 2 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }

Target:
protected void initColumnHeaders ( ) { table.setText ( 0 , com.google.gerrit.client.ui.ProjectsTable.C_NAME , Util.C.projectName ( ) ) ; table.setText ( 0 , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , Util.C.projectDescription ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( 0 , com.google.gerrit.client.ui.ProjectsTable.C_NAME , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; fmt.addStyleName ( 0 , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }
Source:
private static org.apache.lucene.search.Query sortKeyQuery ( com.google.gerrit.server.query.change.SortKeyPredicate p ) { return org.apache.lucene.search.NumericRangeQuery.newLongRange ( p.getField ( ) . getName ( ) , ( ( p.getMinValue ( ) ) != ( java.lang.Long.MIN_VALUE ) ? p.getMinValue ( ) : null ) , ( ( p.getMaxValue ( ) ) != ( java.lang.Long.MAX_VALUE ) ? p.getMaxValue ( ) : null ) , true , true ) ; }

Target:
private static org.apache.lucene.search.Query sortKeyQuery ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , com.google.gerrit.server.query.change.SortKeyPredicate p ) { long min = p.getMinValue ( schema ) ; long max = p.getMaxValue ( schema ) ; return org.apache.lucene.search.NumericRangeQuery.newLongRange ( p.getField ( ) . getName ( ) , ( min != ( java.lang.Long.MIN_VALUE ) ? min : null ) , ( max != ( java.lang.Long.MAX_VALUE ) ? max : null ) , false , false ) ; }
Source:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return input.getAccountId ( ) . equals ( rsrc.getUser ( ) . getAccountId ( ) ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( db.patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { admin = accounts.admin ( ) ; com.google.gerrit.acceptance.git.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , project.get ( ) ) ; db = reviewDbProvider.open ( ) ; atrScope.set ( atrScope.newContext ( reviewDbProvider , sshSession , identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , admin.getId ( ) ) ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { admin = accounts.admin ( ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) ) ; db = reviewDbProvider.open ( ) ; atrScope.set ( atrScope.newContext ( reviewDbProvider , sshSession , identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , admin.getId ( ) ) ) ) ; }
Source:
public void testCreate_Empty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { org.junit.Assert.assertTrue ( root.mkdir ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { root.delete ( ) ; } }

Target:
public void testCreate_Empty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createDirectory ( root ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
private com.google.gerrit.server.config.GetServerInfo.SshdInfo getSshdInfo ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String [ ] addr = cfg.getStringList ( "sshd" , null , "listenAddress" ) ; if ( ( ( addr.length ) == 1 ) && ( com.google.gerrit.server.config.GetServerInfo.isOff ( addr [ 0 ] ) ) ) { return null ; } return new com.google.gerrit.server.config.GetServerInfo.SshdInfo ( ) ; }

Target:
private com.google.gerrit.extensions.common.SshdInfo getSshdInfo ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String [ ] addr = cfg.getStringList ( "sshd" , null , "listenAddress" ) ; if ( ( ( addr.length ) == 1 ) && ( com.google.gerrit.server.config.GetServerInfo.isOff ( addr [ 0 ] ) ) ) { return null ; } return new com.google.gerrit.extensions.common.SshdInfo ( ) ; }
Source:
private static int action ( com.google.gerrit.common.data.PermissionRule a ) { switch ( a.getAction ( ) ) { case DENY : return 0 ; default : return 1 + ( a.getAction ( ) . ordinal ( ) ) ; } }

Target:
private static int action ( com.google.gerrit.common.data.PermissionRule a ) { switch ( a.getAction ( ) ) { case DENY : return 0 ; case ALLOW : case BATCH : case BLOCK : case INTERACTIVE : default : return 1 + ( a.getAction ( ) . ordinal ( ) ) ; } }
Source:
public java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = new java.util.ArrayList < > ( 4 ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getPatchSetUrl ( project , commit ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.gerrit.extensions.common.WebLinkInfo apply ( com.google.gerrit.extensions.webui.WebLink webLink ) { return ( ( com.google.gerrit.extensions.webui.PatchSetWebLink ) ( webLink ) ) . getPathSetWebLink ( project , commit ) ; }
Source:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.PatchLineComment > i , int row , final int col ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.PatchLineComment c = i.next ( ) ; insertRow ( row ) ; bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) ) ; row ++ ; } return row ; }

Target:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.PatchLineComment > i , int row , final int col , boolean expandComment ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.PatchLineComment c = i.next ( ) ; insertRow ( row ) ; bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) , expandComment ) ; row ++ ; } return row ; }
Source:
public void topoSortNoChange ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; e2.addDep ( e1 ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = events ( e2 , e1 , e3 ) ; new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; com.google.common.truth.Truth.assertThat ( events ) . containsExactly ( e1 , e2 , e3 ) . inOrder ( ) ; }

Target:
public void lastEventDependsOnFirstEvent ( ) { java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < 20 ; i ++ ) { events.add ( new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) ; } events.get ( ( ( events.size ( ) ) - 1 ) ) . addDep ( events.get ( 0 ) ) ; com.google.gerrit.server.notedb.rebuild.EventSorterTest.assertSorted ( events , events ) ; }
Source:
private void approve ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , com.google.gerrit.acceptance.rest.change.ReviewInput.approve ( ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
private void approve ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = ( cd != null ) ? cd.reviewers ( ) . values ( ) : approvalsUtil.getReviewers ( db , getChange ( ) . getId ( ) ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }

Target:
private com.google.gerrit.server.query.change.ChangeData changeData ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) { return cd != null ? cd : changeDataFactory.create ( db , this ) ; }
Source:
private boolean isValidRegex ( java.lang.String refPattern ) { try { java.util.regex.Pattern.compile ( refPattern.replace ( "${username}/" , "" ) ) ; } catch ( java.util.regex.PatternSyntaxException e ) { error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.git.ProjectConfig.PROJECT_CONFIG , ( "Invalid ref name: " + ( e.getMessage ( ) ) ) ) ) ; return false ; } return true ; }

Target:
private boolean isValidRegex ( java.lang.String refPattern ) { try { com.google.gerrit.server.project.RefPattern.validateRegExp ( refPattern ) ; } catch ( com.google.gerrit.common.errors.InvalidNameException e ) { error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.git.ProjectConfig.PROJECT_CONFIG , ( "Invalid ref name: " + ( e.getMessage ( ) ) ) ) ) ; return false ; } return true ; }
Source:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }

Target:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForCommit ( repo , commit ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }
Source:
void onChangeRevision ( com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = revisionList.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = revisionList.getValue ( idx ) ; revisionList.setEnabled ( false ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( changeId , n ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , n ) ) ; } }

Target:
void onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { onReply ( ) ; }
Source:
private org.apache.lucene.search.Query booleanQuery ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p , org.apache.lucene.search.BooleanClause.Occur o ) throws com.google.gerrit.server.query.QueryParseException { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( toQuery ( p.getChild ( i ) ) , o ) ; } return q ; }

Target:
public java.lang.Void apply ( java.util.List < V > input ) { return null ; }
Source:
public void upsert ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { java.util.Collection < T > inserts = attemptUpdate ( instances ) ; if ( inserts != null ) { insert ( inserts ) ; } }

Target:
public void upsert ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { java.util.Collection < T > inserts = attemptUpdate ( instances ) ; if ( inserts != null ) { insert ( inserts ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { throwOrDefer ( e ) ; } }
Source:
private org.eclipse.jgit.api.Git createProject ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; try { com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , project.get ( ) , null , true ) ; return com.google.gerrit.acceptance.git.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; } finally { sshSession.close ( ) ; } }

Target:
private org.eclipse.jgit.api.Git createProject ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; try { com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) , null , true ) ; return com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; } finally { sshSession.close ( ) ; } }
Source:
private void parseReviewer ( com.google.gerrit.server.notedb.ReviewerStateInternal state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw invalidFooter ( state.getFooterKey ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = noteUtil.parseIdent ( ident , id ) ; if ( ! ( reviewers.containsKey ( accountId ) ) ) { reviewers.put ( accountId , state ) ; } }

Target:
private void parseReviewer ( java.sql.Timestamp ts , com.google.gerrit.server.notedb.ReviewerStateInternal state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw invalidFooter ( state.getFooterKey ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = noteUtil.parseIdent ( ident , id ) ; if ( ! ( reviewers.containsRow ( accountId ) ) ) { reviewers.put ( accountId , state , ts ) ; } }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { checkNotDefined ( name ) ; descriptions.put ( name , desc.getAnnotations ( ) ) ; return new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CallbackMetricImpl < V > ( name , valueClass ) ; }

Target:
public synchronized < F1 , F2 > com.google.gerrit.metrics.Counter2 < F1 , F2 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 , com.google.gerrit.metrics.Field < F2 > field2 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkCounterDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.CounterImplN m = new com.google.gerrit.metrics.dropwizard.CounterImplN ( this , name , desc , field1 , field2 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.counter2 ( ) ; }
Source:
private void initUI ( ) { final com.google.gwt.user.client.ui.FlowPanel sbsPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; sbsPanel.setStyleName ( "gerrit-SideBySideScreen-SideBySideTable" ) ; sbsTable = new com.google.gerrit.client.patches.SideBySideTable ( ) ; sbsPanel.add ( sbsTable ) ; add ( sbsPanel ) ; }

Target:
private void initUI ( ) { historyTable = new com.google.gerrit.client.patches.PatchSideBySideScreen.HistoryTable ( ) ; historyPanel = new com.google.gwt.user.client.ui.DisclosurePanel ( PatchUtil.C.patchHistoryTitle ( ) ) ; historyPanel.setContent ( historyTable ) ; historyPanel.setVisible ( false ) ; add ( historyPanel ) ; sbsPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; sbsPanel.setStyleName ( "gerrit-SideBySideScreen-SideBySideTable" ) ; sbsTable = new com.google.gerrit.client.patches.SideBySideTable ( ) ; sbsPanel.add ( sbsTable ) ; add ( sbsPanel ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; factory ( CommitApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; factory ( CommitApiImpl.Factory.class ) ; factory ( DashboardApiImpl.Factory.class ) ; }
Source:
public int hashCode ( ) { int h = 0 ; if ( ( oldId ) != null ) { h = ( h * 31 ) + ( oldId.hashCode ( ) ) ; } h = ( h * 31 ) + ( newId.hashCode ( ) ) ; h = ( h * 31 ) + ( whitespace.name ( ) . hashCode ( ) ) ; return h ; }

Target:
public int hashCode ( ) { refreshObjectIds ( ) ; int h = 0 ; if ( ( oldId ) != null ) { h = ( h * 31 ) + ( oldId.hashCode ( ) ) ; } h = ( h * 31 ) + ( newId.hashCode ( ) ) ; h = ( h * 31 ) + ( getWhitespace ( ) . name ( ) . hashCode ( ) ) ; return h ; }
Source:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.inject.Provider < ? extends com.google.gerrit.server.ssh.AbstractCommand > f = commands.get ( cmd ) ; if ( f != null ) { return f.get ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }

Target:
public void setExitCallback ( final com.google.gerrit.server.ssh.ExitCallback callback ) { this . exit = callback ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.common.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.client.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.client.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }