auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.ListMultimap < java.lang.String , java.lang.String > map = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }

Target:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.ListMultimap < java.lang.String , java.lang.String > map = com.google.common.collect.MultimapBuilder.hashKeys ( ) . arrayListValues ( ) . build ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
protected java.net.SocketAddress getRemoteAddress ( ) { return session.getAttribute ( SshUtil.REMOTE_PEER ) ; }

Target:
public void run ( ) { com.google.gerrit.server.ssh.SshScopes.invoke ( session , cmd , new java.lang.Runnable ( ) { public void run ( ) { try { synchronized ( list ) { list.add ( cmd ) ; } runImp ( ) ; } finally { synchronized ( list ) { list.remove ( cmd ) ; } } } } ) ; }
Source:
private java.io.File copyToTempFile ( org.eclipse.jgit.lib.ObjectId blobId , java.io.File tempDir ) throws java.io.FileNotFoundException , java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.io.File tmp = java.io.File.createTempFile ( "rules" , ".pl" , tempDir ) ; try ( java.io.FileOutputStream out = new java.io.FileOutputStream ( tmp ) ) { git.open ( blobId ) . copyTo ( out ) ; } return tmp ; }

Target:
private java.io.File copyToTempFile ( org.eclipse.jgit.lib.ObjectId blobId , java.io.File tempDir ) throws java.io.FileNotFoundException , java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.io.File tmp = java.io.File.createTempFile ( "rules" , ".pl" , tempDir ) ; try ( java.io.OutputStream out = java.nio.file.Files.newOutputStream ( tmp.toPath ( ) ) ) { git.open ( blobId ) . copyTo ( out ) ; } return tmp ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { com.google.gerrit.server.account.AccountState accountState = byIdCache.getOrNull ( id ) ; if ( accountState != null ) { i.replace ( accountState ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.maybeGet ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }
Source:
void setText ( final java.lang.String query ) { if ( ( query == null ) || ( query.equals ( "" ) ) ) { searchBox.setText ( Gerrit.C.searchHint ( ) ) ; searchBox.addStyleName ( "gerrit-InputFieldTypeHint" ) ; } else { searchBox.setText ( query ) ; searchBox.removeStyleName ( "gerrit-InputFieldTypeHint" ) ; } }

Target:
void setText ( final java.lang.String query ) { if ( ( query == null ) || ( query.equals ( "" ) ) ) { searchBox.setText ( Gerrit.C.searchHint ( ) ) ; searchBox.addStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } else { searchBox.setText ( query ) ; searchBox.removeStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } }
Source:
private static void unified ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , 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.Unified ( baseId , id.getParentKey ( ) , id.get ( ) , line ) ) ; } } ) ; }

Target:
private static void unified ( 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.Unified ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = configFile ( req ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( f ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }

Target:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = resolveFile ( req ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( f ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }
Source:
public void testGetIssuePatternWCommentLink ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testGetIssuePatternWCommentLink ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "plugin" , "ItsTestName" , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
private java.lang.String errorMessageForBranches ( java.util.List < java.lang.String > branches ) { java.lang.StringBuilder message = new java.lang.StringBuilder ( ) ; for ( java.lang.String branch : branches ) { message.append ( "Cannot delete " ) . append ( branch ) . append ( ": it doesn't exist or you do not have permission " ) . append ( "to delete it\n" ) ; } return message.toString ( ) ; }

Target:
private java.lang.String errorMessageForBranches ( java.util.List < java.lang.String > branches ) { java.lang.StringBuilder message = new java.lang.StringBuilder ( ) ; for ( java.lang.String branch : branches ) { message.append ( "Cannot delete " ) . append ( prefixRef ( branch ) ) . append ( ": it doesn't exist or you do not have permission " ) . append ( "to delete it\n" ) ; } return message.toString ( ) ; }
Source:
private void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( server , schema , replication , emailSender , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.ChangeMergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } }

Target:
private void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( server , schema , replication , emailSender , mergedSenderFactory , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.ChangeMergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } }
Source:
private java.lang.String buildJsonRaw ( java.lang.String path ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , "format=json" , javax.servlet.http.HttpServletResponse.SC_OK ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "application/json" ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; com.google.common.truth.Truth.assertThat ( body ) . startsWith ( magic ) ; return body.substring ( magic.length ( ) ) ; }

Target:
private java.lang.String buildJsonRaw ( java.lang.String path , java.lang.String additionalQueryString ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , ( "format=json" + additionalQueryString ) , javax.servlet.http.HttpServletResponse.SC_OK ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "application/json" ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; com.google.common.truth.Truth.assertThat ( body ) . startsWith ( magic ) ; return body.substring ( magic.length ( ) ) ; }
Source:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.GroupInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.GroupInfo > output = com.google.common.collect.Maps.newTreeMap ( ) ; for ( com.google.gerrit.extensions.common.GroupInfo info : get ( ) ) { output.put ( com.google.common.base.MoreObjects.firstNonNull ( info.name , ( "Group " + ( com.google.gerrit.extensions.restapi.Url.decode ( info.id ) ) ) ) , info ) ; info.name = null ; } return output ; }

