auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.testutil.InMemoryRepositoryManager repoManager = new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; repo = repoManager.createRepository ( project ) ; tr = new org.eclipse.jgit.junit.TestRepository ( repo ) ; tr.branch ( com.google.gerrit.server.update.RepoViewTest.MASTER ) . commit ( ) . create ( ) ; view = new com.google.gerrit.server.update.RepoView ( repoManager , project ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.testing.InMemoryRepositoryManager repoManager = new com.google.gerrit.testing.InMemoryRepositoryManager ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; repo = repoManager.createRepository ( project ) ; tr = new org.eclipse.jgit.junit.TestRepository ( repo ) ; tr.branch ( com.google.gerrit.server.update.RepoViewTest.MASTER ) . commit ( ) . create ( ) ; view = new com.google.gerrit.server.update.RepoView ( repoManager , project ) ; }
Source:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( anotherTerm.isVariable ( ) ) return AFTER ; if ( ! ( anotherTerm.isDouble ( ) ) ) return BEFORE ; return java.lang.Double.compare ( this . val , ( ( com.googlecode.prolog_cafe.lang.DoubleTerm ) ( anotherTerm ) ) . value ( ) ) ; }

Target:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) return AFTER ; if ( ! ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) ) return BEFORE ; return java.lang.Double.compare ( this . val , ( ( com.googlecode.prolog_cafe.lang.DoubleTerm ) ( anotherTerm ) ) . value ( ) ) ; }
Source:
public static com.google.gerrit.server.config.ScheduleConfig.Builder builder ( org.eclipse.jgit.lib.Config config , java.lang.String section ) { return new com.google.gerrit.server.config.AutoValue_ScheduleConfig.Builder ( ) . setNow ( java.time.ZonedDateTime.now ( java.time.ZoneId.systemDefault ( ) ) ) . setKeyInterval ( com.google.gerrit.server.config.ScheduleConfig.KEY_INTERVAL ) . setKeyStartTime ( com.google.gerrit.server.config.ScheduleConfig.KEY_STARTTIME ) . setConfig ( config ) . setSection ( section ) ; }

Target:
public static com.google.gerrit.server.config.ScheduleConfig.Builder builder ( org.eclipse.jgit.lib.Config config , java.lang.String section ) { return new com.google.gerrit.server.config.AutoValue_ScheduleConfig.Builder ( ) . setNow ( com.google.gerrit.server.config.ScheduleConfig.computeNow ( ) ) . setKeyInterval ( com.google.gerrit.server.config.ScheduleConfig.KEY_INTERVAL ) . setKeyStartTime ( com.google.gerrit.server.config.ScheduleConfig.KEY_STARTTIME ) . setConfig ( config ) . setSection ( section ) ; }
Source:
private void fire ( final com.google.gerrit.reviewdb.client.Project.NameKey p , final java.util.Properties statistics ) { com.google.gerrit.extensions.events.GarbageCollectorListener.Event event = new com.google.gerrit.extensions.events.GarbageCollectorListener.Event ( ) { @ java.lang.Override public java.lang.String getProjectName ( ) { return p.get ( ) ; } @ java.lang.Override public java.util.Properties getStatistics ( ) { return statistics ; } } ; for ( com.google.gerrit.extensions.events.GarbageCollectorListener l : listeners ) { try { l.onGarbageCollected ( event ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.server.git.GarbageCollection.log.warn ( "Failure in GarbageCollectorListener" , e ) ; } } }

Target:
private void fire ( final com.google.gerrit.reviewdb.client.Project.NameKey p , final java.util.Properties statistics ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.git.GarbageCollection.Event event = new com.google.gerrit.server.git.GarbageCollection.Event ( p , statistics ) ; for ( com.google.gerrit.extensions.events.GarbageCollectorListener l : listeners ) { try { l.onGarbageCollected ( event ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.server.git.GarbageCollection.log.warn ( "Failure in GarbageCollectorListener" , e ) ; } } }
Source:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( isOwner ( ) ) ; }
Source:
private void createReviewedPanel ( ) { reviewedPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; reviewedCheckBox = new com.google.gwt.user.client.ui.CheckBox ( ( ( PatchUtil.C.reviewedAnd ( ) ) + " " ) ) ; reviewedCheckBox.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Boolean > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { setReviewedByCurrentUser ( event.getValue ( ) ) ; } } ) ; reviewedPanel.add ( reviewedCheckBox ) ; reviewedPanel.add ( getReviewedAnchor ( ) ) ; }

