auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createStarredChangesRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId , org.eclipse.jgit.lib.BatchRefUpdate bruAllUsers , org.eclipse.jgit.lib.Repository allUsersRepo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.ObjectId emptyTree = com.google.gerrit.server.notedb.ChangeRebuilder.emptyTree ( allUsersRepo ) ; for ( com.google.gerrit.reviewdb.client.StarredChange starred : dbProvider.get ( ) . starredChanges ( ) . byChange ( changeId ) ) { bruAllUsers.addCommand ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , emptyTree , com.google.gerrit.reviewdb.client.RefNames.refsStarredChanges ( starred.getAccountId ( ) , changeId ) ) ) ; } }

Target:
private void createStarredChangesRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.git.ChainedReceiveCommands allUsersCmds , org.eclipse.jgit.lib.Repository allUsersRepo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.ObjectId emptyTree = com.google.gerrit.server.notedb.ChangeRebuilder.emptyTree ( allUsersRepo ) ; for ( com.google.gerrit.reviewdb.client.StarredChange starred : dbProvider.get ( ) . starredChanges ( ) . byChange ( changeId ) ) { allUsersCmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , emptyTree , com.google.gerrit.reviewdb.client.RefNames.refsStarredChanges ( starred.getAccountId ( ) , changeId ) ) ) ; } }
Source:
private void uncacheSshKeys ( final com.google.gerrit.client.reviewdb.Account.Id me , final com.google.gerrit.client.reviewdb.ReviewDb db ) { final net.sf.ehcache.constructs.blocking.SelfPopulatingCache c = server.getSshKeysCache ( ) ; final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( me , db ) ; if ( ( a != null ) && ( ( a.getSshUserName ( ) ) != null ) ) { c.remove ( a.getSshUserName ( ) ) ; } }