Target:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.GroupInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.GroupInfo > output = new java.util.TreeMap < > ( ) ; for ( com.google.gerrit.extensions.common.GroupInfo info : get ( ) ) { output.put ( com.google.common.base.MoreObjects.firstNonNull ( info.name , ( "Group " + ( com.google.gerrit.extensions.restapi.Url.decode ( info.id ) ) ) ) , info ) ; info.name = null ; } return output ; }
Source:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; return list.apply ( ) ; }

Target:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; list.setMatchPrefix ( this . getPrefix ( ) ) ; list.setMatchSubstring ( this . getSubstring ( ) ) ; list.setMatchRegex ( this . getRegex ( ) ) ; return list.apply ( ) ; }
Source:
public void testPushForMasterWithTopic ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String topic = "my/topic" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/master/" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; r = pushTo ( ( "refs/for/master%topic=" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; }

Target:
private void testPushForMasterWithTopic ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { selectProtocol ( p ) ; java.lang.String topic = "my/topic" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/master/" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; r = pushTo ( ( "refs/for/master%topic=" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; }
Source:
public void newPatchSetByOwnerOnReviewableChangeToWipInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOwnerOnReviewableChangeToWip ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private java.util.Collection < com.google.gerrit.reviewdb.client.ChangeMessage > filterChangeMessages ( ) { return com.google.common.collect.Collections2.filter ( changeMessages , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage in ) { com.google.gerrit.reviewdb.client.PatchSet.Id psId = in.getPatchSetId ( ) ; return ( psId == null ) || ( patchSets.containsKey ( psId ) ) ; } } ) ; }

Target:
private java.util.Collection < com.google.gerrit.reviewdb.client.ChangeMessage > filterChangeMessages ( ) { final com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrent = upToCurrentPredicate ( ) ; return com.google.common.collect.Collections2.filter ( changeMessages , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage in ) { com.google.gerrit.reviewdb.client.PatchSet.Id psId = in.getPatchSetId ( ) ; if ( psId == null ) { return true ; } return ( upToCurrent.apply ( psId ) ) && ( patchSets.containsKey ( psId ) ) ; } } ) ; }
Source:
protected < T > void doInvoke ( final java.lang.String requestData , final com.google.gwtjsonrpc.client.JsonSerializer < T > resultSerializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , requestData , resultSerializer , callback ) . send ( ) ; }

Target:
protected < T > void doInvoke ( final boolean allowXsrf , final java.lang.String reqData , final com.google.gwtjsonrpc.client.JsonSerializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , allowXsrf , reqData , ser , cb ) . send ( ) ; }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }

Target:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }
Source:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final java.lang.String vs ; if ( com.google.gwt.core.client.GWT.isScript ( ) ) { final com.google.gerrit.client.GerritVersion v = com.google.gwt.core.client.GWT.create ( com.google.gerrit.client.GerritVersion.class ) ; vs = v.version ( ) ; } else { vs = "dev" ; } final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; }

Target:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.bc.BcPGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
private java.lang.String percent ( final long value , final long total ) { if ( total <= 0 ) { return "" ; } final long pcent = ( 100 * value ) / total ; return java.lang.String.format ( "%3d%%" , ( ( int ) ( pcent ) ) ) ; }

