auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > patchSetAttributeSupplier ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } } } ) ; }

Target:
private com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > patchSetAttributeSupplier ( final com.google.gerrit.server.notedb.ChangeNotes notes , final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( notes.getChange ( ) . getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , notes , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } } } ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( currentUserProviderMock.get ( ) ) . thenReturn ( currentUserMock ) ; org.mockito.Mockito.when ( currentUserMock.getCapabilities ( ) ) . thenReturn ( capabilityControlMock ) ; org.mockito.Mockito.when ( capabilityControlMock.canAdministrateServer ( ) ) . thenReturn ( true ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( currentUserProviderMock , tempFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
public void tooManyTerms ( ) throws java.lang.Exception { java.lang.String q = "file:a OR file:b OR file:c" ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( q ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite ( in ) ) ; exception.expect ( com.google.gerrit.index.query.QueryParseException.class ) ; exception.expectMessage ( "too many terms in query" ) ; rewrite ( parse ( ( q + " OR file:d" ) ) ) ; }

Target:
public void tooManyTerms ( ) throws java.lang.Exception { java.lang.String q = "file:a OR file:b OR file:c" ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( q ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite ( in ) ) ; exception.expect ( com.google.gerrit.index.query.QueryParseException.class ) ; exception.expectMessage ( "too many terms in query" ) ; rewrite ( parse ( ( q + " OR file:d" ) ) ) ; }
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 ) ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( rsp ) ; 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 ( com.google.gerrit.httpd.LoginUrlToken.getToken ( req ) ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( rsp ) ; rsp.sendRedirect ( rdr.toString ( ) ) ; }
Source:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit push = new com.google.gerrit.acceptance.git.PushOneCommit ( db , admin.getIdent ( ) , subject , fileName , content , changeId ) ; return push.to ( git , ref ) ; }

Target:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content , changeId ) ; return push.to ( git , ref ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.GeneralPreferences prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; onModuleLoad2 ( result ) ; }
Source:
public synchronized void put ( com.google.gerrit.reviewdb.client.Account account ) { com.google.gerrit.server.account.AccountState state = com.google.gerrit.testutil.FakeAccountCache.newState ( account ) ; byId.put ( account.getId ( ) , state ) ; if ( ( account.getUserName ( ) ) != null ) { byUsername.put ( account.getUserName ( ) , state ) ; } }

Target:
public synchronized void put ( com.google.gerrit.reviewdb.client.Account account ) { com.google.gerrit.server.account.AccountState state = com.google.gerrit.testing.FakeAccountCache.newState ( account ) ; byId.put ( account.getId ( ) , state ) ; if ( ( account.getUserName ( ) ) != null ) { byUsername.put ( account.getUserName ( ) , state ) ; } }
Source:
public org.eclipse.jgit.transport.ReceivePack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository db ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException { final com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_CONTROL ) ) ) ; if ( ! ( pc.getUser ( ) . isIdentifiedUser ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } com.google.gerrit.server.git.ReceiveCommits rc = factory.create ( pc , db ) . getReceiveCommits ( ) ; rc.init ( ) ; org.eclipse.jgit.transport.ReceivePack rp = rc.getReceivePack ( ) ; req.setAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_RC , rc ) ; return rp ; }

Target:
public org.eclipse.jgit.transport.ReceivePack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository db ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException { final com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_CONTROL ) ) ) ; if ( ! ( pc.getUser ( ) . isIdentifiedUser ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } com.google.gerrit.server.git.receive.ReceiveCommits rc = factory.create ( pc , db ) . getReceiveCommits ( ) ; rc.init ( ) ; org.eclipse.jgit.transport.ReceivePack rp = rc.getReceivePack ( ) ; req.setAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_RC , rc ) ; return rp ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.reviewer = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.commitMessage = "This is the first line\nAnd the second line." ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester was added to review - testproject (master) - https://change/ - This is the first line\",\n" ) + " \"pretext\": \"Unit Tester was added to review\",\n" ) + " \"title\": \"testproject (master) - change 1234\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"This is the first line\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.reviewer = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.commitMessage = "This is the title\nThis is the message body." ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester was added to review testproject (master) https://change/: This is the title\",\n" ) + " \"pretext\": \"Unit Tester was added to review <https://change/|testproject (master) change 1234>\",\n" ) + " \"title\": \"This is the title\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Module createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } if ( ( luceneModule ) != null ) { return luceneModule ; } switch ( indexType ) { case LUCENE : return com.google.gerrit.lucene.LuceneIndexModule.latestVersionWithOnlineUpgrade ( ) ; case ELASTICSEARCH : return com.google.gerrit.elasticsearch.ElasticIndexModule.latestVersionWithOnlineUpgrade ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; factory ( AccountIndexer.Factory.class ) ; bind ( com.google.gerrit.server.index.change.IndexRewriter.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.account.AccountIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { com.google.gerrit.common.changes.Side side = getSideFromCm ( cm ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , ( line + 1 ) , null , null ) ; return addDraftBox ( info , false ) ; }

