auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.client.Project.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.common.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }
Source:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void rebaseChangeBaseRecursion ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; com.google.gerrit.extensions.api.changes.RebaseInput ri = new com.google.gerrit.extensions.api.changes.RebaseInput ( ) ; ri.base = r2.getCommit ( ) . name ( ) ; gApi.changes ( ) . id ( r1.getChangeId ( ) ) . revision ( r1.getCommit ( ) . name ( ) ) . rebase ( ri ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { doCreateGroup ( ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.groupListTitle ( ) ) ; createGroupLinkPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; createGroupLinkPanel.setStyleName ( Gerrit.RESOURCES.css ( ) . createGroupLink ( ) ) ; createGroupLinkPanel.add ( new com.google.gerrit.client.ui.Hyperlink ( Util.C.headingCreateGroup ( ) , com.google.gerrit.common.PageLinks.ADMIN_CREATE_GROUP ) ) ; add ( createGroupLinkPanel ) ; groups = new com.google.gerrit.client.admin.GroupTable ( true , com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) ; add ( groups ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
public void onUnload ( ) { super . onUnload ( ) ; if ( ( messageClick ) != null ) { messageClick.removeHandler ( ) ; messageClick = null ; } }

Target:
void setEdit ( boolean edit ) { if ( edit ) { removeStyleName ( draftStyle.view ( ) ) ; addStyleName ( draftStyle.edit ( ) ) ; editArea.setText ( contentPanelMessage.getText ( ) ) ; editArea.setFocus ( true ) ; } else { removeStyleName ( draftStyle.edit ( ) ) ; addStyleName ( draftStyle.view ( ) ) ; } resizePaddingWidget ( ) ; }
Source:
public void onSignOut ( ) { int nRows = table.getRowCount ( ) ; for ( int row = 0 ; row < nRows ; ) { final int nCells = table.getCellCount ( row ) ; int inc = 1 ; for ( int cell = 0 ; cell < nCells ; cell ++ ) { if ( ( table.getWidget ( row , cell ) ) instanceof com.google.gerrit.client.patches.CommentEditorPanel ) { table.removeRow ( row ) ; nRows -- ; inc = 0 ; break ; } } row += inc ; } }

Target:
public void onSignOut ( ) { for ( int row = 0 ; row < ( table.getRowCount ( ) ) ; ) { final int nCells = table.getCellCount ( row ) ; int inc = 1 ; for ( int cell = 0 ; cell < nCells ; cell ++ ) { if ( ( table.getWidget ( row , cell ) ) instanceof com.google.gerrit.client.patches.CommentEditorPanel ) { com.google.gerrit.client.patches.AbstractPatchContentTable.destroyEditor ( table , row , cell ) ; inc = 0 ; } } row += inc ; } }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public java.lang.String getProperty ( java.lang.String key ) { return defaultReader.getProperty ( key ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Branch: master\n" ) + "Patch-Set: 1" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }
Source:
public java.lang.Integer apply ( com.google.gerrit.reviewdb.client.PatchSet in ) { return in.getId ( ) . get ( ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet ps ) { try { com.google.gerrit.reviewdb.client.Change c = db.get ( ) . changes ( ) . get ( ps.getId ( ) . getParentKey ( ) ) ; return ( c != null ) && ( c.getDest ( ) . equals ( change.getDest ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { warn ( e ) ; return true ; } }
Source:
private com.google.gerrit.server.group.InternalGroup rebuild ( com.google.gerrit.server.group.InternalGroup group ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { rebuilder.rebuild ( repo , com.google.gerrit.server.group.db.GroupBundle.fromReviewDb ( db , group.getId ( ) ) , null ) ; com.google.gerrit.server.group.db.GroupConfig groupConfig = com.google.gerrit.server.group.db.GroupConfig.loadForGroup ( repo , group.getGroupUUID ( ) ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > result = groupConfig.getLoadedGroup ( ) ; com.google.common.truth.Truth.assertThat ( result ) . isPresent ( ) ; return result.get ( ) ; } }

Target:
private com.google.gerrit.server.group.db.GroupBundle rebuild ( com.google.gerrit.server.group.db.GroupBundle reviewDbBundle ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { rebuilder.rebuild ( repo , reviewDbBundle , null ) ; return bundleFactory.fromNoteDb ( repo , reviewDbBundle.uuid ( ) ) ; } }
Source:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( argNo ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( type ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.lang.SyntaxException.SYNTAX_ERROR , args ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( argNo ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( type ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.exceptions.SyntaxException.SYNTAX_ERROR , args ) ; }
Source:
private synchronized void runHook ( java.nio.file.Path hook , java.util.List < java.lang.String > args ) { if ( java.nio.file.Files.exists ( hook ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( null , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.common.base.Optional < java.nio.file.Path > hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.isPresent ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook.get ( ) , args ) ) ; } }
Source:
private com.google.gitiles.GitilesView.Builder copyWithPath ( ) { com.google.gitiles.GitilesView.Builder copy ; switch ( type ) { case DIFF : copy = com.google.gitiles.GitilesView.diff ( ) ; break ; case LOG : copy = com.google.gitiles.GitilesView.log ( ) ; break ; default : copy = com.google.gitiles.GitilesView.path ( ) ; break ; } return copy.copyFrom ( this ) ; }

Target:
private com.google.gitiles.GitilesView.Builder copyWithPath ( boolean isLeaf ) { com.google.gitiles.GitilesView.Builder copy ; switch ( type ) { case DIFF : copy = com.google.gitiles.GitilesView.diff ( ) ; break ; case LOG : copy = com.google.gitiles.GitilesView.log ( ) ; break ; case BLAME : copy = ( isLeaf ) ? com.google.gitiles.GitilesView.blame ( ) : com.google.gitiles.GitilesView.path ( ) ; break ; default : copy = com.google.gitiles.GitilesView.path ( ) ; break ; } return copy.copyFrom ( this ) ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; } }
Source:
private void assertConsistency ( java.lang.String msg , com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.Status want ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = check ( ) ; for ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo i : problems ) { if ( ! ( i.status.equals ( want ) ) ) { continue ; } if ( i.message.contains ( msg ) ) { return ; } } fail ( java.lang.String.format ( "could not find substring '%s' in %s" , msg , problems ) ) ; }

Target:
private void assertConsistency ( java.lang.String msg , com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.Status want ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = check ( ) ; for ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo i : problems ) { if ( ! ( i.status.equals ( want ) ) ) { continue ; } if ( i.message.contains ( msg ) ) { return ; } } fail ( java.lang.String.format ( "could not find %s substring '%s' in %s" , want , msg , problems ) ) ; }
Source:
public com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars ( ) throws com.google.gwtorm.server.OrmException { if ( ( stars ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.common.collect.ImmutableMultimap.of ( ) ; } stars = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId ) ; } return stars ; }

Target:
public com.google.common.collect.ImmutableMap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.StarredChangesUtil.StarRef > starRefs ( ) throws com.google.gwtorm.server.OrmException { if ( ( starRefs ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.common.collect.ImmutableMap.of ( ) ; } starRefs = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId ) ; } return starRefs ; }
Source:
private void initForwardingFilter ( ) { setForwardingFilter ( new org.apache.sshd.server.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canConnect ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canListen ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } } ) ; }

Target:
private void initForwarding ( ) { setTcpipForwardingFilter ( new org.apache.sshd.common.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canListen ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canConnect ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } } ) ; setTcpipForwarderFactory ( new org.apache.sshd.common.forward.DefaultTcpipForwarderFactory ( ) ) ; }
Source:
public void close ( ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > closeFutures = com.google.common.collect.Lists.newArrayListWithCapacity ( 2 ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { openIndex.close ( ) ; } } ) ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { closedIndex.close ( ) ; } } ) ) ; com.google.common.util.concurrent.Futures.getUnchecked ( com.google.common.util.concurrent.Futures.allAsList ( closeFutures ) ) ; }