Target:
private static java.lang.String formatAsPercent ( java.lang.Integer i ) { return i != null ? ( java.lang.String.valueOf ( i ) ) + "%" : "" ; }
Source:
protected com.google.gerrit.reviewdb.client.PatchLineComment newPublishedPatchLineComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String filename , java.lang.String UUID , com.google.gerrit.reviewdb.client.CommentRange range , int line , com.google.gerrit.server.IdentifiedUser commenter , java.lang.String parentUUID , java.sql.Timestamp t , java.lang.String message , short side , java.lang.String commitSHA1 ) { return newPatchLineComment ( psId , filename , UUID , range , line , commenter , parentUUID , t , message , side , commitSHA1 , PatchLineComment.Status.PUBLISHED ) ; }

Target:
protected com.google.gerrit.reviewdb.client.PatchLineComment newPublishedComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String filename , java.lang.String UUID , com.google.gerrit.reviewdb.client.CommentRange range , int line , com.google.gerrit.server.IdentifiedUser commenter , java.lang.String parentUUID , java.sql.Timestamp t , java.lang.String message , short side , java.lang.String commitSHA1 ) { return newComment ( psId , filename , UUID , range , line , commenter , parentUUID , t , message , side , commitSHA1 , PatchLineComment.Status.PUBLISHED ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { throw new com.google.gerrit.server.tools.hooks.CommitMsgHookTest.SkipTestOnThisPlatform ( ) ; } super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }

Target:
private void skipIfWin32Platform ( ) { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { java.lang.System.err.println ( ( ( " - Skipping " + ( test.getMethodName ( ) ) ) + " on this system" ) ) ; org.junit.Assume.assumeTrue ( false ) ; } }
Source:
private static org.eclipse.jgit.lib.AnyObjectId aFor ( final com.google.gerrit.server.patch.PatchListKey key , final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.revwalk.RevCommit b ) throws java.io.IOException { if ( ( key.getOldId ( ) ) != null ) { return key.getOldId ( ) ; } switch ( b.getParentCount ( ) ) { case 0 : return com.google.gerrit.server.patch.PatchListCacheImpl.emptyTree ( repo ) ; case 1 : return b.getParent ( 0 ) ; default : return null ; } }

Target:
private static org.eclipse.jgit.lib.AnyObjectId aFor ( final com.google.gerrit.server.patch.PatchListKey key , final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.revwalk.RevCommit b ) throws java.io.IOException { if ( ( key.getOldId ( ) ) != null ) { return key.getOldId ( ) ; } switch ( b.getParentCount ( ) ) { case 0 : return com.google.gerrit.server.patch.PatchListCacheImpl.Loader.emptyTree ( repo ) ; case 1 : return b.getParent ( 0 ) ; default : return null ; } }
Source:
public com.google.gson.JsonObject getChangeData ( int change , com.googlesource.gerrit.plugins.findowners.Util.String2String params ) { return apply ( null , new com.googlesource.gerrit.plugins.findowners.Action.Input ( change , params ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.googlesource.gerrit.plugins.findowners.RestResult > apply ( com.google.gerrit.reviewdb.server.ReviewDb reviewDb , com.google.gerrit.server.change.ChangeResource rsrc , com.googlesource.gerrit.plugins.findowners.Action.Parameters params ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = rsrc.getChange ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( c.getProject ( ) ) ) { com.google.gerrit.server.query.change.ChangeData changeData = changeDataFactory.create ( reviewDb , c ) ; return getChangeData ( repo , params , changeData ) ; } }
Source:
public void run ( ) { renderSkips ( context ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }
Source:
public static void doSignIn ( ) { new com.google.gerrit.client.SignInDialog ( ) . center ( ) ; }

Target:
public static void doSignIn ( ) { switch ( com.google.gerrit.client.Gerrit.myConfig.getAuthType ( ) ) { case HTTP : case HTTP_LDAP : com.google.gwt.user.client.Window.Location.assign ( ( "login/" + ( com.google.gwt.user.client.History.getToken ( ) ) ) ) ; break ; case DEVELOPMENT_BECOME_ANY_ACCOUNT : com.google.gwt.user.client.Window.Location.assign ( "become" ) ; break ; case OPENID : default : new com.google.gerrit.client.SignInDialog ( ) . center ( ) ; break ; } }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = change.getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = com.google.gerrit.rules.StoredValues.getChange ( engine ) . getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { }

Target:
private void renderSubmitType ( com.google.gerrit.reviewdb.client.Change.Status status , boolean canSubmit , com.google.gerrit.extensions.client.SubmitType submitType ) { if ( canSubmit && ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; submitActionText.setInnerText ( com.google.gerrit.client.admin.Util.toLongString ( submitType ) ) ; }
Source:
public void createEmptyEditRest ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_NO_CONTENT , adminSession.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 ) ) ) ; }

Target:
public void writeNoChanges ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . isEqualTo ( "no changes were made" ) ; } }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; if ( Patch.COMMIT_MSG.equals ( path ) ) { line = adjustCommitMessageLine ( line ) ; } java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path , line ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { upToChange ( true ) . run ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > listRepositories ( java.util.Set < java.lang.String > branches ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > repos = com.google.common.collect.Maps.newTreeMap ( ) ; for ( org.eclipse.jgit.lib.Repository repo : scanRepositories ( basePath , req ) ) { repos.put ( getRepositoryName ( repo ) , buildDescription ( repo , branches ) ) ; repo.close ( ) ; } return repos ; }

Target:
public java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > listRepositories ( java.util.Set < java.lang.String > branches ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > repos = com.google.common.collect.Maps.newTreeMap ( com.google.gitiles.DefaultAccess.US_COLLATOR ) ; for ( org.eclipse.jgit.lib.Repository repo : scanRepositories ( basePath , req ) ) { repos.put ( getRepositoryName ( repo ) , buildDescription ( repo , branches ) ) ; repo.close ( ) ; } return repos ; }
Source:
private java.lang.String addressList ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; for ( java.util.Iterator < java.net.SocketAddress > i = listen.iterator ( ) ; i.hasNext ( ) ; ) { r.append ( com.google.gerrit.sshd.SshDaemon.format ( i.next ( ) ) ) ; if ( i.hasNext ( ) ) { r.append ( ", " ) ; } } return r.toString ( ) ; }

