auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Project.NameKey getParentName ( ) { if ( ( project.getParent ( ) ) != null ) { return project.getParent ( ) ; } if ( project.getNameKey ( ) . equals ( allProjectsName ) ) { return null ; } return allProjectsName ; }

Target:
public boolean isAllProjects ( ) { return allProjectsName.equals ( project.getNameKey ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; factory ( LuceneChangeIndex.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; factory ( LuceneChangeIndex.Factory.class ) ; factory ( OnlineReindexer.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > core ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key ) { final boolean disk = false ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }

Target:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > core ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key , final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { final boolean disk = false ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this , type ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }
Source:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.server.index.account.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }
Source:
public java.lang.String formatValue ( ) { if ( ( getValue ( ) ) < 0 ) { return java.lang.Short.toString ( getValue ( ) ) ; } else if ( ( getValue ( ) ) == 0 ) { return " 0" ; } else { return "+" + ( java.lang.Short.toString ( getValue ( ) ) ) ; } }

Target:
public java.lang.String format ( ) { return com.google.gerrit.reviewdb.client.ApprovalCategoryValue.format ( getName ( ) , getValue ( ) ) ; }
Source:
public java.nio.file.FileSystem createFileSystem ( org.apache.sshd.common.Session session ) throws java.io.IOException { return java.nio.file.FileSystems.getDefault ( ) ; }

Target:
public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.FileSystemView getNormalizedView ( ) { return this ; } } ; }
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 null ; } 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 ( 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 ) ; } }
Source:
public void setCfgInjector ( com.google.inject.Injector cfgInjector ) { final com.google.inject.Module cm = copy ( cfgInjector ) ; final com.google.inject.Module sm = copy ( sysInjector ) ; sysModule = new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { install ( copyConfigModule ) ; install ( cm ) ; install ( sm ) ; } } ; }

Target:
public void setDbCfgInjector ( com.google.inject.Injector dbInjector , com.google.inject.Injector cfgInjector ) { final com.google.inject.Module db = copy ( dbInjector ) ; final com.google.inject.Module cm = copy ( cfgInjector ) ; final com.google.inject.Module sm = copy ( sysInjector ) ; sysModule = new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { install ( copyConfigModule ) ; install ( db ) ; install ( cm ) ; install ( sm ) ; } } ; }
Source:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }

Target:
private void dropRemovedDisabledPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( disabled.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( jar.getName ( ) . endsWith ( ".disabled" ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { disabled.remove ( name ) ; } }
Source:
public void listGroupMembersRecursively ( ) throws java.lang.Exception { group ( "gx" , "Administrators" ) ; accounts.create ( "ux" , "gx" ) ; group ( "gy" , "Administrators" ) ; accounts.create ( "uy" , "gy" ) ; PUT ( "/groups/Administrators/groups/gx" ) ; PUT ( "/groups/gx/groups/gy" ) ; assertMembers ( GET ( "/groups/Administrators/members/?recursive" ) , admin.fullName , "ux" , "uy" ) ; }

Target:
public void listNonEmptyGroupMembers ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user1 = createAccount ( "user1" , group ) ; java.lang.String user2 = createAccount ( "user2" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user1 , user2 ) ; }
Source:
public void myGroups ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.reviewdb.AccountGroup > > callback ) { myGroupsFactory.create ( ) . to ( callback ) ; }

Target:
public java.util.List < com.google.gerrit.common.data.GroupDetail > run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { java.util.List < com.google.gerrit.common.data.GroupDetail > groupDetails = new java.util.ArrayList < com.google.gerrit.common.data.GroupDetail > ( ) ; for ( com.google.gerrit.reviewdb.AccountGroup group : myGroupsFactory.create ( ) . call ( ) ) { groupDetails.add ( groupDetailFactory.create ( group.getId ( ) ) . call ( ) ) ; } return groupDetails ; }
Source:
public void testOnAllNodesReplicated ( ) { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent expectedDoneEvent = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( "someProject" , "refs/heads/master" , 5 ) ; dispatcherMock.postEvent ( org.easymock.EasyMock.anyObject ( Branch.NameKey.class ) , com.googlesource.gerrit.plugins.replication.RefReplicationDoneEventEquals.eqEvent ( expectedDoneEvent ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToAllNodes ( "someProject" , "refs/heads/master" , 5 ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }

Target:
public void testOnAllNodesReplicated ( ) throws com.google.gwtorm.server.OrmException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent expectedDoneEvent = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( "someProject" , "refs/heads/master" , 5 ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicationDoneEventEquals.eqEvent ( expectedDoneEvent ) , org.easymock.EasyMock.anyObject ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToAllNodes ( "someProject" , "refs/heads/master" , 5 ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }
Source:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; com.google.gerrit.sshd.SshScope.set ( old ) ; } } } }

