auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.util.Collection < java.lang.String > hashtags , java.util.Collection < java.lang.String > added , java.util.Collection < java.lang.String > removed ) { com.google.gerrit.server.extensions.events.HashtagsEdited.Event e = new com.google.gerrit.server.extensions.events.HashtagsEdited.Event ( change , editor , hashtags , added , removed ) ; if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } for ( com.google.gerrit.extensions.events.HashtagsEditedListener l : listeners ) { l.onHashtagsEdited ( e ) ; } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.util.Collection < java.lang.String > hashtags , java.util.Collection < java.lang.String > added , java.util.Collection < java.lang.String > removed ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.HashtagsEdited.Event e = new com.google.gerrit.server.extensions.events.HashtagsEdited.Event ( change , editor , hashtags , added , removed ) ; for ( com.google.gerrit.extensions.events.HashtagsEditedListener l : listeners ) { l.onHashtagsEdited ( e ) ; } }
Source:
public void testKernelStyleFooter ( ) throws java.lang.Exception { assertEquals ( ( ( ( ( ( "a\n" + ( "\n" + "Change-Id: I1bd787f9e7590a2ac82b02c404c955ffb21877c4\n" ) ) + ( SOB1 ) ) + "[ja: Fixed\n" ) + " the indentation]\n" ) + ( SOB2 ) ) , call ( ( ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + "[ja: Fixed\n" ) + " the indentation]\n" ) + ( SOB2 ) ) ) ) ; }

Target:
public void testKernelStyleFooter ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( ( ( ( "a\n" + ( "\n" + "Change-Id: I1bd787f9e7590a2ac82b02c404c955ffb21877c4\n" ) ) + ( SOB1 ) ) + "[ja: Fixed\n" ) + " the indentation]\n" ) + ( SOB2 ) ) , call ( ( ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + "[ja: Fixed\n" ) + " the indentation]\n" ) + ( SOB2 ) ) ) ) ; }
Source:
public java.lang.String get ( ) { java.lang.String canonicalUrl = super . get ( ) ; if ( canonicalUrl != null ) { return canonicalUrl ; } if ( ( requestProvider ) != null ) { final javax.servlet.http.HttpServletRequest req ; try { req = requestProvider.get ( ) ; } catch ( com.google.inject.ProvisionException noWeb ) { if ( ( noWeb.getCause ( ) ) instanceof com.google.inject.OutOfScopeException ) { return null ; } else { throw noWeb ; } } return com.google.gerrit.httpd.CanonicalWebUrl.computeFromRequest ( req ) ; } return null ; }

