auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void visit ( org.pegdown.ast.HeaderNode node ) { java.lang.String tag = "h" + ( node.getLevel ( ) ) ; html.open ( tag ) ; java.lang.String id = toc.idFromHeader ( node ) ; if ( id != null ) { html.attribute ( "id" , id ) ; } visitChildren ( node ) ; html.close ( tag ) ; }

Target:
public void visit ( com.google.gitiles.doc.NamedAnchorNode node ) { if ( outputNamedAnchor ) { html.open ( "a" ) . attribute ( "name" , node.name ) . close ( "a" ) ; } }
Source:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setBoolean ( "sshd" , null , "testUseInsecureRandom" , true ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; cfg.setInt ( "sshd" , null , "threads" , 1 ) ; cfg.setInt ( "sshd" , null , "commandStartThreads" , 1 ) ; cfg.setInt ( "receive" , null , "threadPoolSize" , 1 ) ; cfg.setInt ( "index" , null , "threads" , 1 ) ; }

Target:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setBoolean ( "sshd" , null , "testUseInsecureRandom" , true ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , true ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; cfg.setInt ( "sshd" , null , "threads" , 1 ) ; cfg.setInt ( "sshd" , null , "commandStartThreads" , 1 ) ; cfg.setInt ( "receive" , null , "threadPoolSize" , 1 ) ; cfg.setInt ( "index" , null , "threads" , 1 ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . annotatedWith ( com.google.gerrit.server.config.GitUploadPackGroups.class ) . toProvider ( com.google.gerrit.server.config.GitUploadPackGroupsProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . annotatedWith ( com.google.gerrit.server.config.GitReceivePackGroups.class ) . toProvider ( com.google.gerrit.server.config.GitReceivePackGroupsProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; factory ( ChangeControl.AssistedFactory.class ) ; factory ( ProjectControl.AssistedFactory.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . annotatedWith ( com.google.gerrit.server.config.GitUploadPackGroups.class ) . toProvider ( com.google.gerrit.server.config.GitUploadPackGroupsProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . annotatedWith ( com.google.gerrit.server.config.GitReceivePackGroups.class ) . toProvider ( com.google.gerrit.server.config.GitReceivePackGroupsProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ChangeControl.Factory.class ) ; factory ( ProjectControl.AssistedFactory.class ) ; }
Source:
private java.util.List < java.security.PublicKey > myHostKeys ( ) { final org.apache.sshd.common.KeyPairProvider p = getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < > ( 2 ) ; com.google.gerrit.sshd.SshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.SshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }

Target:
private java.util.List < java.security.PublicKey > myHostKeys ( ) { final org.apache.sshd.common.keyprovider.KeyPairProvider p = getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < > ( 2 ) ; com.google.gerrit.sshd.SshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.SshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }
Source:
public void byUsername ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.AccountInfo user1 = newAccount ( "myuser" ) ; assertQuery ( "notexisting" ) ; assertQuery ( "Not Existing" ) ; assertQuery ( user1.username , user1 ) ; assertQuery ( ( "username:" + ( user1.username ) ) , user1 ) ; }

Target:
public void byUsername ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.AccountInfo user1 = newAccount ( "myuser" ) ; assertQuery ( "notexisting" ) ; assertQuery ( "Not Existing" ) ; assertQuery ( user1.username , user1 ) ; assertQuery ( ( "username:" + ( user1.username ) ) , user1 ) ; assertQuery ( ( "username:" + ( user1.username.toUpperCase ( ) ) ) , user1 ) ; }
Source:
public com.google.gson.JsonElement serialize ( final org.eclipse.jgit.diff.Edit src , final java.lang.reflect.Type typeOfSrc , final com.google.gson.JsonSerializationContext context ) { if ( src == null ) { return new com.google.gson.JsonNull ( ) ; } final com.google.gson.JsonArray a = new com.google.gson.JsonArray ( ) ; add ( a , src ) ; if ( src instanceof org.eclipse.jgit.diff.ReplaceEdit ) { for ( org.eclipse.jgit.diff.Edit e : ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( src ) ) . getInternalEdits ( ) ) { add ( a , e ) ; } } return a ; }

Target:
public com.google.gson.JsonElement serialize ( final com.google.gerrit.prettify.common.LineEdit src , final java.lang.reflect.Type typeOfSrc , final com.google.gson.JsonSerializationContext context ) { if ( src == null ) { return new com.google.gson.JsonNull ( ) ; } final com.google.gson.JsonArray a = new com.google.gson.JsonArray ( ) ; add ( a , src ) ; if ( ( src.getEdits ( ) ) != null ) { for ( com.google.gerrit.prettify.common.BaseEdit e : src.getEdits ( ) ) { add ( a , e ) ; } } return a ; }
Source:
public static void load ( java.util.List < java.lang.String > plugins , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > callback ) { if ( ( plugins == null ) || ( plugins.isEmpty ( ) ) ) { callback.onSuccess ( com.google.gerrit.client.VoidResult.create ( ) ) ; } else { com.google.gerrit.client.api.PluginLoader.self = new com.google.gerrit.client.api.PluginLoader ( callback ) ; com.google.gerrit.client.api.PluginLoader.self.load ( plugins ) ; com.google.gerrit.client.api.PluginLoader.self.startTimers ( ) ; com.google.gerrit.client.api.PluginLoader.self.center ( ) ; } }

Target:
public static void load ( java.util.List < java.lang.String > plugins , int loadTimeout , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > callback ) { if ( ( plugins == null ) || ( plugins.isEmpty ( ) ) ) { callback.onSuccess ( com.google.gerrit.client.VoidResult.create ( ) ) ; } else { com.google.gerrit.client.api.PluginLoader.self = new com.google.gerrit.client.api.PluginLoader ( loadTimeout , callback ) ; com.google.gerrit.client.api.PluginLoader.self.load ( plugins ) ; com.google.gerrit.client.api.PluginLoader.self.startTimers ( ) ; com.google.gerrit.client.api.PluginLoader.self.center ( ) ; } }
Source:
public void groupCannotBeRenamedToNameOfAnotherGroup ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anotherGroupUuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "admins-ABC" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherGroupName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; createGroup ( anotherGroupUuid , anotherGroupName ) ; expectedException.expect ( com.google.gwtorm.server.OrmDuplicateKeyException.class ) ; expectedException.expectMessage ( anotherGroupName.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.loadForRename ( repo , groupUuid , groupName , anotherGroupName ) ; }

Target:
public void groupCannotBeRenamedToNameOfAnotherGroup ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anotherGroupUuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "admins-ABC" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherGroupName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; createGroup ( anotherGroupUuid , anotherGroupName ) ; expectedException.expect ( com.google.gwtorm.server.OrmDuplicateKeyException.class ) ; expectedException.expectMessage ( anotherGroupName.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.forRename ( repo , groupUuid , groupName , anotherGroupName ) ; }
Source:
private void fill ( com.google.gerrit.reviewdb.client.Account account , boolean detailed ) { name = account.getFullName ( ) ; if ( detailed ) { _account_id = account.getId ( ) . get ( ) ; email = account.getPreferredEmail ( ) ; username = account.getUserName ( ) ; } }

Target:
private void fill ( com.google.gerrit.reviewdb.client.Account account , boolean detailed ) { name = com.google.common.base.Strings.emptyToNull ( account.getFullName ( ) ) ; if ( ( name ) == null ) { name = account.getUserName ( ) ; } if ( detailed ) { _account_id = account.getId ( ) . get ( ) ; email = account.getPreferredEmail ( ) ; username = account.getUserName ( ) ; } }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }
Source:
public void abandonWipChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
Source:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) . isEmpty ( ) ) ; }

