auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.Collection < com.google.gerrit.reviewdb.RefRight > getWildcardRights ( final com.google.gerrit.reviewdb.ApprovalCategory.Id id ) { if ( ( inheritedRights ) == null ) { inheritedRights = index ( project.getInheritedRights ( ) ) ; } final java.util.Collection < com.google.gerrit.reviewdb.RefRight > l = inheritedRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.reviewdb.RefRight > emptySet ( ) ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > getWildcardRights ( final com.google.gerrit.reviewdb.ApprovalCategory.Id id ) { if ( ( inheritedRights ) == null ) { inheritedRights = index ( project.getInheritedRights ( ) ) ; } final java.util.List < com.google.gerrit.reviewdb.RefRight > l = inheritedRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.reviewdb.RefRight > emptyList ( ) ; }
Source:
boolean isSubmit ( ) { return submit ; }

Target:
void addHashtag ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { if ( ! ( notesMigration.enabled ( ) ) ) { throw clp.reject ( "cannot add hashtags; noteDb is disabled" ) ; } java.lang.String hashtag = com.google.gerrit.server.change.HashtagsUtil.cleanupHashtag ( token ) ; if ( ! ( hashtag.isEmpty ( ) ) ) { hashtags.add ( hashtag ) ; } }
Source:
public void testCreateProjectApi ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( newProjectName ) . create ( ) . get ( ) ; org.junit.Assert.assertEquals ( newProjectName , p.name ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; org.junit.Assert.assertNotNull ( projectState ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectApi ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( newProjectName ) . create ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id psId , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.PatchSetApproval ca = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.server.git.ReceiveCommits.ReplaceResult result , final com.google.gerrit.reviewdb.client.Account.Id forAccount , final com.google.gerrit.reviewdb.client.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }
Source:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , boolean isChangeOwner ) { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else if ( SystemGroupBackend.CHANGE_OWNER.equals ( uuid ) ) { return isChangeOwner ; } else { return user.memberOf ( uuid ) ; } }

Target:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , boolean isChangeOwner ) { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else if ( SystemGroupBackend.CHANGE_OWNER.equals ( uuid ) ) { return isChangeOwner ; } else { return user.getEffectiveGroups ( ) . contains ( uuid ) ; } }
Source:
private org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( ) throws java.io.IOException { try { org.eclipse.jgit.lib.Ref ref = repo.getRef ( GitRepositoryManager.REF_REJECT_COMMITS ) ; if ( ref == null ) { return org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } org.eclipse.jgit.revwalk.RevWalk rw = rp.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit map = rw.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( rw.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + ( GitRepositoryManager.REF_REJECT_COMMITS ) ) , badMap ) ; } }