Target:
public java.lang.String get ( ) { java.lang.String canonicalUrl = super . get ( ) ; if ( canonicalUrl != null ) { return canonicalUrl ; } if ( ( requestProvider ) != null ) { final javax.servlet.http.HttpServletRequest req ; try { req = requestProvider.get ( ) ; } catch ( com.google.inject.ProvisionException noWeb ) { if ( ( noWeb.getCause ( ) ) instanceof com.google.inject.OutOfScopeException ) { return null ; } throw noWeb ; } return com.google.gerrit.httpd.CanonicalWebUrl.computeFromRequest ( req ) ; } return null ; }
Source:
public void run ( ) { while ( true ) { if ( stop ) { break ; } openIndex.maybeRefresh ( ) ; closedIndex.maybeRefresh ( ) ; synchronized ( this ) { try { wait ( 100 ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error refreshing index searchers" , e ) ; } } } }

Target:
public void run ( ) { while ( ! ( stop ) ) { openIndex.maybeRefresh ( ) ; closedIndex.maybeRefresh ( ) ; synchronized ( this ) { try { wait ( 100 ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error refreshing index searchers" , e ) ; } } } }
Source:
public static void main ( final java.lang.String [ ] argv ) { final java.lang.String v = com.google.gerrit.pgm.Version.getVersion ( ) ; if ( v == null ) { java.lang.System.err.println ( "fatal: version unavailable" ) ; java.lang.System.exit ( 1 ) ; } java.lang.System.out.println ( ( "gerrit version " + v ) ) ; }

Target:
public int run ( ) throws java.lang.Exception { final java.lang.String v = com.google.gerrit.pgm.Version.getVersion ( ) ; if ( v == null ) { java.lang.System.err.println ( "fatal: version unavailable" ) ; return 1 ; } java.lang.System.out.println ( ( "gerrit version " + v ) ) ; return 0 ; }
Source:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( accountCache , emails , dbKey , repository , project , branch , changeData.currentFilePaths ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( accountCache , emails , dbKey , repository , changeData , project , branch , changeData.currentFilePaths ( ) ) ; }
Source:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( admin ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . submit ( ) ; sender.clear ( ) ; return sc ; }

Target:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . submit ( ) ; sender.clear ( ) ; return sc ; }
Source:
public void onSignIn ( ) { if ( ( patchKey ) != null ) { PatchUtil.DETAIL_SVC.myDrafts ( patchKey , new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > result ) { if ( ! ( result.isEmpty ( ) ) ) { bindDrafts ( result ) ; } } } ) ; } }

Target:
public void onSignIn ( ) { }
Source:
protected void movePointerTo ( final int row , final boolean scroll ) { super . movePointerTo ( row , scroll ) ; if ( ( ! ( popingUp ) ) || ( "" . equals ( nameBox.getText ( ) ) ) ) { nameBox.setText ( getRowItem ( row ) . getName ( ) ) ; } }

Target:
protected void movePointerTo ( final int row , final boolean scroll ) { super . movePointerTo ( row , scroll ) ; if ( ( ! ( popingUp ) ) || ( "" . equals ( nameBox.getText ( ) ) ) ) { nameBox.setText ( getRowItem ( row ) . name ( ) ) ; } }
Source:
private void assertUserIds ( org.bouncycastle.openpgp.PGPPublicKeyRing keyRing , java.lang.String ... expected ) throws java.lang.Exception { java.util.List < java.lang.String > actual = new java.util.ArrayList < > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > userIds = store.get ( keyRing.getPublicKey ( ) . getKeyID ( ) ) . iterator ( ) . next ( ) . getPublicKey ( ) . getUserIDs ( ) ; while ( userIds.hasNext ( ) ) { actual.add ( userIds.next ( ) ) ; } org.junit.Assert.assertEquals ( actual , java.util.Arrays.asList ( expected ) ) ; }

Target:
private void assertUserIds ( org.bouncycastle.openpgp.PGPPublicKeyRing keyRing , java.lang.String ... expected ) throws java.lang.Exception { java.util.List < java.lang.String > actual = new java.util.ArrayList < > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > userIds = store.get ( keyRing.getPublicKey ( ) . getKeyID ( ) ) . iterator ( ) . next ( ) . getPublicKey ( ) . getUserIDs ( ) ; while ( userIds.hasNext ( ) ) { actual.add ( userIds.next ( ) ) ; } org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , actual ) ; }
Source:
public com.google.gerrit.server.CurrentUser getUser ( ) { return new com.google.gerrit.server.CurrentUser ( null ) { @ java.lang.Override public com.google.gerrit.server.account.GroupMembership getEffectiveGroups ( ) { return new com.google.gerrit.server.account.GroupMembership ( ) { @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return null ; } @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getKnownGroups ( ) { return null ; } @ java.lang.Override public boolean containsAnyOf ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return true ; } @ java.lang.Override public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) { return true ; } } ; } } ; }

Target:
public com.google.gerrit.server.CurrentUser getUser ( ) { return new com.google.gerrit.server.CurrentUser ( ) { @ java.lang.Override public com.google.gerrit.server.account.GroupMembership getEffectiveGroups ( ) { return new com.google.gerrit.server.account.GroupMembership ( ) { @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return null ; } @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getKnownGroups ( ) { return null ; } @ java.lang.Override public boolean containsAnyOf ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return true ; } @ java.lang.Override public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) { return true ; } } ; } } ; }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner , sc.starrer , other ) . to ( sc.reviewer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner , sc.starrer , other ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; com.google.common.base.Preconditions.checkArgument ( ps.isDraft ( ) , "cannot delete non-draft patch set %s" , ps.getId ( ) ) ; update.setPatchSetState ( PatchSetState.DELETED ) ; if ( ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.of ( update.getChange ( ) ) ) == ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.REVIEW_DB ) ) { db.patchSets ( ) . delete ( java.util.Collections.singleton ( ps ) ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; com.google.common.base.Preconditions.checkArgument ( ps.isDraft ( ) , "cannot delete non-draft patch set %s" , ps.getId ( ) ) ; update.setPatchSetState ( PatchSetState.DELETED ) ; db.patchSets ( ) . delete ( java.util.Collections.singleton ( ps ) ) ; }
Source:
private static java.lang.Iterable < java.nio.file.Path > filterDisabledPlugins ( java.util.Collection < java.nio.file.Path > paths ) { return com.google.common.collect.Iterables.filter ( paths , new com.google.common.base.Predicate < java.nio.file.Path > ( ) { @ java.lang.Override public boolean apply ( java.nio.file.Path p ) { return ! ( p.getFileName ( ) . toString ( ) . endsWith ( ".disabled" ) ) ; } } ) ; }

Target:
private static java.lang.Iterable < java.nio.file.Path > filterDisabledPlugins ( java.util.Collection < java.nio.file.Path > paths ) { return com.google.common.collect.Iterables.filter ( paths , ( p ) -> ! ( p.getFileName ( ) . toString ( ) . endsWith ( ".disabled" ) ) ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }
Source:
private java.lang.String [ ] getPackFiles ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; try { java.io.File packDir = new java.io.File ( repo.getDirectory ( ) , "objects/pack" ) ; return packDir.list ( new java.io.FilenameFilter ( ) { @ java.lang.Override public boolean accept ( java.io.File dir , java.lang.String name ) { return name.endsWith ( ".pack" ) ; } } ) ; } finally { repo.close ( ) ; } }

Target:
private java.lang.String [ ] getPackFiles ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ) { java.io.File packDir = new java.io.File ( repo.getDirectory ( ) , "objects/pack" ) ; return packDir.list ( new java.io.FilenameFilter ( ) { @ java.lang.Override public boolean accept ( java.io.File dir , java.lang.String name ) { return name.endsWith ( ".pack" ) ; } } ) ; } }
Source:
public void onLoad ( ) { if ( ( info ) == null ) { initUI ( ) ; } super . onLoad ( ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.reviewdb.Account > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; } } ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; }
Source:
public com.google.gerrit.extensions.common.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( recursive ) || ( rsrc.isDirectChild ( ) ) ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getName ( ) ) ; }

