auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.googlesource.gerrit.plugins.quota.Module.Holder load ( com.google.gerrit.reviewdb.client.Account.Id key ) throws java.lang.Exception { com.google.gerrit.server.IdentifiedUser user = userFactory.create ( key ) ; com.google.common.base.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit = finder.firstMatching ( AccountLimitsConfig.Type.UPLOADPACK , user ) ; if ( limit.isPresent ( ) ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) ) ; } return com.googlesource.gerrit.plugins.quota.Module.Holder.EMPTY ; }

Target:
public com.googlesource.gerrit.plugins.quota.Module.Holder load ( com.google.gerrit.reviewdb.client.Account.Id key ) throws java.lang.Exception { com.google.gerrit.server.IdentifiedUser user = userFactory.create ( key ) ; java.util.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit = finder.firstMatching ( AccountLimitsConfig.Type.UPLOADPACK , user ) ; if ( limit.isPresent ( ) ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) ) ; } return com.googlesource.gerrit.plugins.quota.Module.Holder.EMPTY ; }
Source:
public void setUserAccountId ( com.google.gerrit.reviewdb.client.Account.Id id ) { key = new com.google.gerrit.httpd.WebSessionManager.Key ( ( "id:" + id ) ) ; val = new com.google.gerrit.httpd.WebSessionManager.Val ( id , 0 , false , null , 0 , null , null ) ; user = null ; }

Target:
public void setUserAccountId ( com.google.gerrit.reviewdb.client.Account.Id id ) { key = new com.google.gerrit.httpd.WebSessionManager.Key ( ( "id:" + id ) ) ; val = new com.google.gerrit.httpd.WebSessionManager.Val ( id , 0 , false , null , 0 , null , null ) ; user = identified.runAs ( id , user ) ; }
Source:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( isEmpty ( ) ) { return false ; } commit.setAuthor ( newIdent ( getUser ( ) . getAccount ( ) , when ) ) ; commit.setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( serverIdent , when ) ) ; commit.setMessage ( java.lang.String.format ( "Comment on patch set %d" , psId.get ( ) ) ) ; return true ; }

Target:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( isEmpty ( ) ) { return false ; } commit.setAuthor ( newIdent ( getUser ( ) . getAccount ( ) , when ) ) ; commit.setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( serverIdent , when ) ) ; commit.setMessage ( "Update draft comments" ) ; return true ; }
Source:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; cache ( ) . remove ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ; } maybeFlush ( ) ; }

Target:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; cache ( ) . remove ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ; } db.flush ( ) ; }
Source:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.common.changes.ListChangesOption.MESSAGES ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }

Target:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }
Source:
private void parseRequest ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws java.io.IOException , java.io.UnsupportedEncodingException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.io.Reader in = new java.io.InputStreamReader ( req.getInputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { try { parseRequest ( call , in ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; call.error = err ; } } finally { in.close ( ) ; } }

Target:
private void parseRequest ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws java.io.IOException , java.io.UnsupportedEncodingException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.io.Reader in = req.getReader ( ) ; try { try { parseRequest ( call , in ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; call.error = err ; } } finally { in.close ( ) ; } }
Source:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } else { return ghLogin.hub.getOrganization ( organisation ) . getRepository ( repoName ) ; } }