Target:
private java.lang.String addressList ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; for ( java.util.Iterator < java.net.SocketAddress > i = listen.iterator ( ) ; i.hasNext ( ) ; ) { r.append ( com.google.gerrit.server.util.SocketUtil.format ( i.next ( ) , com.google.gerrit.sshd.SshDaemon.IANA_SSH_PORT ) ) ; if ( i.hasNext ( ) ) { r.append ( ", " ) ; } } return r.toString ( ) ; }
Source:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( ) ; } catch ( java.io.FileNotFoundException err ) { throw err ; } } return baseResource ; }

Target:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.main.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }
Source:
public static com.google.gerrit.git.WorkQueue.Task < ? > [ ] getTasks ( ) { final java.util.List < com.google.gerrit.git.WorkQueue.Task < ? > > r = new java.util.ArrayList < com.google.gerrit.git.WorkQueue.Task < ? > > ( ) ; for ( final com.google.gerrit.git.WorkQueue.Executor e : com.google.gerrit.git.WorkQueue.queues ) { e.addAllTo ( r ) ; } return r.toArray ( new com.google.gerrit.git.WorkQueue.Task [ r.size ( ) ] ) ; }

Target:
public java.util.List < com.google.gerrit.git.WorkQueue.Task < ? > > getTasks ( ) { final java.util.List < com.google.gerrit.git.WorkQueue.Task < ? > > r = new java.util.ArrayList < com.google.gerrit.git.WorkQueue.Task < ? > > ( ) ; for ( final com.google.gerrit.git.WorkQueue.Executor e : queues ) { e.addAllTo ( r ) ; } return r ; }
Source:
com.googlesource.gerrit.plugins.cfoauth.AccessToken parseAccessTokenResponse ( java.lang.String tokenResponse ) throws com.googlesource.gerrit.plugins.cfoauth.UAAClientException { if ( com.google.common.base.Strings.isNullOrEmpty ( tokenResponse ) ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Can't extract a token from an empty string" ) ; } com.google.gson.JsonObject json = getAsJsonObject ( tokenResponse ) ; java.lang.String accessToken = getAttribute ( json , com.googlesource.gerrit.plugins.cfoauth.UAAClient.ACCESS_TOKEN_ATTRIBUTE ) ; if ( accessToken == null ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Can't extract a token: missing or invalid 'access_token' attribute" ) ; } return toAccessToken ( accessToken ) ; }

Target:
com.google.gson.JsonObject toJsonWebToken ( java.lang.String accessToken ) throws com.googlesource.gerrit.plugins.cfoauth.UAAClientException { java.lang.String [ ] segments = getSegments ( accessToken ) ; if ( verifySignatures ) { verifySignature ( segments ) ; } return getAsJsonObject ( decodeBase64 ( segments [ 1 ] ) ) ; }
Source:
protected void run ( ) { loader.rescan ( true ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ( names ) == null ) || ( names.isEmpty ( ) ) ) { loader.rescan ( ) ; } else { try { loader.reload ( names ) ; } catch ( com.google.gerrit.server.plugins.InvalidPluginException e ) { throw die ( e.getMessage ( ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { throw die ( e.getMessage ( ) ) ; } } }
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 onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { toggleReviewed ( ) . run ( ) ; }
Source:
private java.lang.String getPullUrl ( ) { final java.util.List < com.jcraft.jsch.HostKey > hostKeys = sshInfo.getHostKeys ( ) ; if ( hostKeys.isEmpty ( ) ) { return "" ; } final java.lang.String host = hostKeys.get ( 0 ) . getHost ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "git pull ssh://" ) ; if ( host.startsWith ( "*:" ) ) { r.append ( getGerritHost ( ) ) ; r.append ( host.substring ( 1 ) ) ; } else { r.append ( host ) ; } r.append ( "/" ) ; r.append ( projectName ) ; r.append ( " " ) ; r.append ( patchSet.getRefName ( ) ) ; return r.toString ( ) ; }

Target:
public java.lang.String getSshHost ( ) { final java.util.List < com.jcraft.jsch.HostKey > hostKeys = sshInfo.getHostKeys ( ) ; if ( hostKeys.isEmpty ( ) ) { return null ; } final java.lang.String host = hostKeys.get ( 0 ) . getHost ( ) ; if ( host.startsWith ( "*:" ) ) { return ( getGerritHost ( ) ) + ( host.substring ( 1 ) ) ; } return host ; }
Source:
void set ( com.google.gerrit.client.changes.ChangeInfo info ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; openForm.setVisible ( canEdit ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; openForm.setVisible ( canEdit ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { showAddKeyBlock ( false ) ; }

Target:
public void run ( ) { if ( com.google.gerrit.client.account.SshPanel.isAppletRunning ( com.google.gerrit.client.account.SshPanel.applet ) ) { appletLoadTimer = null ; cancel ( ) ; doBrowse ( ) ; } else if ( ( 30000 / 200 ) < ( ( attempts ) ++ ) ) { appletLoadTimer = null ; cancel ( ) ; noBrowse ( ) ; } }
Source:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { return com.google.gerrit.client.Dispatcher.toSideBySide ( null , ps , info.path ( ) , ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ? com.google.gerrit.client.diff.DisplaySide.A : com.google.gerrit.client.diff.DisplaySide.B ) , info.line ( ) ) ; }

Target:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { return com.google.gerrit.client.Dispatcher.toPatch ( null , ps , info.path ( ) , ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ? com.google.gerrit.client.diff.DisplaySide.A : com.google.gerrit.client.diff.DisplaySide.B ) , info.line ( ) ) ; }
Source:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; dst.scrollTo ( si.getLeft ( ) , align ( si.getTop ( ) ) ) ; state = 0 ; } }

Target:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; overview.update ( si ) ; dst.scrollTo ( si.getLeft ( ) , align ( si.getTop ( ) ) ) ; state = 0 ; } }
Source:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { createDraftUpdateIfNull ( ) . deleteComment ( c ) ; } else { throw new java.lang.IllegalArgumentException ( ( "Cannot delete published comment " + c ) ) ; } }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.Comment c ) { verifyComment ( c ) ; createDraftUpdateIfNull ( ) . deleteComment ( c ) ; }
Source:
protected com.google.gerrit.reviewdb.AccountGroup missing ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) { return missingGroup ( key ) ; }

