auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }
Source:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.reviewdb.client.Account.Id to ) { try { if ( ( ! ( rcptTo.contains ( to ) ) ) && ( isVisibleTo ( to ) ) ) { rcptTo.add ( to ) ; add ( rt , toAddress ( to ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.mail.send.OutgoingEmail.log.error ( ( "Error reading database for account: " + to ) , e ) ; } }

Target:
protected void add ( final com.google.gerrit.extensions.api.changes.RecipientType rt , final com.google.gerrit.reviewdb.client.Account.Id to ) { try { if ( ( ! ( rcptTo.contains ( to ) ) ) && ( isVisibleTo ( to ) ) ) { rcptTo.add ( to ) ; add ( rt , toAddress ( to ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.mail.send.OutgoingEmail.log.error ( ( "Error reading database for account: " + to ) , e ) ; } }
Source:
private void initRights ( ) { final com.google.gwt.user.client.ui.Label rightsHdr = new com.google.gwt.user.client.ui.Label ( Util.C.headingAccessRights ( ) ) ; rightsHdr.setStyleName ( "gerrit-SmallHeading" ) ; rights = new com.google.gerrit.client.admin.ProjectAdminScreen.RightsTable ( ) ; delRight = new com.google.gwt.user.client.ui.Button ( Util.C.buttonDeleteGroupMembers ( ) ) ; delRight.addClickListener ( new com.google.gwt.user.client.ui.ClickListener ( ) { public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { rights.deleteChecked ( ) ; } } ) ; add ( rightsHdr ) ; add ( rights ) ; add ( delRight ) ; }

Target:
public void onFocus ( com.google.gwt.user.client.ui.Widget sender ) { if ( Util.C.defaultAccountGroupName ( ) . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( "" ) ; nameTxtBox.removeStyleName ( "gerrit-InputFieldTypeHint" ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change getChange ( ) { return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change createChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { change = new com.google.gerrit.reviewdb.client.Change ( com.google.gerrit.server.change.ChangeInserter.getChangeKey ( commit ) , changeId , ctx.getUser ( ) . getAccountId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( ctx.getProject ( ) , refName ) , ctx.getWhen ( ) ) ; change.setStatus ( com.google.common.base.MoreObjects.firstNonNull ( status , Change.Status.NEW ) ) ; change.setTopic ( topic ) ; return change ; }
Source:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) ; if ( user.isIdentifiedUser ( ) ) { h.putString ( starredChangesUtil.getObjectId ( user.getAccountId ( ) , getId ( ) ) . name ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }

Target:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.murmur3_128 ( ) . newHasher ( ) ; if ( user.isIdentifiedUser ( ) ) { h.putString ( starredChangesUtil.getObjectId ( user.getAccountId ( ) , getId ( ) ) . name ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }
Source:
public void deleteDraftChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; }

Target:
public void deleteDraftChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; }
Source:
public void doesNotPublishWhenExpected ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockChange.commitMessage = "WIP-This is a title\nAnd a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( false ) ) ; }

Target:
public void doesNotPublishWhenExpected ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockChange.commitMessage = "WIP-This is a title\nAnd a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( false ) ) ; }
Source:
public static java.lang.String readFile ( final java.io.File parentDir , final java.lang.String name ) throws java.io.IOException { if ( parentDir == null ) { return null ; } final java.io.File path = new java.io.File ( parentDir , name ) ; try { return com.google.gerrit.httpd.HtmlDomUtil.asString ( new java.io.FileInputStream ( path ) ) ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }

Target:
public static org.w3c.dom.Document parseFile ( java.io.File path ) throws java.io.IOException { try ( java.io.InputStream in = new java.io.FileInputStream ( path ) ) { org.w3c.dom.Document doc = com.google.gerrit.httpd.HtmlDomUtil.newBuilder ( ) . parse ( in ) ; com.google.gerrit.httpd.HtmlDomUtil.compact ( doc ) ; return doc ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( org.xml.sax.SAXException | javax.xml.parsers.ParserConfigurationException | java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterRefUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; bind ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) . toInstance ( GitReferenceUpdated.DISABLED ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }
Source:
private static java.lang.String trim ( java.lang.String ref ) { if ( ref.startsWith ( "refs/changes/" ) ) { int s1 = ref.lastIndexOf ( '/' ) ; if ( s1 > 0 ) { int s2 = ref.lastIndexOf ( '/' , ( s1 - 1 ) ) ; if ( s2 > 0 ) { return ref.substring ( ( s2 + 1 ) ) ; } } } return null ; }

Target:
private static java.lang.String trim ( java.lang.String ref ) { if ( ref.startsWith ( RefNames.REFS_CHANGES ) ) { int s1 = ref.lastIndexOf ( '/' ) ; if ( s1 > 0 ) { int s2 = ref.lastIndexOf ( '/' , ( s1 - 1 ) ) ; if ( s2 > 0 ) { return ref.substring ( ( s2 + 1 ) ) ; } } } return null ; }
Source:
private void cleanUpReferences ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.Change.Id id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { accountPatchReviewStore.get ( ) . clearReviewed ( ps.getId ( ) ) ; } starredChangesUtil.unstarAll ( ctx.getChange ( ) . getProject ( ) , id ) ; }

Target:
private void cleanUpReferences ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.Change.Id id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { accountPatchReviewStore.get ( ) . clearReviewed ( ps.getId ( ) ) ; } starredChangesUtil.unstarAll ( ctx.getChange ( ) . getProject ( ) , id ) ; }
Source:
public void approvalTombstoneCommitFormat ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.removeApproval ( "Code-Review" ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Label: -Code-Review\n" ) ) , update.getResult ( ) ) ; }

Target:
public void approvalTombstoneCommitFormat ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.removeApproval ( "Code-Review" ) ; update.commit ( ) ; assertBodyEquals ( "Update patch set 1\n\nPatch-set: 1\nLabel: -Code-Review\n" , update.getResult ( ) ) ; }
Source:
public void findOkRecord ( ) { java.util.Collection < com.google.gerrit.common.data.SubmitRecord > submitRecords = new java.util.ArrayList < > ( ) ; submitRecords.add ( com.google.gerrit.common.data.SubmitRecordTest.NOT_READY_RECORD ) ; submitRecords.add ( com.google.gerrit.common.data.SubmitRecordTest.OK_RECORD ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.common.data.SubmitRecord.findOkRecord ( submitRecords ) . isPresent ( ) ) . isTrue ( ) ; }

Target:
public void okIfAllOkay ( ) { java.util.Collection < com.google.gerrit.common.data.SubmitRecord > submitRecords = new java.util.ArrayList < > ( ) ; submitRecords.add ( com.google.gerrit.common.data.SubmitRecordTest.OK_RECORD ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.common.data.SubmitRecord.allRecordsOK ( submitRecords ) ) . isTrue ( ) ; }
Source:
public com.google.gerrit.server.change.ReviewerResource parse ( com.google.gerrit.server.change.ChangeResource change , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { if ( id.matches ( "^[0-9]+$" ) ) { return new com.google.gerrit.server.change.ReviewerResource ( change , Account.Id.parse ( id ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.change.ReviewerResource parse ( com.google.gerrit.server.change.ChangeResource changeResource , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ! ( id.matches ( "^[0-9]+$" ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = Account.Id.parse ( id ) ; if ( fetchAccountIds ( changeResource ) . contains ( accountId ) ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( accountId ) . getAccount ( ) ; return new com.google.gerrit.server.change.ReviewerResource ( changeResource , account ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change createChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { change = new com.google.gerrit.reviewdb.client.Change ( com.google.gerrit.server.change.ChangeInserter.getChangeKey ( commit ) , changeId , ctx.getUser ( ) . getAccountId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( ctx.getProject ( ) , refName ) , ctx.getWhen ( ) ) ; change.setStatus ( com.google.common.base.MoreObjects.firstNonNull ( status , Change.Status.NEW ) ) ; change.setTopic ( topic ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change createChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { change = new com.google.gerrit.reviewdb.client.Change ( com.google.gerrit.server.change.ChangeInserter.getChangeKey ( commit ) , changeId , ctx.getAccountId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( ctx.getProject ( ) , refName ) , ctx.getWhen ( ) ) ; change.setStatus ( com.google.common.base.MoreObjects.firstNonNull ( status , Change.Status.NEW ) ) ; change.setTopic ( topic ) ; return change ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { if ( ( changeMessage ) == null ) { return ; } emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; reviewerDeleted.fire ( currChange , currPs , reviewer , ctx.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) , changeMessage.getMessage ( ) , newApprovals , oldApprovals , ctx.getWhen ( ) ) ; }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { if ( ( changeMessage ) == null ) { return ; } emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; reviewerDeleted.fire ( currChange , currPs , reviewer , ctx.getAccount ( ) , changeMessage.getMessage ( ) , newApprovals , oldApprovals , ctx.getWhen ( ) ) ; }
Source:
private static void validateDiffMode ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.ResourceKey key , com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , eu.medsea.mimeutil.MimeType mimeType ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( key.diffMode ) != ( DiffMode.NO_DIFF ) ) && ( ( ( key.revisionB ) == null ) || ( ( formatter == null ) && ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.isImage ( mimeType ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }

Target:
private static void validateDiffMode ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.ResourceKey key , com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , eu.medsea.mimeutil.MimeType mimeType ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( key.diffMode ) != ( DiffMode.NO_DIFF ) ) && ( ( key.revisionB ) == null ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }
Source:
public synchronized void removeWriteIndex ( int version ) { int removeIndex = - 1 ; for ( int i = 0 ; i < ( writeIndexes.size ( ) ) ; i ++ ) { if ( ( writeIndexes.get ( i ) . getSchema ( ) . getVersion ( ) ) == version ) { removeIndex = i ; break ; } } if ( removeIndex >= 0 ) { writeIndexes.remove ( removeIndex ) ; } }

Target:
public synchronized void removeWriteIndex ( int version ) { int removeIndex = - 1 ; for ( int i = 0 ; i < ( writeIndexes.size ( ) ) ; i ++ ) { if ( ( writeIndexes.get ( i ) . getSchema ( ) . getVersion ( ) ) == version ) { removeIndex = i ; break ; } } if ( removeIndex >= 0 ) { try { writeIndexes.get ( removeIndex ) . close ( ) ; } finally { writeIndexes.remove ( removeIndex ) ; } } }
Source:
public void getDiffPreferences ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/accounts/" + ( admin.email ) ) + "/preferences.diff" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.server.account.GetDiffPreferences.DiffPreferencesInfo diffPreferences = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.GetDiffPreferences.DiffPreferencesInfo.class ) ; com.google.gerrit.acceptance.rest.account.GetDiffPreferencesIT.assertDiffPreferences ( new com.google.gerrit.reviewdb.client.AccountDiffPreference ( admin.id ) , diffPreferences ) ; }

Target:
public void getDiffPreferences ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/accounts/" + ( admin.email ) ) + "/preferences.diff" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.server.account.GetDiffPreferences.DiffPreferencesInfo diffPreferences = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.GetDiffPreferences.DiffPreferencesInfo.class ) ; com.google.gerrit.acceptance.rest.account.GetDiffPreferencesIT.assertDiffPreferences ( new com.google.gerrit.reviewdb.client.AccountDiffPreference ( admin.id ) , diffPreferences ) ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( ( user != null ) && ( user.isIdentifiedUser ( ) ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }
Source:
private static void formatDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path , org.eclipse.jgit.diff.DiffFormatter diff ) throws java.io.IOException { try { if ( ! ( path.equals ( "" ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; } finally { diff.release ( ) ; } }

Target:
private static void formatDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path , org.eclipse.jgit.diff.DiffFormatter diff ) throws java.io.IOException { try { if ( ! ( path.isEmpty ( ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; } finally { diff.release ( ) ; } }
Source:
private org.apache.solr.common.SolrInputDocument toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { org.apache.solr.common.SolrInputDocument result = new org.apache.solr.common.SolrInputDocument ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > values : schema.buildFields ( cd , fillArgs ) ) { add ( result , values ) ; } return result ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }

Target:
private org.apache.solr.common.SolrInputDocument toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.solr.common.SolrInputDocument result = new org.apache.solr.common.SolrInputDocument ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > values : schema.buildFields ( cd , fillArgs ) ) { add ( result , values ) ; } return result ; }
Source:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; repoManager.start ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; }
Source:
public void testCommitDashV ( ) throws java.lang.Exception { assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( ( ( ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + ( SOB2 ) ) + "\n" ) + "# on branch master\n" ) + "diff --git a/src b/src\n" ) + "new file mode 100644\n" ) + "index 0000000..c78b7f0\n" ) ) ) ; }

Target:
public void testCommitDashV ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( ( ( ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + ( SOB2 ) ) + "\n" ) + "# on branch master\n" ) + "diff --git a/src b/src\n" ) + "new file mode 100644\n" ) + "index 0000000..c78b7f0\n" ) ) ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( 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 ) ) ) ) { display ( result ) ; } }
Source:
private void createErrorBox ( ) { errorLine = new com.google.gwt.user.client.ui.FlowPanel ( ) ; errorLine.setVisible ( false ) ; errorMsg = new com.google.gwt.user.client.ui.InlineLabel ( OpenIdUtil.C.notSupported ( ) ) ; errorLine.setStyleName ( "gerrit-OpenID-errorline" ) ; errorLine.add ( errorMsg ) ; formBody.add ( errorLine ) ; }

Target:
private void createErrorBox ( ) { errorLine = new com.google.gwt.user.client.ui.FlowPanel ( ) ; errorLine.setVisible ( false ) ; errorMsg = new com.google.gwt.user.client.ui.InlineLabel ( ) ; errorLine.setStyleName ( "gerrit-OpenID-errorline" ) ; errorLine.add ( errorMsg ) ; formBody.add ( errorLine ) ; }
Source:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , 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.ABANDONED_CHANGES ) ; }
Source:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.Account a = accountResolver.findByNameOrEmail ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }

Target:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account a = accountResolver.findByNameOrEmail ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }
Source:
public java.lang.String getComment ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "" ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 3 ) { return "" ; } return parts [ 3 ] ; }

Target:
public java.lang.String getComment ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "" ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 3 ) { return "" ; } return parts [ 2 ] ; }
Source:
public void testListTables ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { assertTrue ( dialect.listTables ( db ) . isEmpty ( ) ) ; execute ( "CREATE TABLE cnt (s SERIAL)" ) ; execute ( "CREATE TABLE foo (cnt INT)" ) ; java.util.Set < java.lang.String > s = dialect.listTables ( db ) ; assertEquals ( 1 , s.size ( ) ) ; assertFalse ( s.contains ( "cnt" ) ) ; assertTrue ( s.contains ( "foo" ) ) ; }

Target:
public void testListTables ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { org.junit.Assert.assertTrue ( dialect.listTables ( db ) . isEmpty ( ) ) ; execute ( "CREATE TABLE cnt (s SERIAL)" ) ; execute ( "CREATE TABLE foo (cnt INT)" ) ; java.util.Set < java.lang.String > s = dialect.listTables ( db ) ; org.junit.Assert.assertEquals ( 1 , s.size ( ) ) ; org.junit.Assert.assertFalse ( s.contains ( "cnt" ) ) ; org.junit.Assert.assertTrue ( s.contains ( "foo" ) ) ; }
Source:
private java.util.List < java.lang.String > getLinesOfComment ( com.google.gerrit.reviewdb.client.Comment comment , com.google.gerrit.server.patch.PatchFile fileData ) { java.util.List < java.lang.String > lines = new java.util.ArrayList < > ( ) ; if ( ( comment.range ) == null ) { try { lines.add ( fileData.getLine ( comment.side , comment.lineNbr ) ) ; } catch ( java.lang.Throwable e ) { lines.add ( "" ) ; } } else { lines.addAll ( getLinesByRange ( comment.range , fileData , comment.side ) ) ; } return lines ; }

Target:
private java.util.List < java.lang.String > getLinesOfComment ( com.google.gerrit.reviewdb.client.Comment comment , com.google.gerrit.server.patch.PatchFile fileData ) { java.util.List < java.lang.String > lines = new java.util.ArrayList < > ( ) ; if ( ( comment.range ) == null ) { lines.add ( getLine ( fileData , comment.side , comment.lineNbr ) ) ; } else { lines.addAll ( getLinesByRange ( comment.range , fileData , comment.side ) ) ; } return lines ; }
Source:
private void columnDelta1 ( 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 ( ) . deltaColumn1 ( ) ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { sb.append ( ( ( info.lines_inserted ( ) ) - ( info.lines_deleted ( ) ) ) ) ; } sb.closeTd ( ) ; }

Target:
private void columnDelta1 ( 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 ( ) . deltaColumn1 ( ) ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { sb.append ( ( ( info.lines_inserted ( ) ) + ( info.lines_deleted ( ) ) ) ) ; } sb.closeTd ( ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotes getNotes ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.get ( ) . changes ( ) . get ( changeId ) ; if ( c == null ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( ( ( "\"" + changeId ) + "\" no such change" ) ) ; } return notesFactory.create ( db.get ( ) , c ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes getNotes ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.get ( ) . changes ( ) . get ( changeId ) ; if ( c == null ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( ( ( "\"" + changeId ) + "\" no such change" ) ) ; } return notesFactory.create ( db.get ( ) , c.getProject ( ) , changeId ) ; }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; install ( new com.google.gerrit.server.notedb.NoteDbModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { 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" ) ; } format = com.google.gerrit.server.OutputFormat.JSON ; return display ( null ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) { 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 ( ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeManageServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeDetailServiceImpl.class ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit parseCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { if ( id instanceof org.eclipse.jgit.revwalk.RevCommit ) { return ( ( org.eclipse.jgit.revwalk.RevCommit ) ( id ) ) ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( id ) ; walk.parseBody ( commit ) ; return commit ; } finally { walk.release ( ) ; } }

Target:
private org.eclipse.jgit.revwalk.RevCommit parseCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { if ( id instanceof org.eclipse.jgit.revwalk.RevCommit ) { return ( ( org.eclipse.jgit.revwalk.RevCommit ) ( id ) ) ; } try ( org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( id ) ; walk.parseBody ( commit ) ; return commit ; } }
Source:
public final void scrollToLine ( int line ) { int height = getHeight ( ) ; if ( ( lineAtHeight ( ( height - 20 ) ) ) < line ) { scrollToY ( ( ( heightAtLine ( line , "local" ) ) - ( 0.5 * height ) ) ) ; } setCursor ( net.codemirror.lib.Pos.create ( line ) ) ; }

Target:
public final void scrollToLine ( int line ) { int height = getHeight ( ) ; if ( ( lineAtHeight ( ( height - 20 ) ) ) < line ) { scrollToY ( ( ( heightAtLine ( line , "local" ) ) - ( 0.5 * height ) ) ) ; } setCursor ( net.codemirror.lib.Pos.create ( line , 0 ) ) ; }
Source:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminHighPriorityCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }

Target:
protected void startThread ( com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminHighPriorityCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { checkPermission ( ) ; final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { checkPermission ( ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }
Source:
private void reply ( org.eclipse.jetty.server.HttpConnection conn , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] msg = com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.message ( conn ) ; res.setHeader ( HttpHeader.CONTENT_TYPE.asString ( ) , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( msg.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( msg ) ; } finally { out.close ( ) ; } } }

Target:
private void reply ( org.eclipse.jetty.server.HttpConnection conn , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] msg = com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.message ( conn ) ; res.setHeader ( HttpHeader.CONTENT_TYPE.asString ( ) , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( msg.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { try ( javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ) { out.write ( msg ) ; } } }
Source:
public synchronized < F1 , F2 , F3 > com.google.gerrit.metrics.Timer3 < F1 , F2 , F3 > newTimer ( 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.Field < F3 > field3 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkTimerDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.TimerImplN m = new com.google.gerrit.metrics.dropwizard.TimerImplN ( this , name , desc , field1 , field2 , field3 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.timer3 ( ) ; }

Target:
public synchronized < F1 , F2 , F3 > com.google.gerrit.metrics.Timer3 < F1 , F2 , F3 > newTimer ( 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.Field < F3 > field3 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkTimerDescription ( name , desc ) ; com.google.gerrit.metrics.dropwizard.TimerImplN m = new com.google.gerrit.metrics.dropwizard.TimerImplN ( this , name , desc , field1 , field2 , field3 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.timer3 ( ) ; }
Source:
public static com.google.gitiles.Revision peel ( java.lang.String name , org.eclipse.jgit.lib.ObjectId id , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.revwalk.RevObject obj = walk.parseAny ( id ) ; org.eclipse.jgit.revwalk.RevObject peeled = walk.peel ( obj ) ; return new com.google.gitiles.Revision ( name , obj , obj.getType ( ) , peeled , peeled.getType ( ) ) ; }

Target:
public static com.google.gitiles.Revision peel ( java.lang.String name , org.eclipse.jgit.revwalk.RevObject obj , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.revwalk.RevObject peeled = walk.peel ( obj ) ; return new com.google.gitiles.Revision ( name , obj , obj.getType ( ) , peeled , peeled.getType ( ) ) ; }
Source:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } com.google.gerrit.client.info.GitwebInfo gw = com.google.gerrit.client.Gerrit.info ( ) . gitweb ( ) ; if ( ( gw != null ) && ( ( project ) != null ) ) { return gw.toRevision ( project , info.commit ( ) . commit ( ) ) ; } return null ; }

Target:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } return null ; }
Source:
public void inheritRead_AppendWithDenyOfRef ( ) { 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/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }

Target:
public void inheritRead_AppendWithDenyOfRef ( ) { 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/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanRead ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }
Source:
public java.io.Reader getReader ( ) throws java.io.IOException , java.lang.IllegalStateException { java.io.Reader reader = new java.io.InputStreamReader ( response.getEntity ( ) . getContent ( ) ) ; reader.skip ( JSON_MAGIC.length ) ; return reader ; }

Target:
public java.io.Reader getReader ( ) throws java.io.IOException , java.lang.IllegalStateException { if ( ( ( reader ) == null ) && ( ( response.getEntity ( ) ) != null ) ) { reader = new java.io.InputStreamReader ( response.getEntity ( ) . getContent ( ) ) ; reader.skip ( JSON_MAGIC.length ) ; } return reader ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byChange ( notes.getChangeId ( ) ) ) ; } else { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( notes.load ( ) . getChangeMessages ( ) . values ( ) ) ; } }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byChange ( notes.getChangeId ( ) ) ) ; } else { return notes.load ( ) . getChangeMessages ( ) ; } }
Source:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) ) ; } } }

Target:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) ) ; } } }
Source:
public void testTimeAltersId ( ) throws java.lang.Exception { assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I3251906b99dda598a58a6346d8126237ee1ea800\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I69adf9208d828f41a3d7e41afbca63aff37c0c5c\n" ) ) , call ( "a\n" ) ) ; }

Target:
public void testTimeAltersId ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; org.junit.Assert.assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I3251906b99dda598a58a6346d8126237ee1ea800\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; org.junit.Assert.assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I69adf9208d828f41a3d7e41afbca63aff37c0c5c\n" ) ) , call ( "a\n" ) ) ; }
Source:
private com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute getPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute p = new com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; return p ; }

Target:
private com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute getPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute p = new com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; return p ; }