Target:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ! ( replyTo.has_line ( ) ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createLine ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { java.io.File resourceFile = getResourceFile ( resourcePath ) ; if ( ( resourceFile.exists ( ) ) && ( ( resourceFile.length ( ) ) > 0 ) ) { return resourceOf ( resourcePath ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { return webScanner.getEntry ( resourcePath ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getClock ( ) . getTime ( ) ) / 1000 ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getDate ( ) . getTime ( ) ) / 1000 ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String name = dcmd.getCommandName ( ) ; java.lang.StringBuilder commandName = new java.lang.StringBuilder ( ( name == null ? "" : name ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.areg1 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; if ( ! ( matcher.find ( ) ) ) { return engine.fail ( ) ; } return engine.jtry2 ( com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_check , com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_next ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.r1 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; if ( ! ( matcher.find ( ) ) ) { return engine.fail ( ) ; } return engine.jtry ( com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_check , com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_next , new com.googlecode.prolog_cafe.lang.ChoicePointFrame.S2 ( engine ) ) ; }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format 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 , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public void onPostUpload ( org.eclipse.jgit.storage.pack.PackStatistics stats ) { upload.increment ( ) ; }

Target:
public void onPostUpload ( org.eclipse.jgit.storage.pack.PackStatistics stats ) { com.google.gerrit.server.git.UploadPackMetricsHook.Operation op = com.google.gerrit.server.git.UploadPackMetricsHook.Operation.FETCH ; if ( ( ( stats.getUninterestingObjects ( ) ) == null ) || ( stats.getUninterestingObjects ( ) . isEmpty ( ) ) ) { op = com.google.gerrit.server.git.UploadPackMetricsHook.Operation.CLONE ; } upload.increment ( op ) ; }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ( impl.isShowTree ( ) ) && ( ( impl.getShowBranch ( ) ) != null ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --tree and --show-branch options are not compatible." ) ; } if ( ( impl.isShowTree ( ) ) && ( impl.isShowDescription ( ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --tree and --description options are not compatible." ) ; } impl.display ( out ) ; }

Target:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ! ( impl.getFormat ( ) . isJson ( ) ) ) { if ( ( impl.isShowTree ( ) ) && ( ( impl.getShowBranch ( ) ) != null ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --tree and --show-branch options are not compatible." ) ; } if ( ( impl.isShowTree ( ) ) && ( impl.isShowDescription ( ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --tree and --description options are not compatible." ) ; } } impl.display ( out ) ; }
Source:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > ( val ) ; h.created = java.lang.System.currentTimeMillis ( ) ; mem.put ( key , h ) ; executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { store.put ( key , h ) ; } } ) ; }

Target:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > ( val ) ; h.created = com.google.gerrit.server.util.TimeUtil.nowMs ( ) ; mem.put ( key , h ) ; executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { store.put ( key , h ) ; } } ) ; }
Source:
public void notifyDraftDelta ( final int delta ) { if ( ( fileList ) != null ) { fileList.notifyDraftDelta ( patchKey , delta ) ; } }

Target:
public void notifyDraftDelta ( final int delta ) { if ( ( fileList ) != null ) { fileList.notifyDraftDelta ( patchKey , delta ) ; } com.google.gwt.user.client.ui.Widget p = getParent ( ) ; while ( p != null ) { if ( p instanceof com.google.gerrit.client.patches.CommentEditorContainer ) { ( ( com.google.gerrit.client.patches.CommentEditorContainer ) ( p ) ) . notifyDraftDelta ( delta ) ; break ; } p = p.getParent ( ) ; } }
Source:
public void withDuplicateSystemGroupCaseInsensitiveName_Conflict ( ) throws java.lang.Exception { java.lang.String newGroupName = "Registered Users" ; adminSshSession.exec ( ( "gerrit create-group " + newGroupName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isTrue ( ) ; }

Target:
public void withDuplicateSystemGroupCaseInsensitiveName_Conflict ( ) throws java.lang.Exception { java.lang.String newGroupName = "Registered Users" ; adminSshSession.exec ( ( ( "gerrit create-group '" + ( newGroupName.toUpperCase ( ) ) ) + "'" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( adminSshSession.getError ( ) ) . isEqualTo ( ( ( "fatal: group '" + newGroupName ) + "\' already exists\n" ) ) ; }
Source:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.AccountInfo.class ) ) ; }

Target:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ) ; }
Source:
java.lang.String get ( final java.lang.String attName ) throws javax.naming.NamingException { return java.lang.String.valueOf ( atts.get ( attName ) . get ( 0 ) ) ; }