Target:
public com.google.gerrit.reviewdb.AccountGroup createEntry ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( key ) ; if ( group != null ) { return group ; } else { return missing ( key ) ; } } finally { db.close ( ) ; } }
Source:
private boolean isMergeable ( com.google.gerrit.reviewdb.client.Change c ) { final com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( c.getId ( ) ) ; final com.google.gerrit.server.git.CommitMergeStatus s = ( commit != null ) ? commit.statusCode : null ; boolean isMergeable = false ; if ( ( s != null ) && ( ( ( s.equals ( CommitMergeStatus.CLEAN_MERGE ) ) || ( s.equals ( CommitMergeStatus.CLEAN_PICK ) ) ) || ( s.equals ( CommitMergeStatus.ALREADY_MERGED ) ) ) ) { isMergeable = true ; } return isMergeable ; }

Target:
private boolean containsMissingCommits ( final com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.SubmitType , com.google.gerrit.server.git.CodeReviewCommit > map , final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ! ( isSubmitForMissingCommitsStillPossible ( commit ) ) ) { return false ; } for ( final com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { if ( ! ( map.containsValue ( missingCommit ) ) ) { return false ; } } return true ; }
Source:
private static com.google.gerrit.server.git.CodeReviewCommit failed ( com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit n , com.google.gerrit.server.git.strategy.CommitMergeStatus failure ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.resetRetain ( canMergeFlag ) ; rw.markStart ( n ) ; rw.markUninteresting ( mergeTip ) ; com.google.gerrit.server.git.CodeReviewCommit failed ; while ( ( failed = rw.next ( ) ) != null ) { failed.setStatusCode ( failure ) ; } return failed ; }

Target:
private static com.google.gerrit.server.git.CodeReviewCommit failed ( com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit n , com.google.gerrit.server.git.strategy.CommitMergeStatus failure ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.reset ( ) ; rw.markStart ( n ) ; rw.markUninteresting ( mergeTip ) ; com.google.gerrit.server.git.CodeReviewCommit failed ; while ( ( failed = rw.next ( ) ) != null ) { failed.setStatusCode ( failure ) ; } return failed ; }
Source:
public void restoreExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( getExternalIds ( admin ) ) ; db.accountExternalIds ( ) . delete ( getExternalIds ( user ) ) ; db.accountExternalIds ( ) . insert ( savedExternalIds ) ; }

Target:
public void restoreExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( getExternalIds ( admin ) ) ; db.accountExternalIds ( ) . delete ( getExternalIds ( user ) ) ; db.accountExternalIds ( ) . insert ( savedExternalIds ) ; accountCache.evict ( admin.getId ( ) ) ; accountCache.evict ( user.getId ( ) ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { com.google.gerrit.reviewdb.RefRight r = getRowItem ( row ) ; if ( ( r != null ) && ( refRightIds.contains ( r.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
private void doDeleteRefRights ( final java.util.HashSet < com.google.gerrit.reviewdb.RefRight.Key > refRightIds ) { if ( ! ( refRightIds.isEmpty ( ) ) ) { Util.PROJECT_SVC.deleteRight ( projectName , refRightIds , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ProjectDetail > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { display ( result ) ; } } ) ; } }
Source:
public void skipOnlyOnSpecificRef ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipRef=refs/heads/myref\n" ) + "skipGroup=testGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( anyUser , projectName , "refs/heads/myref" , "testOp" ) ) . isFalse ( ) ; }

Target:
public void skipOnlyOnSpecificRef ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipRef=refs/heads/myref\n" ) + "skipGroup=testGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" ) . get ( ) , projectName , "refs/heads/myref" , "testOp" ) ) . isFalse ( ) ; }
Source:
private static void set ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String key , java.lang.String val ) { if ( com.google.common.base.Strings.isNullOrEmpty ( val ) ) { cfg.unset ( com.google.gerrit.server.account.GetPreferences.MY , section , key ) ; } else { cfg.setString ( com.google.gerrit.server.account.GetPreferences.MY , section , key , val ) ; } }

Target:
private static void set ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String key , java.lang.String val ) { if ( com.google.common.base.Strings.isNullOrEmpty ( val ) ) { cfg.unset ( UserConfigSections.MY , section , key ) ; } else { cfg.setString ( UserConfigSections.MY , section , key , val ) ; } }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxTerms" , 0 ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { com.google.gerrit.server.index.IndexConfig.Builder b = com.google.gerrit.server.index.IndexConfig.builder ( ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxLimit" , b :: maxLimit ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxPages" , b :: maxPages ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxTerms" , b :: maxTerms ) ; return b.build ( ) ; }
Source:
void onRenderEntireFile ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.renderEntireFile ( e.getValue ( ) ) ; view.updateRenderEntireFile ( ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( java.util.Objects.equals ( mode , getSelectedMode ( ) ) ) ) && ( view.isAttached ( ) ) ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; } } ) ; } }