auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate , com.google.gerrit.reviewdb.client.Account.Id updater ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd , util.accountInfo ( updater ) ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate , com.google.gerrit.reviewdb.client.Account.Id updater ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd , util.accountInfo ( updater ) ) ; } } }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.lang.String path = rsrc.getPatchKey ( ) . get ( ) ; if ( Patch.COMMIT_MSG.equals ( path ) ) { return "text/plain" ; } return fileContentUtil.getContentType ( rsrc.getRevision ( ) . getControl ( ) . getProject ( ) . getNameKey ( ) , rsrc.getRevision ( ) . getPatchSet ( ) . getRevision ( ) . get ( ) , path ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.lang.String path = rsrc.getPatchKey ( ) . get ( ) ; if ( Patch.COMMIT_MSG.equals ( path ) ) { return FileContentUtil.TEXT_X_GERRIT_COMMIT_MESSAGE ; } return fileContentUtil.getContentType ( rsrc.getRevision ( ) . getControl ( ) . getProjectControl ( ) . getProjectState ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( rsrc.getRevision ( ) . getPatchSet ( ) . getRevision ( ) . get ( ) ) , path ) ; }
Source:
public void testUpsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }

Target:
public void upsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( oneRow ) ; assertCorrectUpdating ( update , 1 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.common.data.SubmitRecord ) { com.google.gerrit.common.data.SubmitRecord r = ( ( com.google.gerrit.common.data.SubmitRecord ) ( o ) ) ; return ( ( java.util.Objects.equals ( status , r.status ) ) && ( java.util.Objects.equals ( labels , r.labels ) ) ) && ( java.util.Objects.equals ( errorMessage , r.errorMessage ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.common.data.SubmitRecord ) { com.google.gerrit.common.data.SubmitRecord r = ( ( com.google.gerrit.common.data.SubmitRecord ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( status , r.status ) ) && ( java.util.Objects.equals ( labels , r.labels ) ) ) && ( java.util.Objects.equals ( errorMessage , r.errorMessage ) ) ) && ( java.util.Objects.equals ( requirements , r.requirements ) ) ; } return false ; }
Source:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , com.google.gerrit.client.diff.SideBySide2.Direction.NEXT ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public void commitMessageOptionJSON ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = executeSuccessfulQuery ( ( "--commit-message " + changeId ) ) ; com.google.common.truth.Truth.assertThat ( changes.size ( ) ) . isEqualTo ( 1 ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . contains ( PushOneCommit.SUBJECT ) ; }

Target:
public void commitMessageOptionJSON ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = executeSuccessfulQuery ( ( "--commit-message " + changeId ) ) ; com.google.common.truth.Truth.assertThat ( changes ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . contains ( PushOneCommit.SUBJECT ) ; }
Source:
java.lang.Runnable toggleOpenBox ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } } } ; }

Target:
java.lang.Runnable openCloseAll ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseAll ( ) ; } } } } ; }
Source:
public void copyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , ( - 2 ) ) ; }

Target:
public void copyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , ( - 2 ) ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "index" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "index" ) ) ; }
Source:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( new com.google.gitiles.Renderer.FileUrlMapper ( ) ) , com.google.common.base.MoreObjects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }

Target:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( com.google.gitiles.Renderer.fileUrlMapper ( ) ) , com.google.common.base.MoreObjects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }
Source:
public static void registerEmail ( java.lang.String account , java.lang.String email , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.account.EmailInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "emails" ) . id ( email ) . ifNoneMatch ( ) . put ( in , cb ) ; }

Target:
public static void registerEmail ( java.lang.String account , java.lang.String email , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.account.EmailInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "emails" ) . id ( email ) . ifNoneMatch ( ) . put ( in , cb ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.api.changes.ProblemInfo > check ( com.google.gerrit.reviewdb.client.Change c ) { reset ( ) ; change = c ; try { checkImpl ( ) ; return problems ; } finally { if ( ( rw ) != null ) { rw.release ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } } }

Target:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.reviewdb.client.Change c ) { reset ( ) ; change = c ; try { checkImpl ( ) ; return com.google.gerrit.server.change.ConsistencyChecker.Result.create ( c , problems ) ; } finally { if ( ( rw ) != null ) { rw.release ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } } }
Source:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }

Target:
public boolean execute ( ) { if ( ( prefs.syntaxHighlighting ( ) ) && ( isAttached ( ) ) ) { setSyntaxHighlighting ( prefs.syntaxHighlighting ( ) ) ; } return false ; }
Source:
public void listOneGroupMember ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( GET_ONE ( "/groups/Administrators/members/admin" ) . name ) . isEqualTo ( admin.fullName ) ; }

Target:
public void listNonEmptyGroupMembers ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user1 = createAccount ( "user1" , group ) ; java.lang.String user2 = createAccount ( "user2" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user1 , user2 ) ; }
Source:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , meta.description ( ) ) ) . to ( clazz ) ; }

Target:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } if ( meta.runsAt ( ) . isSupported ( slaveMode ) ) { bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , meta.description ( ) ) ) . to ( clazz ) ; } }
Source:
protected com.google.gerrit.server.change.ChangeResource parseChangeResource ( java.lang.String changeId ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( changeId , atrScope.get ( ) . getUser ( ) ) ; com.google.common.truth.Truth.assertThat ( ctls ) . hasSize ( 1 ) ; return new com.google.gerrit.server.change.ChangeResource ( ctls.get ( 0 ) ) ; }

Target:
protected com.google.gerrit.server.change.ChangeResource parseChangeResource ( java.lang.String changeId ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( changeId , atrScope.get ( ) . getUser ( ) ) ; com.google.common.truth.Truth.assertThat ( ctls ) . hasSize ( 1 ) ; return changeResourceFactory.create ( ctls.get ( 0 ) ) ; }
Source:
private void insertOne ( T obj ) throws com.google.gwtorm.client.OrmException { byte [ ] idx = indexRowData ( obj ) ; for ( com.google.gwtorm.nosql.IndexFunction < T > f : com.google.gwtorm.nosql.generic.GenericAccess.getQueryIndexes ( ) ) { if ( f.includes ( obj ) ) { db.upsert ( indexRowKey ( f , obj ) , idx ) ; } } db.insert ( dataRowKey ( obj ) , com.google.gwtorm.nosql.generic.GenericAccess.getObjectCodec ( ) . encode ( obj ) . toByteArray ( ) ) ; }

Target:
public void update ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T obj : instances ) { upsertOne ( obj , true ) ; } }
Source:
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.setString ( "gerrit" , null , "basePath" , "git" ) ; 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 ) { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setBoolean ( "sshd" , null , "testUseInsecureRandom" , true ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; cfg.setInt ( "sshd" , null , "threads" , 1 ) ; cfg.setInt ( "sshd" , null , "commandStartThreads" , 1 ) ; cfg.setInt ( "receive" , null , "threadPoolSize" , 1 ) ; cfg.setInt ( "index" , null , "threads" , 1 ) ; }
Source:
public void getProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/projects/" + name ) + ".git" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.extensions.common.ProjectInfo p = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.ProjectInfo.class ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }

Target:
public void getProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( name ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "list" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserListScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "user/(.*)" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserScreen.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "settings" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserSettingsScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "list" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserListScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "user/(.*)" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserScreen.Factory ( ) ) ; }
Source:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , java.nio.file.Path basePath , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.nio.file.Path trashRepo = basePath.resolve ( ( ( ( ( nameKey.get ( ) ) + "." ) + ( com.googlesource.gerrit.plugins.deleteproject.TimeMachine.now ( ) . toEpochMilli ( ) ) ) + ".%deleted%.git" ) ) ; return java.nio.file.Files.move ( directory , trashRepo , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }

Target:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , java.nio.file.Path basePath , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.nio.file.Path trashRepo = basePath.resolve ( ( ( ( ( nameKey.get ( ) ) + "." ) + ( java.lang.System.currentTimeMillis ( ) ) ) + ".%deleted%.git" ) ) ; return java.nio.file.Files.move ( directory , trashRepo , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.submit ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { onSubmitResult ( result ) ; } } ) ; }

Target:
public void onFailure ( java.lang.Throwable err ) { if ( com.google.gerrit.client.changes.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.changes.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; redisplay ( ) ; } else { b.setEnabled ( true ) ; super . onFailure ( err ) ; } }
Source:
public void markKeyInvalid ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = getKey ( seq ) ; if ( key != null ) { key.setInvalid ( ) ; } }

Target:
private boolean deleteKey ( int seq ) { checkLoaded ( ) ; if ( ( seq <= ( keys.size ( ) ) ) && ( keys.get ( ( seq - 1 ) ) . isPresent ( ) ) ) { keys.set ( ( seq - 1 ) , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }
Source:
protected void setTitleText ( final java.lang.String text ) { headerText.setText ( text ) ; }

Target:
protected void setPageTitle ( final java.lang.String text ) { final java.lang.String old = headerText.getText ( ) ; headerText.setText ( text ) ; if ( ( ( windowTitle ) == null ) || ( ( windowTitle ) == old ) ) { setWindowTitle ( text ) ; } }
Source:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.io.File file = path.toFile ( ) ; java.lang.String fileName = file.getName ( ) ; if ( ( file.isFile ( ) ) && ( fileName.endsWith ( ScalaPluginProvider.SCALA_EXTENSION ) ) ) { scalaFiles.add ( file ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }

Target:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.lang.String fileName = path.getFileName ( ) . toString ( ) ; if ( ( java.nio.file.Files.isRegularFile ( path ) ) && ( fileName.endsWith ( ScalaPluginProvider.SCALA_EXTENSION ) ) ) { scalaFiles.add ( path ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } com.google.gerrit.server.git.WorkQueue.Executor executor ; if ( threads <= 0 ) { executor = workQueue.getDefaultQueue ( ) ; } else { executor = workQueue.createQueue ( threads , "index" ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( executor ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "index" ) ) ; }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: master" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseSubject ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Subject: Some subject of a change\n" ) + "Subject: Some other subject\n" ) ) ) ; }
Source:
private void writeFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { res.setStatus ( HttpServletResponse.SC_NO_CONTENT ) ; java.io.InputStream in = req.getInputStream ( ) ; java.io.OutputStream out = new java.io.FileOutputStream ( configFile ( req ) ) ; try { com.google.common.io.ByteStreams.copy ( in , out ) ; } finally { out.close ( ) ; } }

Target:
private void writeFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { res.setStatus ( HttpServletResponse.SC_NO_CONTENT ) ; streamRequestToFile ( req , configFile ( req ) ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; table.setSavePointerId ( com.google.gwt.user.client.History.getToken ( ) ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { display ( r ) ; } public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; table.setSavePointerId ( com.google.gwt.user.client.History.getToken ( ) ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { display ( r ) ; } } ) ; }
Source:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; org.junit.Assert.assertTrue ( edit.isPresent ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.modifyFile ( edit.get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , org.eclipse.jgit.lib.Constants.encode ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_NO_CONTENT , session.post ( urlEdit ( ) ) . getStatusCode ( ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; org.junit.Assert.assertArrayEquals ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD , com.google.gerrit.acceptance.edit.ChangeEditIT.toBytes ( fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ) ) ; }
Source:
public void onSend ( ) { Util.MANAGE_SVC.createNewPatchSet ( patchSetId , getMessageText ( ) , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; new com.google.gerrit.client.ErrorDialog ( caught.getMessage ( ) ) . center ( ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.message ( changeId.get ( ) , revision , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } } ) ; }
Source:
private void applyAllFailed ( ) { if ( ( ( failed ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applyFailed ( ) ; } callbacks.clear ( ) ; } }

Target:
public void applyFailed ( ) { com.google.gerrit.client.rpc.HttpCallback < T > cb = delegate ; if ( cb != null ) { delegate = null ; result = null ; cb.onFailure ( failedThrowable ) ; } }
Source:
public void fromName ( ) { com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.RefPermission.fromName ( "doesnotexist" ) ) . isEmpty ( ) ; com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.RefPermission.fromName ( "" ) ) . isEmpty ( ) ; com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.RefPermission.fromName ( Permission.VIEW_PRIVATE_CHANGES ) ) . hasValue ( RefPermission.READ_PRIVATE_CHANGES ) ; }

Target:
public void stringToRefPermission ( ) { com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.DefaultPermissionMappings.refPermission ( "doesnotexist" ) ) . isEmpty ( ) ; com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.DefaultPermissionMappings.refPermission ( "" ) ) . isEmpty ( ) ; com.google.common.truth.Truth8.assertThat ( com.google.gerrit.server.permissions.DefaultPermissionMappings.refPermission ( Permission.VIEW_PRIVATE_CHANGES ) ) . hasValue ( RefPermission.READ_PRIVATE_CHANGES ) ; }
Source:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.diff.SideBySide ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ; } } ) ; }

Target:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.client.DiffObject base , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.diff.SideBySide ( base , com.google.gerrit.client.DiffObject.patchSet ( id.getParentKey ( ) ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
private static java.lang.String addInvalidKey ( java.util.List < com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; key.setInvalid ( ) ; keys.add ( com.google.common.base.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.getSshPublicKey ( ) ) ) + "\n" ; }

Target:
private static java.lang.String addInvalidKey ( java.util.List < java.util.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; key.setInvalid ( ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.getSshPublicKey ( ) ) ) + "\n" ; }
Source:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord , com.google.gerrit.client.ui.CommentLinkProcessor commentLinkProcessor ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) , commentLinkProcessor ) ; }

Target:
public void display ( com.google.gerrit.common.data.ChangeDetail changeDetail , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord , com.google.gerrit.client.ui.CommentLinkProcessor commentLinkProcessor ) { infoBlock.display ( changeDetail , acc , submitTypeRecord ) ; messageBlock.display ( changeDetail.getChange ( ) . currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) , commentLinkProcessor ) ; }
Source:
private void checkAccessAnnotations ( java.lang.Class < ? extends java.lang.Object > clazz ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.extensions.annotations.RequiresCapability rc = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.RequiresCapability.class ) ; if ( rc != null ) { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; com.google.gerrit.server.account.CapabilityControl ctl = user.getCapabilities ( ) ; if ( ( ! ( ctl.canPerform ( rc.value ( ) ) ) ) && ( ! ( ctl.canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "Capability %s is required to access this resource" , rc.value ( ) ) ) ; } } }

Target:
private void checkRequiresCapability ( com.google.gerrit.httpd.restapi.RestApiServlet.ViewData viewData ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.account.CapabilityUtils.checkRequiresCapability ( globals.currentUser , viewData.pluginName , viewData.view.getClass ( ) ) ; }
Source:
public static java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.server.query.change.ChangeData > asMap ( java.util.List < com.google.gerrit.server.query.change.ChangeData > changes ) { java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.server.query.change.ChangeData > result = com.google.common.collect.Maps.newHashMapWithExpectedSize ( changes.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changes ) { result.put ( cd.getId ( ) , cd ) ; } return result ; }

Target:
public static java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.server.query.change.ChangeData > asMap ( java.util.List < com.google.gerrit.server.query.change.ChangeData > changes ) { return changes.stream ( ) . collect ( java.util.stream.Collectors.toMap ( com.google.gerrit.server.query.change.ChangeData :: getId , ( cd ) -> cd ) ) ; }
Source:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }

Target:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } com.googlesource.gerrit.plugins.replication.PushOne.log.info ( ( ( ( "Push to " + ( uri ) ) + " references: " ) + todo ) ) ; return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; rdr.append ( '#' ) ; rdr.append ( getToken ( req ) ) ; rsp.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; rsp.setHeader ( "Pragma" , "no-cache" ) ; rsp.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; rsp.sendRedirect ( rdr.toString ( ) ) ; }

Target:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; rdr.append ( '#' ) ; rdr.append ( getToken ( req ) ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( rsp ) ; rsp.sendRedirect ( rdr.toString ( ) ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotesState buildState ( ) { return com.google.gerrit.server.notedb.ChangeNotesState.create ( id , new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) , createdOn , lastUpdatedOn , ownerId , branch , currentPatchSetId , subject , topic , originalSubject , submissionId , status , hashtags , patchSets , buildApprovals ( ) , com.google.gerrit.server.ReviewerSet.fromTable ( com.google.common.collect.Tables.transpose ( reviewers ) ) , allPastReviewers , buildReviewerUpdates ( ) , submitRecords , buildAllMessages ( ) , buildMessagesByPatchSet ( ) , comments ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotesState buildState ( ) { return com.google.gerrit.server.notedb.ChangeNotesState.create ( id , new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) , createdOn , lastUpdatedOn , ownerId , branch , currentPatchSetId , subject , topic , originalSubject , submissionId , status , assignee , hashtags , patchSets , buildApprovals ( ) , com.google.gerrit.server.ReviewerSet.fromTable ( com.google.common.collect.Tables.transpose ( reviewers ) ) , allPastReviewers , buildReviewerUpdates ( ) , submitRecords , buildAllMessages ( ) , buildMessagesByPatchSet ( ) , comments ) ; }
Source:
private void initUUID ( ) { final com.google.gwt.user.client.ui.VerticalPanel groupUUIDPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; groupUUIDPanel.setStyleName ( Gerrit.RESOURCES.css ( ) . groupUUIDPanel ( ) ) ; groupUUIDPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingGroupUUID ( ) ) ) ; groupUUIDLabel = new com.google.gwtexpui.clippy.client.CopyableLabel ( "" ) ; groupUUIDPanel.add ( groupUUIDLabel ) ; add ( groupUUIDPanel ) ; }

Target:
private void initUUID ( ) { final com.google.gwt.user.client.ui.VerticalPanel groupUUIDPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; groupUUIDPanel.setStyleName ( Gerrit.RESOURCES.css ( ) . groupUUIDPanel ( ) ) ; groupUUIDPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( AdminConstants.I.headingGroupUUID ( ) ) ) ; groupUUIDLabel = new com.google.gwtexpui.clippy.client.CopyableLabel ( "" ) ; groupUUIDPanel.add ( groupUUIDLabel ) ; add ( groupUUIDPanel ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( com.google.gerrit.server.project.ChangeControl ctrl , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db , ps.getId ( ) , ( ( com.google.gerrit.server.IdentifiedUser ) ( ctrl.getCurrentUser ( ) ) ) . getAccountId ( ) , ctrl.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( com.google.gerrit.server.project.ChangeControl ctrl , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db , ps.getId ( ) , ( ( com.google.gerrit.server.IdentifiedUser ) ( ctrl.getUser ( ) ) ) . getAccountId ( ) , ctrl.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void testPushWithMultipleChangeIds ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with multiple Change-Id\n" + ( ( "\n" + "Change-Id: I10f98c2ef76e52e23aa23be5afeb71e40b350e86\n" ) + "Change-Id: Ie9a132e107def33bdd513b7854b50de911edba0a\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; }

Target:
private void testPushWithMultipleChangeIds ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with multiple Change-Id\n" + ( ( "\n" + "Change-Id: I10f98c2ef76e52e23aa23be5afeb71e40b350e86\n" ) + "Change-Id: Ie9a132e107def33bdd513b7854b50de911edba0a\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } resizeCodeMirror ( ) ; }
Source:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canPerform ( Permission.EDIT_TOPIC_NAME ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return refControl.canPerform ( Permission.EDIT_TOPIC_NAME ) ; }

Target:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canPerform ( Permission.EDIT_TOPIC_NAME ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return refControl.canForceEditTopicName ( ) ; }
Source:
public void reviewProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Change.Id > cb ) { org.eclipse.jgit.lib.ObjectId base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; reviewProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
public void reviewProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Change.Id > cb ) { reviewProjectAccessFactory.create ( projectName , com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.getBase ( baseRevision ) , sections , msg ) . to ( cb ) ; }
Source:
public void start ( ) { publisherThread = new java.lang.Thread ( publisher ) ; publisherThread.start ( ) ; if ( ! ( isConnected ( ) ) ) { connect ( ) ; monitorTimer.schedule ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { if ( ! ( isConnected ( ) ) ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.info ( "#start: try to reconnect" ) ; connect ( ) ; } } } , com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.MONITOR_FIRSTTIME_DELAY , properties.getSection ( com.googlesource.gerrit.plugins.rabbitmq.config.section.Monitor.class ) . interval ) ; } }

Target:
public void start ( ) { publisherThread = new java.lang.Thread ( publisher ) ; publisherThread.setName ( "rabbitmq-publisher" ) ; publisherThread.start ( ) ; if ( ! ( isConnected ( ) ) ) { connect ( ) ; monitorTimer.schedule ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { if ( ! ( isConnected ( ) ) ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.info ( "#start: try to reconnect" ) ; connect ( ) ; } } } , com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.MONITOR_FIRSTTIME_DELAY , properties.getSection ( com.googlesource.gerrit.plugins.rabbitmq.config.section.Monitor.class ) . interval ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ; if ( p == null ) { p = com.google.gerrit.reviewdb.client.AccountDiffPreference.createDefault ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setAccountDiffPreference ( p ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.extensions.client.DiffPreferencesInfo p = com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ; result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setDiffPreferences ( p ) ; }