auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term a2 = arg2.dereference ( ) ; if ( a1.isVariable ( ) ) { throw new com.googlecode.prolog_cafe.lang.PInstantiationException ( this , 1 ) ; } if ( ! ( a2.unify ( createUser ( engine , a1 ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term a2 = arg2.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) { throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; } if ( ! ( a2.unify ( createUser ( engine , a1 ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void deleteVoteFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . to ( 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 ) ; }

Target:
public void deleteVoteFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( 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 ) . noOneElse ( ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeRestored.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeRestored.log , e ) ; } } }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps , dontCopy ) ; }
Source:
private java.util.List < java.util.regex.Pattern > getCommentRegexList ( ) { java.util.ArrayList < java.util.regex.Pattern > regexList = new java.util.ArrayList < java.util.regex.Pattern > ( ) ; java.lang.String match = gerritConfig.getString ( "commentLink" , itsName , "match" ) ; if ( match != null ) { regexList.add ( java.util.regex.Pattern.compile ( match ) ) ; } return regexList ; }

Target:
public java.util.regex.Pattern getPattern ( ) { java.util.regex.Pattern ret = null ; java.lang.String match = gerritConfig.getString ( "commentLink" , itsName , "match" ) ; if ( match != null ) { ret = java.util.regex.Pattern.compile ( match ) ; } return ret ; }
Source:
public void fixIdIsGeneratedForFixSuggestion ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.acceptance.api.revision.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . fixId ( ) . isNotEmpty ( ) ; com.google.gerrit.acceptance.api.revision.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . fixId ( ) . isNotEqualTo ( fixSuggestionInfo.fixId ) ; }

Target:
public void fixIdIsGeneratedForFixSuggestion ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.extensions.common.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . fixId ( ) . isNotEmpty ( ) ; com.google.gerrit.extensions.common.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . fixId ( ) . isNotEqualTo ( fixSuggestionInfo.fixId ) ; }
Source:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
private static void assertKeyMapContains ( com.google.gerrit.server.git.gpg.TestKey expected , java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > actualMap ) { com.google.gerrit.extensions.common.GpgKeyInfo actual = actualMap.get ( expected.getKeyIdString ( ) ) ; com.google.common.truth.Truth.assertThat ( actual ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( actual.id ) . isNull ( ) ; actual.id = expected.getKeyIdString ( ) ; com.google.gerrit.acceptance.api.accounts.AccountIT.assertKeyEquals ( expected , actual ) ; }

Target:
private static void assertKeyMapContains ( com.google.gerrit.gpg.testutil.TestKey expected , java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > actualMap ) { com.google.gerrit.extensions.common.GpgKeyInfo actual = actualMap.get ( expected.getKeyIdString ( ) ) ; com.google.common.truth.Truth.assertThat ( actual ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( actual.id ) . isNull ( ) ; actual.id = expected.getKeyIdString ( ) ; com.google.gerrit.acceptance.api.accounts.AccountIT.assertKeyEquals ( expected , actual ) ; }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } } ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } } ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.common.data.ContributorAgreement cla ) { if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , cla.getName ( ) ) ; runHook ( claSignedHook , args ) ; } }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( ! ( claSignedHook.isPresent ( ) ) ) { return ; } if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }
Source:
private void finishLogin ( final javax.servlet.http.HttpServletResponse rsp , final boolean success ) throws java.io.IOException { final java.lang.StringBuilder body = new java.lang.StringBuilder ( ) ; body.append ( "<html>" ) ; body.append ( "<script><!--\n" ) ; body.append ( ( ( "parent.gerritPostSignIn(" + success ) + ");\n" ) ) ; body.append ( "// -->\n" ) ; body.append ( "</script>" ) ; body.append ( "</html>" ) ; final byte [ ] raw = body.toString ( ) . getBytes ( "UTF-8" ) ; rsp.setContentType ( "text/html; charset=UTF-8" ) ; rsp.setContentLength ( raw.length ) ; final java.io.OutputStream out = rsp.getOutputStream ( ) ; out.write ( raw ) ; out.close ( ) ; }

Target:
public static void forceLogout ( final javax.servlet.http.HttpServletResponse rsp ) { javax.servlet.http.Cookie c ; c = new javax.servlet.http.Cookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE , "" ) ; c.setMaxAge ( 0 ) ; rsp.addCookie ( c ) ; c = new javax.servlet.http.Cookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE , "" ) ; c.setMaxAge ( 0 ) ; rsp.addCookie ( c ) ; }
Source:
private boolean isEmpty ( ) { return ( ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( ( changeMessage ) == null ) ) && ( commentsForBase.isEmpty ( ) ) ) && ( commentsForPs.isEmpty ( ) ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( subject ) == null ) ) && ( ( submitRecords ) == null ) ; }