Target:
public com.google.gerrit.extensions.common.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( recursive ) || ( rsrc.isDirectChild ( ) ) ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getChild ( ) . getProject ( ) . getName ( ) ) ; }
Source:
public void testCreateProjectWithEmptyCommit ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; gApi.projects ( ) . create ( in ) ; assertEmptyCommit ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectWithEmptyCommit ( ) throws java.lang.Exception { java.lang.String newProjectName = name ( "newProject" ) ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; gApi.projects ( ) . create ( in ) ; assertEmptyCommit ( newProjectName , "refs/heads/master" ) ; }
Source:
public void voteOnBehalfOfInvalidLabel ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi revision = gApi.changes ( ) . id ( r.getChangeId ( ) ) . current ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.onBehalfOf = user.id.toString ( ) ; in.label ( "Not-A-Label" , 5 ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "label \"Not-A-Label\" is not a configured label" ) ; revision.review ( in ) ; }

Target:
public void voteOnBehalfOfInvalidLabel ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Not-A-Label" , 5 ) ; in.onBehalfOf = user.id.toString ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "label \"Not-A-Label\" is not a configured label" ) ; gApi.changes ( ) . id ( changeId ) . current ( ) . review ( in ) ; }
Source:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { out.write ( com.google.gerrit.server.change.GetPatch.formatEmailHeader ( commit ) . getBytes ( com.google.common.base.Charsets.UTF_8 ) ) ; org.eclipse.jgit.diff.DiffFormatter fmt = new org.eclipse.jgit.diff.DiffFormatter ( out ) ; fmt.setRepository ( repo ) ; fmt.format ( base.getTree ( ) , commit.getTree ( ) ) ; fmt.flush ( ) ; }