Target:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > projectInfoList = com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) ; org.junit.Assert.assertTrue ( ( ( projectInfoList.size ( ) ) == 1 ) ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; java.sql.Timestamp ts = com.google.gerrit.server.util.TimeUtil.nowTs ( ) ; md.getCommitBuilder ( ) . setAuthor ( new org.eclipse.jgit.lib.PersonIdent ( "Example User" , "user@example.com" , ts , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; md.getCommitBuilder ( ) . setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( "Gerrit Test" , "notthis@email.com" , ts , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { return new com.google.gerrit.server.notedb.ChangeUpdate ( repoManager , accountCache , com.google.gerrit.server.notedb.ChangeNotesTest.LABEL_TYPES , c , account , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ; }
Source:
private < K , V > java.util.Map < K , V > limitToValidPatchSets ( java.util.Map < K , V > in , final com.google.common.base.Function < K , com.google.gerrit.reviewdb.client.PatchSet.Id > func ) { final com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrent = upToCurrentPredicate ( ) ; return com.google.common.collect.Maps.filterKeys ( in , new com.google.common.base.Predicate < K > ( ) { @ java.lang.Override public boolean apply ( K in ) { com.google.gerrit.reviewdb.client.PatchSet.Id psId = func.apply ( in ) ; return ( upToCurrent.apply ( psId ) ) && ( patchSets.containsKey ( psId ) ) ; } } ) ; }

Target:
private com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > validPatchSetPredicate ( ) { final com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrent = upToCurrentPredicate ( ) ; return new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet.Id in ) { return ( upToCurrent.apply ( in ) ) && ( patchSets.containsKey ( in ) ) ; } } ; }
Source:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }

Target:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key2 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithExpiration ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }
Source:
public void onCreateGroup ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newGroupName ) { updateGroupList ( null , newGroupName ) ; }