Target:
private void populateReviewedPanel ( ) { reviewedPanel.clear ( ) ; reviewedCheckBox = new com.google.gwt.user.client.ui.CheckBox ( ( ( PatchUtil.C.reviewedAnd ( ) ) + " " ) ) ; reviewedCheckBox.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Boolean > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { setReviewedByCurrentUser ( event.getValue ( ) ) ; } } ) ; reviewedPanel.add ( reviewedCheckBox ) ; reviewedPanel.add ( getReviewedAnchor ( ) ) ; }
Source:
public com.google.gerrit.metrics.dropwizard.MetricJson apply ( com.google.gerrit.metrics.dropwizard.MetricResource resource ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ! ( user.getCapabilities ( ) . canViewCaches ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "restricted to viewCaches" ) ; } return new com.google.gerrit.metrics.dropwizard.MetricJson ( resource.getMetric ( ) , metrics.getAnnotations ( resource.getName ( ) ) , dataOnly ) ; }

Target:
public com.google.gerrit.metrics.dropwizard.MetricJson apply ( com.google.gerrit.metrics.dropwizard.MetricResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { permissionBackend.user ( user ) . check ( GlobalPermission.VIEW_CACHES ) ; return new com.google.gerrit.metrics.dropwizard.MetricJson ( resource.getMetric ( ) , metrics.getAnnotations ( resource.getName ( ) ) , dataOnly ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addDraftBox ( com.google.gerrit.client.changes.CommentInfo info , boolean doSave ) { com.google.gerrit.client.diff.DraftBox box = new com.google.gerrit.client.diff.DraftBox ( this , revision , info , commentLinkProcessor , true , doSave ) ; addCommentBox ( info , box ) ; if ( ! doSave ) { box.setEdit ( true ) ; } net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( info.side ( ) ) . getLineHandle ( ( ( info.line ( ) ) - 1 ) ) ; lineActiveBoxMap.put ( handle , box ) ; return box ; }

Target:
private com.google.gerrit.client.diff.DraftBox addDraftBox ( com.google.gerrit.client.changes.CommentInfo info , boolean doSave ) { net.codemirror.lib.CodeMirror cm = getCmFromSide ( info.side ( ) ) ; com.google.gerrit.client.diff.DraftBox box = new com.google.gerrit.client.diff.DraftBox ( this , cm , revision , info , commentLinkProcessor , true , doSave ) ; addCommentBox ( info , box ) ; if ( ! doSave ) { box.setEdit ( true ) ; } net.codemirror.lib.CodeMirror.LineHandle handle = cm.getLineHandle ( ( ( info.line ( ) ) - 1 ) ) ; lineActiveBoxMap.put ( handle , box ) ; return box ; }
Source:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }

Target:
protected void populateProjects ( ) { final java.lang.String mySubname = subname ; com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } } } ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbChangeState rebuild ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.ChangeBundle bundle ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( bundle.getChange ( ) ) ; buildUpdates ( manager , bundle ) ; return com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( change , manager.stage ( ) ) ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.ChangeBundle bundle ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( bundle.getChange ( ) ) ; buildUpdates ( manager , bundle ) ; return manager.stageAndApplyDelta ( change ) ; }
Source:
public void testInsertOne ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . insert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; }

Target:
public void testUpsertTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( branchName , listener.getUser ( ) ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.CommitInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.GetMergeList gml = getMergeList.get ( ) ; gml.setUninterestingParent ( getUninterestingParent ( ) ) ; gml.setAddLinks ( getAddLinks ( ) ) ; return gml.apply ( revision ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get merge list" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.CommitInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.restapi.change.GetMergeList gml = getMergeList.get ( ) ; gml.setUninterestingParent ( getUninterestingParent ( ) ) ; gml.setAddLinks ( getAddLinks ( ) ) ; return gml.apply ( revision ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get merge list" , e ) ; } }
Source:
public void onSuggestRefresh ( ) { refresh ( ) ; }