Target:
private void format ( java.io.OutputStream out ) throws java.io.IOException { out.write ( com.google.gerrit.server.change.GetPatch.formatEmailHeader ( commit ) . getBytes ( com.google.common.base.Charsets.UTF_8 ) ) ; org.eclipse.jgit.diff.DiffFormatter fmt = new org.eclipse.jgit.diff.DiffFormatter ( out ) ; fmt.setRepository ( repo ) ; fmt.format ( base.getTree ( ) , commit.getTree ( ) ) ; fmt.flush ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }

Target:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }
Source:
private boolean isEmpty ( ) { return ( ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( ( changeMessage ) == null ) ) && ( comments.isEmpty ( ) ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( subject ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( hashtags ) == null ) ; }

Target:
private boolean isEmpty ( ) { return ( ( ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( ( changeMessage ) == null ) ) && ( comments.isEmpty ( ) ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( subject ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( hashtags ) == null ) ) && ( ( topic ) == null ) ; }
Source:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) && ( running.compareAndSet ( false , true ) ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } executor.remove ( this ) ; executor.purge ( ) ; return true ; } else { return false ; } }

Target:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) && ( running.compareAndSet ( false , true ) ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } executor.remove ( this ) ; executor.purge ( ) ; return true ; } return false ; }
Source:
private void sendHtml ( javax.servlet.http.HttpServletResponse res , org.w3c.dom.Document doc ) throws java.io.IOException { byte [ ] bin = com.google.gerrit.httpd.HtmlDomUtil.toUTF8 ( doc ) ; res.setStatus ( HttpServletResponse.SC_UNAUTHORIZED ) ; res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( "UTF-8" ) ; res.setContentLength ( bin.length ) ; javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( bin ) ; } finally { out.close ( ) ; } }

Target:
private void sendHtml ( javax.servlet.http.HttpServletResponse res , org.w3c.dom.Document doc ) throws java.io.IOException { byte [ ] bin = com.google.gerrit.httpd.HtmlDomUtil.toUTF8 ( doc ) ; res.setStatus ( HttpServletResponse.SC_UNAUTHORIZED ) ; res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( "UTF-8" ) ; res.setContentLength ( bin.length ) ; try ( javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ) { out.write ( bin ) ; } }
Source:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { checkRemoveReviewer ( notes , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ; }
Source:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , repo , rw , base , path , ins , content ) ) ; break ; } dce.finish ( ) ; }

Target:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , rw , base , path , ins , content ) ) ; break ; } dce.finish ( ) ; }
Source:
protected void add ( final com.google.gwtorm.schema.SequenceModel s ) throws com.google.gwtorm.client.OrmException { final java.lang.String n = s.getSequenceName ( ) ; checkNotUsed ( n ) ; if ( ( sequences.put ( n , s ) ) != null ) { throw new com.google.gwtorm.client.OrmException ( ( "Duplicate sequences " + n ) ) ; } allNames.add ( n ) ; }

Target:
protected void add ( final com.google.gwtorm.schema.SequenceModel s ) throws com.google.gwtorm.server.OrmException { final java.lang.String n = s.getSequenceName ( ) ; checkNotUsed ( n ) ; if ( ( sequences.put ( n , s ) ) != null ) { throw new com.google.gwtorm.server.OrmException ( ( "Duplicate sequences " + n ) ) ; } allNames.add ( n ) ; }
Source:
public java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ( ! ( commandAllowed ) ) || ( ! ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.RepoScheme ) ) ) { return null ; } return ( ( scheme.getUrl ( project ) ) + " " ) + ref ; }

Target:
public java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ( commandAllowed ) && ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.RepoScheme ) ) { return ( ( scheme.getUrl ( project ) ) + " " ) + ref ; } return null ; }
Source:
private < T extends java.lang.Enum < ? > > void set ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , T value , T def ) { if ( ( value != null ) && ( value != def ) ) { cfg.setString ( section , null , name , value.toString ( ) ) ; } else { cfg.unset ( section , null , name ) ; } }