Target:
public void stop ( ) { com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination ( executor , java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; }
Source:
com.google.gerrit.client.admin.ProjectBranchesScreen.Query run ( ) { com.google.gerrit.client.projects.ProjectApi.getBranches ( getProjectKey ( ) , ( ( pageSize ) + 1 ) , qStart , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.projects.BranchInfo > > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.projects.BranchInfo > result ) { if ( ! ( isAttached ( ) ) ) { } else if ( ( query ) == ( com.google.gerrit.client.admin.ProjectBranchesScreen.Query.this ) ) { query = null ; showList ( result ) ; } else { query.run ( ) ; } } } ) ; return this ; }

Target:
com.google.gerrit.client.admin.ProjectBranchesScreen.Query run ( ) { com.google.gerrit.client.projects.ProjectApi.getBranches ( getProjectKey ( ) , ( ( pageSize ) + 1 ) , qStart , qMatch , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.projects.BranchInfo > > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.projects.BranchInfo > result ) { if ( ! ( isAttached ( ) ) ) { } else if ( ( query ) == ( com.google.gerrit.client.admin.ProjectBranchesScreen.Query.this ) ) { query = null ; showList ( result ) ; } else { query.run ( ) ; } } } ) ; return this ; }
Source:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void storeLocalOffline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; org.mockito.Mockito.verify ( localEventsDb ) . storeEvent ( mockEvent ) ; }
Source:
public java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > getOrdedProjects ( ) throws com.google.gerrit.server.git.SubmoduleException { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project.NameKey > projectGraph = getProjectSubscriptionGraph ( ) ; return com.google.gerrit.server.git.SubmoduleOp.topoSort ( projectGraph ) ; }