Target:
private boolean isEmpty ( ) { return ( ( ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( ( changeMessage ) == null ) ) && ( commentsForBase.isEmpty ( ) ) ) && ( commentsForPs.isEmpty ( ) ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( subject ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( hashtags ) == null ) ; }
Source:
private void initSystemConfig ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.SystemConfig s = com.google.gerrit.client.reviewdb.SystemConfig.create ( ) ; s.xsrfPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.accountPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.sshdPort = 29418 ; c.systemConfig ( ) . insert ( java.util.Collections.singleton ( s ) ) ; }

Target:
private void initSystemConfig ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.SystemConfig s = com.google.gerrit.client.reviewdb.SystemConfig.create ( ) ; s.xsrfPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.accountPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.sshdPort = 29418 ; c.systemConfig ( ) . insert ( java.util.Collections.singleton ( s ) ) ; final com.google.gerrit.client.reviewdb.AccountGroup admin = new com.google.gerrit.client.reviewdb.AccountGroup ( com.google.gerrit.client.admin.GroupAdminService.ADMIN_GROUP , new com.google.gerrit.client.reviewdb.AccountGroup.Id ( c.nextAccountGroupId ( ) ) ) ; c.accountGroups ( ) . insert ( java.util.Collections.singleton ( admin ) ) ; }
Source:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jCoMmItTeR" , change1 ) ; assertQuery ( "committer:ExAmPlE" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }

Target:
public void byProject ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }
Source:
public void add ( final com.google.gerrit.client.data.ApprovalType t ) { initApprovalTypes ( ) ; approvalTypes.add ( t ) ; }

Target:
public void add ( final com.google.gerrit.client.data.ApprovalType t ) { if ( 0 <= ( t.getCategory ( ) . getPosition ( ) ) ) { initApprovalTypes ( ) ; approvalTypes.add ( t ) ; } else { initActionTypes ( ) ; actionTypes.add ( t ) ; } }
Source:
public java.lang.Object apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( format ) == ( com.google.gerrit.server.OutputFormat.TEXT ) ) { java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream ( ) ; display ( buf ) ; return com.google.gerrit.extensions.restapi.BinaryResult.create ( buf.toByteArray ( ) ) . setContentType ( "text/plain" ) . setCharacterEncoding ( "UTF-8" ) ; } return apply ( ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( format ) == ( com.google.gerrit.server.OutputFormat.TEXT ) ) { java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream ( ) ; display ( buf ) ; return com.google.gerrit.extensions.restapi.BinaryResult.create ( buf.toByteArray ( ) ) . setContentType ( "text/plain" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; } return apply ( ) ; }
Source:
public void upsertTwoFirstExistsingNoInfo ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 2 ) ; }

Target:
public void upsertTwoFirstExistsingNoInfo ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 2 ) ; }
Source:
public void abandonReviewableChangeNotifyOwnersReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner , sc.starrer ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableChangeNotifyOwnersReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.acceptance.server.mail.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner , sc.starrer ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
public com.google.gerrit.server.rpc.GerritJsonServlet get ( ) { final com.google.gwtjsonrpc.client.RemoteJsonService srv = injector.getInstance ( serviceClass ) ; return injector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gwtjsonrpc.client.RemoteJsonService.class ) . toInstance ( srv ) ; } } ) . getInstance ( com.google.gerrit.server.rpc.GerritJsonServlet.class ) ; }