Target:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final boolean prior = starred ; setStarred ( ( ! prior ) ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( changeId , starred ) ; Util.LIST_SVC.toggleStars ( req , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; setStarred ( prior ) ; } } ) ; }
Source:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Project.NameKey > getProjectsInOrder ( ) throws com.google.gerrit.server.git.SubmoduleException { java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > projects = new java.util.LinkedHashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : branchesByProject.keySet ( ) ) ; HEAD ( 26 ) ; a551 ( "More horizontal space for patch set descriptions" ) ; addAllSubmoduleProjects ( project , new java.util.LinkedHashSet < > ( ) , projects ) ; }

Target:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Project.NameKey > getProjectsInOrder ( ) throws com.google.gerrit.server.git.SubmoduleException { java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > projects = new java.util.LinkedHashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : branchesByProject.keySet ( ) ) { addAllSubmoduleProjects ( project , new java.util.LinkedHashSet < > ( ) , projects ) ; } for ( com.google.gerrit.reviewdb.client.Branch.NameKey branch : updatedBranches ) { projects.add ( branch.getParentKey ( ) ) ; } return com.google.common.collect.ImmutableSet.copyOf ( projects ) ; }
Source:
private void computeInsertedDeleted ( ) { inserted = 0 ; deleted = 0 ; for ( int i = 0 ; i < ( list.length ( ) ) ; i ++ ) { com.google.gerrit.client.diff.FileInfo info = list.get ( i ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { inserted += info.linesInserted ( ) ; deleted += info.linesDeleted ( ) ; } } }

Target:
private void computeInsertedDeleted ( ) { inserted = 0 ; deleted = 0 ; for ( int i = 0 ; i < ( list.length ( ) ) ; i ++ ) { com.google.gerrit.client.info.FileInfo info = list.get ( i ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { inserted += info.linesInserted ( ) ; deleted += info.linesDeleted ( ) ; } } }
Source:
private void doClearPassword ( ) { if ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) ) != null ) { enableUI ( false ) ; com.google.gerrit.client.account.AccountApi.clearHttpPassword ( "self" , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { display ( null ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }

Target:
private void doClearPassword ( ) { if ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . username ( ) ) != null ) { enableUI ( false ) ; com.google.gerrit.client.account.AccountApi.clearHttpPassword ( "self" , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { display ( null ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }
Source:
public void testIsEnabledRefNoParentNoBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentNoBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
private static java.lang.String apply ( com.google.gerrit.server.ParamertizedString p , com.google.gerrit.server.auth.ldap.LdapQuery.Result m ) throws javax.naming.NamingException { if ( p == null ) { return null ; } final java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( final java.lang.String name : m.attributes ( ) ) { values.put ( name , m.get ( name ) ) ; } java.lang.String r = p.replace ( values ) ; return r.isEmpty ( ) ? null : r ; }

Target:
private static java.lang.String apply ( com.google.gerrit.common.data.ParamertizedString p , com.google.gerrit.server.auth.ldap.LdapQuery.Result m ) throws javax.naming.NamingException { if ( p == null ) { return null ; } final java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( final java.lang.String name : m.attributes ( ) ) { values.put ( name , m.get ( name ) ) ; } java.lang.String r = p.replace ( values ) ; return r.isEmpty ( ) ? null : r ; }
Source:
public void onBrowserEvent ( final com.google.gwt.user.client.Event event ) { if ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) { com.google.gwt.user.client.History.newItem ( getTargetHistoryToken ( ) , false ) ; com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.changes.ChangeScreen ( change ) ) ; com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; } }

Target:
protected com.google.gerrit.client.ui.Screen createScreen ( ) { return new com.google.gerrit.client.changes.ChangeScreen ( change ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > optionalChangeEdit , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gwtorm.server.OrmException { java.util.Optional < com.google.gerrit.reviewdb.client.PatchSet > editBasePatchSet = optionalChangeEdit.map ( ChangeEdit :: getBasePatchSet ) ; return editBasePatchSet.isPresent ( ) ? editBasePatchSet.get ( ) : lookupCurrentPatchSet ( changeControl ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > optionalChangeEdit , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { java.util.Optional < com.google.gerrit.reviewdb.client.PatchSet > editBasePatchSet = optionalChangeEdit.map ( ChangeEdit :: getBasePatchSet ) ; return editBasePatchSet.isPresent ( ) ? editBasePatchSet.get ( ) : lookupCurrentPatchSet ( notes ) ; }
Source:
void display ( final com.google.gerrit.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getUserName ( ) ) ; info.setText ( 1 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 2 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 3 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; info.setText ( 4 , fieldIdx , account.getId ( ) . toString ( ) ) ; }

Target:
void display ( final com.google.gerrit.reviewdb.Account account ) { info.setWidget ( 0 , fieldIdx , new com.google.gerrit.client.account.UsernameField ( ) ) ; info.setText ( 1 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 2 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 3 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; info.setText ( 4 , fieldIdx , account.getId ( ) . toString ( ) ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments ) ; if ( prefs.expandAllComments ( ) ) { commentManager.setExpandAllComments ( true ) ; } renderSkips ( prefs.context ( ) ) ; }
Source:
public void testGcOneProject ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( POST ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) ) . isEqualTo ( HttpStatus.SC_OK ) ; gcAssert.assertHasPackFile ( allProjects ) ; gcAssert.assertHasNoPackFile ( project , project2 ) ; }

Target:
public void testGcOneProject ( ) throws java.lang.Exception { POST ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) . assertOK ( ) ; gcAssert.assertHasPackFile ( allProjects ) ; gcAssert.assertHasNoPackFile ( project , project2 ) ; }
Source:
public void testInsertOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; com.google.gwtorm.data.TestPerson copy = schema.people ( ) . all ( ) . toList ( ) . get ( 0 ) ; assertNotSame ( copy , bob ) ; assertEquals ( bob.name ( ) , copy.name ( ) ) ; }

Target:
public void testInsertOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.Person bob = new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; com.google.gwtorm.data.Person copy = schema.people ( ) . all ( ) . toList ( ) . get ( 0 ) ; org.junit.Assert.assertNotSame ( copy , bob ) ; org.junit.Assert.assertEquals ( bob.name ( ) , copy.name ( ) ) ; }
Source:
public void testInfinity ( ) { com.google.gwtorm.nosql.IndexKeyBuilder ib = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; ib.infinity ( ) ; com.google.gwtorm.nosql.IndexKeyBuilderTest.assertEquals ( new byte [ ] { ( ( byte ) ( 255 ) ) , ( ( byte ) ( 255 ) ) } , ib ) ; }

Target:
public void testInfinity ( ) { com.google.gwtorm.nosql.IndexKeyBuilder ib = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; ib.infinity ( ) ; com.google.gwtorm.nosql.IndexKeyBuilderTest.assertEqualToBuilderResult ( new byte [ ] { ( ( byte ) ( 255 ) ) , ( ( byte ) ( 255 ) ) } , ib ) ; }
Source:
public void testName ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.quota.RepoSizeCache repoSizeCache = org.easymock.EasyMock.createMock ( com.googlesource.gerrit.plugins.quota.RepoSizeCache.class ) ; com.google.gerrit.reviewdb.client.Project.NameKey p = new com.google.gerrit.reviewdb.client.Project.NameKey ( com.googlesource.gerrit.plugins.quota.DeletionListenerTest.MY_PROJECT ) ; repoSizeCache.evict ( p ) ; com.googlesource.gerrit.plugins.quota.DeletionListener classUnderTest = new com.googlesource.gerrit.plugins.quota.DeletionListener ( repoSizeCache ) ; org.easymock.EasyMock.replay ( repoSizeCache ) ; com.google.gerrit.extensions.events.ProjectDeletedListener.Event event = new com.google.gerrit.extensions.events.ProjectDeletedListener.Event ( ) { @ java.lang.Override public java.lang.String getProjectName ( ) { return com.googlesource.gerrit.plugins.quota.DeletionListenerTest.MY_PROJECT ; } } ; classUnderTest.onProjectDeleted ( event ) ; org.easymock.EasyMock.verify ( repoSizeCache ) ; }

Target:
public com.google.gerrit.extensions.api.changes.NotifyHandling getNotify ( ) { return com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ) ; }

Target:
public abstract com.google.gerrit.server.index.IndexConfig.Builder maxTerms ( int maxTerms ) ;
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params , com.google.gerrit.acceptance.SshSession session ) throws java.lang.Exception { java.lang.String rawResponse = session.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }

Target:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params , com.google.gerrit.acceptance.SshSession session ) throws java.lang.Exception { java.lang.String rawResponse = session.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }
Source:
private java.lang.String getTokenForScreen ( java.lang.String filter , int skip ) { java.lang.String token = com.google.gerrit.common.PageLinks.toProjectBranches ( getProjectKey ( ) ) ; if ( ( filter != null ) && ( ! ( filter.isEmpty ( ) ) ) ) { token += "?filter=" + ( com.google.gwt.http.client.URL.encodeQueryString ( filter ) ) ; } if ( skip > 0 ) { if ( token.contains ( "?filter=" ) ) { token += "," ; } else { token += "?" ; } token += "skip=" + skip ; } return token ; }

Target:
public java.lang.String getScreenToken ( ) { return com.google.gerrit.common.PageLinks.toProjectBranches ( getProjectKey ( ) ) ; }
Source:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( update.getRevision ( ) ) ; walk.parseBody ( commit ) ; org.junit.Assert.assertEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , commit.getFullMessage ( ) ) ; } finally { walk.release ( ) ; } }

Target:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , update.getRevision ( ) ) ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; com.google.common.base.Optional < java.lang.Boolean > m = object.isMergeable ( ) ; return ( ( c != null ) && ( m.isPresent ( ) ) ) && ( m.get ( ) ) ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { return getValue ( ) . equals ( getField ( ) . get ( object , args ) ) ; }
Source:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( final org.eclipse.jgit.lib.Ref r : repo.getAllRefs ( ) . values ( ) ) { if ( com.google.gerrit.reviewdb.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private java.util.Collection < org.eclipse.jgit.lib.ObjectId > existingObjects ( ) { if ( ( existingObjects ) == null ) { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs = repo.getAllRefs ( ) ; existingObjects = new java.util.ArrayList < org.eclipse.jgit.lib.ObjectId > ( refs.size ( ) ) ; for ( org.eclipse.jgit.lib.Ref r : refs.values ( ) ) { existingObjects.add ( r.getObjectId ( ) ) ; } } return existingObjects ; }
Source:
public void rebuildChangeWithNoPatchSets ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; db.changes ( ) . beginTransaction ( id ) ; try { db.patchSets ( ) . delete ( db.patchSets ( ) . byChange ( id ) ) ; db.commit ( ) ; } finally { db.rollback ( ) ; } exception.expect ( com.google.gerrit.server.notedb.ChangeRebuilder.NoPatchSetsException.class ) ; checker.rebuildAndCheckChanges ( id ) ; }

Target:
public void rebuildChangeWithNoPatchSets ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; db.changes ( ) . beginTransaction ( id ) ; try { db.patchSets ( ) . delete ( db.patchSets ( ) . byChange ( id ) ) ; db.commit ( ) ; } finally { db.rollback ( ) ; } exception.expect ( com.google.gerrit.server.notedb.rebuild.ChangeRebuilder.NoPatchSetsException.class ) ; checker.rebuildAndCheckChanges ( id ) ; }
Source:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > getApprovals ( ) { if ( ( approvals ) == null ) { approvals = com.google.common.collect.ImmutableListMultimap.copyOf ( com.google.common.collect.Multimaps.transformValues ( state.approvals ( ) , PatchSetApproval :: new ) ) ; } return approvals ; }