Target:
private org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( ) throws java.io.IOException { try { org.eclipse.jgit.lib.Ref ref = repo.getRef ( RefNames.REFS_REJECT_COMMITS ) ; if ( ref == null ) { return org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } org.eclipse.jgit.revwalk.RevWalk rw = rp.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit map = rw.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( rw.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + ( com.google.gerrit.reviewdb.client.RefNames.REFS_REJECT_COMMITS ) ) , badMap ) ; } }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( com.google.gerrit.server.change.CherryPick.canCherryPick ( resource ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( ( ( resource.getControl ( ) . getProjectControl ( ) . canUpload ( ) ) && ( resource.isCurrent ( ) ) ) ) ; }
Source:
private com.google.gerrit.server.update.NoteDbBatchUpdate.ChangeContextImpl newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { logDebug ( "Opening change for update" , id ) ; com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; boolean isNew = c != null ; if ( ! isNew ) { c = ChangeNotes.Factory.newNoteDbOnlyChange ( project , id ) ; } else { logDebug ( "Change is new" , id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c , ( ! isNew ) ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.update.NoteDbBatchUpdate.ChangeContextImpl ( ctl ) ; }

Target:
private com.google.gerrit.server.update.FusedNoteDbBatchUpdate.ChangeContextImpl newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { logDebug ( "Opening change for update" , id ) ; com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; boolean isNew = c != null ; if ( ! isNew ) { c = ChangeNotes.Factory.newNoteDbOnlyChange ( project , id ) ; } else { logDebug ( "Change is new" , id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c , ( ! isNew ) ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.update.FusedNoteDbBatchUpdate.ChangeContextImpl ( ctl ) ; }
Source:
public void logEventListenerError ( org.slf4j.Logger log , java.lang.Exception error ) { if ( log.isDebugEnabled ( ) ) { log.debug ( "Error in event listener" , error ) ; } else { log.warn ( ( "Error in event listener: " + ( error.getMessage ( ) ) ) ) ; } }

Target:
public void logEventListenerError ( org.slf4j.Logger log , java.lang.Exception error ) { if ( log.isDebugEnabled ( ) ) { log.debug ( "Error in event listener" , error ) ; } else { log.warn ( "Error in event listener: {}" , error.getMessage ( ) ) ; } }
Source:
public void show ( ) { if ( ( com.google.gerrit.client.SignInDialog.current ) != null ) { com.google.gerrit.client.SignInDialog.current.hide ( ) ; } super . show ( ) ; com.google.gerrit.client.SignInDialog.current = this ; signInCallback.install ( ) ; panel.setFocus ( true ) ; }

Target:
public void show ( ) { if ( ( com.google.gerrit.client.SignInDialog.current ) != null ) { com.google.gerrit.client.SignInDialog.current.hide ( ) ; } super . show ( ) ; com.google.gerrit.client.SignInDialog.current = this ; signInCallback.install ( ) ; if ( ( panel ) instanceof com.google.gerrit.client.openid.OpenIdLoginPanel ) { ( ( com.google.gerrit.client.openid.OpenIdLoginPanel ) ( panel ) ) . setFocus ( true ) ; } }
Source:
private java.lang.String canCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { if ( canUpdate ( ) ) { return null ; } else if ( isMergedIntoBranchOrTag ( repo , commit ) ) { return null ; } return ( "lacks permission " + ( com.google.gerrit.common.data.Permission.PUSH ) ) + " for creating new commit object" ; }

Target:
private java.lang.String canCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , java.lang.String userId ) { if ( canUpdate ( ) ) { return null ; } else if ( isMergedIntoBranchOrTag ( repo , commit ) ) { return null ; } return ( ( userId + " lacks permission " ) + ( com.google.gerrit.common.data.Permission.PUSH ) ) + " for creating new commit object" ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups ( final com.google.gerrit.server.account.AccountState who ) { final java.util.HashSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > r = new java.util.HashSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) ; r.addAll ( membershipCache.get ( com.google.gerrit.server.auth.ldap.LdapRealm.findId ( who.getExternalIds ( ) ) ) ) ; r.addAll ( who.getInternalGroups ( ) ) ; return r ; }

Target:
public com.google.gerrit.server.account.GroupMembership groups ( final com.google.gerrit.server.account.AccountState who ) { return groupMembershipFactory.create ( com.google.common.collect.Iterables.concat ( membershipCache.get ( com.google.gerrit.server.auth.ldap.LdapRealm.findId ( who.getExternalIds ( ) ) ) , who.getInternalGroups ( ) ) ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { ok &= modifyOne ( rsrc ) ; } catch ( java.lang.Exception err ) { ok = false ; com.google.gerrit.sshd.commands.SetReviewersCommand.log.error ( ( "Error updating reviewers on change " + ( rsrc.getId ( ) ) ) , err ) ; writeError ( "fatal" , ( "internal error while updating " + ( rsrc.getId ( ) ) ) ) ; } } if ( ! ok ) { throw com.google.gerrit.sshd.commands.SetReviewersCommand.error ( "fatal: one or more updates failed; review output above" ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { ok &= modifyOne ( rsrc ) ; } catch ( java.lang.Exception err ) { ok = false ; com.google.gerrit.sshd.commands.SetReviewersCommand.log.error ( ( "Error updating reviewers on change " + ( rsrc.getId ( ) ) ) , err ) ; writeError ( "fatal" , ( "internal error while updating " + ( rsrc.getId ( ) ) ) ) ; } } if ( ! ok ) { throw die ( "one or more updates failed; review output above" ) ; } }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; if ( ( result.isEmpty ( ) ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; resizeBoxPaddings ( ) ; }
Source:
public static java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > ids ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.Iterables.transform ( accounts , new com.google.common.base.Function < com.google.gerrit.acceptance.TestAccount , com.google.gerrit.reviewdb.client.Account.Id > ( ) { @ java.lang.Override public Account.Id apply ( com.google.gerrit.acceptance.TestAccount in ) { return in.id ; } } ) ; }

Target:
public static com.google.common.collect.FluentIterable < com.google.gerrit.reviewdb.client.Account.Id > ids ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.acceptance.TestAccount , com.google.gerrit.reviewdb.client.Account.Id > ( ) { @ java.lang.Override public Account.Id apply ( com.google.gerrit.acceptance.TestAccount in ) { return in.id ; } } ) ; }
Source:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ; }

Target:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; }
Source:
public final java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ! ( commandAllowed ) ) { return null ; } if ( ( ( ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.SshScheme ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.HttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousHttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.GitScheme ) ) { java.lang.String url = scheme.getUrl ( project ) ; if ( url != null ) { return getCommand ( url , ref ) ; } else return null ; } else { return null ; } }