Target:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { if ( oldName != null ) { byName.invalidate ( oldName.get ( ) ) ; } if ( newName != null ) { byName.invalidate ( newName.get ( ) ) ; } }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin = loginProvider.get ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; if ( ! ( hubLogin.isLoggedIn ( ) ) ) { hubLogin.login ( request , response , authScopes ) ; return ; } else { chain.doFilter ( request , response ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin = loginProvider.get ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; LOG.debug ( ( "GitHub login: " + hubLogin ) ) ; if ( ! ( hubLogin.isLoggedIn ( ) ) ) { hubLogin.login ( request , response , authScopes ) ; return ; } else { chain.doFilter ( request , response ) ; } }
Source:
public void testTransitionToUnhealthy ( ) throws java.io.IOException { assertIsHealthy ( ) ; javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( currentUserProviderMock.get ( ) ) . thenReturn ( currentUserMock ) ; org.mockito.Mockito.when ( currentUserMock.getCapabilities ( ) ) . thenReturn ( capabilityControlMock ) ; org.mockito.Mockito.when ( capabilityControlMock.canAdministrateServer ( ) ) . thenReturn ( true ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( currentUserProviderMock , tempFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.SideBySide2.Direction dir ) { switch ( dir ) { case PREV : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasPrev ? prev : up ) . go ( ) ; } } ; case NEXT : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasNext ? next : up ) . go ( ) ; } } ; default : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { } } ; } }

Target:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasPrev ? prev : up ) . go ( ) ; } } ; case NEXT : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasNext ? next : up ) . go ( ) ; } } ; default : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { } } ; } }
Source:
protected void configure ( ) { its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; addStandardCommentFactory = createMock ( AddStandardComment.Factory.class ) ; bind ( AddStandardComment.Factory.class ) . toInstance ( addStandardCommentFactory ) ; }