Target:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > getApprovals ( ) { if ( ( approvals ) == null ) { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > b = com.google.common.collect.ImmutableListMultimap.builder ( ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > e : state.approvals ( ) ) { b.put ( e.getKey ( ) , new com.google.gerrit.reviewdb.client.PatchSetApproval ( e.getValue ( ) ) ) ; } approvals = b.build ( ) ; } return approvals ; }
Source:
private java.util.Set < org.eclipse.jgit.revwalk.RevCommit > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw ) throws com.google.gerrit.server.git.IntegrationException { try { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = new java.util.HashSet < > ( ) ; com.google.gerrit.server.git.strategy.SubmitDryRun.addCommits ( changeDataCache.getAlreadyAccepted ( repo ) , rw , accepted ) ; org.eclipse.jgit.lib.ObjectId tip = changeDataCache.getTestAgainst ( ) ; if ( tip != null ) { accepted.add ( rw.parseCommit ( tip ) ) ; } return accepted ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Failed to determine already accepted commits." , e ) ; } }

Target:
private java.util.Set < org.eclipse.jgit.revwalk.RevCommit > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw ) throws com.google.gerrit.server.git.IntegrationException { try { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = new java.util.HashSet < > ( ) ; com.google.gerrit.server.submit.SubmitDryRun.addCommits ( changeDataCache.getAlreadyAccepted ( repo ) , rw , accepted ) ; org.eclipse.jgit.lib.ObjectId tip = changeDataCache.getTestAgainst ( ) ; if ( tip != null ) { accepted.add ( rw.parseCommit ( tip ) ) ; } return accepted ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Failed to determine already accepted commits." , e ) ; } }
Source:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }

Target:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return com.google.gerrit.server.notedb.ChangeNoteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return changeNoteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( true ) ; saveProject.setEnabled ( false ) ; display ( result ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType ) ; saveProject.setVisible ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) ) ; saveProject.setEnabled ( false ) ; display ( result ) ; }
Source:
public static com.google.gerrit.client.DiffObject parse ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String str ) { if ( ( str == null ) || ( str.isEmpty ( ) ) ) { return new com.google.gerrit.client.DiffObject ( null ) ; } try { return new com.google.gerrit.client.DiffObject ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , java.lang.Integer.parseInt ( str ) ) ) ; } catch ( java.lang.NumberFormatException e ) { return null ; } }