Target:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } else { return ghLogin.getHub ( ) . getOrganization ( organisation ) . getRepository ( repoName ) ; } }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.projectKey ) != null ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( com.google.gerrit.client.Gerrit.projectKey , panel ) ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { com.google.gerrit.reviewdb.client.Project.NameKey projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } super . onScreenLoad ( event ) ; }
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 , java.util.List < com.google.gerrit.extensions.common.CommentInfo > > comments ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listComments.apply ( revision ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve comments" , e ) ; } }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column ) { final java.lang.String name = column.getColumnName ( ) ; final java.lang.String t = getTrueLiteralValue ( ) ; final java.lang.String f = getFalseLiteralValue ( ) ; return ( ( ( ( ( ( ( "CHAR(1) NOT NULL DEFAULT " + f ) + " CHECK (" ) + name ) + " IN (" ) + t ) + "," ) + f ) + "))" ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.String name = column.getColumnName ( ) ; final java.lang.String t = getTrueLiteralValue ( ) ; final java.lang.String f = getFalseLiteralValue ( ) ; return ( ( ( ( ( ( ( "CHAR(1) NOT NULL DEFAULT " + f ) + " CHECK (" ) + name ) + " IN (" ) + t ) + "," ) + f ) + "))" ; }
Source:
static java.lang.String basename ( java.lang.String path ) { path = com.google.gitiles.Paths.MATCHER.trimTrailingFrom ( path ) ; int slash = path.lastIndexOf ( '/' ) ; if ( slash < 0 ) { return path ; } return path.substring ( ( slash + 1 ) ) ; }

Target:
static java.lang.String basename ( java.lang.String path ) { path = com.google.gitiles.PathUtil.MATCHER.trimTrailingFrom ( path ) ; int slash = path.lastIndexOf ( '/' ) ; if ( slash < 0 ) { return path ; } return path.substring ( ( slash + 1 ) ) ; }
Source:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) throws java.io.IOException { java.net.InetSocketAddress http = com.google.gerrit.acceptance.GerritServer.newPort ( ) ; java.net.InetSocketAddress sshd = com.google.gerrit.acceptance.GerritServer.newPort ( ) ; java.lang.String url = ( "http://" + ( com.google.gerrit.acceptance.GerritServer.format ( http ) ) ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , com.google.gerrit.acceptance.GerritServer.format ( sshd ) ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; }

Target:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) throws java.io.IOException { 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.setString ( "cache" , null , "directory" , null ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; }
Source:
private static java.lang.String readCSS ( ) { if ( ( com.google.gerrit.server.documentation.MarkdownFormatter.css ) != null ) { return com.google.gerrit.server.documentation.MarkdownFormatter.css ; } try { return com.google.gerrit.server.documentation.MarkdownFormatter.readPegdownCss ( new java.util.concurrent.atomic.AtomicBoolean ( ) ) ; } catch ( java.io.IOException err ) { com.google.gerrit.server.documentation.MarkdownFormatter.log.warn ( "Cannot load pegdown.css" , err ) ; return "" ; } }

Target:
private static java.lang.String readCSS ( ) { if ( ( com.google.gerrit.server.documentation.MarkdownFormatter.defaultCss ) != null ) { return com.google.gerrit.server.documentation.MarkdownFormatter.defaultCss ; } try { return com.google.gerrit.server.documentation.MarkdownFormatter.readPegdownCss ( new java.util.concurrent.atomic.AtomicBoolean ( ) ) ; } catch ( java.io.IOException err ) { com.google.gerrit.server.documentation.MarkdownFormatter.log.warn ( "Cannot load pegdown.css" , err ) ; return "" ; } }
Source:
public boolean canDeleteDraft ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( isOwner ( ) ) || ( getRefControl ( ) . canDeleteDrafts ( ) ) ) && ( isVisible ( db ) ) ; }

Target:
public boolean canDelete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Status status ) throws com.google.gwtorm.server.OrmException { if ( ! ( isVisible ( db ) ) ) { return false ; } switch ( status ) { case DRAFT : return ( isOwner ( ) ) || ( getRefControl ( ) . canDeleteDrafts ( ) ) ; case NEW : case ABANDONED : return isAdmin ( ) ; case MERGED : default : return false ; } }
Source:
private java.util.List < com.google.gerrit.server.change.RevisionResource > byLegacyPatchSetId ( com.google.gerrit.server.change.ChangeResource change , java.lang.String id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = dbProvider.get ( ) . patchSets ( ) . get ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , java.lang.Integer.parseInt ( id ) ) ) ; if ( ps != null ) { return java.util.Collections.singletonList ( new com.google.gerrit.server.change.RevisionResource ( change , ps ) ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
private java.util.List < com.google.gerrit.server.change.RevisionResource > byLegacyPatchSetId ( com.google.gerrit.server.change.ChangeResource change , java.lang.String id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( dbProvider.get ( ) , change.getNotes ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , java.lang.Integer.parseInt ( id ) ) ) ; if ( ps != null ) { return java.util.Collections.singletonList ( new com.google.gerrit.server.change.RevisionResource ( change , ps ) ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : access ( ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getName ( ) ) ; } } return all ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.section ; com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getName ( ) ) ; } } return all ; }
Source:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean deleteChangeFromIndex ( final int changeId ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( ( "delete change " + changeId ) + " from index" ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.delete ( buildIndexEndpoint ( changeId ) ) ; } } . execute ( ) ; }
Source:
private com.google.gerrit.server.notedb.RepoSequence newSequence ( java.lang.String name , int start , int batchSize , java.lang.Runnable afterReadRef , com.github.rholder.retry.Retryer < org.eclipse.jgit.lib.RefUpdate.Result > retryer ) { return new com.google.gerrit.server.notedb.RepoSequence ( repoManager , project , name , start , batchSize , afterReadRef , retryer ) ; }