Target:
protected void configure ( ) { its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; addStandardCommentFactory = createMock ( AddStandardComment.Factory.class ) ; bind ( AddStandardComment.Factory.class ) . toInstance ( addStandardCommentFactory ) ; addVelocityCommentFactory = createMock ( AddVelocityComment.Factory.class ) ; bind ( AddVelocityComment.Factory.class ) . toInstance ( addVelocityCommentFactory ) ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.sshd.SshKeyCacheImpl.Username , com.google.gerrit.sshd.SshKeyCacheImpl.EntryList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.sshd.SshKeyCacheImpl.Username , com.google.gerrit.sshd.SshKeyCacheImpl.EntryList > > ( ) { } ; core ( type , com.google.gerrit.sshd.SshKeyCacheImpl.CACHE_NAME ) . populateWith ( com.google.gerrit.sshd.SshKeyCacheImpl.Loader.class ) ; bind ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; bind ( com.google.gerrit.server.ssh.SshKeyCache.class ) . to ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.sshd.SshKeyCacheImpl.Username , com.google.gerrit.sshd.SshKeyCacheImpl.EntryList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.sshd.SshKeyCacheImpl.Username , com.google.gerrit.sshd.SshKeyCacheImpl.EntryList > > ( ) { } ; cache ( type , com.google.gerrit.sshd.SshKeyCacheImpl.CACHE_NAME ) . populateWith ( com.google.gerrit.sshd.SshKeyCacheImpl.Loader.class ) ; bind ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; bind ( com.google.gerrit.server.ssh.SshKeyCache.class ) . to ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; }
Source:
private void renderActionTextDate ( com.google.gerrit.client.changes.ChangeInfo info ) { java.lang.String action ; if ( info.created ( ) . equals ( info.updated ( ) ) ) { action = Util.C.changeInfoBlockUploaded ( ) ; } else { action = Util.C.changeInfoBlockUpdated ( ) ; } actionText.setInnerText ( action ) ; actionDate.setInnerText ( com.google.gerrit.client.FormatUtil.relativeFormat ( info.updated ( ) ) ) ; }

Target:
private void renderActionTextDate ( com.google.gerrit.client.info.ChangeInfo info ) { java.lang.String action ; if ( info.created ( ) . equals ( info.updated ( ) ) ) { action = Util.C.changeInfoBlockUploaded ( ) ; } else { action = Util.C.changeInfoBlockUpdated ( ) ; } actionText.setInnerText ( action ) ; actionDate.setInnerText ( com.google.gerrit.client.FormatUtil.relativeFormat ( info.updated ( ) ) ) ; }
Source:
protected void insert ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . cPROJECT ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setText ( row , 1 , k.name ( ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
protected void configure ( ) { try { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( true ) ; bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( gs ) ; bind ( com.google.gerrit.server.ContactStore.class ) . toInstance ( com.google.gerrit.server.EncryptedContactStore.create ( gs ) ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . to ( com.google.gerrit.server.MimeUtilFileTypeRegistry.class ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } }

Target:
private static com.google.inject.Module createDatabaseModule ( ) { return new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { try { bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( com.google.gerrit.server.GerritServer.getInstance ( true ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } bind ( com.google.gerrit.server.ContactStore.class ) . toProvider ( com.google.gerrit.server.EncryptedContactStoreProvider.class ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . to ( com.google.gerrit.server.MimeUtilFileTypeRegistry.class ) ; } } ; }
Source:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; try ( com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ) { schemaCreator.create ( c ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; try ( com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ) { singleVersionListener.start ( ) ; schemaCreator.create ( c ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } finally { singleVersionListener.stop ( ) ; } } return this ; }
Source:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminHighPriorityCommand ( ) ) && ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }

Target:
private boolean isAdminHighPriorityCommand ( ) { if ( ( getClass ( ) . getAnnotation ( com.google.gerrit.sshd.AdminHighPriorityCommand.class ) ) != null ) { try { permissionBackend.user ( user ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } } return false ; }
Source:
void edit ( com.google.gerrit.common.data.ProjectAccess access ) { driver.edit ( access ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( commitTools , ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ; }

Target:
void edit ( com.google.gerrit.common.data.ProjectAccess access ) { this . access = access ; final boolean editing = ! ( edit.isEnabled ( ) ) ; accessEditor.setEditing ( editing ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( editTools , ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ; cancel.setVisible ( editing ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( commitTools , editing ) ; driver.edit ( access ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) 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 ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) 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 ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { dispatcher.fireEvent ( change , event , db ) ; }

Target:
private com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > patchSetAttributeSupplier ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } } } ) ; }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; HEAD ( ( ( com.google.gerrit.httpd.revision ) ( modules.add ( new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.RestModule ( ) ) ) ) ) ; modules.add ( new com.google.gerrit.common.EventBroker.Module ( ) ) ; modules.add ( new com.google.gerrit.server.schema.H2AccountPatchReviewStore.Module ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.git.GitRepositoryManagerModule.class ) ) ; modules.add ( new com.google.gerrit.server.events.StreamEventsApiListener.Module ( ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , false , false , false ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( resource.getControl ( ) . getProjectControl ( ) . canUpload ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( ( ( resource.getControl ( ) . getProjectControl ( ) . canUpload ( ) ) && ( resource.isCurrent ( ) ) ) ) ; }
Source:
private void toggleCurrentRow ( ) { final com.google.gwt.user.client.ui.CheckBox cb = ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( getCurrentRow ( ) , 1 ) ) ) ; if ( cb != null ) { cb.setChecked ( ( ! ( cb.isChecked ( ) ) ) ) ; } }

Target:
private void toggleCurrentRow ( ) { final com.google.gwt.user.client.ui.CheckBox cb = ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( getCurrentRow ( ) , 1 ) ) ) ; if ( cb != null ) { cb.setValue ( ( ! ( cb.getValue ( ) ) ) ) ; } }
Source:
public void noCopyMinScoreOnRework ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }

Target:
public void noCopyMinScoreOnRework ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.FileSystemView getNormalizedView ( ) { return this ; } } ; }

Target:
public java.lang.Iterable < java.nio.file.FileStore > getFileStores ( ) { return null ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( com.google.gerrit.server.patch.PatchListKey.eq ( oldId , k.oldId ) ) && ( com.google.gerrit.server.patch.PatchListKey.eq ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public org.eclipse.jgit.lib.ObjectId getOldId ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } return oldId ; }
Source:
public void addPatchSetComments ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.PatchLineComment > patchLineComments ) { for ( com.google.gerrit.reviewdb.PatchLineComment comment : patchLineComments ) { if ( ( comment.getKey ( ) . getParentKey ( ) . getParentKey ( ) . get ( ) ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < com.google.gerrit.server.events.PatchSetCommentAttribute > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }

Target:
public void addPatchSetComments ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > patchLineComments ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment comment : patchLineComments ) { if ( ( comment.getKey ( ) . getParentKey ( ) . getParentKey ( ) . get ( ) ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < com.google.gerrit.server.events.PatchSetCommentAttribute > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }
Source:
private void configureMainSection ( ) { ui.header ( "Main section" ) ; java.lang.String sharedDir = promptAndSetString ( "Shared directory" , com.ericsson.gerrit.plugins.highavailability.MAIN_SECTION , com.ericsson.gerrit.plugins.highavailability.SHARED_DIRECTORY_KEY , null ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( sharedDir ) ) ) { java.nio.file.Path shared = site.site_path.resolve ( sharedDir ) ; com.google.gerrit.common.FileUtil.mkdirsOrDie ( shared , ( "cannot create " + shared ) ) ; } }

Target:
private void configureMainSection ( ) { ui.header ( "Main section" ) ; java.lang.String sharedDirDefault = ( ui.isBatch ( ) ) ? com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_SHARED_DIRECTORY : null ; java.lang.String shared = promptAndSetString ( "Shared directory" , com.ericsson.gerrit.plugins.highavailability.Configuration.MAIN_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY_KEY , sharedDirDefault ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( shared ) ) ) { java.nio.file.Path resolved = site.site_path.resolve ( java.nio.file.Paths.get ( shared ) ) ; com.google.gerrit.common.FileUtil.mkdirsOrDie ( resolved , ( "cannot create " + resolved ) ) ; } }
Source:
public com.google.common.collect.ImmutableMap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( ) { if ( ( patchSets ) == null ) { patchSets = com.google.common.collect.ImmutableMap.copyOf ( com.google.common.collect.Maps.transformValues ( state.patchSets ( ) , PatchSet :: new ) ) ; } return patchSets ; }

Target:
public com.google.common.collect.ImmutableSortedMap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( ) { if ( ( patchSets ) == null ) { com.google.common.collect.ImmutableSortedMap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > b = com.google.common.collect.ImmutableSortedMap.orderedBy ( java.util.Comparator.comparing ( com.google.gerrit.reviewdb.client.PatchSet.Id :: get ) ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > e : state.patchSets ( ) ) { b.put ( e.getKey ( ) , new com.google.gerrit.reviewdb.client.PatchSet ( e.getValue ( ) ) ) ; } patchSets = b.build ( ) ; } return patchSets ; }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher , database ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher , database , notesFactory ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
public void hostIndexOneComponentPrefix ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . setRepositoryPrefix ( "foo" ) . build ( ) ; org.junit.Assert.assertEquals ( "/b/foo/" , view.toUrl ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "host" , "url" , "/b/?format=HTML" ) , com.google.common.collect.ImmutableMap.of ( "text" , "foo" , "url" , "/b/foo/" ) ) , view.getBreadcrumbs ( ) ) ; }

Target:
public void hostIndexOneComponentPrefix ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . setRepositoryPrefix ( "foo" ) . build ( ) ; com.google.common.truth.Truth.assertThat ( view.toUrl ( ) ) . isEqualTo ( "/b/foo/" ) ; com.google.common.truth.Truth.assertThat ( view.getBreadcrumbs ( ) ) . containsExactly ( com.google.gitiles.GitilesViewTest.breadcrumb ( "host" , "/b/?format=HTML" ) , com.google.gitiles.GitilesViewTest.breadcrumb ( "foo" , "/b/foo/" ) ) . inOrder ( ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isWildProject ( ) ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }
Source:
public Account.Id lookup ( java.lang.String accountName ) { if ( com.google.common.base.Strings.isNullOrEmpty ( accountName ) ) { return null ; } try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orNull ( ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }

Target:
public Account.Id lookup ( java.lang.String accountName ) { if ( com.google.common.base.Strings.isNullOrEmpty ( accountName ) ) { return null ; } try { java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orElse ( null ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }
Source:
public void customConflictMessageWitTopicTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "i am ${topic}" , topic ) ; java.lang.String conflictMessage = "i am testtopic" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "i am testtopic" , "i am testtopic" , "i am testtopic" ) ; }

Target:
public void customConflictMessageWitTopicTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "i am ${topic}" , topic ) ; java.lang.String conflictMessage = "i am testtopic" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( conflictMessage , conflictMessage , conflictMessage ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; try { db = java.sql.DriverManager.getConnection ( url , user , pass ) ; } catch ( java.lang.Throwable t ) { org.junit.Assume.assumeNoException ( t ) ; } executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE bar" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }

Target:
public void tearDown ( ) { drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE bar" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; if ( ( executor ) != null ) { executor.close ( ) ; } executor = null ; if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }
Source:
private static void collectEmail ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String email , java.lang.String file , int lineNumber ) { if ( ! ( email.equals ( "*" ) ) ) { if ( ( map.get ( email ) ) == null ) { map.put ( email , new java.util.HashSet < > ( ) ) ; } map.get ( email ) . add ( ( ( file + ":" ) + lineNumber ) ) ; } }

Target:
private static void collectEmail ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String email , java.lang.String file , int lineNumber ) { if ( ! ( email.equals ( "*" ) ) ) { map.computeIfAbsent ( email , ( java.lang.String k ) -> new java.util.HashSet < > ( ) ) ; map.get ( email ) . add ( ( ( file + ":" ) + lineNumber ) ) ; } }
Source:
public static void query ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } call.send ( callback ) ; }

Target:
public static void query ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; call.send ( callback ) ; }