Target:
java.lang.String get ( final java.lang.String attName ) throws javax.naming.NamingException { final javax.naming.directory.Attribute att = getAll ( attName ) ; return ( att != null ) && ( 0 < ( att.size ( ) ) ) ? java.lang.String.valueOf ( att.get ( 0 ) ) : null ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; com.google.gerrit.common.TimeUtil.setCurrentMillisSupplier ( ( ) -> com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ) ; }

Target:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testing.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testing.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; com.google.gerrit.common.TimeUtil.setCurrentMillisSupplier ( ( ) -> com.google.gerrit.testing.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testing.TestTimeUtil.clockStepMs ) ) ; }
Source:
public void testPersonPrimaryKey ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.TestPerson.Key key = new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( key , 18 ) ; assertSame ( key , schema.people ( ) . primaryKey ( bob ) ) ; }

Target:
public void testPersonPrimaryKey ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.Person.Key key = new com.google.gwtorm.data.Person.Key ( "Bob" ) ; final com.google.gwtorm.data.Person bob = new com.google.gwtorm.data.Person ( key , 18 ) ; org.junit.Assert.assertSame ( key , schema.people ( ) . primaryKey ( bob ) ) ; }
Source:
public int compare ( java.util.Map.Entry < java.lang.String , java.nio.file.Path > e1 , java.util.Map.Entry < java.lang.String , java.nio.file.Path > e2 ) { java.nio.file.Path n1 = e1.getValue ( ) . getFileName ( ) ; java.nio.file.Path n2 = e2.getValue ( ) . getFileName ( ) ; return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( n1.endsWith ( ".jar" ) , n2.endsWith ( ".jar" ) ) . compare ( n1 , n2 ) . result ( ) ; }

Target:
public int compare ( java.util.Map.Entry < java.lang.String , java.nio.file.Path > e1 , java.util.Map.Entry < java.lang.String , java.nio.file.Path > e2 ) { java.nio.file.Path n1 = e1.getValue ( ) . getFileName ( ) ; java.nio.file.Path n2 = e2.getValue ( ) . getFileName ( ) ; return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( isJar ( n1 ) , isJar ( n2 ) ) . compare ( n1 , n2 ) . result ( ) ; }
Source:
public void doFilter ( com.google.gerrit.server.events.ChangeAbandonedEvent hook ) throws java.io.IOException { java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }

Target:
public void doFilter ( com.google.gerrit.server.events.ChangeAbandonedEvent hook ) throws java.io.IOException { if ( ! ( gerritConfig.getBoolean ( its.name ( ) , null , "commentOnChangeAbandoned" , true ) ) ) { return ; } java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids , new java.util.HashMap < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > ( ) ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; }

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 ( ) ; com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } else { b.setEnabled ( true ) ; super . onFailure ( err ) ; } }
Source:
void onCollapseAll ( com.google.gwt.event.dom.client.ClickEvent e ) { int n = history.getWidgetCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ( ( com.google.gerrit.client.change.Message ) ( history.getWidget ( i ) ) ) . setOpen ( false ) ; } expandAll.setVisible ( true ) ; collapseAll.setVisible ( false ) ; }

Target:
void onExpandAll ( com.google.gwt.event.dom.client.ClickEvent e ) { int n = history.getWidgetCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ( ( com.google.gerrit.client.change.Message ) ( history.getWidget ( i ) ) ) . setOpen ( true ) ; } expandAll.setVisible ( false ) ; collapseAll.setVisible ( true ) ; }
Source:
public org.parboiled.Rule whitespace ( ) { return zeroOrMore ( anyOf ( " \t" ) ) ; }

Target:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , Sp ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , Line ( body ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( popAsString ( ) , parse ( body ) ) ) ) ; }
Source:
private java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > getScopes ( com.googlesource.gerrit.plugins.github.oauth.CompositeConfig config ) { java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > scopes = com.google.common.collect.Maps.newHashMap ( ) ; java.util.Set < java.lang.String > configKeys = config.getNames ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION ) ; for ( java.lang.String key : configKeys ) { if ( key.startsWith ( "scopes" ) ) { java.lang.String scopesString = config.getString ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , null , key ) ; scopes.put ( key , parseScopesString ( scopesString ) ) ; } } return scopes ; }

Target:
private java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > getScopes ( org.eclipse.jgit.lib.Config config ) { java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > scopes = com.google.common.collect.Maps.newHashMap ( ) ; java.util.Set < java.lang.String > configKeys = config.getNames ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , true ) ; for ( java.lang.String key : configKeys ) { if ( key.startsWith ( "scopes" ) ) { java.lang.String scopesString = config.getString ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , null , key ) ; scopes.put ( key , parseScopesString ( scopesString ) ) ; } } return scopes ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.RefRight > getRefRights ( final com.google.gerrit.common.data.ApprovalType at ) { return getRefRights ( com.google.gerrit.server.workflow.FunctionState.id ( at ) ) ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > getRefRights ( final com.google.gerrit.reviewdb.ApprovalCategory.Id id ) { if ( ( refRights ) == null ) { refRights = index ( project.getLocalRights ( ) ) ; } final java.util.List < com.google.gerrit.reviewdb.RefRight > l = refRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.reviewdb.RefRight > emptyList ( ) ; }
Source:
public com.google.gerrit.server.group.SubgroupResource parse ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.GroupDescription.Internal parent = resource.asInternalGroup ( ) . orElseThrow ( MethodNotAllowedException :: new ) ; com.google.gerrit.common.data.GroupDescription.Basic member = groupsCollection.parse ( TopLevelResource.INSTANCE , id ) . getGroup ( ) ; if ( ( resource.getControl ( ) . canSeeGroup ( ) ) && ( isSubgroup ( parent , member ) ) ) { return new com.google.gerrit.server.group.SubgroupResource ( resource , member ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.group.SubgroupResource parse ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.common.data.GroupDescription.Internal parent = resource.asInternalGroup ( ) . orElseThrow ( MethodNotAllowedException :: new ) ; com.google.gerrit.common.data.GroupDescription.Basic member = groupsCollection.parse ( TopLevelResource.INSTANCE , id ) . getGroup ( ) ; if ( ( resource.getControl ( ) . canSeeGroup ( ) ) && ( com.google.gerrit.server.group.SubgroupsCollection.isSubgroup ( parent , member ) ) ) { return new com.google.gerrit.server.group.SubgroupResource ( resource , member ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public void testAppend_Object ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.Object ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.Object ( ) { @ java.lang.Override public java.lang.String toString ( ) { return "foobar" ; } } ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_Object ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( ( ( java.lang.Object ) ( null ) ) ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( new java.lang.Object ( ) { @ java.lang.Override public java.lang.String toString ( ) { return "foobar" ; } } ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "foobar" ) ; }
Source:
private static void execute ( org.eclipse.jgit.lib.BatchRefUpdate bru , org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { bru.execute ( rw , NullProgressMonitor.INSTANCE ) ; } }

Target:
private static void execute ( org.eclipse.jgit.lib.BatchRefUpdate bru , org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { bru.execute ( rw , NullProgressMonitor.INSTANCE ) ; } for ( org.eclipse.jgit.transport.ReceiveCommand command : bru.getCommands ( ) ) { if ( ( command.getResult ( ) ) != ( ReceiveCommand.Result.OK ) ) { throw new java.io.IOException ( java.lang.String.format ( "Command %s failed: %s" , command.toString ( ) , command.getResult ( ) ) ) ; } } }
Source:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { createLuceneIndex ( ) ; } else { ui.message ( ( "The index must be built before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) ) ; initFlags.autoStart = false ; } }

Target:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( site , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , true ) ; } else { final java.lang.String message = java.lang.String.format ( ( "\nThe index must be %sbuilt before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) , ( site.isNew ? "" : "re" ) ) ; ui.message ( message ) ; initFlags.autoStart = false ; } }
Source:
static java.lang.String resolveTargetUrl ( com.google.gitiles.GitilesView view , java.lang.String target ) { java.lang.String resolved = com.google.gitiles.Paths.simplifyPathUpToRoot ( target , view.getPathPart ( ) ) ; if ( resolved == null ) { return null ; } return com.google.gitiles.GitilesView.path ( ) . copyFrom ( view ) . setPathPart ( resolved ) . toUrl ( ) ; }

Target:
static java.lang.String resolveTargetUrl ( com.google.gitiles.GitilesView view , java.lang.String target ) { java.lang.String resolved = com.google.gitiles.PathUtil.simplifyPathUpToRoot ( target , view.getPathPart ( ) ) ; if ( resolved == null ) { return null ; } return com.google.gitiles.GitilesView.path ( ) . copyFrom ( view ) . setPathPart ( resolved ) . toUrl ( ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "WIP" ) . setTitle ( "Set Work In Progress" ) . setVisible ( ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( ! ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "WIP" ) . setTitle ( "Set Work In Progress" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) && ( ! ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) , com.google.gerrit.extensions.conditions.BooleanCondition.or ( rsrc.isUserOwner ( ) , permissionBackend.user ( self ) . testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ) ) ; }
Source:
private static int decodeInt ( final byte [ ] buf ) { int r = ( buf [ 0 ] ) << 8 ; r |= ( buf [ 1 ] ) & 255 ; r <<= 8 ; r |= ( buf [ 2 ] ) & 255 ; return ( r << 8 ) | ( ( buf [ 3 ] ) & 255 ) ; }

Target:
private static int decodeInt ( final byte [ ] buf , final int o ) { int r = ( buf [ o ] ) << 8 ; r |= ( buf [ ( o + 1 ) ] ) & 255 ; r <<= 8 ; r |= ( buf [ ( o + 2 ) ] ) & 255 ; return ( r << 8 ) | ( ( buf [ ( o + 3 ) ] ) & 255 ) ; }
Source:
private static java.lang.String addKey ( 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 ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }

Target:
private static java.lang.String addInvalidKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( keyId , pub ) ; key.setInvalid ( ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.getSshPublicKey ( ) ) ) + "\n" ; }
Source:
public com.google.gerrit.extensions.api.access.ProjectAccessInfo access ( com.google.gerrit.extensions.api.access.ProjectAccessInput p ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return setAccess.apply ( checkExists ( ) , p ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put access rights" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.CommitApi commit ( java.lang.String commit ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return commitApi.create ( commitsCollection.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( commit ) ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse commit" , e ) ; } }
Source:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.sshd.args4j.AccountIdHandler.class ) ; registerOptionHandler ( AccountGroup.Id.class , com.google.gerrit.sshd.args4j.AccountGroupIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.sshd.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.sshd.args4j.ProjectControlHandler.class ) ; }

Target:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.sshd.args4j.AccountIdHandler.class ) ; registerOptionHandler ( AccountGroup.Id.class , com.google.gerrit.sshd.args4j.AccountGroupIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.sshd.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.sshd.args4j.ProjectControlHandler.class ) ; registerOptionHandler ( java.net.SocketAddress.class , com.google.gerrit.sshd.args4j.SocketAddressHandler.class ) ; }
Source:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . addParameter ( "q" , query ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }

Target:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . addParameter ( "q" , query ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }
Source:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , git , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( "refs/for/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String amendChange ( org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , testRepo , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( "refs/for/master" ) . getChangeId ( ) ; }
Source:
public static com.google.gerrit.server.account.AuthRequest forEmail ( final java.lang.String email ) { final com.google.gerrit.server.account.AuthRequest r ; r = new com.google.gerrit.server.account.AuthRequest ( ( ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_MAILTO ) + email ) ) ; r.setEmailAddress ( email ) ; return r ; }

Target:
public static com.google.gerrit.server.account.AuthRequest forEmail ( final java.lang.String email ) { final com.google.gerrit.reviewdb.AccountExternalId.Key i = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_MAILTO , email ) ; final com.google.gerrit.server.account.AuthRequest r = new com.google.gerrit.server.account.AuthRequest ( i.get ( ) ) ; r.setEmailAddress ( email ) ; return r ; }
Source:
private void updateGroupNames ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gerrit.common.data.GroupReference ... groupRefs ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.BatchRefUpdate bru = repo.getRefDatabase ( ) . newBatchUpdate ( ) ; com.google.gerrit.server.group.db.GroupNameNotes.updateGroupNames ( repo , inserter , bru , java.util.Arrays.asList ( groupRefs ) , ident ) ; inserter.flush ( ) ; com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( bru , repo ) ; } }

Target:
private void updateAllGroups ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gerrit.common.data.GroupReference ... groupRefs ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.BatchRefUpdate bru = repo.getRefDatabase ( ) . newBatchUpdate ( ) ; com.google.gerrit.server.group.db.GroupNameNotes.updateAllGroups ( repo , inserter , bru , java.util.Arrays.asList ( groupRefs ) , ident ) ; inserter.flush ( ) ; com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( bru , repo ) ; } }