Target:
public com.google.gerrit.server.http.GerritJsonServlet get ( ) { final com.google.gwtjsonrpc.client.RemoteJsonService srv = injector.getInstance ( serviceClass ) ; return injector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gwtjsonrpc.client.RemoteJsonService.class ) . toInstance ( srv ) ; } } ) . getInstance ( com.google.gerrit.server.http.GerritJsonServlet.class ) ; }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base ; if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } else { base = null ; } changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
public void changeProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { changeProjectAccessFactory.create ( projectName , com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.getBase ( baseRevision ) , sections , msg ) . to ( cb ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.ChangeEditResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return fileContentUtil.getContentType ( rsrc.getChangeEdit ( ) . getChange ( ) . getProject ( ) , rsrc.getChangeEdit ( ) . getRevision ( ) . get ( ) , rsrc.getPath ( ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.ChangeEditResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return fileContentUtil.getContentType ( rsrc.getControl ( ) . getProjectControl ( ) . getProjectState ( ) , rsrc.getChangeEdit ( ) . getEditCommit ( ) , rsrc.getPath ( ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.rpc.Common.setGerritConfig ( result.config ) ; if ( ( result.xsrfToken ) != null ) { com.google.gwtjsonrpc.client.JsonUtil.getDefaultXsrfManager ( ) . setToken ( null , result.xsrfToken ) ; } if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.xsrfToken ) != null ) { com.google.gwtjsonrpc.client.JsonUtil.getDefaultXsrfManager ( ) . setToken ( null , result.xsrfToken ) ; } if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }
Source:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.lang.String value ) { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > eqPath = new com.google.gerrit.server.query.change.EqualsPathPredicate ( ChangeQueryBuilder.FIELD_FILE , value ) ; if ( ! ( args.indexes.getSearchIndex ( ) . getSchema ( ) . getFields ( ) . containsKey ( ChangeField.FILE_PART.getName ( ) ) ) ) { return eqPath ; } return com.google.gerrit.server.query.Predicate.or ( eqPath , new com.google.gerrit.server.query.change.EqualsFilePredicate ( value ) ) ; }

Target:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.lang.String value ) { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > eqPath = new com.google.gerrit.server.query.change.EqualsPathPredicate ( ChangeQueryBuilder.FIELD_FILE , value ) ; if ( ! ( args.getSchema ( ) . hasField ( ChangeField.FILE_PART ) ) ) { return eqPath ; } return com.google.gerrit.server.query.Predicate.or ( eqPath , new com.google.gerrit.server.query.change.EqualsFilePredicate ( value ) ) ; }
Source:
public void setAuthor ( com.google.gerrit.server.IdentifiedUser user ) { getCommitBuilder ( ) . setAuthor ( user.newCommitterIdent ( getCommitBuilder ( ) . getCommitter ( ) . getWhen ( ) , getCommitBuilder ( ) . getCommitter ( ) . getTimeZone ( ) ) ) ; }

Target:
public void setAuthor ( com.google.gerrit.server.IdentifiedUser author ) { this . author = author ; getCommitBuilder ( ) . setAuthor ( author.newCommitterIdent ( getCommitBuilder ( ) . getCommitter ( ) . getWhen ( ) , getCommitBuilder ( ) . getCommitter ( ) . getTimeZone ( ) ) ) ; }
Source:
private void createGroup ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; try { performCreateGroup.createGroup ( groupName , groupDescription , visibleToAll , ownerGroupId , initialMembers , initialGroups ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } }

Target:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; try { performCreateGroupFactory.create ( ) . createGroup ( groupName , groupDescription , visibleToAll , ownerGroupId , initialMembers , initialGroups ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } }
Source:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , int id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; r.append ( '/' ) ; return r ; }

Target:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , int id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( id ) ) ; r.append ( '/' ) ; return r ; }
Source:
private boolean recursiveDelete ( java.io.File file ) { if ( file.isDirectory ( ) ) { java.io.File [ ] contents = file.listFiles ( ) ; if ( contents == null ) { return false ; } for ( java.io.File f : contents ) { if ( ! ( recursiveDelete ( f ) ) ) { return false ; } } } return file.delete ( ) ; }

Target:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.nio.file.Files.delete ( file ) ; return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
public void groupNameNoteIsConsistent ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-1\n\tname = g-1\n" ) ; java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , "g-1" , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . isEmpty ( ) ; }

Target:
public void groupNameNoteIsConsistent ( ) throws java.lang.Exception { updateGroupNamesRef ( "g-1" , "[group]\n\tuuid = uuid-1\n\tname = g-1\n" ) ; java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "g-1" ) , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . isEmpty ( ) ; }
Source:
private void initReplyButton ( ) { reply.setTitle ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyTitle ( ) ) ; reply.setHTML ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openDiv ( ) . append ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyLabel ( ) ) . closeDiv ( ) ) ; if ( changeInfo.revision ( revision ) . is_edit ( ) ) { reply.setVisible ( false ) ; quickApprove.setVisible ( false ) ; } }