Target:
void unset ( java.lang.String name ) { set ( name , null ) ; }
Source:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }

Target:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; select ( ) ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.reviewdb.client.AccountGeneralPreferences pref = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) ; pref.setDownloadUrl ( urlType ) ; com.google.gerrit.client.account.Util.ACCOUNT_SVC.changePreferences ( pref , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.common.VoidResult result ) { } } ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; select ( ) ; if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( ( urlType ) != null ) ) { com.google.gerrit.reviewdb.client.AccountGeneralPreferences pref = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) ; pref.setDownloadUrl ( urlType ) ; com.google.gerrit.client.account.Util.ACCOUNT_SVC.changePreferences ( pref , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.common.VoidResult result ) { } } ) ; } }
Source:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.sshd.SshKeyCacheEntry key ) { return userFactory.create ( AccessPath.SSH_COMMAND , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , key.getAccount ( ) ) ; }

Target:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.sshd.SshKeyCacheEntry key ) { return userFactory.create ( sd.getRemoteAddress ( ) , key.getAccount ( ) ) ; }
Source:
public void testEmpty ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertTrue ( b.isEmpty ( ) ) ; assertFalse ( b.hasContent ( ) ) ; assertEquals ( "" , b.asString ( ) ) ; b.append ( "a" ) ; assertTrue ( b.hasContent ( ) ) ; assertEquals ( "a" , b.asString ( ) ) ; }

Target:
public void testEmpty ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertTrue ( b.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( b.hasContent ( ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; b.append ( "a" ) ; org.junit.Assert.assertTrue ( b.hasContent ( ) ) ; org.junit.Assert.assertEquals ( "a" , b.asString ( ) ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; try { changeControl = changeControlFactory.controlFor ( c , userFactory.create ( c.getOwner ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } } return changeControl ; }

Target:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; try { changeControl = changeControlFactory.controlFor ( db , c , userFactory.create ( c.getOwner ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } } return changeControl ; }
Source:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; }

Target:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; } }
Source:
public void select ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme urlType ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( ( d.getUrlType ( ) ) == urlType ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }

Target:
public void select ( java.lang.String urlType ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( d.getUrlType ( ) . equals ( urlType ) ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }
Source:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String labelName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( project , ( ( com.google.gerrit.common.data.Permission.LABEL ) + labelName ) , com.google.gerrit.server.project.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; r.setRange ( ( - 1 ) , 1 ) ; return r ; }

Target:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String labelName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { return com.google.gerrit.server.project.Util.blockLabel ( project , labelName , ( - 1 ) , 1 , group , ref ) ; }
Source:
public void testReplaceOverlappingAtFirstCharLongestMatch ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "abcd" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace ab = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "ab" , "AB" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace abc = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "[^d][^d][^d]" , "234" ) ; assertEquals ( "ABcd" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( ab , abc ) ) . asString ( ) ) ; assertEquals ( "234d" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( abc , ab ) ) . asString ( ) ) ; }

Target:
public void testReplaceOverlappingAtFirstCharLongestMatch ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "abcd" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace ab = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "ab" , "AB" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace abc = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "[^d][^d][^d]" , "234" ) ; org.junit.Assert.assertEquals ( "ABcd" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( ab , abc ) ) . asString ( ) ) ; org.junit.Assert.assertEquals ( "234d" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( abc , ab ) ) . asString ( ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.Revision ) { com.google.gitiles.Revision r = ( ( com.google.gitiles.Revision ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( name , r.name ) ) && ( java.util.Objects.equals ( id , r.id ) ) ) && ( java.util.Objects.equals ( type , r.type ) ) ) && ( java.util.Objects.equals ( peeledId , r.peeledId ) ) ) && ( java.util.Objects.equals ( peeledType , r.peeledType ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.Revision ) { com.google.gitiles.Revision r = ( ( com.google.gitiles.Revision ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( name , r.name ) ) && ( java.util.Objects.equals ( id , r.id ) ) ) && ( ( type ) == ( r.type ) ) ) && ( java.util.Objects.equals ( peeledId , r.peeledId ) ) ) && ( ( peeledType ) == ( r.peeledType ) ) ; } return false ; }
Source:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getAllLeafColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : nestedColumns ) { if ( c.isNested ( ) ) { r.addAll ( c.getNestedColumns ( ) ) ; } else { r.add ( c ) ; } } return r ; }