Target:
private com.google.gerrit.server.notedb.RepoSequence newSequence ( java.lang.String name , final int start , int batchSize , java.lang.Runnable afterReadRef , com.github.rholder.retry.Retryer < org.eclipse.jgit.lib.RefUpdate.Result > retryer ) { return new com.google.gerrit.server.notedb.RepoSequence ( repoManager , project , name , new com.google.gerrit.server.notedb.RepoSequence.Seed ( ) { @ java.lang.Override public int get ( ) { return start ; } } , batchSize , afterReadRef , retryer ) ; }
Source:
protected void onStarClick ( final int row ) { final com.google.gerrit.client.data.ChangeInfo c = getChangeInfo ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { c.setStarred ( ( ! ( c.isStarred ( ) ) ) ) ; setStar ( row , c ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( c.getId ( ) , c.isStarred ( ) ) ; Util.LIST_SVC.toggleStars ( req , VoidCallback.INSTANCE ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; c.setStarred ( prior ) ; setStar ( row , c ) ; }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot delete project on remote site {}. " + ( "Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ; } }

Target:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , uri ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( "Error deleting local repository {}:\n" , uri.getPath ( ) , e ) ; } }
Source:
public void run ( ) { try { final java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ; try { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } finally { br.close ( ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }

Target:
private void copyStderrToLog ( final java.io.InputStream in ) { new java.lang.Thread ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } } } , "Gitweb-ErrorLogger" ) . start ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi create ( com.google.gerrit.extensions.common.ChangeInfo in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.ChangeInfo out = createChange.apply ( TopLevelResource.INSTANCE , in ) . value ( ) ; return api.create ( changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( out.changeId ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi create ( com.google.gerrit.extensions.common.ChangeInfo in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.ChangeInfo out = createChange.apply ( TopLevelResource.INSTANCE , in ) . value ( ) ; return api.create ( changes.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( out._number ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create change" , e ) ; } }
Source:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = createSshInjector ( sysInjector ) ; sysInjector.getInstance ( com.google.gerrit.server.cache.CachePool.class ) . start ( ) ; sshInjector.getInstance ( com.google.gerrit.sshd.SshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = createSshInjector ( sysInjector ) ; final com.google.gerrit.lifecycle.LifecycleManager mgr = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; mgr.add ( sysInjector , sshInjector ) ; mgr.start ( ) ; return never ( ) ; }
Source:
private com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute getPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute p = new com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; return p ; }

Target:
private com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute getPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute p = new com.google.gerrit.common.ChangeHookRunner.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; final com.google.gerrit.server.account.AccountState uploader = accountCache.get ( patchSet.getUploader ( ) ) ; p.uploader = getAccountAttribute ( uploader.getAccount ( ) ) ; return p ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.AccountGroupMember > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.AccountGroupMember k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
protected abstract void display ( final com.google.gerrit.common.data.GroupDetail groupDetail ) ;
Source:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }
Source:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { projectKey = new com.google.gerrit.client.reviewdb.Project.NameKey ( in.readUTF ( ) ) ; oldId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; newId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; fileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; sourceFileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; whitespace = com.google.gerrit.client.patches.PatchScriptSettings.Whitespace.valueOf ( com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ) ; }

Target:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { projectKey = new com.google.gerrit.client.reviewdb.Project.NameKey ( in.readUTF ( ) ) ; oldId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; newId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; fileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; sourceFileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; whitespace = com.google.gerrit.client.data.PatchScriptSettings.Whitespace.valueOf ( com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ) ; }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }

Target:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }
Source:
private com.google.gerrit.server.git.CodeReviewCommit getBranchTip ( com.google.gerrit.reviewdb.client.Branch.NameKey destBranch ) throws com.google.gerrit.server.git.IntegrationException { if ( openBranches.containsKey ( destBranch ) ) { return openBranches.get ( destBranch ) ; } else { getPendingRefUpdate ( destBranch ) ; return openBranches.get ( destBranch ) ; } }

Target:
private com.google.gerrit.server.git.CodeReviewCommit getBranchTip ( com.google.gerrit.server.git.MergeOp.OpenRepo repo , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch ) throws com.google.gerrit.server.git.IntegrationException { if ( openBranches.containsKey ( destBranch ) ) { return openBranches.get ( destBranch ) ; } else { getPendingRefUpdate ( repo , destBranch ) ; return openBranches.get ( destBranch ) ; } }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; if ( ( result.isEmpty ( ) ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; if ( ( result.isEmpty ( ) ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; final int idx = tabTokens.indexOf ( initialTabToken ) ; tabs.selectTab ( ( 0 <= idx ? idx : 0 ) ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; display ( ) ; }
Source:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.ssh.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.NEW , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }

Target:
public void testPushForMasterAsDraft ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/drafts/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.DRAFT , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; ref = "refs/for/master%draft" ; r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.DRAFT , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicItem.bind ( binder ( ) , com.google.gerrit.common.EventDispatcher.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.ForwardedAwareEventBroker.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicItem.bind ( binder ( ) , com.google.gerrit.common.EventDispatcher.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.ForwardedAwareEventBroker.class ) ; }
Source:
private void assertSubmitter ( com.google.gerrit.acceptance.PushOneCommit.Result change ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo info = get ( change.getChangeId ( ) , ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( info.messages ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( info.messages ) . hasSize ( 3 ) ; if ( ( getSubmitType ( ) ) == ( com.google.gerrit.extensions.client.SubmitType.CHERRY_PICK ) ) { com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getLast ( info.messages ) . message ) . startsWith ( "Change has been successfully cherry-picked as " ) ; } else { com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getLast ( info.messages ) . message ) . isEqualTo ( "Change has been successfully merged by Administrator" ) ; } }

Target:
public java.lang.String apply ( com.google.gerrit.extensions.common.ChangeMessageInfo in ) { return in.message ; }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterRefUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }
Source:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, no message will be shown" ) ; return null ; } if ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.now ( ) . compareTo ( expiresAt ) ) > 0 ) { return null ; } return msg ; }

Target:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, no message will be shown" ) ; return null ; } if ( ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.now ( ) . compareTo ( startsAt ) ) < 0 ) || ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.now ( ) . compareTo ( expiresAt ) ) > 0 ) ) { return null ; } return msg ; }
Source:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( box.getSide ( ) ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( linePublishedBoxesMap.containsKey ( handle ) ) { java.util.List < com.google.gerrit.client.diff.PublishedBox > list = linePublishedBoxesMap.get ( handle ) ; lineActiveBoxMap.put ( handle , list.get ( ( ( list.size ( ) ) - 1 ) ) ) ; } }

Target:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( box.getSide ( ) ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( linePublishedBoxesMap.containsKey ( handle ) ) { java.util.List < com.google.gerrit.client.diff.PublishedBox > list = linePublishedBoxesMap.get ( handle ) ; lineActiveBoxMap.put ( handle , list.get ( ( ( list.size ( ) ) - 1 ) ) ) ; } unsaved.remove ( box ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchLineComment c : object.comments ( ) ) { if ( ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) && ( c.getAuthor ( ) . equals ( accountId ) ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { return ! ( args.plcUtil.draftByChangeAuthor ( args.db.get ( ) , object.notes ( ) , accountId ) . isEmpty ( ) ) ; }
Source:
private void display ( final com.google.gerrit.client.data.SideBySidePatchDetail detail ) { sbsTable.setAccountInfoCache ( detail.getAccounts ( ) ) ; sbsTable.display ( detail ) ; sbsTable.finishDisplay ( true ) ; }

Target:
private void display ( final com.google.gerrit.client.data.SideBySidePatchDetail detail ) { showSideBySide ( detail ) ; if ( ( ( detail.getHistory ( ) ) != null ) && ( ( detail.getHistory ( ) . size ( ) ) > 1 ) ) { historyTable.display ( detail.getHistory ( ) ) ; historyPanel.setOpen ( false ) ; historyPanel.setVisible ( true ) ; } else { historyPanel.setVisible ( false ) ; } }
Source:
private void insertDummyChangeApproval ( final com.google.gerrit.server.ssh.commands.Receive.ReplaceResult result , final com.google.gerrit.client.reviewdb.Account.Id forAccount , final com.google.gerrit.client.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.ChangeApproval ca = new com.google.gerrit.client.reviewdb.ChangeApproval ( new com.google.gerrit.client.reviewdb.ChangeApproval.Key ( result.change.getId ( ) , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( result.change ) ; db.changeApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) , txn ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.client.reviewdb.Change change , final com.google.gerrit.client.reviewdb.PatchSet.Id psId , final com.google.gerrit.client.reviewdb.Account.Id forAccount , final com.google.gerrit.client.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.PatchSetApproval ca = new com.google.gerrit.client.reviewdb.PatchSetApproval ( new com.google.gerrit.client.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) , txn ) ; }
Source:
public java.lang.String getCommitMessage ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { try ( com.google.gerrit.extensions.restapi.BinaryResult binaryResult = getChangeEditCommitMessage.apply ( changeResource ) ) { return binaryResult.asString ( ) ; } } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot get commit message of change edit" , e ) ; } }

Target:
public java.lang.String getCommitMessage ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { try ( com.google.gerrit.extensions.restapi.BinaryResult binaryResult = getChangeEditCommitMessage.apply ( changeResource ) ) { return binaryResult.asString ( ) ; } } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get commit message of change edit" , e ) ; } }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListTagsRequest request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListTags list = listTagsProvider.get ( ) ; list.setLimit ( request.getLimit ( ) ) ; list.setStart ( request.getStart ( ) ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list tags" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.TagInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListTags list = listTagsProvider.get ( ) ; list.setLimit ( request.getLimit ( ) ) ; list.setStart ( request.getStart ( ) ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list tags" , e ) ; } }
Source:
private void assertRefs ( java.lang.String ... expectedWithMeta ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { assertRefs ( repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , notesFactory , changeCache , repo , projectControl ( ) , new com.google.gerrit.testutil.DisabledReviewDb ( ) , true ) , true , expectedWithMeta ) ; } }

Target:
private void assertUploadPackRefs ( java.lang.String ... expectedWithMeta ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { assertRefs ( repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , notesFactory , changeCache , repo , projectControl ( ) , new com.google.gerrit.testutil.DisabledReviewDb ( ) , true ) , true , expectedWithMeta ) ; } }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( final com.google.gerrit.reviewdb.client.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } final com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( final com.google.gerrit.reviewdb.client.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }
Source:
public void testLimitArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , 5 ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }

Target:
public void testOptionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.IndexRewriteTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }
Source:
private void display ( final com.google.gerrit.client.data.ChangeDetail detail ) { if ( ( changeInfo ) == null ) { displayTitle ( detail.getChange ( ) . getSubject ( ) ) ; } description.setText ( detail.getDescription ( ) ) ; approvals.display ( detail.getApprovals ( ) ) ; descriptionPanel.setOpen ( true ) ; approvalsPanel.setOpen ( true ) ; }

Target:
private void display ( final com.google.gerrit.client.data.ChangeDetail detail ) { if ( ( changeInfo ) == null ) { displayTitle ( detail.getChange ( ) . getSubject ( ) ) ; } infoBlock.display ( detail ) ; description.setText ( detail.getDescription ( ) ) ; approvals.display ( detail.getApprovals ( ) ) ; descriptionPanel.setOpen ( true ) ; approvalsPanel.setOpen ( true ) ; }
Source:
private static void incrementCount ( com.google.common.cache.LoadingCache < com.google.gerrit.reviewdb.client.Project.NameKey , java.util.concurrent.atomic.AtomicLong > cache , com.google.gerrit.reviewdb.client.Project.NameKey project ) { try { cache.get ( project ) . incrementAndGet ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.quota.FetchAndPushCounter.log.warn ( ( "Couldn't increment usage counter for project " + ( project.get ( ) ) ) , e ) ; } }

Target:
private static void incrementCount ( com.google.common.cache.LoadingCache < com.google.gerrit.reviewdb.client.Project.NameKey , java.util.concurrent.atomic.AtomicLong > cache , com.google.gerrit.reviewdb.client.Project.NameKey project ) { cache.getUnchecked ( project ) . incrementAndGet ( ) ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "upload" , new com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.imagare.client.ImagareAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "preferences" , new com.googlesource.gerrit.plugins.imagare.client.ImagarePreferenceScreen.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "upload" , new com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "settings" , new com.googlesource.gerrit.plugins.imagare.client.ImagareAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "preferences" , new com.googlesource.gerrit.plugins.imagare.client.ImagarePreferenceScreen.Factory ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.config.TaskResource rsrc , com.google.gerrit.server.config.DeleteTask.Input input ) { rsrc.getTask ( ) . cancel ( true ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.config.TaskResource rsrc , com.google.gerrit.server.config.DeleteTask.Input input ) { com.google.gerrit.server.git.WorkQueue.Task < ? > task = rsrc.getTask ( ) ; boolean taskDeleted = task.cancel ( true ) ; return taskDeleted ? com.google.gerrit.extensions.restapi.Response.none ( ) : com.google.gerrit.extensions.restapi.Response.withStatusCode ( javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR , ( "Unable to kill task " + task ) ) ; }