Target:
private static < T > void reverse ( java.util.LinkedHashSet < T > set ) { if ( set == null ) { return ; } java.util.Deque < T > q = new java.util.ArrayDeque < > ( set ) ; set.clear ( ) ; while ( ! ( q.isEmpty ( ) ) ) { set.add ( q.removeLast ( ) ) ; } }
Source:
private void initDisplayControls ( ) { final com.google.gwt.user.client.ui.Grid displayControls = new com.google.gwt.user.client.ui.Grid ( 0 , 5 ) ; displayControls.setStyleName ( "gerrit-PatchScreen-DisplayControls" ) ; add ( displayControls ) ; createIgnoreWhitespace ( displayControls , 0 , 0 ) ; createContext ( displayControls , 0 , 2 ) ; }

Target:
private void initDisplayControls ( ) { final com.google.gwt.user.client.ui.Grid displayControls = new com.google.gwt.user.client.ui.Grid ( 0 , 5 ) ; displayControls.setStyleName ( Gerrit.RESOURCES.css ( ) . patchScreenDisplayControls ( ) ) ; add ( displayControls ) ; createIgnoreWhitespace ( displayControls , 0 , 0 ) ; createContext ( displayControls , 0 , 2 ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.setChangeId ( c.getKey ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
protected java.util.List < java.lang.String > getValues ( com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( 2 ) ; values.add ( token.expiresAt ) ; return values ; }

Target:
protected java.util.List < java.lang.String > getValues ( com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( 2 ) ; values.add ( com.googlesource.gerrit.plugins.lfs.LfsDateTime.format ( token.issued ) ) ; values.add ( java.lang.String.valueOf ( token.expiresIn ) ) ; return values ; }
Source:
private static void addDiffLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final com.google.gerrit.client.patches.PatchScreen.TopView tv ) { m.addItem ( new com.google.gerrit.client.ui.LinkMenuItem ( text , "" ) { @ java.lang.Override public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } } ) ; }

Target:
public static boolean hasDocSearch ( ) { return com.google.gerrit.client.Gerrit.docSearch ; }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }
Source:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { 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.group.SystemGroupBackend.ANONYMOUS_USERS , "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/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( subname ) == null ) || ( "" . equals ( subname ) ) ) { display ( result ) ; } }

Target:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }
Source:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; tr.branch ( com.google.gerrit.gpg.PublicKeyStore.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }

Target:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; tr.branch ( com.google.gerrit.gpg.PublicKeyStore.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl findOne ( com.google.gerrit.reviewdb.client.Change.Id id , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = find ( id , user ) ; if ( ( ctls.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( id ) ; } return ctls.get ( 0 ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes findOne ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.notedb.ChangeNotes > notes = find ( id ) ; if ( ( notes.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( id ) ; } return notes.get ( 0 ) ; }
Source:
void cleanup ( ) { try { jarFile.close ( ) ; } catch ( java.io.IOException err ) { } if ( ( ! ( tmpFile.delete ( ) ) ) && ( tmpFile.exists ( ) ) ) { PluginLoader.log.warn ( ( "Cannot delete " + ( tmpFile.getAbsolutePath ( ) ) ) ) ; } else { PluginLoader.log.info ( ( "Cleaned plugin " + ( tmpFile.getName ( ) ) ) ) ; } }

Target:
void cleanup ( ) { try { jarFile.close ( ) ; } catch ( java.io.IOException err ) { } if ( ( ! ( tmpFile.delete ( ) ) ) && ( tmpFile.exists ( ) ) ) { PluginLoader.log.warn ( ( ( "Cannot delete " + ( tmpFile.getAbsolutePath ( ) ) ) + ", retrying to delete it on termination of the virtual machine" ) ) ; tmpFile.deleteOnExit ( ) ; } else { PluginLoader.log.info ( ( "Cleaned plugin " + ( tmpFile.getName ( ) ) ) ) ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.getPatchSet ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }
Source:
private org.apache.lucene.search.Query not ( com.google.gerrit.server.query.Predicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.query.Predicate < V > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.server.index.TimestampRangePredicate < V > ) ( n ) ) ) ; } return new org.apache.lucene.search.BooleanQuery.Builder ( ) . add ( new org.apache.lucene.search.MatchAllDocsQuery ( ) , org.apache.lucene.search.BooleanClause.Occur.MUST ) . add ( toQuery ( n ) , org.apache.lucene.search.BooleanClause.Occur.MUST_NOT ) . build ( ) ; }

Target:
private org.apache.lucene.search.Query not ( com.google.gerrit.index.query.Predicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.index.query.Predicate < V > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.index.query.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.index.query.TimestampRangePredicate < V > ) ( n ) ) ) ; } return new org.apache.lucene.search.BooleanQuery.Builder ( ) . add ( new org.apache.lucene.search.MatchAllDocsQuery ( ) , org.apache.lucene.search.BooleanClause.Occur.MUST ) . add ( toQuery ( n ) , org.apache.lucene.search.BooleanClause.Occur.MUST_NOT ) . build ( ) ; }
Source:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventNoBranches ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void create_Empty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createDirectory ( root ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { java.nio.file.Files.delete ( root ) ; } }