Target:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getAllLeafColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : nestedColumns ) { if ( c.isNested ( ) ) { r.addAll ( c.getAllLeafColumns ( ) ) ; } else { r.add ( c ) ; } } return r ; }
Source:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { com.google.gerrit.server.project.Util.allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectControl pc = newProjectControl ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.junit.Assert.assertTrue ( pc.canReadCommit ( db , rw , rw.parseCommit ( id ) ) ) ; }

Target:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectControl pc = newProjectControl ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.junit.Assert.assertTrue ( pc.canReadCommit ( db , rw , rw.parseCommit ( id ) ) ) ; }
Source:
private static org.apache.lucene.search.Query sortKeyQuery ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , com.google.gerrit.server.query.change.SortKeyPredicate p ) { long min = p.getMinValue ( schema ) ; long max = p.getMaxValue ( schema ) ; return org.apache.lucene.search.NumericRangeQuery.newLongRange ( p.getField ( ) . getName ( ) , ( min != ( java.lang.Long.MIN_VALUE ) ? min : null ) , ( max != ( java.lang.Long.MAX_VALUE ) ? max : null ) , false , false ) ; }

Target:
private org.apache.lucene.search.Query sortKeyQuery ( com.google.gerrit.server.query.change.SortKeyPredicate p ) { long min = p.getMinValue ( schema ) ; long max = p.getMaxValue ( schema ) ; return org.apache.lucene.search.NumericRangeQuery.newLongRange ( p.getField ( ) . getName ( ) , ( min != ( java.lang.Long.MIN_VALUE ) ? min : null ) , ( max != ( java.lang.Long.MAX_VALUE ) ? max : null ) , false , false ) ; }
Source:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > psIdLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; if ( ( psIdLines.size ( ) ) != 1 ) { throw parseException ( "missing or multiple %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines ) ; } java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdLines.get ( 0 ) ) ; if ( psId == null ) { throw parseException ( "invalid %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines.get ( 0 ) ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , psId ) ; }

Target:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > psIdLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; if ( ( psIdLines.size ( ) ) != 1 ) { throw parseException ( "missing or multiple %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines ) ; } java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdLines.get ( 0 ) ) ; if ( psId == null ) { throw parseException ( "invalid %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines.get ( 0 ) ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { if ( ( isNoDifferences ( caught ) ) && ( ! isFirst ) ) { historyTable.enableAll ( true ) ; showPatch ( false ) ; } else { super . onFailure ( caught ) ; } } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { super . onFailure ( caught ) ; } }
Source:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final com.google.gerrit.common.data.ReviewResult result = restoreChangeFactory.create ( patchSetId , message ) . call ( ) ; if ( ( result.getErrors ( ) . size ( ) ) > 0 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( result.getChangeId ( ) ) ; } return changeDetailFactory.create ( result.getChangeId ( ) ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final com.google.gerrit.common.data.ReviewResult result = restoreChangeFactory.create ( patchSetId.getParentKey ( ) , message ) . call ( ) ; if ( ( result.getErrors ( ) . size ( ) ) > 0 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( result.getChangeId ( ) ) ; } return changeDetailFactory.create ( result.getChangeId ( ) ) . call ( ) ; }
Source:
public void testCreatePermissionOnlyProject ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.permissionsOnly = true ; gApi.projects ( ) . create ( in ) ; assertHead ( newProjectName , RefNames.REFS_CONFIG ) ; }

Target:
public void testCreatePermissionOnlyProject ( ) throws java.lang.Exception { java.lang.String newProjectName = name ( "newProject" ) ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.permissionsOnly = true ; gApi.projects ( ) . create ( in ) ; assertHead ( newProjectName , RefNames.REFS_CONFIG ) ; }