Target:
private void initReplyButton ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { if ( ! ( info.revision ( revision ) . is_edit ( ) ) ) { reply.setTitle ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyTitle ( ) ) ; reply.setHTML ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openDiv ( ) . append ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyLabel ( ) ) . closeDiv ( ) ) ; reply.setVisible ( true ) ; } }
Source:
public void display ( final com.google.gerrit.client.reviewdb.Change chg , final com.google.gerrit.client.reviewdb.PatchSetInfo info , final com.google.gerrit.client.data.AccountInfoCache acc ) { infoBlock.display ( chg , acc ) ; description.setHTML ( com.google.gerrit.client.ui.DomUtil.linkify ( com.google.gerrit.client.ui.DomUtil.escape ( info.getMessage ( ) ) ) ) ; descriptionPanel.setOpen ( true ) ; }

Target:
public void display ( final com.google.gerrit.client.reviewdb.Change chg , final com.google.gerrit.client.reviewdb.PatchSetInfo info , final com.google.gerrit.client.data.AccountInfoCache acc ) { infoBlock.display ( chg , acc ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( description , new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( info.getMessage ( ) ) . linkify ( ) ) ; descriptionPanel.setOpen ( true ) ; }
Source:
private com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrentPredicate ( ) { final int max = change.currentPatchSetId ( ) . get ( ) ; return new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet.Id in ) { return ( in.get ( ) ) <= max ; } } ; }

Target:
private com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrentPredicate ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = change.currentPatchSetId ( ) ; if ( current == null ) { return com.google.common.base.Predicates.alwaysFalse ( ) ; } final int max = current.get ( ) ; return new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet.Id in ) { return ( in.get ( ) ) <= max ; } } ; }
Source:
public void addTrackingIds ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.TrackingId > ids ) { if ( ! ( ids.isEmpty ( ) ) ) { a.trackingIds = new java.util.ArrayList < com.google.gerrit.server.events.TrackingIdAttribute > ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.TrackingId t : ids ) { a.trackingIds.add ( asTrackingIdAttribute ( t ) ) ; } } }

Target:
public void addTrackingIds ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.client.TrackingId > ids ) { if ( ! ( ids.isEmpty ( ) ) ) { a.trackingIds = new java.util.ArrayList < com.google.gerrit.server.events.TrackingIdAttribute > ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.TrackingId t : ids ) { a.trackingIds.add ( asTrackingIdAttribute ( t ) ) ; } } }
Source:
public int compare ( java.io.File a , java.io.File b ) { int cmp = com.google.common.primitives.Longs.compare ( b.lastModified ( ) , a.lastModified ( ) ) ; if ( cmp != 0 ) { return cmp ; } return a.getName ( ) . compareTo ( b.getName ( ) ) ; }

Target:
public int compare ( java.io.File a , java.io.File b ) { int cmp = java.lang.Long.compare ( b.lastModified ( ) , a.lastModified ( ) ) ; if ( cmp != 0 ) { return cmp ; } return a.getName ( ) . compareTo ( b.getName ( ) ) ; }
Source:
public java.lang.Object createEntry ( java.lang.Object genericKey ) throws java.lang.Exception { final com.google.gerrit.server.patch.DiffCacheKey key = ( ( com.google.gerrit.server.patch.DiffCacheKey ) ( genericKey ) ) ; final org.spearce.jgit.lib.Repository db = server.openRepository ( key.getProjectKey ( ) . get ( ) ) ; try { return createEntry ( key , db ) ; } finally { db.close ( ) ; } }

Target:
com.google.gerrit.server.patch.DiffCacheContent createEntry ( final com.google.gerrit.server.patch.DiffCacheKey key ) throws java.lang.Exception { final org.spearce.jgit.lib.Repository db = server.openRepository ( key.getProjectKey ( ) . get ( ) ) ; try { return createEntry ( key , db ) ; } finally { db.close ( ) ; } }
Source:
public void evictAll ( ) { byName.removeAll ( ) ; }

Target:
public void onCreateProject ( com.google.gerrit.reviewdb.Project.NameKey newProjectName ) { listLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > n = list.get ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL ) ; n = new java.util.TreeSet < com.google.gerrit.reviewdb.Project.NameKey > ( n ) ; n.add ( newProjectName ) ; list.put ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL , java.util.Collections.unmodifiableSortedSet ( n ) ) ; } finally { listLock.unlock ( ) ; } }
Source:
private void mockUnconnectablePhabricator ( ) { org.easymock.EasyMock.expect ( serverConfig.getString ( "its-phabricator" , null , "url" ) ) . andReturn ( "<no-url>" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-phabricator" , null , "username" ) ) . andReturn ( "none" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-phabricator" , null , "certificate" ) ) . andReturn ( "none" ) . anyTimes ( ) ; }