Target:
private void onDestroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; sshScope.set ( old ) ; } } } }
Source:
private com.google.gerrit.reviewdb.client.Project.SubmitType getSubmitType ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { try { final com.google.gerrit.common.data.SubmitTypeRecord r = changeControlFactory.controlFor ( change , identifiedUserFactory.create ( change.getOwner ( ) ) ) . getSubmitTypeRecord ( db.get ( ) , cd.currentPatchSet ( db ) , cd ) ; if ( ( r.status ) != ( SubmitTypeRecord.Status.OK ) ) { return null ; } return r.type ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return null ; } }

Target:
private com.google.gerrit.reviewdb.client.Project.SubmitType getSubmitType ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { try { final com.google.gerrit.common.data.SubmitTypeRecord r = args.changeControlGenericFactory.controlFor ( change , args.userFactory.create ( change.getOwner ( ) ) ) . getSubmitTypeRecord ( db.get ( ) , cd.currentPatchSet ( ) , cd ) ; if ( ( r.status ) != ( SubmitTypeRecord.Status.OK ) ) { return null ; } return r.type ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return null ; } }
Source:
private void refreshFileTable ( ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }

Target:
private void refreshFileTable ( ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , com.google.gerrit.client.DiffObject.parse ( changeInfo.legacyId ( ) , n ) ) ; } }
Source:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo b = com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo.create ( ) ; b.setConfiguredValue ( InheritableBoolean.FALSE ) ; setBool ( contentMerge , b ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }

Target:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( com.google.gerrit.extensions.common.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo b = com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo.create ( ) ; b.setConfiguredValue ( InheritableBoolean.FALSE ) ; setBool ( contentMerge , b ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }
Source:
public void onSuccess ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; if ( ( ( result.accounts ) != null ) && ( ( result.members ) != null ) ) { accounts.merge ( result.accounts ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroupMember m : result.members ) { members.insertMember ( m ) ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.admin.GroupDetail result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; if ( ( ( result.accounts ) != null ) && ( ( result.members ) != null ) ) { accounts.merge ( result.accounts ) ; members.display ( result.members ) ; } }
Source:
public void groupNameNoteHasDifferentNameAndUUID ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-2\n\tname = g-2\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" ) ) , com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( "group note of name 'g-1' claims to represent name of 'g-2'" ) ) . inOrder ( ) ; }

Target:
public void groupNameNoteHasDifferentNameAndUUID ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-2\n\tname = g-2\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" ) ) , com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( "group note of name 'g-1' claims to represent name of 'g-2'" ) ) . inOrder ( ) ; }
Source:
public static com.google.gerrit.server.account.AuthRequest forEmail ( final java.lang.String email ) { final com.google.gerrit.reviewdb.client.AccountExternalId.Key i = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_MAILTO , email ) ; final com.google.gerrit.server.account.AuthRequest r = new com.google.gerrit.server.account.AuthRequest ( i.get ( ) ) ; r.setEmailAddress ( email ) ; return r ; }

Target:
public static com.google.gerrit.server.account.AuthRequest forEmail ( java.lang.String email ) { com.google.gerrit.server.account.AuthRequest r = new com.google.gerrit.server.account.AuthRequest ( ExternalId.Key.create ( com.google.gerrit.server.account.ExternalId.SCHEME_MAILTO , email ) ) ; r.setEmailAddress ( email ) ; return r ; }
Source:
private void createBatchUsersGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference , com.google.gerrit.reviewdb.client.AccountGroup.UUID adminsGroupUuid ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Users who perform batch actions on Gerrit" ) . setOwnerGroupUUID ( adminsGroupUuid ) . build ( ) ; createGroup ( db , allUsersRepo , groupCreation , groupUpdate ) ; }

Target:
private void createAdminsGroup ( com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Gerrit Site Administrators" ) . build ( ) ; createGroup ( allUsersRepo , groupCreation , groupUpdate ) ; }
Source:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } git = com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( url + "/" ) + ( project.get ( ) ) ) ) ; }