Target:
public static com.google.gerrit.client.DiffObject parse ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String str ) { if ( ( str == null ) || ( str.isEmpty ( ) ) ) { return new com.google.gerrit.client.DiffObject ( false ) ; } if ( com.google.gerrit.client.DiffObject.AUTO_MERGE.equals ( str ) ) { return new com.google.gerrit.client.DiffObject ( true ) ; } try { return new com.google.gerrit.client.DiffObject ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , java.lang.Integer.parseInt ( str ) ) ) ; } catch ( java.lang.NumberFormatException e ) { return null ; } }
Source:
private void preMerge ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy , java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { logDebug ( "Running submit strategy for commits" , strategy.getClass ( ) . getSimpleName ( ) , toMerge.size ( ) ) ; mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; logDebug ( "Produced new commits" , strategy.getNewCommits ( ) . size ( ) ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }

Target:
private com.google.gerrit.server.git.MergeTip preMerge ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy , java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { logDebug ( "Running submit strategy for commits" , strategy.getClass ( ) . getSimpleName ( ) , toMerge.size ( ) ) ; mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; logDebug ( "Produced new commits" , strategy.getNewCommits ( ) . size ( ) ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; return mergeTip ; }
Source:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.lang.String name = describe ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) , com.google.gitiles.ViewFilter.getView ( req ) , req , res ) ; if ( name == null ) { return ; } java.io.PrintWriter out = startRenderText ( req , res ) ; out.write ( com.google.gitiles.RefServlet.sanitizeRefForText ( name ) ) ; out.close ( ) ; }

Target:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.lang.String name = describe ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) , com.google.gitiles.ViewFilter.getView ( req ) , req , res ) ; if ( name == null ) { return ; } java.io.Writer out = startRenderText ( req , res ) ; out.write ( com.google.gitiles.RefServlet.sanitizeRefForText ( name ) ) ; out.close ( ) ; }
Source:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.ssh.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.NEW , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }

Target:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.NEW , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }
Source:
public void blockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; com.google.gerrit.server.project.ProjectControl a = user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }

Target:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }
Source:
public com.google.gerrit.server.patch.DiffSummary getDiffSummary ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return getDiffSummary ( com.google.gerrit.server.patch.PatchListKey.againstDefaultBase ( b , ws ) , project ) ; }

Target:
public com.google.gerrit.server.patch.DiffSummary getDiffSummary ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return getDiffSummary ( com.google.gerrit.server.patch.DiffSummaryKey.fromPatchListKey ( com.google.gerrit.server.patch.PatchListKey.againstDefaultBase ( b , ws ) ) , project ) ; }
Source:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKey.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + ":\n Key is expired" ) ) ; }

Target:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + ":\n Key is expired" ) ) ; }
Source:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.hasActions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }

Target:
private void initChangeAction ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actions = ( info.hasActions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.info.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }