auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }
Source:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"OLD-SCHOOL\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" ) + "Section</h1>" ) ) ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( ( "<a class=\"h\" name=\"OLD-SCHOOL\" href=\"#OLD-SCHOOL\"><span></span></a>" + "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" ) + "Other</h1>" ) ) ) ; }

Target:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"OLD-SCHOOL\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "Section</h1>" ) ) ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( ( "<a class=\"h\" name=\"OLD-SCHOOL\" href=\"#OLD-SCHOOL\"><span></span></a>" + "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" ) + "Other</h1>" ) ) ) ; }
Source:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Project.NameKey name ) { try { return repoManager.openRepository ( name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }

Target:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.client.Project.NameKey name ) { try { return repoManager.openRepository ( name ) ; } catch ( java.io.IOException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }
Source:
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 ( ) ; 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.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 , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; if ( ! ( slave ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } 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 , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; if ( ! ( slave ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( sysInjector ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.account.AccountResolver.class ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( GroupControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.account.AccountResolver.class ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( GroupControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE , ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE , ( 20 << 20 ) ) ; try ( java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ) { bin.writeTo ( gz ) ; } return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }
Source:
public com.google.gerrit.client.admin.AccountGroupDetail run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.rpc.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; final com.google.gerrit.client.admin.AccountGroupDetail d = new com.google.gerrit.client.admin.AccountGroupDetail ( ) ; final boolean auto = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . isAutoGroup ( group.getId ( ) ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , group , auto ) ; return d ; }

Target:
public com.google.gerrit.client.admin.AccountGroupDetail run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.rpc.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; final com.google.gerrit.client.admin.AccountGroupDetail d = new com.google.gerrit.client.admin.AccountGroupDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , group ) ; return d ; }
Source:
public boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } else { return getRefControl ( ) . canForceEditTopicName ( ) ; } }

Target:
public boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }
Source:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , com.google.gerrit.sshd.DispatchCommand cmd ) { final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; auditService.dispatch ( new com.google.gerrit.audit.SshAuditEvent ( sid , extractCurrentUser ( ctx ) , extractWhat ( cmd ) , created , extractParameters ( cmd ) , result ) ) ; }

Target:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , com.google.gerrit.sshd.DispatchCommand cmd ) { audit ( ctx , result , extractWhat ( cmd ) , extractParameters ( cmd ) ) ; }
Source:
public void testNameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = com.google.gerrit.server.query.FieldPredicateTest.f ( name , value ) ; org.junit.Assert.assertSame ( name , f.getOperator ( ) ) ; org.junit.Assert.assertSame ( value , f.getValue ( ) ) ; org.junit.Assert.assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }

Target:
public void testNameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = f ( name , value ) ; org.junit.Assert.assertSame ( name , f.getOperator ( ) ) ; org.junit.Assert.assertSame ( value , f.getValue ( ) ) ; org.junit.Assert.assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignOut ( ) ; } }

Target:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignOut ( ) ; } }
Source:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "enabled" ) ) . toInstance ( new com.googlesource.gerrit.plugins.its.base.its.ItsHookEnabledConfigEntry ( pluginName , pluginCfgFactory ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) . in ( Scopes.SINGLETON ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
protected byte [ ] readFile ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return new byte [ ] { } ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ; if ( tw != null ) { org.eclipse.jgit.lib.ObjectLoader obj = reader.open ( tw.getObjectId ( 0 ) , Constants.OBJ_BLOB ) ; return obj.getCachedBytes ( java.lang.Integer.MAX_VALUE ) ; } return new byte [ ] { } ; }

Target:
protected byte [ ] readFile ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return new byte [ ] { } ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ) { if ( tw != null ) { org.eclipse.jgit.lib.ObjectLoader obj = reader.open ( tw.getObjectId ( 0 ) , Constants.OBJ_BLOB ) ; return obj.getCachedBytes ( java.lang.Integer.MAX_VALUE ) ; } } return new byte [ ] { } ; }
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 ( authScopes ) ) ) { 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 ) ) ) ; if ( ! ( hubLogin.isLoggedIn ( ) ) ) { hubLogin.login ( request , response , authScopes ) ; return ; } else { chain.doFilter ( request , response ) ; } }
Source:
public com.google.gerrit.client.reviewdb.Account getAccount ( ) { if ( ( account ) == null ) { account = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( getAccountId ( ) ) ; } return account ; }

Target:
public com.google.gerrit.client.reviewdb.Account getAccount ( ) { if ( ( account ) == null ) { account = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( getAccountId ( ) ) ; if ( ( account ) == null ) { account = new com.google.gerrit.client.reviewdb.Account ( getAccountId ( ) ) ; } } return account ; }
Source:
protected void bccWatchesNotifyAllComments ( ) throws javax.mail.MessagingException { if ( ( db ) != null ) { try { final com.google.gerrit.client.reviewdb.Project project = getProject ( ) ; if ( project != null ) { for ( com.google.gerrit.client.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( project.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.client.reviewdb.Project project = getProject ( ) ; if ( project != null ) { for ( com.google.gerrit.client.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( project.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException { java.lang.String cmd = "UPDATE changes SET status = 'n' WHERE status = 's';" ; ui.message ( ( "Running " + cmd ) ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { e.execute ( cmd ) ; } ui.message ( "done" ) ; }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException { try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { e.execute ( "UPDATE changes SET status = 'n' WHERE status = 's';" ) ; } }
Source:
public static void logEventListenerError ( java.lang.Object listener , java.lang.Exception error ) { if ( com.google.gerrit.server.extensions.events.EventUtil.log.isDebugEnabled ( ) ) { com.google.gerrit.server.extensions.events.EventUtil.log.debug ( java.lang.String.format ( "Error in event listener %s" , listener.getClass ( ) . getName ( ) , error ) ) ; } else { com.google.gerrit.server.extensions.events.EventUtil.log.warn ( "Error in listener {}: {}" , listener.getClass ( ) . getName ( ) , error.getMessage ( ) ) ; } }

Target:
public static void logEventListenerError ( java.lang.Object listener , java.lang.Exception error ) { if ( com.google.gerrit.server.extensions.events.EventUtil.log.isDebugEnabled ( ) ) { com.google.gerrit.server.extensions.events.EventUtil.log.debug ( java.lang.String.format ( "Error in event listener %s" , listener.getClass ( ) . getName ( ) ) , error ) ; } else { com.google.gerrit.server.extensions.events.EventUtil.log.warn ( "Error in listener {}: {}" , listener.getClass ( ) . getName ( ) , error.getMessage ( ) ) ; } }
Source:
protected void configure ( ) { cache ( ExternalIdCacheImpl.CACHE_NAME , org.eclipse.jgit.lib.ObjectId.class , new com.google.inject.TypeLiteral < com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.externalids.ExternalId > > ( ) { } ) . maximumWeight ( 1 ) . loader ( com.google.gerrit.server.account.externalids.ExternalIdCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.account.externalids.ExternalIdCacheImpl.class ) ; bind ( com.google.gerrit.server.account.externalids.ExternalIdCache.class ) . to ( com.google.gerrit.server.account.externalids.ExternalIdCacheImpl.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.account.externalids.ExternalIdCacheImpl.class ) ; bind ( com.google.gerrit.server.account.externalids.ExternalIdCache.class ) . to ( com.google.gerrit.server.account.externalids.ExternalIdCacheImpl.class ) ; }
Source:
public void testGcOneProject ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( HttpStatus.SC_OK , POST ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) ) ; gcAssert.assertHasPackFile ( allProjects ) ; gcAssert.assertHasNoPackFile ( project , project2 ) ; }

Target:
public void testGcOneProject ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( POST ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/gc" ) ) ) . isEqualTo ( HttpStatus.SC_OK ) ; gcAssert.assertHasPackFile ( allProjects ) ; gcAssert.assertHasNoPackFile ( project , project2 ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < com.google.gwtorm.data.PhoneBookDb > ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < com.google.gwtorm.data.PhoneBookDb > ( ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( o == null ) || ( ! ( o instanceof com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry ) ) ) { return false ; } com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry other = ( ( com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry ) ( o ) ) ; if ( ( ( this . filter ) != ( other.filter ) ) || ( ( this . reviewer ) != ( other.reviewer ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( o == null ) || ( ! ( o instanceof com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry ) ) ) { return false ; } com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry other = ( ( com.googlesource.gerrit.plugins.reviewers.client.ReviewersScreen.ReviewerEntry ) ( o ) ) ; if ( ( ! ( this . filter.equals ( other.filter ) ) ) || ( ! ( this . reviewer.equals ( other.reviewer ) ) ) ) { return false ; } return true ; }
Source:
public void queryOne ( ) throws java.sql.SQLException { java.sql.Connection conn = null ; java.sql.Statement stat = null ; try { conn = ds.getConnection ( ) ; stat = conn.createStatement ( ) ; stat.executeQuery ( ( ( "SELECT * FROM " + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME ) ) + " LIMIT 1" ) ) ; } finally { closeStatement ( stat ) ; closeConnection ( conn ) ; } }

Target:
public void queryOne ( ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { stat.executeQuery ( ( ( "SELECT * FROM " + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME ) ) + " LIMIT 1" ) ) ; } }
Source:
private static int getInt ( org.eclipse.jgit.transport.RemoteConfig rc , org.eclipse.jgit.lib.Config cfg , java.lang.String name , int defValue ) { BRANCH ( 7 ) ; com.googlesource.gerrit.plugins.replication.b1df7 Fix ; com.googlesource.gerrit.plugins.replication.nits in ; of ( replication.maxRetries ) ; return cfg.getInt ( "remote" , rc.getName ( ) , name , defValue ) ; }

Target:
private static int getInt ( org.eclipse.jgit.transport.RemoteConfig rc , org.eclipse.jgit.lib.Config cfg , java.lang.String name , int defValue ) { return cfg.getInt ( "remote" , rc.getName ( ) , name , defValue ) ; }
Source:
public boolean isPatchVisible ( com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ps.isDraft ( ) ) && ( ! ( isDraftVisible ( db , null ) ) ) ) { return false ; } return isVisible ( db ) ; }

Target:
public boolean isPatchVisible ( com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ( ps != null ) && ( ps.isDraft ( ) ) ) && ( ! ( isDraftVisible ( db , null ) ) ) ) { return false ; } return isVisible ( db ) ; }
Source:
public void testGetUser ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . user ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.USER_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.USER ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . user ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.USER ) ; }

Target:
public void testGetUser ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . user ( ) ) . isEmpty ( ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.USER_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.USER ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . user ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.USER ) ; }
Source:
void onSaveSuccess ( final com.google.gerrit.reviewdb.Account result ) { final com.google.gerrit.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; me.setSshUserName ( result.getSshUserName ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }

Target:
void onSaveSuccess ( final com.google.gerrit.reviewdb.Account result ) { final com.google.gerrit.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; BRANCH ( a06f4d ) ; AbstractSubmit : Test = $missing$ ; com.google.gerrit.acceptance.git.submit whole ; on ( projects ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }
Source:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }

Target:
private boolean stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } return ! ( unload.isEmpty ( ) ) ; }
Source:
protected org.eclipse.jgit.lib.ObjectId getObjectId ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return null ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ; if ( tw != null ) { return tw.getObjectId ( 0 ) ; } return null ; }

Target:
protected org.eclipse.jgit.lib.ObjectId getObjectId ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return null ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ) { if ( tw != null ) { return tw.getObjectId ( 0 ) ; } } return null ; }
Source:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.exceptions.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getProject ( ) . getNameKey ( ) , config.getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }

Target:
public Project.NameKey getNameKey ( ) { return getProject ( ) . getNameKey ( ) ; }
Source:
private static com.google.gerrit.server.project.ListBranches.BranchInfo createBranchInfo ( org.eclipse.jgit.lib.Ref ref , com.google.gerrit.server.project.RefControl refControl , java.util.Set < java.lang.String > targets ) { com.google.gerrit.server.project.ListBranches.BranchInfo b = new com.google.gerrit.server.project.ListBranches.BranchInfo ( ) ; b.ref = ref.getName ( ) ; if ( ( ref.getObjectId ( ) ) != null ) { b.revision = ref.getObjectId ( ) . name ( ) ; } b.setCanDelete ( ( ( ! ( targets.contains ( ref.getName ( ) ) ) ) && ( refControl.canDelete ( ) ) ) ) ; return b ; }

Target:
private static com.google.gerrit.server.project.ListBranches.BranchInfo createBranchInfo ( org.eclipse.jgit.lib.Ref ref , com.google.gerrit.server.project.RefControl refControl , java.util.Set < java.lang.String > targets ) { return new com.google.gerrit.server.project.ListBranches.BranchInfo ( ref.getName ( ) , ( ( ref.getObjectId ( ) ) != null ? ref.getObjectId ( ) . name ( ) : null ) , ( ( ! ( targets.contains ( ref.getName ( ) ) ) ) && ( refControl.canDelete ( ) ) ) ) ; }
Source:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; bind ( CapabilityControl.Factory.class ) . toProvider ( com.google.inject.assistedinject.FactoryProvider.newFactory ( CapabilityControl.Factory.class , com.google.gerrit.server.account.CapabilityControl.class ) ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . toInstance ( projectCache ) ; }

Target:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; factory ( CapabilityControl.Factory.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . toInstance ( projectCache ) ; }
Source:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( null , change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }

Target:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( null , change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , null ) ; }
Source:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutDescription.Input in = new com.google.gerrit.server.group.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( rsrc , in ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group description" , e ) ; } }

Target:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutDescription.Input in = new com.google.gerrit.server.group.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( rsrc , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group description" , e ) ; } }
Source:
private void onPatchSetCreated ( final com.google.gerrit.server.events.PatchSetCreatedEvent event ) { com.google.gerrit.server.data.ChangeAttribute change = event.change.get ( ) ; if ( atomicityHelper.isAtomicReview ( change ) ) { processNewAtomicPatchSet ( change ) ; } try { autoSubmitIfMergeable ( change ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException | com.google.gerrit.server.update.UpdateException e ) { com.criteo.gerrit.plugins.automerge.AutomaticMerger.log.error ( ( "An exception occured while trying to merge change #" + ( change.number ) ) , e ) ; } }

Target:
private void onPatchSetCreated ( final com.google.gerrit.server.events.PatchSetCreatedEvent event ) { com.google.gerrit.server.data.ChangeAttribute change = event.change.get ( ) ; if ( atomicityHelper.isAtomicReview ( change ) ) { processNewAtomicPatchSet ( change ) ; } try { autoSubmitIfMergeable ( change ) ; } catch ( java.lang.Exception e ) { com.criteo.gerrit.plugins.automerge.AutomaticMerger.log.error ( ( "An exception occured while trying to merge change #" + ( change.number ) ) , e ) ; } }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { java.lang.String id = cd.getId ( ) . toString ( ) ; try { if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.deleteById ( id ) ; commit ( openIndex ) ; } else { closedIndex.deleteById ( id ) ; commit ( closedIndex ) ; } } catch ( org.apache.solr.client.solrj.SolrServerException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { java.lang.String id = cd.getId ( ) . toString ( ) ; try { if ( cd.change ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.deleteById ( id ) ; commit ( openIndex ) ; } else { closedIndex.deleteById ( id ) ; commit ( closedIndex ) ; } } catch ( com.google.gwtorm.server.OrmException | org.apache.solr.client.solrj.SolrServerException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.owners = java.util.Collections.singletonList ( "non-existing-group" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( "/projects/newProject" , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_UNPROCESSABLE_ENTITY , r.getStatusCode ( ) ) ; }

Target:
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.owners = java.util.Collections.singletonList ( "non-existing-group" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( "/projects/newProject" , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_UNPROCESSABLE_ENTITY ) ; }
Source:
public void restoreReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "restore" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void restoreReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "restore" , 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.ALL_COMMENTS ) ; }
Source:
public void testReplaceInOrder ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nReally GWTEXPUI-9918 is better\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(GWTEXPUI-(\\d+))" , "<a href=\"gwtexpui-bug?$2\">$1</a>" ) , new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s+(\\d+))" , "<a href=\"generic-bug?$2\">$1</a>" ) ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"generic-bug?42\">issue 42</a>\n" + "Really <a href=\"gwtexpui-bug?9918\">GWTEXPUI-9918</a> is better\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceInOrder ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nReally GWTEXPUI-9918 is better\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(GWTEXPUI-(\\d+))" , "<a href=\"gwtexpui-bug?$2\">$1</a>" ) , new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s+(\\d+))" , "<a href=\"generic-bug?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( "A\n" + ( ( "<a href=\"generic-bug?42\">issue 42</a>\n" + "Really <a href=\"gwtexpui-bug?9918\">GWTEXPUI-9918</a> is better\n" ) + "B" ) ) , n.asString ( ) ) ; }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public com.google.gerrit.reviewdb.client.Change getChange ( ) { return notes.getChange ( ) ; }
Source:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { setKeyExchangeFactories ( NamedFactory.Utils.setUpTransformedFactories ( true , java.util.Collections.unmodifiableList ( java.util.Arrays.asList ( BuiltinDHFactories.dhg14 , BuiltinDHFactories.dhg1 ) ) , ServerBuilder.DH2KEX ) ) ; org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }

Target:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( ctl.getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
public void testTagHeightWidth ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.openElement ( "img" ) ) ; assertSame ( b , b.setHeight ( 100 ) ) ; assertSame ( b , b.setWidth ( 42 ) ) ; assertSame ( b , b.closeSelf ( ) ) ; assertEquals ( "<img height=\"100\" width=\"42\" />" , b.asString ( ) ) ; }

Target:
public void testTagHeightWidth ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.openElement ( "img" ) ) ; org.junit.Assert.assertSame ( b , b.setHeight ( 100 ) ) ; org.junit.Assert.assertSame ( b , b.setWidth ( 42 ) ) ; org.junit.Assert.assertSame ( b , b.closeSelf ( ) ) ; org.junit.Assert.assertEquals ( "<img height=\"100\" width=\"42\" />" , b.asString ( ) ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
private boolean canCreateCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , boolean admin , boolean owner ) { if ( admin || ( owner && ( ! ( isBlocked ( Permission.CREATE ) ) ) ) ) { return true ; } else if ( canUpdate ( ) ) { return true ; } else if ( isMergedIntoBranchOrTag ( db , repo , commit ) ) { return true ; } return false ; }

Target:
private boolean canCreateCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { if ( canUpdate ( ) ) { return true ; } else if ( isMergedIntoBranchOrTag ( db , repo , commit ) ) { return true ; } return false ; }
Source:
public void testInsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , sqlException ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( insert , 1 ) ; }

Target:
public void testInsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , sqlException ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( insert , 1 ) ; }