Target:
private void mockUnconnectablePhabricator ( ) { org.easymock.EasyMock.expect ( serverConfig.getString ( "its-phabricator" , null , "url" ) ) . andReturn ( "<no-url>" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-phabricator" , null , "token" ) ) . andReturn ( "none" ) . anyTimes ( ) ; }
Source:
public java.util.Collection < com.google.gerrit.common.data.GroupReference > suggest ( java.lang.String name ) { java.util.Set < com.google.gerrit.common.data.GroupReference > groups = com.google.common.collect.Sets.newTreeSet ( com.google.gerrit.server.account.GroupBackends.GROUP_REF_NAME_COMPARATOR ) ; for ( com.google.gerrit.server.account.GroupBackend g : backends ) { groups.addAll ( g.suggest ( name ) ) ; } return groups ; }

Target:
public java.util.Collection < com.google.gerrit.common.data.GroupReference > suggest ( java.lang.String name , com.google.gerrit.server.project.ProjectControl project ) { java.util.Set < com.google.gerrit.common.data.GroupReference > groups = com.google.common.collect.Sets.newTreeSet ( com.google.gerrit.server.account.GroupBackends.GROUP_REF_NAME_COMPARATOR ) ; for ( com.google.gerrit.server.account.GroupBackend g : backends ) { groups.addAll ( g.suggest ( name , project ) ) ; } return groups ; }
Source:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritSubmit_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.deny ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotSubmit ( "refs/foobar" , u ) ; assertCannotSubmit ( "refs/tags/foobar" , u ) ; assertCanSubmit ( "refs/heads/foobar" , u ) ; }
Source:
public boolean isDone ( ) { if ( super . isDone ( ) ) { return true ; } else if ( isGenAvailableNowForCurrentSearcher ( ) ) { set ( null ) ; return true ; } return false ; }

Target:
public boolean isDone ( ) { if ( super . isDone ( ) ) { return true ; } else if ( isGenAvailableNowForCurrentSearcher ( ) ) { set ( null ) ; return true ; } else if ( ! ( reopenThread.isAlive ( ) ) ) { setException ( new java.lang.IllegalStateException ( "NRT thread is dead" ) ) ; return true ; } return false ; }
Source:
private java.util.List < java.lang.String > cacheNames ( ) throws com.google.gerrit.extensions.restapi.RestApiException { return ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; }

Target:
private void doList ( ) { for ( java.lang.String name : ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ) { stderr.print ( name ) ; stderr.print ( '\n' ) ; } stderr.flush ( ) ; }
Source:
public java.util.Map < java.lang.String , com.j2bugzilla.rpc.GetLegalValues.Fields > getFields ( ) { java.util.Map < java.lang.String , com.j2bugzilla.rpc.GetLegalValues.Fields > fields = new java.util.HashMap < java.lang.String , com.j2bugzilla.rpc.GetLegalValues.Fields > ( ) ; fields.put ( "status" , Fields.STATUS ) ; fields.put ( "resolution" , Fields.RESOLUTION ) ; return fields ; }

Target:
private void assertLegalValue ( com.j2bugzilla.rpc.GetLegalValues.Fields field , java.lang.String actionValue ) throws com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException , com.j2bugzilla.base.BugzillaException { if ( ! ( getLegalValues ( field ) . contains ( actionValue ) ) ) { throw new com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException ( ( ( ( ( "The value '" + actionValue ) + "' is not an allowed value for bugzilla's " ) + ( field.getInternalName ( ) ) ) + " field" ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.config.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; 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 ; } }
Source:
private < K , V > java.util.Map < K , V > limitToValidPatchSets ( java.util.Map < K , V > in , final com.google.common.base.Function < K , com.google.gerrit.reviewdb.client.PatchSet.Id > func ) { final com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrent = upToCurrentPredicate ( ) ; return com.google.common.collect.Maps.filterKeys ( in , new com.google.common.base.Predicate < K > ( ) { @ java.lang.Override public boolean apply ( K in ) { com.google.gerrit.reviewdb.client.PatchSet.Id psId = func.apply ( in ) ; return ( upToCurrent.apply ( psId ) ) && ( patchSets.containsKey ( psId ) ) ; } } ) ; }

Target:
private < K , V > java.util.Map < K , V > limitToValidPatchSets ( java.util.Map < K , V > in , final com.google.common.base.Function < K , com.google.gerrit.reviewdb.client.PatchSet.Id > func ) { return com.google.common.collect.Maps.filterKeys ( in , com.google.common.base.Predicates.compose ( validPatchSetPredicate ( ) , func ) ) ; }
Source:
private static void initHostname ( ) { com.google.gerrit.client.Gerrit.myHost = Window.Location.getHostName ( ) ; final int d1 = com.google.gerrit.client.Gerrit.myHost.indexOf ( '.' ) ; if ( d1 < 0 ) { return ; } final int d2 = com.google.gerrit.client.Gerrit.myHost.indexOf ( '.' , ( d1 + 1 ) ) ; if ( d2 >= 0 ) { com.google.gerrit.client.Gerrit.myHost = com.google.gerrit.client.Gerrit.myHost.substring ( 0 , d2 ) ; } }

Target:
private static void initHostname ( ) { com.google.gerrit.client.Gerrit.myHost = com.google.gwt.user.client.Window.Location.getHostName ( ) ; final int d1 = com.google.gerrit.client.Gerrit.myHost.indexOf ( '.' ) ; if ( d1 < 0 ) { return ; } final int d2 = com.google.gerrit.client.Gerrit.myHost.indexOf ( '.' , ( d1 + 1 ) ) ; if ( d2 >= 0 ) { com.google.gerrit.client.Gerrit.myHost = com.google.gerrit.client.Gerrit.myHost.substring ( 0 , d2 ) ; } }
Source:
public void onError ( final com.google.gwt.http.client.Request request , final java.lang.Throwable exception ) { com.google.gwtjsonrpc.client.JsonUtil.fireOnCallEnd ( ) ; callback.onFailure ( exception ) ; }

Target:
public void onError ( final com.google.gwt.http.client.Request request , final java.lang.Throwable exception ) { com.google.gwtjsonrpc.client.JsonUtil.fireOnCallEnd ( ) ; if ( ( ( exception.getClass ( ) ) == ( java.lang.RuntimeException.class ) ) && ( exception.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) ) { callback.onFailure ( new com.google.gwtjsonrpc.client.ServerUnavailableException ( ) ) ; } else { callback.onFailure ( exception ) ; } }
Source:
private < T > org.elasticsearch.index.query.BoolQueryBuilder or ( com.google.gerrit.server.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { try { org.elasticsearch.index.query.BoolQueryBuilder q = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; for ( com.google.gerrit.server.query.Predicate < T > c : p.getChildren ( ) ) { q.should ( toQueryBuilder ( c ) ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }

Target:
private < T > org.elasticsearch.index.query.BoolQueryBuilder or ( com.google.gerrit.index.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { try { org.elasticsearch.index.query.BoolQueryBuilder q = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; for ( com.google.gerrit.index.query.Predicate < T > c : p.getChildren ( ) ) { q.should ( toQueryBuilder ( c ) ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }
Source:
public void newPatchSetOnWipChangeToReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + "/plugins/" ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { start ( plugin ) ; } pending = null ; }

Target:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + "/plugins/" ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; if ( filter != null ) { plugins.put ( plugin.getName ( ) , filter ) ; } } pending = null ; }
Source:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( ( getTail ( ) ) <= num ) && ( num <= ( getHead ( ) ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.events.path ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }

Target:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( cachedTail.isLessThanOrEqualTo ( num , com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ) && ( cachedHead.isGreaterThanOrEqualTo ( num , com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.events.path ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }
Source:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( java.util.Collection < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > futures = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { futures.add ( indexAsync ( id ) ) ; } return com.google.gerrit.server.index.ChangeIndexer.allAsList ( futures ) ; }

Target:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id id ) { return ( executor ) != null ? submit ( new com.google.gerrit.server.index.ChangeIndexer.IndexTask ( project , id ) ) : com.google.common.util.concurrent.Futures.< java.lang.Object , java.io.IOException > immediateCheckedFuture ( null ) ; }
Source:
private static boolean isJsonBody ( final com.google.gwtjsonrpc.server.ActiveCall call ) { java.lang.String type = call.httpRequest.getContentType ( ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonUtil.JSON_TYPE.equals ( type ) ; }

Target:
private static boolean isBodyJson ( final com.google.gwtjsonrpc.server.ActiveCall call ) { java.lang.String type = call.httpRequest.getContentType ( ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonUtil.JSON_TYPE.equals ( type ) ; }