auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . statusTypeCell ( ) ) ; if ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }

Target:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . status ( ) ) ; if ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }
Source:
private void assertProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( controlForNotes ( notes ) , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }

Target:
private void assertProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( notes , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
private int colorLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { for ( int i = 0 ; i < cnt ; i ++ ) { cm.addLineClass ( ( line + i ) , LineClassWhere.WRAP , diffTable.style.diff ( ) ) ; } return line + cnt ; }

Target:
private void colorLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { for ( int i = 0 ; i < cnt ; i ++ ) { cm.addLineClass ( ( line + i ) , LineClassWhere.WRAP , diffTable.style.diff ( ) ) ; } }
Source:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
private static org.apache.lucene.search.Query or ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { try { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( com.google.gerrit.lucene.QueryBuilder.toQuery ( schema , p.getChild ( i ) ) , org.apache.lucene.search.BooleanClause.Occur.SHOULD ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }

Target:
private org.apache.lucene.search.Query or ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { try { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( toQuery ( p.getChild ( i ) ) , org.apache.lucene.search.BooleanClause.Occur.SHOULD ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( final com.google.gerrit.reviewdb.Change change ) throws com.google.gerrit.server.project.NoSuchChangeException { try { final com.google.gerrit.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; return projectControl.validateFor ( projectKey ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( final com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.server.project.NoSuchChangeException { try { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; return projectControl.validateFor ( projectKey ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; if ( notesMigration.readChanges ( ) ) { ctx.getNotes ( ) . load ( ) ; } return ctx ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; return ctx ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicItem.bind ( binder ( ) , com.google.gerrit.common.EventDispatcher.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.ForwardedAwareEventBroker.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; }
Source:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
public boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void set ( com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.client.change.ChangeScreen2.Style style , com.google.gwt.user.client.ui.Widget editButton , com.google.gwt.user.client.ui.Widget replyButton , com.google.gerrit.client.change.FileTable.Mode mode , boolean editExists ) { this . base = base ; this . curr = curr ; this . style = style ; this . editButton = editButton ; this . replyButton = replyButton ; this . mode = mode ; this . editExists = editExists ; }

Target:
public void set ( com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.client.change.ChangeScreen2.Style style , com.google.gwt.user.client.ui.Widget replyButton , com.google.gerrit.client.change.FileTable.Mode mode , boolean editExists ) { this . base = base ; this . curr = curr ; this . style = style ; this . replyButton = replyButton ; this . mode = mode ; this . editExists = editExists ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byBranchCommit ( java.lang.String project , java.lang.String branch , java.lang.String hash ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.ProjectPredicate ( project ) , new com.google.gerrit.server.query.change.RefPredicate ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.commit ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hash ) ) ) ; }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byBranchCommit ( java.lang.String project , java.lang.String branch , java.lang.String hash ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.ProjectPredicate ( project ) , new com.google.gerrit.server.query.change.RefPredicate ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.commit ( hash ) ) ) ; }
Source:
private org.eclipse.jgit.transport.URIish toSshUri ( org.eclipse.jgit.transport.URIish uri ) throws java.net.URISyntaxException { java.lang.String uriStr = uri.toString ( ) ; if ( ( ( uri.getHost ( ) ) != null ) && ( uriStr.startsWith ( com.googlesource.gerrit.plugins.replication.GerritSshApi.GERRIT_ADMIN_PROTOCOL_PREFIX ) ) ) { return new org.eclipse.jgit.transport.URIish ( uriStr.substring ( 0 , com.googlesource.gerrit.plugins.replication.GerritSshApi.GERRIT_ADMIN_PROTOCOL_PREFIX.length ( ) ) ) ; } java.lang.String rawPath = uri.getRawPath ( ) ; if ( ! ( rawPath.endsWith ( "/" ) ) ) { rawPath = rawPath + "/" ; } org.eclipse.jgit.transport.URIish sshUri = new org.eclipse.jgit.transport.URIish ( ( "ssh://" + rawPath ) ) ; if ( ( sshUri.getPort ( ) ) < 0 ) { sshUri = sshUri.setPort ( SshAddressesModule.DEFAULT_PORT ) ; } return sshUri ; }

Target:
private org.eclipse.jgit.transport.URIish toSshUri ( org.eclipse.jgit.transport.URIish uri ) throws java.net.URISyntaxException { java.lang.String uriStr = uri.toString ( ) ; if ( ( ( uri.getHost ( ) ) != null ) && ( uriStr.startsWith ( com.googlesource.gerrit.plugins.replication.GerritSshApi.GERRIT_ADMIN_PROTOCOL_PREFIX ) ) ) { return new org.eclipse.jgit.transport.URIish ( uriStr.substring ( com.googlesource.gerrit.plugins.replication.GerritSshApi.GERRIT_ADMIN_PROTOCOL_PREFIX.length ( ) ) ) ; } java.lang.String rawPath = uri.getRawPath ( ) ; if ( ! ( rawPath.endsWith ( "/" ) ) ) { rawPath = rawPath + "/" ; } org.eclipse.jgit.transport.URIish sshUri = new org.eclipse.jgit.transport.URIish ( ( "ssh://" + rawPath ) ) ; if ( ( sshUri.getPort ( ) ) < 0 ) { sshUri = sshUri.setPort ( SshAddressesModule.DEFAULT_PORT ) ; } return sshUri ; }
Source:
public void run ( ) { ui.header ( "User Authentication" ) ; initAuthType ( ) ; if ( ( auth.getSecure ( "registerEmailPrivateKey" ) ) == null ) { auth.setSecure ( "registerEmailPrivateKey" , com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ) ; } if ( ( auth.getSecure ( "restTokenPrivateKey" ) ) == null ) { auth.setSecure ( "restTokenPrivateKey" , com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ) ; } initSignedPush ( ) ; }

Target:
public void run ( ) { ui.header ( "User Authentication" ) ; initAuthType ( ) ; if ( ( auth.getSecure ( "registerEmailPrivateKey" ) ) == null ) { auth.setSecure ( "registerEmailPrivateKey" , com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ) ; } initSignedPush ( ) ; }
Source:
public void commentOnReviewableChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private static com.google.gerrit.client.ui.Screen mine ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } else { com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; } }

Target:
private static com.google.gerrit.client.ui.Screen mine ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; }
Source:
private PushOneCommit.Result push ( java.lang.String content , java.lang.String baseChangeId ) throws java.lang.Exception { java.lang.String subject = "Change subject" ; java.lang.String fileName = "a.txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content , baseChangeId ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push.to ( git , "refs/for/master" ) ; r.assertOkStatus ( ) ; return r ; }

Target:
private PushOneCommit.Result push ( java.lang.String content , java.lang.String baseChangeId ) throws java.lang.Exception { java.lang.String subject = "Change subject" ; java.lang.String fileName = "a.txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content , baseChangeId ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push.to ( "refs/for/master" ) ; r.assertOkStatus ( ) ; return r ; }
Source:
public void testExactMatch ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^foo.c" ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo.c" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo.cc" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "bar.c" ) ) ) ; }

Target:
public void testExactMatch ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^foo.c" ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo.c" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo.cc" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "bar.c" ) ) ) ; }
Source:
public void testCreateProject ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( newProjectName ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProject ( ) throws java.lang.Exception { java.lang.String newProjectName = name ( "newProject" ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( newProjectName ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
private java.lang.String readAbandonMessage ( org.eclipse.jgit.lib.Config cfg , java.lang.String webUrl ) { java.lang.String abandonMessage = cfg.getString ( com.google.gerrit.server.config.ChangeCleanupConfig.SECTION , null , com.google.gerrit.server.config.ChangeCleanupConfig.KEY_ABANDON_MESSAGE ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( abandonMessage ) ) { abandonMessage = com.google.gerrit.server.config.ChangeCleanupConfig.DEFAULT_ABANDON_MESSAGE ; } abandonMessage = abandonMessage.replaceAll ( "\\$\\{URL\\}" , webUrl ) ; return abandonMessage ; }

Target:
private java.lang.String readAbandonMessage ( org.eclipse.jgit.lib.Config cfg , java.lang.String webUrl ) { java.lang.String abandonMessage = cfg.getString ( com.google.gerrit.server.config.ChangeCleanupConfig.SECTION , null , com.google.gerrit.server.config.ChangeCleanupConfig.KEY_ABANDON_MESSAGE ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( abandonMessage ) ) { abandonMessage = com.google.gerrit.server.config.ChangeCleanupConfig.DEFAULT_ABANDON_MESSAGE ; } if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( webUrl ) ) ) { abandonMessage = abandonMessage.replaceAll ( "\\$\\{URL\\}" , webUrl ) ; } return abandonMessage ; }
Source:
private static org.eclipse.jgit.lib.PersonIdent ident ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , org.eclipse.jgit.lib.PersonIdent serverIdent , java.lang.String anonymousCowardName , com.google.gerrit.server.CurrentUser u , java.util.Date when ) { com.google.gerrit.server.notedb.AbstractChangeUpdate.checkUserType ( u ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
private static org.eclipse.jgit.lib.PersonIdent ident ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , org.eclipse.jgit.lib.PersonIdent serverIdent , com.google.gerrit.server.CurrentUser u , java.util.Date when ) { com.google.gerrit.server.notedb.AbstractChangeUpdate.checkUserType ( u ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
public < T extends com.google.gwt.core.client.JavaScriptObject > void send ( final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , url.toString ( ) ) ; req.setHeader ( "Accept" , JsonConstants.JSON_TYPE ) ; req.setCallback ( new com.google.gerrit.client.rpc.RestApi.MyRequestCallback < T > ( true , cb ) ) ; try { RpcStatus.INSTANCE.onRpcStart ( ) ; req.send ( ) ; } catch ( com.google.gwt.http.client.RequestException e ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; cb.onFailure ( e ) ; } }

Target:
public < T extends com.google.gwt.core.client.JavaScriptObject > void send ( final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , url.toString ( ) ) ; req.setHeader ( "Accept" , JsonConstants.JSON_TYPE ) ; req.setCallback ( new com.google.gerrit.client.rpc.RestApi.MyRequestCallback < T > ( cb ) ) ; try { RpcStatus.INSTANCE.onRpcStart ( ) ; req.send ( ) ; } catch ( com.google.gwt.http.client.RequestException e ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; cb.onFailure ( e ) ; } }
Source:
private boolean combineB ( final int i ) { final int s = edits.get ( i ) . getBeginB ( ) ; final int e = edits.get ( ( i - 1 ) ) . getEndB ( ) ; return ( s - e ) <= ( 2 * ( context ) ) ; }

Target:
private boolean combineB ( final int i ) { final int s = edits.get ( i ) . getBeginB ( ) ; final int e = edits.get ( ( i - 1 ) ) . getEndB ( ) ; return ( s - e ) <= ( ( 2 * ( context ) ) + 1 ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.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 ) ) ) ) { projects.display ( result ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.String val = com.google.gerrit.server.query.change.IsWatchedByPredicate.describe ( user ) ; if ( ( val.indexOf ( ' ' ) ) < 0 ) { return ( ( ChangeQueryBuilder.FIELD_WATCHEDBY ) + ":" ) + val ; } else { return ( ( ( ChangeQueryBuilder.FIELD_WATCHEDBY ) + ":\"" ) + val ) + "\"" ; } }

Target:
public java.lang.String toString ( ) { java.lang.String val = com.google.gerrit.server.query.change.IsWatchedByPredicate.describe ( user ) ; if ( ( val.indexOf ( ' ' ) ) < 0 ) { return ( ( ChangeQueryBuilder.FIELD_WATCHEDBY ) + ":" ) + val ; } return ( ( ( ChangeQueryBuilder.FIELD_WATCHEDBY ) + ":\"" ) + val ) + "\"" ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply , ( ( edit ) != null ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply , fileTableMode , ( ( edit ) != null ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) ) ; }
Source:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState firstParent = com.google.common.collect.Iterables.getFirst ( child.parents ( ) , null ) ; return ( firstParent != null ) && ( parent.getNameKey ( ) . equals ( firstParent.getProject ( ) . getNameKey ( ) ) ) ; }

Target:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState firstParent = com.google.common.collect.Iterables.getFirst ( child.parents ( ) , null ) ; return ( firstParent != null ) && ( parent.getNameKey ( ) . equals ( firstParent.getNameKey ( ) ) ) ; }
Source:
public org.apache.sshd.server.Command createCommand ( final java.lang.String requestCommand ) { java.lang.String c = requestCommand ; com.google.gerrit.sshd.SshCreateCommandInterceptor interceptor = createCommandInterceptor.get ( ) ; if ( interceptor != null ) { c = interceptor.intercept ( c ) ; } return new com.google.gerrit.sshd.CommandFactoryProvider.Trampoline ( c ) ; com.google.gerrit.sshd.Consistently use ; }

Target:
public org.apache.sshd.server.Command createCommand ( java.lang.String requestCommand ) { java.lang.String c = requestCommand ; com.google.gerrit.sshd.SshCreateCommandInterceptor interceptor = createCommandInterceptor.get ( ) ; if ( interceptor != null ) { c = interceptor.intercept ( c ) ; } return new com.google.gerrit.sshd.CommandFactoryProvider.Trampoline ( c ) ; }
Source:
public void starChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }

Target:
public void starChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }
Source:
public void taggedCommitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.commit ( ) . create ( ) ; repo.tick ( 1 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , commit ) ; org.junit.Assert.assertEquals ( ( ( start ) + 1 ) , getTime ( commit ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( tag ) ) ; }

Target:
public void taggedCommitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.commit ( ) . create ( ) ; repo.tick ( 1 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , commit ) ; com.google.common.truth.Truth.assertThat ( getTime ( commit ) ) . isEqualTo ( ( ( start ) + 1 ) ) ; com.google.common.truth.Truth.assertThat ( getTime ( tag ) ) . isEqualTo ( ( ( start ) + 2 ) ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setRepositoryPrefix ( java.lang.String prefix ) { switch ( type ) { case HOST_INDEX : this . repositoryPrefix = ( prefix != null ) ? com.google.common.base.Strings.emptyToNull ( com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( prefix ) ) : null ; return this ; case ARCHIVE : case BLAME : case DESCRIBE : case DIFF : case DOC : case LOG : case PATH : case REFS : case REPOSITORY_INDEX : case REVISION : case ROOTED_DOC : case SHOW : default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set repository prefix on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setRepositoryPrefix ( java.lang.String prefix ) { switch ( type ) { case HOST_INDEX : this . repositoryPrefix = ( prefix != null ) ? com.google.common.base.Strings.emptyToNull ( com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( prefix ) ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set repository prefix on %s view" , type ) ) ; } }
Source:
public boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.error ( ( ( ( "[" + ( args.submissionId ) ) + "]" ) + msg ) , t ) ; } else { com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.error ( ( ( ( "[" + ( args.submissionId ) ) + "]" ) + msg ) ) ; } } }

Target:
protected void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.error ( ( ( args.submissionId ) + msg ) , t ) ; } else { com.google.gerrit.server.git.strategy.SubmitStrategyOp.log.error ( ( ( args.submissionId ) + msg ) ) ; } } }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.httpd.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.httpd.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.httpd.rpc.project.ProjectModule ( ) ) ; }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForCommit ( repo , commit ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }

Target:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChangeForCommit ( repo , commit ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }
Source:
public void abandon ( com.google.gerrit.extensions.api.changes.AbandonInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { abandon.get ( ) . apply ( change , in ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot abandon change" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot abandon change" , e ) ; } }

Target:
public void abandon ( com.google.gerrit.extensions.api.changes.AbandonInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { abandon.get ( ) . apply ( change , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot abandon change" , e ) ; } }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval copy ( com.google.gerrit.reviewdb.client.PatchSetApproval src , com.google.gerrit.server.project.ChangeControl ctl ) { com.google.gerrit.reviewdb.client.PatchSetApproval dest = new com.google.gerrit.reviewdb.client.PatchSetApproval ( src.getPatchSetId ( ) , src ) ; dest.cache ( ctl.getChange ( ) ) ; dest.setLabel ( src.getLabel ( ) ) ; return dest ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval copy ( com.google.gerrit.reviewdb.client.PatchSetApproval src , com.google.gerrit.server.project.ChangeControl ctl ) { com.google.gerrit.reviewdb.client.PatchSetApproval dest = new com.google.gerrit.reviewdb.client.PatchSetApproval ( src.getPatchSetId ( ) , src ) ; dest.cache ( ctl.getChange ( ) ) ; return dest ; }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.saveChange ( ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; ctx.saveChange ( ) ; } }
Source:
public void submitToEmptyRepo ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( false ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , getRemoteHead ( ) . getId ( ) ) ; }

Target:
public void submitToEmptyRepo ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( false ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; }
Source:
public void onSuccess ( final com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserInfo serviceUserInfo ) { new com.google.gerrit.plugin.client.rpc.RestApi ( "config" ) . id ( "server" ) . view ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) , "config" ) . get ( new com.google.gwt.user.client.rpc.AsyncCallback < com.googlesource.gerrit.plugins.serviceuser.client.ConfigInfo > ( ) { @ java.lang.Override public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.ConfigInfo configInfo ) { display ( serviceUserInfo , configInfo.getAllowEmail ( ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( val ) ; h.created = com.google.gerrit.common.TimeUtil.nowMs ( ) ; mem.put ( key , h ) ; executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { store.put ( key , h ) ; } } ) ; }

Target:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( val ) ; h.created = com.google.gerrit.common.TimeUtil.nowMs ( ) ; mem.put ( key , h ) ; executor.execute ( ( ) -> store.put ( key , h ) ) ; }
Source:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { com.google.gerrit.server.mail.OutgoingEmail.log.warn ( "Skipping delivery of email with no body" ) ; return false ; } if ( smtpRcptTo.isEmpty ( ) ) { com.google.gerrit.server.mail.OutgoingEmail.log.info ( "Skipping delivery of email with no recipients" ) ; return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { com.google.gerrit.server.mail.OutgoingEmail.log.warn ( "Skipping delivery of email with no body" ) ; return false ; } if ( smtpRcptTo.isEmpty ( ) ) { com.google.gerrit.server.mail.OutgoingEmail.log.warn ( "Skipping delivery of email with no recipients" ) ; return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }
Source:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.util.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.util.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; assertNotNull ( lib.bouncyCastle ) ; assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }

Target:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.util.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.util.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; org.junit.Assert.assertNotNull ( lib.bouncyCastle ) ; org.junit.Assert.assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }
Source:
public void testNoChangeIndexUsesSqlRewrites ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:open project:p ref:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out ; out = rewrite ( in ) ; assertTrue ( ( ( out instanceof com.google.gerrit.server.query.AndPredicate ) || ( out instanceof com.google.gerrit.server.index.IndexedChangeQuery ) ) ) ; indexes.setSearchIndex ( null ) ; out = rewrite ( in ) ; assertTrue ( ( out instanceof com.google.gerrit.server.query.RewritePredicate ) ) ; }

Target:
public void testNoChangeIndexUsesSqlRewrites ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:open project:p ref:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out ; out = rewrite ( in ) ; org.junit.Assert.assertTrue ( ( ( out instanceof com.google.gerrit.server.query.AndPredicate ) || ( out instanceof com.google.gerrit.server.index.IndexedChangeQuery ) ) ) ; indexes.setSearchIndex ( null ) ; out = rewrite ( in ) ; org.junit.Assert.assertTrue ( ( out instanceof com.google.gerrit.server.query.RewritePredicate ) ) ; }
Source:
public synchronized < F1 , F2 > com.google.gerrit.metrics.Counter2 < F1 , F2 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 , com.google.gerrit.metrics.Field < F2 > field2 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkCounterDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.CounterImplN m = new com.google.gerrit.metrics.dropwizard.CounterImplN ( this , name , desc , field1 , field2 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.counter2 ( ) ; }

Target:
public synchronized < F1 , F2 > com.google.gerrit.metrics.Counter2 < F1 , F2 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 , com.google.gerrit.metrics.Field < F2 > field2 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkCounterDescription ( name , desc ) ; com.google.gerrit.metrics.dropwizard.CounterImplN m = new com.google.gerrit.metrics.dropwizard.CounterImplN ( this , name , desc , field1 , field2 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.counter2 ( ) ; }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { if ( token == null ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Must provide an access token" ) ; } com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken = uaaClient.toAccessToken ( token.getToken ( ) ) ; com.googlesource.gerrit.plugins.cfoauth.UserInfo userInfo = accessToken.getUserInfo ( ) ; userInfo.setDisplayName ( uaaClient.getDisplayName ( token.getToken ( ) ) ) ; return com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.getAsOAuthUserInfo ( userInfo ) ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { if ( token == null ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Must provide an access token" ) ; } return getAsOAuthUserInfo ( uaaClient.toAccessToken ( token.getToken ( ) ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply , ( ( edit ) != null ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }
Source:
public static java.lang.String mergeStrategyName ( boolean useContentMerge , boolean useRecursiveMerge ) { if ( useContentMerge ) { if ( useRecursiveMerge ) { return MergeStrategy.RECURSIVE.getName ( ) ; } else { return MergeStrategy.RESOLVE.getName ( ) ; } } else { return MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.getName ( ) ; } }

Target:
public static java.lang.String mergeStrategyName ( boolean useContentMerge , boolean useRecursiveMerge ) { if ( useContentMerge ) { if ( useRecursiveMerge ) { return MergeStrategy.RECURSIVE.getName ( ) ; } return MergeStrategy.RESOLVE.getName ( ) ; } return MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.getName ( ) ; }