Target:
private void uncacheSshKeys ( final java.lang.String userName ) { if ( userName != null ) { server.getSshKeysCache ( ) . remove ( userName ) ; } }
Source:
private void createLock ( java.lang.String project , com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext action ) throws java.io.IOException { com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput input = action.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsPutLocksAction.log.debug ( "Create lock for in project {}" , input.path , project ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLock lock = new com.googlesource.gerrit.plugins.lfs.locks.LfsLock ( "random_id" , input.path , now ( ) , new com.googlesource.gerrit.plugins.lfs.locks.LfsLockOwner ( "Lock Owner <lock_owner@example.com>" ) ) ; action.sendResponse ( lock ) ; }

Target:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsPutLocksAction.log.debug ( "Delete (-f {}) lock for in project {}" , java.lang.Boolean.TRUE.equals ( input.force ) , lockId , project ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLock lock = new com.googlesource.gerrit.plugins.lfs.locks.LfsLock ( lockId , "some/path/to/file" , now ( ) , new com.googlesource.gerrit.plugins.lfs.locks.LfsLockOwner ( "Lock Owner <lock_owner@example.com>" ) ) ; context.sendResponse ( lock ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ( names ) != null ) && ( ! ( names.isEmpty ( ) ) ) ) { try { loader.enablePlugins ( com.google.common.collect.Sets.newHashSet ( names ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { e.printStackTrace ( stderr ) ; throw die ( "plugin failed to enable" ) ; } } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw die ( "remote plugin administration is disabled" ) ; } if ( ( ( names ) != null ) && ( ! ( names.isEmpty ( ) ) ) ) { try { loader.enablePlugins ( com.google.common.collect.Sets.newHashSet ( names ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { e.printStackTrace ( stderr ) ; throw die ( "plugin failed to enable" ) ; } } }
Source:
public void keyRevokedByExpiredKeyBeforeExpirationIsRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyBeforeExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k , "Key is revoked (retired and no longer valid): test9 not used" ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2005-08-01 13:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }

Target:
public void keyRevokedByExpiredKeyBeforeExpirationIsRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey k = add ( com.google.gerrit.gpg.testing.TestKeys.keyRevokedByExpiredKeyBeforeExpiration ( ) ) ; add ( com.google.gerrit.gpg.testing.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k , "Key is revoked (retired and no longer valid): test9 not used" ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2005-08-01 13:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > listBranches ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.BranchInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { listBranches.setLimit ( request.getLimit ( ) ) ; listBranches.setStart ( request.getStart ( ) ) ; listBranches.setMatchSubstring ( request.getSubstring ( ) ) ; listBranches.setMatchRegex ( request.getRegex ( ) ) ; try { return listBranches.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo accessChange ( com.google.gerrit.extensions.api.access.ProjectAccessInput p ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return createAccessChange.apply ( checkExists ( ) , p ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put access right change" , e ) ; } }
Source:
private void configureCacheSection ( ) { ui.header ( "Cache section" ) ; promptAndSetString ( "Cache thread pool size" , com.ericsson.gerrit.plugins.highavailability.CACHE_SECTION , com.ericsson.gerrit.plugins.highavailability.THREAD_POOL_SIZE_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.DEFAULT_THREAD_POOL_SIZE ) ) ; }

Target:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy strategy = ui.readEnum ( PeerInfoStrategy.JGROUPS , "Peer info strategy" ) ; config.setEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; } }
Source:
private boolean isEmpty ( ) { return ( ( ( ( approvals.isEmpty ( ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( changeMessage ) == null ) ; }

Target:
private boolean isEmpty ( ) { return ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( reviewers.isEmpty ( ) ) ) && ( commentsForBase.isEmpty ( ) ) ) && ( commentsForPs.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( changeMessage ) == null ) ; }
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 ) { com.google.gerrit.metrics.CallbackMetric < V > m = root.newCallbackMetric ( ( ( prefix ) + name ) , valueClass , desc ) ; cleanup.add ( m ) ; return m ; }

Target:
public < 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.Counter2 < F1 , F2 > m = root.newCounter ( ( ( prefix ) + name ) , desc , field1 , field2 ) ; cleanup.add ( m ) ; return m ; }
Source:
private java.util.List < com.google.gerrit.server.notedb.ChangeNotes > scanNotedb ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids = com.google.gerrit.server.notedb.ChangeNotes.Factory.scan ( repo ) ; java.util.List < com.google.gerrit.server.notedb.ChangeNotes > changeNotes = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { changeNotes.add ( create ( db , project , id ) ) ; } return changeNotes ; }

Target:
private java.util.List < com.google.gerrit.server.notedb.ChangeNotes > scanNoteDb ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids = com.google.gerrit.server.notedb.ChangeNotes.Factory.scan ( repo ) ; java.util.List < com.google.gerrit.server.notedb.ChangeNotes > changeNotes = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { changeNotes.add ( create ( db , project , id ) ) ; } return changeNotes ; }
Source:
public void testParsingYaml ( ) { java.lang.String yamlString = ( "inherited: true\n" + ( "owners:\n" + "- " ) ) + ( USER_C_EMAIL_COM ) ; java.util.Optional < com.vmware.gerrit.owners.common.OwnersConfig > config = getOwnersConfig ( yamlString ) ; org.junit.Assert.assertTrue ( config.isPresent ( ) ) ; org.junit.Assert.assertEquals ( 1 , config.get ( ) . getOwners ( ) . size ( ) ) ; org.junit.Assert.assertTrue ( config.get ( ) . getOwners ( ) . contains ( com.vmware.gerrit.owners.common.USER_C_EMAIL_COM ) ) ; }

Target:
public void testParsingYaml ( ) { java.lang.String yamlString = ( "inherited: true\n" + ( "owners:\n" + "- " ) ) + ( USER_C_EMAIL_COM ) ; java.util.Optional < com.vmware.gerrit.owners.common.OwnersConfig > config = getOwnersConfig ( yamlString ) ; org.junit.Assert.assertTrue ( config.isPresent ( ) ) ; org.junit.Assert.assertTrue ( config.get ( ) . isInherited ( ) ) ; org.junit.Assert.assertEquals ( 1 , config.get ( ) . getOwners ( ) . size ( ) ) ; org.junit.Assert.assertTrue ( config.get ( ) . getOwners ( ) . contains ( com.vmware.gerrit.owners.common.USER_C_EMAIL_COM ) ) ; }
Source:
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 ) ; }

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 ) ; com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; grant ( normalProject , "refs/*" , Permission.VIEW_PRIVATE_CHANGES , false , privilegedGroup.getGroupUUID ( ) ) ; grant ( normalProject , "refs/*" , Permission.FORGE_SERVER , false , privilegedGroup.getGroupUUID ( ) ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; com.google.gerrit.server.index.group.GroupIndexerImpl.autoReindexIfStale ( uuid ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { groupCache.evict ( uuid ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; com.google.gerrit.server.index.group.GroupIndexerImpl.autoReindexIfStale ( uuid ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.util.List < ? > input ) throws java.lang.Exception { com.google.gerrit.server.git.MultiProgressMonitor.Task t = mpm.beginSubTask ( "update refs" , MultiProgressMonitor.UNKNOWN ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { bru.execute ( walk , t ) ; mpm.end ( ) ; return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } finally { walk.release ( ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.util.List < ? > input ) throws java.lang.Exception { com.google.gerrit.pgm.RebuildNotedb.execute ( bru , repo ) ; com.google.gerrit.pgm.RebuildNotedb.execute ( bruForDrafts , allUsersRepo ) ; mpm.end ( ) ; return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { new com.google.gerrit.server.index.ChangeIndexer.Task ( cd , true ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }

Target:
private java.util.Collection < com.google.gerrit.server.index.ChangeIndex > getWriteIndexes ( ) { return ( indexes ) != null ? indexes.getWriteIndexes ( ) : java.util.Collections.singleton ( index ) ; }
Source:
private void deleteFile ( java.io.File f ) { if ( ( f.exists ( ) ) && ( ! ( f.delete ( ) ) ) ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.warn ( ( ( ( "Cannot delete file " + ( f.getName ( ) ) ) + " from cache " ) + ( dir.getAbsolutePath ( ) ) ) ) ; } }

Target:
private void deleteFile ( java.nio.file.Path path ) { try { java.nio.file.Files.deleteIfExists ( path ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.error ( ( ( ( "Error trying to delete " + path ) + " from " ) + ( dir ) ) , e ) ; } }
Source:
public com.google.common.base.Optional < T > deserialize ( java.lang.String input ) { com.google.common.base.Optional < java.lang.String > decrypted = cipher.decrypt ( input ) ; if ( ! ( decrypted.isPresent ( ) ) ) { return com.google.common.base.Optional.absent ( ) ; } return createToken ( com.google.common.base.Splitter.on ( com.googlesource.gerrit.plugins.lfs.LfsAuthToken.Processor.DELIMETER ) . splitToList ( decrypted.get ( ) ) ) ; }

Target:
public java.util.Optional < T > deserialize ( java.lang.String input ) { java.util.Optional < java.lang.String > decrypted = cipher.decrypt ( input ) ; if ( ! ( decrypted.isPresent ( ) ) ) { return java.util.Optional.empty ( ) ; } return createToken ( com.google.common.base.Splitter.on ( com.googlesource.gerrit.plugins.lfs.LfsAuthToken.Processor.DELIMETER ) . splitToList ( decrypted.get ( ) ) ) ; }
Source:
public void unblockMoreSpecificRefWithExclusiveFlag ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockMoreSpecificRefWithExclusiveFlag ( ) { com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanUpdate ( "refs/heads/master" , u ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { createReplyEditor ( this ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { if ( ( reply ) == ( event.getSource ( ) ) ) { createReplyEditor ( ) ; } else if ( ( replyDone ) == ( event.getSource ( ) ) ) { cannedReply ( PatchUtil.C.cannedReplyDone ( ) ) ; } } else { com.google.gerrit.client.Gerrit.doSignIn ( com.google.gwt.user.client.History.getToken ( ) ) ; } }
Source:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) throws com.google.gwtorm.server.OrmException { changeMessage = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( ctl.getChange ( ) . getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , user.getAccountId ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , patchSet.getId ( ) ) ; changeMessage.setMessage ( message ) ; return this ; }

Target:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) throws com.google.gwtorm.server.OrmException , java.io.IOException { init ( ) ; changeMessage = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( ctl.getChange ( ) . getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , user.getAccountId ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , patchSet.getId ( ) ) ; changeMessage.setMessage ( message ) ; return this ; }
Source:
public void groupNameNoteHasDifferentUUID ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-2\n\tname = g-1\n" ) ; java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , "g-1" , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . containsExactly ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( ( "group with name 'g-1' has UUID 'uuid-1' in 'group.config' but 'uuid-2' in group " + "name notes" ) ) ) ; }

Target:
public void groupNameNoteHasDifferentUUID ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-2\n\tname = g-1\n" ) ; java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "g-1" ) , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . containsExactly ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( ( "group with name 'g-1' has UUID 'uuid-1' in 'group.config' but 'uuid-2' in group " + "name notes" ) ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Restored" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( input.message ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( input.message.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Restored" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( input.message ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( input.message.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_RESTORE ) ; }
Source:
public static void setGroupOptions ( com.google.gerrit.reviewdb.client.AccountGroup.UUID group , boolean isVisibleToAll , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.groups.GroupApi.GroupOptionsInput in = com.google.gerrit.client.groups.GroupApi.GroupOptionsInput.create ( ) ; in.isVisibleToAll ( isVisibleToAll ) ; com.google.gerrit.client.groups.GroupApi.group ( group ) . view ( "options" ) . put ( in , cb ) ; }

Target:
public static void setGroupOptions ( com.google.gerrit.reviewdb.client.AccountGroup.UUID group , boolean isVisibleToAll , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.groups.GroupApi.GroupOptionsInput in = com.google.gerrit.client.groups.GroupApi.GroupOptionsInput.create ( ) ; in.visibleToAll ( isVisibleToAll ) ; com.google.gerrit.client.groups.GroupApi.group ( group ) . view ( "options" ) . put ( in , cb ) ; }
Source:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }
Source:
public void fromString ( final java.lang.String in ) { final java.lang.String [ ] parts = in.split ( "," ) ; int p = 0 ; if ( ( getParentKey ( ) ) != null ) { getParentKey ( ) . fromString ( parts [ ( p ++ ) ] ) ; } for ( final com.google.gwtorm.client.Key < ? > k : members ( ) ) { k.fromString ( parts [ ( p ++ ) ] ) ; } }

Target:
public void fromString ( final java.lang.String in ) { final java.lang.String [ ] parts = in.split ( "," ) ; int p = 0 ; if ( ( getParentKey ( ) ) != null ) { getParentKey ( ) . fromString ( com.google.gwtorm.client.KeyUtil.decode ( parts [ ( p ++ ) ] ) ) ; } for ( final com.google.gwtorm.client.Key < ? > k : members ( ) ) { k.fromString ( com.google.gwtorm.client.KeyUtil.decode ( parts [ ( p ++ ) ] ) ) ; } }
Source:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : return true ; case OPENID_SSO : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.client.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }

Target:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : case OAUTH : return true ; case OPENID_SSO : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.client.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.diff.DiffApi.diff ( revision , path ) . base ( base ) . wholeFile ( ) . ignoreWhitespace ( DiffApi.IgnoreWhitespace.NONE ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.diff.DiffInfo > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.diff.DiffInfo diff ) { display ( diff ) ; } } ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.diff.DiffInfo diff ) { new net.codemirror.lib.ModeInjector ( ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_a ( ) ) ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_b ( ) ) ) . inject ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.lang.Void > ( this ) { @ java.lang.Override protected void preDisplay ( java.lang.Void result ) { display ( diff ) ; } } ) ; }
Source:
private void insertMessage ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( changeMessage ) != null ) { db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; } }

Target:
private void commitMessageNotForChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; if ( ( changeMessage ) != null ) { com.google.gerrit.reviewdb.client.Change otherChange = db.changes ( ) . get ( changeMessage.getPatchSetId ( ) . getParentKey ( ) ) ; com.google.gerrit.server.project.ChangeControl otherControl = refControl.getProjectControl ( ) . controlFor ( otherChange ) ; com.google.gerrit.server.notedb.ChangeUpdate updateForOtherChange = updateFactory.create ( otherControl , change.getLastUpdatedOn ( ) ) ; cmUtil.addChangeMessage ( db , updateForOtherChange , changeMessage ) ; updateForOtherChange.commit ( ) ; } }
Source:
public void testCannotUploadToAnyRef ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , devs , "refs/heads/*" , 1 , 2 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canPushToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testInheritSubmit_OverridesAndDeniesOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) . setDeny ( true ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/foobar" ) . canSubmit ( ) ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/tags/foobar" ) . canSubmit ( ) ) ; assertTrue ( "can submit" , u.controlForRef ( "refs/heads/foobar" ) . canSubmit ( ) ) ; }
Source:
public void run ( ) { for ( int i = 0 ; i < ( ( group.size ( ) ) - 1 ) ; i ++ ) { group.get ( i ) . setValue ( false , false ) ; } group.get ( ( ( group.size ( ) ) - 1 ) ) . setValue ( true , true ) ; }

Target:
public void run ( ) { group.selectMax ( ) ; }
Source:
public void deleteVoteFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; return com.google.gerrit.common.data.LabelType.withDefaultValuesDoNotCheckName ( name ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.ProjectRight k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public com.google.gerrit.server.config.GetServerInfo.ServerInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.net.MalformedURLException { com.google.gerrit.server.config.GetServerInfo.ServerInfo info = new com.google.gerrit.server.config.GetServerInfo.ServerInfo ( ) ; info.auth = new com.google.gerrit.server.config.GetServerInfo.AuthInfo ( authConfig , realm ) ; info.contactStore = getContactStoreInfo ( ) ; info.download = new com.google.gerrit.server.config.GetServerInfo.DownloadInfo ( downloadSchemes , downloadCommands , archiveFormats ) ; info.gerrit = new com.google.gerrit.server.config.GetServerInfo.GerritInfo ( allProjectsName , allUsersName ) ; return info ; }

Target:
public com.google.gerrit.server.config.GetServerInfo.ServerInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.net.MalformedURLException { com.google.gerrit.server.config.GetServerInfo.ServerInfo info = new com.google.gerrit.server.config.GetServerInfo.ServerInfo ( ) ; info.auth = new com.google.gerrit.server.config.GetServerInfo.AuthInfo ( authConfig , realm ) ; info.contactStore = getContactStoreInfo ( ) ; info.download = new com.google.gerrit.server.config.GetServerInfo.DownloadInfo ( downloadSchemes , downloadCommands , archiveFormats ) ; info.gerrit = new com.google.gerrit.server.config.GetServerInfo.GerritInfo ( allProjectsName , allUsersName ) ; info.gitWeb = getGitWebInfo ( gitWebConfig ) ; return info ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { hashtagTextBox.setEnabled ( true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; error.setInnerText ( "" ) ; hashtagTextBox.setText ( "" ) ; if ( ( result != null ) && ( ( result.length ( ) ) > 0 ) ) { updateHashtagList ( result ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { onOpenForm ( ) ; }
Source:
public static void load ( java.util.List < java.lang.String > plugins , final java.lang.String token ) { if ( ( plugins == null ) || ( plugins.isEmpty ( ) ) ) { com.google.gerrit.client.Gerrit.display ( token ) ; } else { com.google.gerrit.client.api.PluginLoader.self = new com.google.gerrit.client.api.PluginLoader ( token ) ; com.google.gerrit.client.api.PluginLoader.self.load ( plugins ) ; com.google.gerrit.client.api.PluginLoader.self.startTimers ( ) ; com.google.gerrit.client.api.PluginLoader.self.center ( ) ; } }

Target:
public static void load ( java.util.List < java.lang.String > plugins , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > callback ) { if ( ( plugins == null ) || ( plugins.isEmpty ( ) ) ) { callback.onSuccess ( com.google.gerrit.client.VoidResult.create ( ) ) ; } else { com.google.gerrit.client.api.PluginLoader.self = new com.google.gerrit.client.api.PluginLoader ( callback ) ; com.google.gerrit.client.api.PluginLoader.self.load ( plugins ) ; com.google.gerrit.client.api.PluginLoader.self.startTimers ( ) ; com.google.gerrit.client.api.PluginLoader.self.center ( ) ; } }
Source:
public void onResponseReceived ( com.google.gwt.http.client.Request req , com.google.gwt.http.client.Response resp ) { if ( ( resp.getStatusCode ( ) ) == ( com.google.gwt.http.client.Response.SC_OK ) ) { cb.onSuccess ( com.google.gerrit.client.documentation.DocInfo.create ( ) ) ; } else { cb.onSuccess ( null ) ; } }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request req , com.google.gwt.http.client.Response resp ) { switch ( resp.getStatusCode ( ) ) { case com.google.gwt.http.client.Response.SC_OK : case com.google.gwt.http.client.Response.SC_MOVED_PERMANENTLY : case com.google.gwt.http.client.Response.SC_MOVED_TEMPORARILY : cb.onSuccess ( com.google.gerrit.client.documentation.DocInfo.create ( ) ) ; break ; default : cb.onSuccess ( null ) ; break ; } }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; }
Source:
private static java.util.Set < java.lang.Class < ? > > loadScriptClasses ( java.io.File srcFile , com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine ) throws com.google.gerrit.server.plugins.InvalidPluginException { try { return scriptEngine.eval ( srcFile ) ; } catch ( java.lang.ClassNotFoundException | java.io.IOException e ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Cannot evaluate script file " + srcFile ) , e ) ; } }

Target:
private static java.util.Set < java.lang.Class < ? > > loadScriptClasses ( java.nio.file.Path srcFile , com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine ) throws com.google.gerrit.server.plugins.InvalidPluginException { try { return scriptEngine.eval ( srcFile ) ; } catch ( java.lang.ClassNotFoundException | java.io.IOException e ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Cannot evaluate script file " + srcFile ) , e ) ; } }
Source:
public synchronized javax.servlet.ServletOutputStream getOutputStream ( ) { com.google.common.base.Preconditions.checkState ( ( ( writer ) == null ) , "getWriter() already called" ) ; if ( ( outputStream ) == null ) { outputStream = new javax.servlet.ServletOutputStream ( ) { @ java.lang.Override public void write ( int b ) throws java.io.IOException { actualBody.write ( b ) ; } } ; } return outputStream ; }

Target:
public synchronized javax.servlet.ServletOutputStream getOutputStream ( ) { com.google.common.base.Preconditions.checkState ( ( ( writer ) == null ) , "getWriter() already called" ) ; if ( ( outputStream ) == null ) { final java.io.PrintWriter osWriter = new java.io.PrintWriter ( actualBody ) ; outputStream = new javax.servlet.ServletOutputStream ( ) { @ java.lang.Override public void write ( int c ) throws java.io.IOException { osWriter.write ( c ) ; osWriter.flush ( ) ; } } ; } return outputStream ; }
Source:
private static org.eclipse.jgit.dircache.DirCacheEditor.PathEdit getPathEdit ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , java.lang.String path , org.eclipse.jgit.lib.ObjectInserter ins , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { final org.eclipse.jgit.lib.ObjectId oid = ( op == ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY ) ) ? ins.insert ( Constants.OBJ_BLOB , content ) : com.google.gerrit.server.edit.ChangeEditModifier.getObjectIdForRestoreOperation ( repo , rw , base , path ) ; return new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( path ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; ent.setObjectId ( oid ) ; } } ; }

Target:
public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { if ( ( ent.getRawMode ( ) ) == 0 ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; } ent.setObjectId ( content ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSet ( psId ) ) ; } return notes.load ( ) . getApprovals ( ) . get ( psId ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSet ( psId ) ) ; } return copier.getForPatchSet ( db , ctl , psId ) ; }
Source:
private boolean isJiraConnectSuccessful ( ) { ui.message ( "Checking Jira connectivity ... " ) ; try { com.googlesource.gerrit.plugins.hooks.jira.JiraClient jiraClient = new com.googlesource.gerrit.plugins.hooks.jira.JiraClient ( jiraUrl ) ; com.googlesource.gerrit.plugins.hooks.jira.JiraSession jiraToken = jiraClient.login ( jiraUsername , jiraPassword ) ; jiraClient.logout ( jiraToken ) ; ui.message ( "[OK]\n" ) ; return true ; } catch ( java.rmi.RemoteException e ) { ui.message ( "*FAILED* (%s)\n" , e.toString ( ) ) ; return false ; } }

Target:
private boolean isJiraConnectSuccessful ( ) { ui.message ( "Checking Jira connectivity ... " ) ; try { new com.googlesource.gerrit.plugins.hooks.jira.JiraClient ( jiraUrl , jiraUsername , jiraPassword ) . sysInfo ( ) . getVersion ( ) ; ui.message ( "[OK]\n" ) ; return true ; } catch ( java.net.URISyntaxException e ) { ui.message ( "*FAILED* (%s)\n" , e.toString ( ) ) ; return false ; } }
Source:
private void assertRefUpdatedEvents ( java.util.HashMap < java.lang.String , org.eclipse.jgit.revwalk.RevCommit > revisions ) throws java.lang.Exception { for ( java.lang.String branch : revisions.keySet ( ) ) { org.eclipse.jgit.revwalk.RevCommit revision = revisions.get ( branch ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch , null , revision , revision , null ) ; } }

Target:
private void assertRefUpdatedEvents ( java.util.HashMap < java.lang.String , org.eclipse.jgit.revwalk.RevCommit > revisions ) throws java.lang.Exception { for ( java.lang.String branch : revisions.keySet ( ) ) { org.eclipse.jgit.revwalk.RevCommit revision = revisions.get ( branch ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , prefixRef ( branch ) , null , revision , revision , null ) ; } }
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.extensions.common.GpgKeysInput in = new com.google.gerrit.extensions.common.GpgKeysInput ( ) ; 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 ) ; } }
Source:
public void run ( ) { ( hasNext ? next : up ) . go ( ) ; }

Target:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return ( ) -> { ( hasPrev ? prev : up ) . go ( ) ; } ; case NEXT : return ( ) -> { ( hasNext ? next : up ) . go ( ) ; } ; default : return ( ) -> { } ; } }