Target:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.lang.Exception { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( url + "/" ) + ( project.get ( ) ) ) ) ) ; }
Source:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeQueryString ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeQueryString ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.FromTo fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
private void resizeBoxPaddings ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { for ( com.google.gerrit.client.diff.CommentBox box : allBoxes ) { box.resizePaddingWidget ( ) ; } } } ) ; }
Source:
public void includeExistingGroup_OK ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . consume ( ) ; com.google.common.truth.Truth.assertThat ( PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; }

Target:
public void includeRemoveGroup ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; gApi.groups ( ) . id ( p ) . addGroups ( g ) ; assertIncludes ( p , g ) ; gApi.groups ( ) . id ( p ) . removeGroups ( g ) ; assertNoIncludes ( p ) ; }
Source:
void resizePaddingWidget ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { public void execute ( ) { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; } } ) ; }

Target:
void resizePaddingWidget ( ) { selfWidget.changed ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( getCommentInfo ( ) . side ( ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } } } ) ; }
Source:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; com.google.gerrit.server.notedb.DraftCommentNotes.Parser parser = new com.google.gerrit.server.notedb.DraftCommentNotes.Parser ( getChangeId ( ) , walk , rev , repoManager , draftsProject , author ) ; parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; }

Target:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; try ( com.google.gerrit.server.notedb.DraftCommentNotes.Parser parser = new com.google.gerrit.server.notedb.DraftCommentNotes.Parser ( getChangeId ( ) , walk , rev , repoManager , draftsProject , author ) ) { parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; } finally { walk.release ( ) ; } }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }

Target:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( otherCm.side ( ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }
Source:
public void testGetUrl ( ) throws java.lang.Exception { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetUrlIsDroppingTrailingSlash ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( 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 ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) + "/" ) ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ) ) { return false ; } com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask other = ( ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ) ( obj ) ) ; return ( ( changeId ) == ( other.changeId ) ) && ( ( deleted ) == ( other.deleted ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.SyncIndexTask ) ) { return false ; } com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.SyncIndexTask other = ( ( com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.SyncIndexTask ) ( obj ) ) ; return ( ( changeId ) == ( other.changeId ) ) && ( ( deleted ) == ( other.deleted ) ) ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( ( result.length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.conflictingChanges ( result.length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , convertChangeList ( result ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convertChangeList ( result ) ; if ( ( changes.length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.conflictingChanges ( changes.length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , changes ) ; } }
Source:
private com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo getPluginInfo ( ) { com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo info = new com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo ( ) ; info.hasAvatars = com.google.gerrit.server.config.GetServerInfo.toBoolean ( ( ( avatar.get ( ) ) != null ) ) ; info.jsResourcePaths = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { info.jsResourcePaths.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } return info ; }

Target:
private com.google.gerrit.extensions.common.PluginConfigInfo getPluginInfo ( ) { com.google.gerrit.extensions.common.PluginConfigInfo info = new com.google.gerrit.extensions.common.PluginConfigInfo ( ) ; info.hasAvatars = com.google.gerrit.server.config.GetServerInfo.toBoolean ( ( ( avatar.get ( ) ) != null ) ) ; info.jsResourcePaths = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { info.jsResourcePaths.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } return info ; }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS , ( ! ( patchSet.isDraft ( ) ) ) ) ; }
Source:
public void testLimit ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) , 4 ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testLimit ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) , 3 ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-index-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.highavailability.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class , Answers.RETURNS_DEEP_STUBS ) ; org.mockito.Mockito.when ( configMock.index ( ) . threadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-index-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.highavailability.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class , Answers.RETURNS_DEEP_STUBS ) ; org.mockito.Mockito.when ( configMock.index ( ) . threadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }
Source:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ; try { try { getInstance ( com.google.gerrit.server.schema.SchemaCreator.class ) . create ( c ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } finally { c.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ; try { try { schemaCreator.create ( c ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } finally { c.close ( ) ; } } return this ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; case SOLR : return new com.google.gerrit.solr.SolrIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }

Target:
private com.google.inject.Module createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } if ( ( luceneModule ) != null ) { return luceneModule ; } switch ( indexType ) { case LUCENE : return com.google.gerrit.lucene.LuceneIndexModule.latestVersionWithOnlineUpgrade ( ) ; case ELASTICSEARCH : return com.google.gerrit.elasticsearch.ElasticIndexModule.latestVersionWithOnlineUpgrade ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : textBox.addKeyUpHandler ( new com.google.gwt.event.dom.client.KeyUpHandler ( ) { @ java.lang.Override public void onKeyUp ( final com.google.gwt.event.dom.client.KeyUpEvent event ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; } } ) ; break ; } } }
Source:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getCurrentUser ( ) . memberOf ( ownerUUID ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }

Target:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getCurrentUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }
Source:
public void duplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR status:draft) bar:p file:a" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.index.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }

Target:
public void duplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.index.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { addPanel.setVisible ( result.canAddRefs ( ) ) ; } } ) ; query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( ) . start ( start ) . run ( ) ; savedPanel = BRANCH ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { addPanel.setVisible ( result.canAddRefs ( ) ) ; } } ) ; query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( match ) . start ( start ) . run ( ) ; savedPanel = BRANCH ; }
Source:
private boolean canForceUpdate ( ) { if ( ! ( isProjectStatePermittingWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }

Target:
private boolean canForceUpdate ( ) { if ( ! ( isProjectStatePermittingWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) || ( projectControl.isAdmin ( ) ) ; } }
Source:
public static com.google.gerrit.client.account.EditPreferences create ( com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.gerrit.client.account.EditPreferences p = createObject ( ) . cast ( ) ; p.tabSize ( in.tabSize ) ; p.lineLength ( in.lineLength ) ; p.hideTopMenu ( in.hideTopMenu ) ; p.showTabs ( in.showTabs ) ; p.showWhitespaceErrors ( in.showWhitespaceErrors ) ; p.syntaxHighlighting ( in.syntaxHighlighting ) ; p.hideLineNumbers ( in.hideLineNumbers ) ; p.theme ( in.theme ) ; p.keyMapType ( in.keyMapType ) ; return p ; }

Target:
public static com.google.gerrit.client.account.EditPreferences create ( com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.gerrit.client.account.EditPreferences p = createObject ( ) . cast ( ) ; p.tabSize ( in.tabSize ) ; p.lineLength ( in.lineLength ) ; p.cursorBlinkRate ( in.cursorBlinkRate ) ; p.hideTopMenu ( in.hideTopMenu ) ; p.showTabs ( in.showTabs ) ; p.showWhitespaceErrors ( in.showWhitespaceErrors ) ; p.syntaxHighlighting ( in.syntaxHighlighting ) ; p.hideLineNumbers ( in.hideLineNumbers ) ; p.theme ( in.theme ) ; p.keyMapType ( in.keyMapType ) ; return p ; }
Source:
private static java.lang.String description ( com.google.gerrit.sshd.CommandMetaData meta ) { return com.google.common.base.Objects.firstNonNull ( com.google.common.base.Strings.emptyToNull ( meta.description ( ) ) , meta.descr ( ) ) ; }

Target:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , meta.description ( ) ) ) . to ( clazz ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { if ( ( edit ) != null ) { edit.setName ( edit.commit ( ) . commit ( ) ) ; result.revisions ( ) . put ( edit.name ( ) , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } render ( result.revisions ( ) ) ; loaded = true ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo result ) { if ( ( edit ) != null ) { edit.setName ( edit.commit ( ) . commit ( ) ) ; result.revisions ( ) . put ( edit.name ( ) , com.google.gerrit.client.info.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } render ( result.revisions ( ) ) ; loaded = true ; }
Source:
public void simplifyPathUpToNullRootDetectsNullRoot ( ) throws java.lang.Exception { org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "/foo" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( ".././../" , null ) ) ; org.junit.Assert.assertEquals ( "a/b" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b" , null ) ) ; org.junit.Assert.assertEquals ( "a/c" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b/../c" , null ) ) ; }

Target:
public void simplifyPathUpToNullRootDetectsNullRoot ( ) throws java.lang.Exception { org.junit.Assert.assertNull ( com.google.gitiles.PathUtil.simplifyPathUpToRoot ( "/foo" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.PathUtil.simplifyPathUpToRoot ( "../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.PathUtil.simplifyPathUpToRoot ( "../../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.PathUtil.simplifyPathUpToRoot ( ".././../" , null ) ) ; org.junit.Assert.assertEquals ( "a/b" , com.google.gitiles.PathUtil.simplifyPathUpToRoot ( "a/b" , null ) ) ; org.junit.Assert.assertEquals ( "a/c" , com.google.gitiles.PathUtil.simplifyPathUpToRoot ( "a/b/../c" , null ) ) ; }