auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }
Source:
private void refreshObjectIds ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId getNewId ( ) { if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } return newId ; }
Source:
public void onSuccess ( java.lang.Void result ) { if ( ( prefs.syntaxHighlighting ( ) ) && ( view.isAttached ( ) ) ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; } } ) ; } }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( java.util.Objects.equals ( mode , getSelectedMode ( ) ) ) ) && ( view.isAttached ( ) ) ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; } } ) ; } }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : args.starredChangesUtil.byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , accountId ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }

Target:
protected void bccStarredBy ( ) { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : args.starredChangesUtil.byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , accountId ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }
Source:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesStart ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withStart ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
private com.google.gerrit.server.ssh.Failure usage ( ) { final java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( "usage: " ) ; m.append ( getName ( ) ) ; if ( isGerrit ( ) ) { m.append ( " [--reviewer=email]*" ) ; m.append ( " [--cc=email]*" ) ; } m.append ( " '/project.git'" ) ; return new com.google.gerrit.server.ssh.Failure ( 1 , m.toString ( ) ) ; }

Target:
void addCC ( final java.lang.String nameOrEmail ) throws org.kohsuke.args4j.CmdLineException { ccId.add ( toAccountId ( nameOrEmail ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.groups.GroupMap.my ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.groups.GroupList.my ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupList > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.groups.GroupList result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . get ( key ) . orElse ( null ) ; } }

Target:
java.util.Optional < com.google.gerrit.server.account.externalids.ExternalId > get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . get ( key ) ; } }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { com.googlecode.prolog_cafe.lang.Term a2 = engine.areg2 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > iter = ( ( java.util.Iterator < java.lang.String > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a2 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry2 ( gerrit_owners.PRED_owner_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_owner_path_1.OWNER_PATH_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { com.googlecode.prolog_cafe.lang.Term a2 = engine.r2 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > iter = ( ( java.util.Iterator < java.lang.String > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a2 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry2 ( gerrit_owners.PRED_owner_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_owner_path_1.OWNER_PATH_NEXT ) ; }
Source:
private static void whoAmI ( ) { final java.lang.String name = com.google.gerrit.client.FormatUtil.nameEmail ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; final com.google.gwt.user.client.ui.InlineLabel l = new com.google.gwt.user.client.ui.InlineLabel ( name ) ; l.setStyleName ( "gerrit-MenuBarUserName" ) ; com.google.gerrit.client.Gerrit.menuRight.add ( l ) ; }

Target:
private static void whoAmI ( ) { final java.lang.String name = com.google.gerrit.client.FormatUtil.nameEmail ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; final com.google.gwt.user.client.ui.InlineLabel l = new com.google.gwt.user.client.ui.InlineLabel ( name ) ; l.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . menuBarUserName ( ) ) ; com.google.gerrit.client.Gerrit.menuRight.add ( l ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { if ( open && ( ( result.values ( ) . length ( ) ) > 0 ) ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toGroup ( result.values ( ) . get ( 0 ) . getGroupUUID ( ) ) ) ; } else { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } }
Source:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { xsrf = xsrfInit ( ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot initialize XSRF" , e ) ; } }

Target:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { xsrf = xsrfInit ( ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot initialize XSRF" , e ) ; } myMethods = com.google.gwtjsonrpc.server.JsonServlet.methods ( ( ( com.google.gwtjsonrpc.client.RemoteJsonService ) ( serviceHandle ( ) ) ) ) ; if ( myMethods.isEmpty ( ) ) { throw new javax.servlet.ServletException ( "No service methods declared" ) ; } }
Source:
public static java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; if ( meEnd > 0 ) { return com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . substring ( ( meEnd + 1 ) ) ; } else { return "" ; } }

Target:
public static java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; java.lang.String finalUrlSuffix = ( "?" + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.FINAL_URL_PARAM ) ) + "=true" ; if ( meEnd > 0 ) { return ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . substring ( ( meEnd + 1 ) ) ) + finalUrlSuffix ; } else { return finalUrlSuffix ; } }
Source:
public void duplicateAccountEventOfAQueuedEventShouldGetDiscarded ( ) { com.google.gerrit.server.git.WorkQueue.Executor poolMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.Executor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; indexEventHandler.onAccountIndexed ( accountId.get ( ) ) ; indexEventHandler.onAccountIndexed ( accountId.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.IndexAccountTask ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) ; }

Target:
public void duplicateAccountEventOfAQueuedEventShouldGetDiscarded ( ) { java.util.concurrent.ScheduledThreadPoolExecutor poolMock = org.mockito.Mockito.mock ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; indexEventHandler.onAccountIndexed ( accountId.get ( ) ) ; indexEventHandler.onAccountIndexed ( accountId.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.IndexAccountTask ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.submitter = mockAccount ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.commitMessage = "This is a title\nAnd a the body." ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester merged\\n>>>" + ( "testproject (master): This is a title (https://change/)\"," + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.submitter = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.commitMessage = "This is a title\nAnd a the body." ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester merged\\n>>>" + ( "testproject (master): This is a title (https://change/)\"," + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encode ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }

Target:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encodeToByteString ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }
Source:
public com.google.gerrit.server.permissions.PermissionBackend.ForChange change ( com.google.gerrit.server.notedb.ChangeNotes notes ) { com.google.gerrit.reviewdb.client.Change change = notes.getChange ( ) ; com.google.common.base.Preconditions.checkArgument ( getProjectControl ( ) . getProject ( ) . getNameKey ( ) . equals ( change.getProject ( ) ) , "mismatched project" ) ; return getProjectControl ( ) . controlFor ( notes ) . asForChange ( null , db ) ; }

Target:
public com.google.gerrit.server.permissions.PermissionBackend.ForChange change ( com.google.gerrit.server.notedb.ChangeNotes notes ) { com.google.gerrit.reviewdb.client.Project.NameKey project = getProjectControl ( ) . getProject ( ) . getNameKey ( ) ; com.google.gerrit.reviewdb.client.Change change = notes.getChange ( ) ; com.google.common.base.Preconditions.checkArgument ( project.equals ( change.getProject ( ) ) , "expected change in project %s, not %s" , project , change.getProject ( ) ) ; return getProjectControl ( ) . controlFor ( notes ) . asForChange ( null , db ) ; }
Source:
public void testCreateProjectHttpWhenProjectAlreadyExists_PreconditionFailed ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.putWithHeader ( ( "/projects/" + ( allProjects.get ( ) ) ) , new org.apache.http.message.BasicHeader ( com.google.common.net.HttpHeaders.IF_NONE_MATCH , "*" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_PRECONDITION_FAILED ) ; }

Target:
public void testCreateProjectHttpWhenProjectAlreadyExists_PreconditionFailed ( ) throws java.lang.Exception { adminSession.putWithHeader ( ( "/projects/" + ( allProjects.get ( ) ) ) , new org.apache.http.message.BasicHeader ( com.google.common.net.HttpHeaders.IF_NONE_MATCH , "*" ) ) . assertPreconditionFailed ( ) ; }
Source:
public void topoSortNoChange ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; e2.addDep ( e1 ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = events ( e2 , e1 , e3 ) ; new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; com.google.common.truth.Truth.assertThat ( events ) . containsExactly ( e1 , e2 , e3 ) . inOrder ( ) ; }

Target:
private java.util.List < com.google.gerrit.server.notedb.rebuild.Event > threeEventsOneDep ( int depFromIdx , int depOnIdx ) { java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = com.google.common.collect.Lists.newArrayList ( new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) , new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) , new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) ; events.get ( depFromIdx ) . addDep ( events.get ( depOnIdx ) ) ; return events ; }
Source:
public void visit ( int version , int access , java.lang.String name , java.lang.String signature , java.lang.String superName , java.lang.String [ ] interfaces ) { this . className = org.objectweb.asm.Type.getObjectType ( name ) . getClassName ( ) ; this . access = access ; }

Target:
public void visit ( int version , int access , java.lang.String name , java.lang.String signature , java.lang.String superName , java.lang.String [ ] interfaces ) { this . interfaces = com.google.common.collect.Iterables.transform ( com.google.common.collect.Sets.newHashSet ( interfaces ) , com.google.gerrit.server.plugins.JarScanner.TO_JAVA_QUALIFIED_CLASS_NAME ) ; this . className = org.objectweb.asm.Type.getObjectType ( name ) . getClassName ( ) ; this . access = access ; }
Source:
public void doesNotPublishWhenTurnedOff ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( false ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockChange.commitMessage = "This is a title\nAnd a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( false ) ) ; }

Target:
public void doesNotPublishWhenTurnedOff ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( false ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockChange.commitMessage = "This is a title\nand a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( false ) ) ; }
Source:
private void decodeStarredBy ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.index.IndexableField [ ] starredBy = doc.getFields ( com.google.gerrit.lucene.LuceneChangeIndex.STARREDBY_FIELD ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accounts = com.google.common.collect.Sets.newHashSetWithExpectedSize ( starredBy.length ) ; for ( org.apache.lucene.index.IndexableField r : starredBy ) { accounts.add ( new com.google.gerrit.reviewdb.client.Account.Id ( r.numericValue ( ) . intValue ( ) ) ) ; } cd.setStarredBy ( accounts ) ; }

Target:
private void decodeStarredBy ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { java.util.Collection < org.apache.lucene.index.IndexableField > starredBy = doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.STARREDBY_FIELD ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accounts = com.google.common.collect.Sets.newHashSetWithExpectedSize ( starredBy.size ( ) ) ; for ( org.apache.lucene.index.IndexableField r : starredBy ) { accounts.add ( new com.google.gerrit.reviewdb.client.Account.Id ( r.numericValue ( ) . intValue ( ) ) ) ; } cd.setStarredBy ( accounts ) ; }
Source:
public void testResponseWithMalformedResponse ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withFault ( Fault.MALFORMED_RESPONSE_CHUNK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isFalse ( ) ; }

Target:
public void testResponseWithMalformedResponse ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withFault ( Fault.MALFORMED_RESPONSE_CHUNK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isFalse ( ) ; }
Source:
java.util.Map < java.lang.String , java.lang.Short > getLabels ( ) { return labels ; }

Target:
void addLabel ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
public static com.google.gerrit.client.reviewdb.Account find ( final com.google.gerrit.client.reviewdb.ReviewDb db , final java.lang.String nameOrEmail ) throws com.google.gwtorm.client.OrmException { final int lt = nameOrEmail.indexOf ( '<' ) ; final int gt = nameOrEmail.indexOf ( '>' ) ; if ( ( lt >= 0 ) && ( gt > lt ) ) { final java.lang.String email = nameOrEmail.substring ( ( lt + 1 ) , gt ) ; return com.google.gerrit.client.reviewdb.Account.one ( db.accounts ( ) . byPreferredEmail ( email ) ) ; } if ( nameOrEmail.contains ( "@" ) ) { return com.google.gerrit.client.reviewdb.Account.one ( db.accounts ( ) . byPreferredEmail ( nameOrEmail ) ) ; } return com.google.gerrit.client.reviewdb.Account.one ( db.accounts ( ) . suggestByFullName ( nameOrEmail , nameOrEmail , 2 ) ) ; }

Target:
private static com.google.gerrit.client.reviewdb.Account findByEmail ( final com.google.gerrit.client.reviewdb.ReviewDb db , final java.lang.String email ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.reviewdb.Account.oneAccount ( db.accounts ( ) . byPreferredEmail ( email ) ) ; if ( a == null ) { a = com.google.gerrit.client.reviewdb.Account.oneAccountExternalId ( db.accountExternalIds ( ) . byEmailAddress ( email ) ) ; } return a ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , reply , fileTableMode , ( ( edit ) != null ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , com.google.gerrit.reviewdb.client.Account.Id pullRequestAuthorId , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , pullRequestAuthorId , null ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , com.google.gerrit.reviewdb.client.Account.Id pullRequestAuthorId , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , pullRequestAuthorId , new java.sql.Timestamp ( java.lang.System.currentTimeMillis ( ) ) , null ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }
Source:
public void deleteReviewerFromReviewableChangeNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . notTo ( extraCcer , sc.owner , sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . noOneElse ( ) ; }
Source:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; 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.testing.TestKey key3 = com.google.gerrit.gpg.testing.TestKeys.expiredKey ( ) ; 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:
public static void match ( java.lang.String match , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupMap > cb ) { if ( ( match == null ) || ( "" . equals ( match ) ) ) { com.google.gerrit.client.groups.GroupMap.all ( cb ) ; } else { new com.google.gerrit.client.rpc.RestApi ( "/groups/" ) . addParameter ( "m" , match ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; } }

Target:
public static void match ( java.lang.String match , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupMap > cb ) { if ( ( match == null ) || ( "" . equals ( match ) ) ) { com.google.gerrit.client.groups.GroupMap.all ( cb ) ; } else { com.google.gerrit.client.groups.GroupMap.groups ( ) . addParameter ( "m" , match ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; } }
Source:
protected void set ( int newValue ) { seq = newValue ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof com.google.gerrit.reviewdb.client.AccountSshKey.Id ) ) { return false ; } com.google.gerrit.reviewdb.client.AccountSshKey.Id otherId = ( ( com.google.gerrit.reviewdb.client.AccountSshKey.Id ) ( obj ) ) ; return ( java.util.Objects.equals ( accountId , otherId.accountId ) ) && ( java.util.Objects.equals ( seq , otherId.seq ) ) ; }
Source:
public static void deleteEdit ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.edit ( id ) . delete ( cb ) ; }

Target:
public static void submit ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "submit" ) . post ( in , cb ) ; }
Source:
public com.google.gerrit.httpd.resources.Resource get ( com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String file , org.eclipse.jgit.lib.ObjectId revId ) { return cache.getUnchecked ( new com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ( formatter.getName ( ) , project , file , revId ) . asString ( ) ) ; }

Target:
public com.google.gerrit.httpd.resources.Resource get ( com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String file , org.eclipse.jgit.lib.ObjectId revId ) { org.eclipse.jgit.lib.ObjectId metaConfigRevId ; try { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { metaConfigRevId = repo.resolve ( RefNames.REFS_CONFIG ) ; } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { return null ; } return cache.getUnchecked ( new com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ( formatter.getName ( ) , project , file , revId , metaConfigRevId ) . asString ( ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( approvals ) == null ) { approvals = db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) . toList ( ) ; } return approvals ; }

Target:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > approvalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( approvals ) == null ) { approvals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) { if ( ( ( limitedIds ) == null ) || ( limitedIds.contains ( legacyId ) ) ) { approvals.put ( psa.getPatchSetId ( ) , psa ) ; } } } return approvals ; }
Source:
public void create_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isFalse ( ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }

Target:
public void create_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isFalse ( ) ; com.google.gerrit.extensions.common.testing.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchSetApproval getChangeApproval ( com.google.gerrit.reviewdb.client.ApprovalCategory.Id id ) { for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : given ) { if ( a.getCategoryId ( ) . equals ( id ) ) { return a ; } } return null ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSetApproval getChangeApproval ( java.lang.String label ) { for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : given ) { if ( ( ( a.getLabel ( ) ) != null ) && ( a.getLabel ( ) . equals ( label ) ) ) { return a ; } } return null ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.util.List < ? > input ) { mpm.end ( ) ; return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.util.List < ? > input ) throws java.lang.Exception { com.google.gerrit.server.git.MultiProgressMonitor.Task t = mpm.beginSubTask ( "update refs" , MultiProgressMonitor.UNKNOWN ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { bru.execute ( walk , t ) ; mpm.end ( ) ; return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } finally { walk.release ( ) ; } }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.emptySet ( ) , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , java.util.Collections.emptySet ( ) , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; addHashtagIcon.setVisible ( canEdit ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; project = info.projectNameKey ( ) ; canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; addHashtagIcon.setVisible ( canEdit ) ; }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo updateDefaultEditPreferences ( com.google.gerrit.server.git.MetaDataUpdate md , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.PreferencesConfig.VersionedDefaultPreferences defaultPrefs = new com.google.gerrit.server.account.PreferencesConfig.VersionedDefaultPreferences ( ) ; defaultPrefs.load ( md ) ; com.google.gerrit.server.config.ConfigUtil.storeSection ( defaultPrefs.getConfig ( ) , UserConfigSections.EDIT , null , input , com.google.gerrit.extensions.client.EditPreferencesInfo.defaults ( ) ) ; defaultPrefs.commit ( md ) ; return com.google.gerrit.server.account.PreferencesConfig.parseEditPreferences ( defaultPrefs.getConfig ( ) , null , null ) ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo updateDefaultEditPreferences ( com.google.gerrit.server.git.MetaDataUpdate md , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences defaultPrefs = new com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences ( ) ; defaultPrefs.load ( md ) ; com.google.gerrit.server.config.ConfigUtil.storeSection ( defaultPrefs.getConfig ( ) , UserConfigSections.EDIT , null , input , com.google.gerrit.extensions.client.EditPreferencesInfo.defaults ( ) ) ; defaultPrefs.commit ( md ) ; return com.google.gerrit.server.account.Preferences.parseEditPreferences ( defaultPrefs.getConfig ( ) , null , null ) ; }
Source:
protected void populateProjects ( ) { Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }

Target:
protected void populateProjects ( ) { Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( ) { @ java.lang.Override public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
private java.lang.String getTokenForScreen ( java.lang.String filter , int skip ) { java.lang.String token = com.google.gerrit.common.PageLinks.ADMIN_PROJECTS ; 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.ADMIN_PROJECTS ; }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify , submoduleOp , dryrun ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify , accountsToNotify , submoduleOp , dryrun ) ; }
Source:
public com.google.gerrit.httpd.raw.ResourceServlet.Resource call ( ) throws java.io.IOException { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( java.nio.file.Files.getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( name ) , java.nio.file.Files.readAllBytes ( p ) ) ; }

Target:
public com.google.gerrit.httpd.raw.ResourceServlet.Resource call ( ) throws java.io.IOException { try { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( java.nio.file.Files.getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( p.toString ( ) ) , java.nio.file.Files.readAllBytes ( p ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { return com.google.gerrit.httpd.raw.ResourceServlet.Resource.NOT_FOUND ; } }
Source:
private static void recursiveDelete ( java.io.File path ) { java.io.File [ ] entries = path.listFiles ( ) ; if ( entries != null ) { for ( java.io.File e : entries ) { com.google.gerrit.pgm.init.BaseInit.recursiveDelete ( e ) ; } } if ( ( ! ( path.delete ( ) ) ) && ( path.exists ( ) ) ) { java.lang.System.err.println ( ( "warn: Cannot remove " + path ) ) ; } }

Target:
public java.nio.file.FileVisitResult visitFileFailed ( java.nio.file.Path f , java.io.IOException e ) { java.lang.System.err.println ( ( msg + f ) ) ; return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
public static void createProject ( com.google.gerrit.acceptance.SshSession s , java.lang.String name ) throws com.jcraft.jsch.JSchException , java.io.IOException { s.exec ( ( ( "gerrit create-project --empty-commit --name \"" + name ) + "\"" ) ) ; }

Target:
public static void createProject ( com.google.gerrit.acceptance.SshSession s , java.lang.String name , com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( "gerrit create-project --empty-commit --name \"" ) ; b.append ( name ) ; b.append ( "\"" ) ; if ( parent != null ) { b.append ( " --parent \"" ) ; b.append ( parent.get ( ) ) ; b.append ( "\"" ) ; } s.exec ( b.toString ( ) ) ; }