Target:
private static boolean isRecognizedScheme ( com.google.gerrit.extensions.config.DownloadScheme scheme ) { return ( ( ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.SshScheme ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.HttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousHttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.GitScheme ) ; }
Source:
public void contextDestroyed ( final javax.servlet.ServletContextEvent event ) { try { final com.google.gerrit.server.GerritServer gs = injector.getInstance ( com.google.inject.Key.get ( com.google.gerrit.server.GerritServer.class ) ) ; gs.closeDataSource ( ) ; } catch ( com.google.inject.ConfigurationException ce ) { } catch ( java.security.ProviderException ce ) { } super . contextDestroyed ( event ) ; }

Target:
public void contextDestroyed ( final javax.servlet.ServletContextEvent event ) { try { final com.google.gerrit.server.GerritServer gs = injector.getInstance ( com.google.inject.Key.get ( com.google.gerrit.server.GerritServer.class ) ) ; gs.closeDataSource ( ) ; } catch ( com.google.inject.ConfigurationException ce ) { } catch ( java.security.ProviderException ce ) { } com.google.gerrit.git.WorkQueue.terminate ( ) ; super . contextDestroyed ( event ) ; }
Source:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; }

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.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.DEFAULT_CLUSTER_NAME ) ; } }
Source:
public org.eclipse.jgit.lib.ObjectId apply ( org.eclipse.jgit.lib.Ref r ) { return r.getObjectId ( ) ; }

Target:
public static java.lang.Iterable < org.eclipse.jgit.lib.ObjectId > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { return com.google.common.collect.FluentIterable.from ( repo.getRefDatabase ( ) . getRefs ( Constants.R_HEADS ) . values ( ) ) . append ( repo.getRefDatabase ( ) . getRefs ( Constants.R_TAGS ) . values ( ) ) . transform ( Ref :: getObjectId ) ; }
Source:
private void readObject ( java.io.ObjectInputStream input ) throws java.io.IOException { java.io.ByteArrayInputStream buf = new java.io.ByteArrayInputStream ( com.google.gerrit.server.ioutil.BasicSerialization.readBytes ( input ) ) ; try ( java.util.zip.InflaterInputStream in = new java.util.zip.InflaterInputStream ( buf ) ) { java.util.List < java.lang.String > l = com.google.common.base.Splitter.on ( '\n' ) . splitToList ( com.google.gerrit.server.ioutil.BasicSerialization.readString ( in ) ) ; paths = l.toArray ( new java.lang.String [ l.size ( ) ] ) ; } }

Target:
private void readObject ( java.io.ObjectInputStream input ) throws java.io.IOException { paths = new java.lang.String [ com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( input ) ] ; try ( java.util.zip.InflaterInputStream in = new java.util.zip.InflaterInputStream ( input ) ) { for ( int i = 0 ; i < ( paths.length ) ; i ++ ) { paths [ i ] = com.google.gerrit.server.ioutil.BasicSerialization.readString ( in ) ; } } }
Source:
public void resetAllRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef = createRef ( "refs/any/test" ) ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . reset ( project ) . build ( ) ) { updateRef ( matchingRef ) ; } assertRef ( matchingRef ) ; }

Target:
public void resetAllRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef = createRef ( "refs/any/test" ) ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . build ( new com.google.gerrit.acceptance.ProjectResetter.Config ( ) . reset ( project ) ) ) { updateRef ( matchingRef ) ; } assertRef ( matchingRef ) ; }
Source:
protected void removeCookie ( final java.lang.String name ) { com.google.gwtjsonrpc.server.JsonServlet.< com.google.gwtjsonrpc.server.ActiveCall > getCurrentCall ( ) . removeCookie ( name ) ; }

Target:
static java.lang.String getTokenText ( final java.lang.String cookieName ) { final java.lang.String v = com.google.gwtjsonrpc.server.ServletCookieAccess.get ( cookieName ) ; if ( v == null ) { return null ; } final int s = v.indexOf ( '$' ) ; return s >= 0 ? v.substring ( ( s + 1 ) ) : null ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.GeneralPreferencesInfo a = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; return loader.loadFromAllUsers ( a , p , git ) ; } }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { return com.google.gerrit.server.config.GetPreferences.readFromGit ( gitMgr , loader , allUsersName , null ) ; }
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.server.util.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 { 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 shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.lang.Exception { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( configMock.main ( ) . sharedDirectory ( ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }

Target:
public void shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.lang.Exception { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( configMock.main ( ) . sharedDirectory ( ) ) . thenReturn ( configuredDirectory.toPath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }
Source:
public com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganizationStructure load ( java.lang.String username ) throws java.lang.Exception { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganizationStructure orgsTeams = new com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganizationStructure ( ) ; com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin = ghLoginProvider.get ( username ) ; if ( ghLogin == null ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.warn ( "Cannot login to GitHub on behalf of '{}'" , username ) ; return orgsTeams ; } try { loadOrganisationsAndTeams ( username , orgsTeams , ghLogin ) ; } catch ( java.io.FileNotFoundException teamsNotFound ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.info ( "Cannot access teams for user '{}': falling back to list of public organisations" , username ) ; loadOrganisations ( username , orgsTeams , ghLogin ) ; } com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.debug ( "GitHub user '{}' belongs to: {}" , username , orgsTeams ) ; return orgsTeams ; }

Target:
public com.googlesource.gerrit.plugins.github.groups.OrganizationStructure load ( java.lang.String username ) throws java.lang.Exception { com.googlesource.gerrit.plugins.github.groups.OrganizationStructure orgsTeams = new com.googlesource.gerrit.plugins.github.groups.OrganizationStructure ( ) ; com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin = ghLoginProvider.get ( username ) ; if ( ghLogin == null ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.warn ( "Cannot login to GitHub on behalf of '{}'" , username ) ; return orgsTeams ; } try { loadOrganisationsAndTeams ( username , orgsTeams , ghLogin ) ; } catch ( java.io.FileNotFoundException teamsNotFound ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.info ( "Cannot access teams for user '{}': falling back to list of public organisations" , username ) ; loadOrganisations ( username , orgsTeams , ghLogin ) ; } com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.debug ( "GitHub user '{}' belongs to: {}" , username , orgsTeams ) ; return orgsTeams ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo > result ) { java.util.List < com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion ( reviewer , req.getQuery ( ) ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > result ) { java.util.List < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( com.google.gerrit.client.info.AccountInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( reviewer , req.getQuery ( ) ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }
Source:
public static boolean onSubmitChange ( com.google.gerrit.client.changes.ChangeInfo change , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev ) { com.google.gwt.core.client.JsArray < com.google.gwt.core.client.JavaScriptObject > h = com.google.gerrit.client.api.ApiGlue.getEventHandlers ( "submitchange" ) ; for ( int i = 0 ; i < ( h.length ( ) ) ; i ++ ) { if ( ! ( com.google.gerrit.client.api.ChangeGlue.invoke ( h.get ( i ) , change , rev ) ) ) { return false ; } } return true ; }

Target:
public static boolean onSubmitChange ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { com.google.gwt.core.client.JsArray < com.google.gwt.core.client.JavaScriptObject > h = com.google.gerrit.client.api.ApiGlue.getEventHandlers ( "submitchange" ) ; for ( int i = 0 ; i < ( h.length ( ) ) ; i ++ ) { if ( ! ( com.google.gerrit.client.api.ChangeGlue.invoke ( h.get ( i ) , change , rev ) ) ) { return false ; } } return true ; }
Source:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( label.getText ( ) ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }

Target:
private void cancel ( ) { label.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( label.getText ( ) ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.ChangeDetail result ) { if ( result != null ) { detailCache.set ( result ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private PushOneCommit.Result createChangeWithTopic ( java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }
Source:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "enabled" ) ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsHookEnabledConfigEntry ( pluginName , pluginCfgFactory ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "enabled" ) ) . toInstance ( new com.googlesource.gerrit.plugins.its.base.its.ItsHookEnabledConfigEntry ( pluginName , pluginCfgFactory ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
public void addChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.ChangeMessage changeMessage ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( changeMessage.getAuthor ( ) , update.getUser ( ) . getAccountId ( ) ) , "cannot store change message of %s in update of %s" , changeMessage.getAuthor ( ) , update.getUser ( ) . getAccountId ( ) ) ; update.setChangeMessage ( changeMessage.getMessage ( ) ) ; db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; }

Target:
public void addChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.ChangeMessage changeMessage ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( changeMessage.getAuthor ( ) , update.getAccountId ( ) ) , "cannot store change message by %s in update by %s" , changeMessage.getAuthor ( ) , update.getAccountId ( ) ) ; update.setChangeMessage ( changeMessage.getMessage ( ) ) ; db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; }
Source:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { impl.doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; rsp.reset ( ) ; rsp.sendError ( 500 ) ; } }

Target:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { rsp.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; rsp.setHeader ( "Pragma" , "no-cache" ) ; rsp.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; impl.doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; rsp.reset ( ) ; rsp.sendError ( 500 ) ; } }
Source:
public void onSuccess ( java.lang.Void result ) { view.getEditor ( ) . operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { java.lang.String t = newTheme.name ( ) . toLowerCase ( ) ; view.getEditor ( ) . setOption ( "theme" , t ) ; } } ) ; }

Target:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; } }
Source:
public static boolean hasCacheHeader ( javax.servlet.http.HttpServletResponse res ) { return ( ( ( res.getHeader ( "Cache-Control" ) ) != null ) || ( ( res.getHeader ( "Expires" ) ) != null ) ) || ( "no-cache" . equals ( res.getHeader ( "Pragma" ) ) ) ; }

Target:
public static boolean hasCacheHeader ( javax.servlet.http.HttpServletResponse res ) { return ( res.containsHeader ( "Cache-Control" ) ) || ( res.containsHeader ( "Expires" ) ) ; }
Source:
public void testUsernamePatternCanUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/users/${username}/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "a-registered-user" ) ; org.junit.Assert.assertTrue ( "can upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; }

Target:
public void testUsernamePatternCanUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/users/${username}/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "a-registered-user" ) ; assertCanUpload ( u ) ; }
Source:
public void listTagsOfNonVisibleBranch ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/hidden" ) ; grant ( Permission.CREATE , project , "refs/tags/*" ) ; grant ( Permission.PUSH , project , "refs/tags/*" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag1 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v1.0" ) ; com.google.gerrit.acceptance.PushOneCommit push1 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push1.setTag ( tag1 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r1 = push1.to ( "refs/for/master%submit" ) ; r1.assertOkStatus ( ) ; pushTo ( "refs/heads/hidden" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag2 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v2.0" ) ; com.google.gerrit.acceptance.PushOneCommit push2 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push2.setTag ( tag2 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = push2.to ( "refs/for/hidden%submit" ) ; r2.assertOkStatus ( ) ; java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > result = getTags ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommit ( ) . getName ( ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag2.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . revision ) . isEqualTo ( r2.getCommit ( ) . getName ( ) ) ; blockRead ( "refs/heads/hidden" ) ; result = getTags ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommit ( ) . getName ( ) ) ; }

Target:
private void createTags ( ) throws java.lang.Exception { grantTagPermissions ( ) ; for ( java.lang.String tagname : com.google.gerrit.acceptance.rest.project.TagsIT.testTags ) { com.google.gerrit.acceptance.PushOneCommit.Tag tag = new com.google.gerrit.acceptance.PushOneCommit.Tag ( tagname ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push.setTag ( tag ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/for/master%submit" ) ; result.assertOkStatus ( ) ; } }
Source:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else { return ( session.isSignedIn ( ) ) && ( session.isTokenValid ( keyIn ) ) ; } }

Target:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else { return ( session.isSignedIn ( ) ) && ( keyIn.equals ( session.getAccessToken ( ) ) ) ; } }
Source:
private static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > commitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits ) { return com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( commits ) ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hashes ) ) ) ) ; }
Source:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . projectNameColumn ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }
Source:
public static java.lang.String format ( final com.google.gerrit.reviewdb.client.Change change ) { return ( ( ( ( change.getProject ( ) . get ( ) ) + "~" ) + ( change.getDest ( ) . getShortName ( ) ) ) + "~" ) + ( change.getKey ( ) . get ( ) ) ; }

Target:
private static java.lang.String format ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , com.google.gerrit.reviewdb.client.Change.Key change ) { return ( ( ( ( branch.getParentKey ( ) . get ( ) ) + "~" ) + ( branch.getShortName ( ) ) ) + "~" ) + ( change.get ( ) ) ; }
Source:
public void deleteChange ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( "Change is not a draft" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }

Target:
public void deleteChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( "Change is not a draft" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }
Source:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { return api.create ( name ) ; } catch ( java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { return api.create ( name ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve project" , e ) ; } }
Source:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind kind ) throws java.lang.Exception { switch ( kind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case NO_CHANGE : case MERGE_FIRST_PARENT_UPDATE : default : org.junit.Assert.fail ( ( "unexpexted change kind: " + kind ) ) ; } }

Target:
private java.lang.String createChange ( com.google.gerrit.extensions.client.ChangeKind kind ) throws java.lang.Exception { switch ( kind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : case com.google.gerrit.extensions.client.ChangeKind.REWORK : case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : case NO_CHANGE : return createChange ( ) . getChangeId ( ) ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : return createChangeForMergeCommit ( ) ; default : throw new java.lang.IllegalStateException ( ( "unexpected change kind: " + kind ) ) ; } }