Target:
public void create_Empty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createDirectory ( root ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isTrue ( ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } deleteRefFactory.create ( project ) . refs ( input.branches ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } deleteRefFactory.create ( project ) . refs ( input.branches ) . prefix ( org.eclipse.jgit.lib.Constants.R_HEADS ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
private static java.lang.String name ( final com.google.gerrit.client.data.AccountInfo ai ) { if ( ( ai.getFullName ( ) ) != null ) { return ai.getFullName ( ) ; } if ( ( ai.getPreferredEmail ( ) ) != null ) { return ai.getPreferredEmail ( ) ; } return Gerrit.C.anonymousCoward ( ) ; }

Target:
public static com.google.gerrit.client.ui.AccountDashboardLink link ( final com.google.gerrit.client.data.AccountInfoCache cache , final com.google.gerrit.client.reviewdb.Account.Id id ) { final com.google.gerrit.client.data.AccountInfo ai = cache.get ( id ) ; return ai != null ? new com.google.gerrit.client.ui.AccountDashboardLink ( ai ) : null ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.client.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
java.util.List < com.google.gerrit.server.project.SectionMatcher > getAllSections ( ) { if ( isAllProjects ) { return getLocalAccessSections ( ) ; } java.util.List < com.google.gerrit.server.project.SectionMatcher > all = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { all.addAll ( s.getLocalAccessSections ( ) ) ; } return all ; }
Source:
void removeCommentBox ( com.google.gerrit.common.changes.Side side , int line ) { getLineBoxMapFromSide ( side ) . remove ( line ) ; }

Target:
void removeDraft ( com.google.gerrit.common.changes.Side side , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( side ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( lineLastPublishedBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.put ( handle , lineLastPublishedBoxMap.get ( handle ) ) ; } }
Source:
public void testBranchDelegation2 ( ) { grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/heads/x/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.OWNER , fixers , "refs/heads/x/y/*" ) ; doNotInherit ( local , com.google.gerrit.common.data.Permission.OWNER , "refs/heads/x/y/*" ) ; com.google.gerrit.server.project.ProjectControl uDev = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "not owner" , uDev.isOwner ( ) ) ; assertTrue ( "owns ref" , uDev.isOwnerAnyRef ( ) ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/master" , uDev ) ; com.google.gerrit.server.project.ProjectControl uFix = util.user ( local , fixers ) ; assertFalse ( "not owner" , uFix.isOwner ( ) ) ; assertTrue ( "owns ref" , uFix.isOwnerAnyRef ( ) ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/bar" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/x/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/x/y" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/master" , uFix ) ; }

Target:
public void testBranchDelegation1 ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/heads/x/*" ) ; com.google.gerrit.server.project.ProjectControl uDev = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "not owner" , uDev.isOwner ( ) ) ; assertTrue ( "owns ref" , uDev.isOwnerAnyRef ( ) ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/master" , uDev ) ; }
Source:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Comment c : commentsUtil.publishedByChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }

Target:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { return commentsUtil.publishedByChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) . stream ( ) . map ( com.google.gerrit.server.change.PostReview.CommentSetEntry :: create ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.info.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; com.google.gerrit.client.Gerrit.urlAliasMatcher = new com.google.gerrit.client.UrlAliasMatcher ( info.urlAliases ( ) ) ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } }

Target:
public void onSuccess ( com.google.gerrit.client.info.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; com.google.gerrit.client.Gerrit.urlAliasMatcher = new com.google.gerrit.client.UrlAliasMatcher ( info.urlAliases ( ) ) ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } com.google.gerrit.client.Gerrit.docSearch = info.gerrit ( ) . docSearch ( ) ; }
Source:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , com.google.gerrit.client.diff.SideBySide2.Direction.NEXT ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { chunkManager.diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.AgreementInfo > result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.client.account.AgreementInfo info : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { mySigned.add ( info.name ( ) ) ; } postRPC ( ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AgreementInfo > result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.client.info.AgreementInfo info : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { mySigned.add ( info.name ( ) ) ; } postRPC ( ) ; } }
Source:
public final java.lang.String toString ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "(" ) ; for ( int i = 0 ; i < ( getChildCount ( ) ) ; i ++ ) { if ( i != 0 ) { r.append ( " AND " ) ; } r.append ( getChild ( i ) ) ; } r.append ( ")" ) ; return r.toString ( ) ; }

Target:
public final java.lang.String toString ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "(" ) ; for ( int i = 0 ; i < ( getChildCount ( ) ) ; i ++ ) { if ( i != 0 ) { r.append ( " " ) ; } r.append ( getChild ( i ) ) ; } r.append ( ")" ) ; return r.toString ( ) ; }
Source:
public boolean canAbandon ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ; }

Target:
public boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public boolean isEnabled ( ) { return ( ( this . serverToken ) != null ) && ( ! ( this . serverToken.isEmpty ( ) ) ) ; }

Target:
public boolean isEnabled ( ) { return ( ( ( this . serverToken ) != null ) && ( ! ( this . serverToken.isEmpty ( ) ) ) ) && ( ( ( this . serverSenderId ) != null ) && ( ! ( this . serverSenderId.isEmpty ( ) ) ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.account.AccountInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i._account_id ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.account.AccountInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i._accountId ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; callback ( req , rsp , SignInResult.CANCEL ) ; } }

Target:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { if ( ( manager ) == null ) { callback ( req , rsp , SignInResult.CANCEL ) ; return ; } try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; callback ( req , rsp , SignInResult.CANCEL ) ; } }
Source:
public void testParsingYaml ( ) { java.lang.String yamlString = "inherited: true\n" + ( "owners:\n" + "- user-c@example.com" ) ; java.util.Optional < com.vmware.gerrit.owners.common.OwnersConfig > config = getOwnersConfig ( yamlString ) ; org.junit.Assert.assertTrue ( config.isPresent ( ) ) ; org.junit.Assert.assertEquals ( 1 , config.get ( ) . getOwners ( ) . size ( ) ) ; org.junit.Assert.assertTrue ( config.get ( ) . getOwners ( ) . contains ( "user-c@example.com" ) ) ; }

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