auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.server.git.WorkQueue.Task.State getState ( ) { if ( ( isDone ( ) ) && ( ! ( isPeriodic ( ) ) ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.DONE ; } else if ( isRunning ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.RUNNING ; } else if ( isCancelled ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.CANCELLED ; } final long delay = getDelay ( java.util.concurrent.TimeUnit.MILLISECONDS ) ; if ( delay <= 0 ) { return com.google.gerrit.server.git.WorkQueue.Task.State.READY ; } else if ( 0 < delay ) { return com.google.gerrit.server.git.WorkQueue.Task.State.SLEEPING ; } return com.google.gerrit.server.git.WorkQueue.Task.State.OTHER ; }

Target:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) && ( running.compareAndSet ( false , true ) ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } executor.remove ( this ) ; executor.purge ( ) ; return true ; } else { return false ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( GroupControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.account.AccountResolver.class ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( GroupControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { final com.google.gwtexpui.globalkey.client.KeyCommand k = map.get ( com.google.gwtexpui.globalkey.client.KeyCommandSet.toMask ( event ) ) ; if ( k != null ) { event.stopPropagation ( ) ; k.onKeyPress ( event ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { final com.google.gwtexpui.globalkey.client.KeyCommand k = map.get ( com.google.gwtexpui.globalkey.client.KeyCommandSet.toMask ( event ) ) ; if ( k != null ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; k.onKeyPress ( event ) ; } }
Source:
private void assertBranchesDeleted ( ) throws java.lang.Exception { assertBranches ( com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; }

Target:
private void assertBranchesDeleted ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { for ( java.lang.String branch : branches ) { com.google.common.truth.Truth.assertThat ( repo.exactRef ( branch ) ) . isNull ( ) ; } } }
Source:
public void testUpsertTwoFirstExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 2 ) ; }

Target:
public void testUpdateOneConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = asAccountAttribute ( message.getAuthor ( ) ) ; a.message = message.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.events.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.server.events.PatchSetCommentAttribute a = new com.google.gerrit.server.events.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }
Source:
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 ) ; factory ( AccountIndexer.Factory.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 ) ; }

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 ) ; factory ( AccountIndexerImpl.Factory.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 java.util.Map < com.google.gerrit.reviewdb.client.PatchLineComment.Key , com.google.gerrit.reviewdb.client.PatchLineComment > filterPatchLineComments ( ) { return limitToExistingPatchSets ( patchLineComments , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchLineComment.Key , com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public PatchSet.Id apply ( com.google.gerrit.reviewdb.client.PatchLineComment.Key in ) { return in.getParentKey ( ) . getParentKey ( ) ; } } ) ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.PatchLineComment.Key , com.google.gerrit.reviewdb.client.PatchLineComment > filterPatchLineComments ( ) { return limitToValidPatchSets ( patchLineComments , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchLineComment.Key , com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public PatchSet.Id apply ( com.google.gerrit.reviewdb.client.PatchLineComment.Key in ) { return in.getParentKey ( ) . getParentKey ( ) ; } } ) ; }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change.getId ( ) ) ; cm.setFrom ( change.getOwner ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( extraCC ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.change.ChangeInserter.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change.getId ( ) ) ; cm.setFrom ( change.getOwner ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.setNotify ( notify ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( extraCC ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.change.ChangeInserter.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putEditPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult n ) { prefs.copyTo ( com.google.gerrit.client.Gerrit.getEditPreferences ( ) ) ; } } ) ; close ( ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putEditPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.EditPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.EditPreferences p ) { com.google.gerrit.client.Gerrit.setEditPreferences ( p.copyTo ( new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ) ) ; } } ) ; close ( ) ; }
Source:
private void namedKey ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b , final java.lang.String name ) { b.append ( '<' ) ; b.openSpan ( ) ; b.setStyleName ( com.google.gwtexpui.globalkey.client.KeyCommand.KS ) ; b.append ( name ) ; b.closeSpan ( ) ; b.append ( ">" ) ; }

Target:
private void namedKey ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b , final java.lang.String name ) { b.append ( '<' ) ; b.openSpan ( ) ; b.setStyleName ( KeyResources.I.css ( ) . helpKey ( ) ) ; b.append ( name ) ; b.closeSpan ( ) ; b.append ( ">" ) ; }
Source:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( ( "/projects/" + ( com.google.gwt.http.client.URL.encode ( prefix ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterRaw ( "type" , "ALL" ) . addParameter ( "n" , limit ) . addParameterTrue ( "d" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.PUSH_TAG ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.CREATE_TAG ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( "Failed to delete repository %s" , uri.getPath ( ) ) , e ) ; } }

Target:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Deleted local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Deleted remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }
Source:
protected void configure ( ) { cache ( com.google.gerrit.server.account.GroupIncludeCacheImpl.BYINCLUDE_NAME , AccountGroup.UUID.class , new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . loader ( com.google.gerrit.server.account.GroupIncludeCacheImpl.ByIncludeLoader.class ) ; bind ( com.google.gerrit.server.account.GroupIncludeCacheImpl.class ) ; bind ( com.google.gerrit.server.account.GroupIncludeCache.class ) . to ( com.google.gerrit.server.account.GroupIncludeCacheImpl.class ) ; }

Target:
protected void configure ( ) { cache ( com.google.gerrit.server.account.GroupIncludeCacheImpl.BYINCLUDE_NAME , AccountGroup.UUID.class , new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . loader ( com.google.gerrit.server.account.GroupIncludeCacheImpl.MemberInLoader.class ) ; cache ( com.google.gerrit.server.account.GroupIncludeCacheImpl.MEMBERS_NAME , AccountGroup.UUID.class , new com.google.inject.TypeLiteral < java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > > ( ) { } ) . loader ( com.google.gerrit.server.account.GroupIncludeCacheImpl.MembersOfLoader.class ) ; bind ( com.google.gerrit.server.account.GroupIncludeCacheImpl.class ) ; bind ( com.google.gerrit.server.account.GroupIncludeCache.class ) . to ( com.google.gerrit.server.account.GroupIncludeCacheImpl.class ) ; }
Source:
public void add ( final com.google.gerrit.client.data.ApprovalType t ) { if ( 0 <= ( t.getCategory ( ) . getPosition ( ) ) ) { initApprovalTypes ( ) ; approvalTypes.add ( t ) ; } else { initActionTypes ( ) ; actionTypes.add ( t ) ; } }

Target:
public void add ( final com.google.gerrit.client.data.ApprovalType t ) { if ( t.getCategory ( ) . isAction ( ) ) { initActionTypes ( ) ; actionTypes.add ( t ) ; } else { initApprovalTypes ( ) ; approvalTypes.add ( t ) ; } }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { for ( int i = 0 ; i < ( result.length ( ) ) ; i ++ ) { if ( path.equals ( result.get ( i ) ) ) { reviewed.setValue ( true , false ) ; break ; } } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { boolean b = com.google.gerrit.client.rpc.Natives.asList ( result ) . contains ( path ) ; reviewed.setValue ( b , false ) ; if ( ( ! b ) && ( ( reviewedState ) == ( com.google.gerrit.client.diff.Header.ReviewedState.AUTO_REVIEW ) ) ) { postAutoReviewed ( ) ; } reviewedState = com.google.gerrit.client.diff.Header.ReviewedState.LOADED ; }
Source:
private static int limitThreads ( org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.schema.DataSourceType dst , int threads ) { boolean usePool = cfg.getBoolean ( "database" , "connectionpool" , dst.usePool ( ) ) ; int poolLimit = cfg.getInt ( "database" , "poollimit" , DataSourceProvider.DEFAULT_POOL_LIMIT ) ; if ( usePool && ( threads > poolLimit ) ) { com.google.gerrit.pgm.util.ThreadLimiter.log.warn ( ( ( "Limiting program to " + poolLimit ) + " threads due to database.poolLimit" ) ) ; return poolLimit ; } return threads ; }

Target:
private static int limitThreads ( org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.schema.DataSourceType dst , com.google.gerrit.server.config.ThreadSettingsConfig threadSettingsConfig , int threads ) { boolean usePool = cfg.getBoolean ( "database" , "connectionpool" , dst.usePool ( ) ) ; int poolLimit = threadSettingsConfig.getDatabasePoolLimit ( ) ; if ( usePool && ( threads > poolLimit ) ) { com.google.gerrit.pgm.util.ThreadLimiter.log.warn ( ( ( "Limiting program to " + poolLimit ) + " threads due to database.poolLimit" ) ) ; return poolLimit ; } return threads ; }
Source:
private void allowCodeReviewOnBehalfOf ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.LabelType codeReviewType = com.google.gerrit.server.project.testing.Util.codeReview ( ) ; java.lang.String forCodeReviewAs = com.google.gerrit.common.data.Permission.forLabelAs ( codeReviewType.getName ( ) ) ; java.lang.String heads = "refs/heads/*" ; com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , forCodeReviewAs , ( - 1 ) , 1 , uuid , heads ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void allowCodeReviewOnBehalfOf ( ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.LabelType codeReviewType = com.google.gerrit.server.project.testing.Util.codeReview ( ) ; java.lang.String forCodeReviewAs = com.google.gerrit.common.data.Permission.forLabelAs ( codeReviewType.getName ( ) ) ; java.lang.String heads = "refs/heads/*" ; com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , forCodeReviewAs , ( - 1 ) , 1 , uuid , heads ) ; saveProjectConfig ( project , cfg ) ; }
Source:
private void initEditor ( java.lang.String content ) { cm = net.codemirror.lib.CodeMirror.create ( editor , getConfig ( ) ) ; cm.setValue ( content ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; cm.addKeyMap ( net.codemirror.lib.KeyMap.create ( ) . on ( "Ctrl-L" , gotoLine ( ) ) . on ( "Cmd-L" , gotoLine ( ) ) . on ( "Cmd-S" , save ( ) ) . on ( "Ctrl-S" , save ( ) ) ) ; }
Source:
public void testIsEnabledEventNoBranches ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchNonMatchingRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > branchesByProject ( ) { com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > ret = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.Branch.NameKey branch : targets.keySet ( ) ) { ret.put ( branch.getParentKey ( ) , branch ) ; } return ret ; }

Target:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Project.NameKey > getProjectsInOrder ( ) throws com.google.gerrit.server.git.SubmoduleException { java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > projects = new java.util.LinkedHashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : branchesByProject.keySet ( ) ) { addAllSubmoduleProjects ( project , new java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) , projects ) ; } for ( com.google.gerrit.reviewdb.client.Branch.NameKey branch : updatedBranches ) { projects.add ( branch.getParentKey ( ) ) ; } return com.google.common.collect.ImmutableSet.copyOf ( projects ) ; }
Source:
public void emptyChangeUpdate ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( newChange ( ) , changeOwner ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( update.getRevision ( ) ) . isNull ( ) ; }

Target:
public void createdOnChangeNotes ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; java.sql.Timestamp createdOn = newNotes ( c ) . getChange ( ) . getCreatedOn ( ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isNotNull ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setTopic ( "topic" ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( newNotes ( c ) . getChange ( ) . getCreatedOn ( ) ) . isEqualTo ( createdOn ) ; }
Source:
public com.google.gerrit.server.project.RefControl forUser ( final com.google.gerrit.server.CurrentUser who ) { return getProjectControl ( ) . forUser ( who ) . controlForRef ( getRefName ( ) ) ; }

Target:
public com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( getRefName ( ) ) ; } else { return new com.google.gerrit.server.project.RefControl ( newCtl , getRefName ( ) , relevant ) ; } }
Source:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable , final com.google.gerrit.client.patches.PatchScreen.TopView topView ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , topView , null ) ; }

Target:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.PatchSet.Id base , com.google.gerrit.reviewdb.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , com.google.gerrit.client.patches.PatchScreen.TopView topView ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , topView , null ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > fetchAccountIds ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : dbProvider.get ( ) . patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) ) { accountIds.add ( a.getAccountId ( ) ) ; } return accountIds ; }

Target:
private java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > fetchAccountIds ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { return approvalsUtil.getReviewers ( dbProvider.get ( ) , rsrc.getChange ( ) . getId ( ) ) . values ( ) ; }
Source:
private com.google.gwtorm.client.SchemaFactory < T > newFactory ( final java.lang.ClassLoader cl , final java.lang.String name ) { try { final java.lang.Class < ? > ft = java.lang.Class.forName ( name , true , cl ) ; return ( ( com.google.gwtorm.client.SchemaFactory < T > ) ( ft.newInstance ( ) ) ) ; } catch ( java.lang.InstantiationException e ) { return null ; } catch ( java.lang.IllegalAccessException e ) { return null ; } catch ( java.lang.ClassNotFoundException e ) { return null ; } }

Target:
private java.lang.Class < T > generate ( com.google.gwtorm.schema.sql.SqlDialect dialect , final com.google.gwtorm.server.GeneratedClassLoader loader ) throws com.google.gwtorm.client.OrmException { return ( ( java.lang.Class < T > ) ( new com.google.gwtorm.jdbc.gen.SchemaGen ( loader , schemaModel , dialect ) . create ( ) ) ) ; }
Source:
public int compare ( final com.google.gerrit.reviewdb.ProjectRight a , final com.google.gerrit.reviewdb.ProjectRight b ) { int rc = categoryOf ( a ) . compareTo ( categoryOf ( b ) ) ; if ( rc == 0 ) { rc = groupOf ( a ) . compareTo ( groupOf ( b ) ) ; } return rc ; }

Target:
public int compare ( final com.google.gerrit.reviewdb.RefRight a , final com.google.gerrit.reviewdb.RefRight b ) { int rc = categoryOf ( a ) . compareTo ( categoryOf ( b ) ) ; if ( rc == 0 ) { rc = a.getRefPattern ( ) . compareTo ( b.getRefPattern ( ) ) ; } if ( rc == 0 ) { rc = groupOf ( a ) . compareTo ( groupOf ( b ) ) ; } return rc ; }
Source:
int getStart ( ) { return start ; }

Target:
public int compareTo ( com.google.gerrit.client.diff.DiffChunkInfo o ) { if ( ( side ) == ( o.side ) ) { return ( start ) - ( o.start ) ; } else if ( ( side ) == ( DisplaySide.A ) ) { int comp = ( startOnOther ) - ( o.start ) ; return comp == 0 ? - 1 : comp ; } else { int comp = ( start ) - ( o.startOnOther ) ; return comp == 0 ? 1 : comp ; } }
Source:
public void closeEditsAreCombined ( ) throws java.lang.Exception { java.lang.String a = "ab1cdef2gh\n" ; java.lang.String b = "ab2cdef3gh\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.wordEdit ( 2 , 8 , 2 , 8 ) ) ; }

Target:
public void closeEditsAreCombined ( ) throws java.lang.Exception { java.lang.String a = "ab1cdef2gh\n" ; java.lang.String b = "ab2cdef3gh\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . common ( "ab" ) . replace ( "1cdef2" , "2cdef3" ) . common ( "gh\n" ) . edits ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkLabelName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
public void pushWithPrivateByDefaultEnabled ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( createChange ( ) . getChange ( ) . change ( ) . isPrivate ( ) ) . isEqualTo ( true ) ; }

Target:
public void createChangeBypassPrivateByDefaultEnabled ( ) throws java.lang.Exception { setPrivateByDefault ( project2 , InheritableBoolean.TRUE ) ; com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project2.get ( ) , "master" , "empty change" ) ; input.isPrivate = false ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isNull ( ) ; }
Source:
protected java.lang.String velocifyFile ( java.lang.String name ) throws com.google.gerrit.common.errors.EmailException { try { org.apache.velocity.runtime.RuntimeInstance runtime = args.velocityRuntime ; if ( ( runtime.getLoaderNameForResource ( name ) ) == null ) { name = "com/google/gerrit/server/mail/" + name ; } org.apache.velocity.Template template = runtime.getTemplate ( name , "UTF-8" ) ; java.io.StringWriter w = new java.io.StringWriter ( ) ; template.merge ( velocityContext , w ) ; return w.toString ( ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.common.errors.EmailException ( ( "Cannot format velocity template " + name ) , e ) ; } }

Target:
protected java.lang.String velocifyFile ( java.lang.String name ) throws com.google.gerrit.common.errors.EmailException { try { org.apache.velocity.runtime.RuntimeInstance runtime = args.velocityRuntime ; if ( ( runtime.getLoaderNameForResource ( name ) ) == null ) { name = "com/google/gerrit/server/mail/" + name ; } org.apache.velocity.Template template = runtime.getTemplate ( name , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; java.io.StringWriter w = new java.io.StringWriter ( ) ; template.merge ( velocityContext , w ) ; return w.toString ( ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.common.errors.EmailException ( ( "Cannot format velocity template " + name ) , e ) ; } }
Source:
public com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject forProject ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { org.eclipse.jgit.lib.Config cfg ; try { cfg = cfgFactory.getProjectPluginConfigWithInheritance ( projectName , pluginName ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.log.error ( "Unable to get config for project {}" , projectName.get ( ) ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; } return new com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject ( cfg ) ; }

Target:
public com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject forProject ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { org.eclipse.jgit.lib.Config cfg ; try { cfg = cfgFactory.getProjectPluginConfigWithMergedInheritance ( projectName , pluginName ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.log.error ( "Unable to get config for project {}" , projectName.get ( ) ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; } return new com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject ( cfg ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.client.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }
Source:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.common.data.GitwebLink.p ( r , branch.getParentKey ( ) ) ; com.google.gerrit.common.data.GitwebLink.h ( r , branch ) ; com.google.gerrit.common.data.GitwebLink.a ( r , "shortlog" ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; net.codemirror.theme.ThemeLoader.loadTheme ( prefs.theme ( ) , themeCallback ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }
Source:
public void onAddAccountsToGroup ( com.google.gerrit.reviewdb.client.Account.Id me , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupMember > added ) { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMemberAudit > auditInserts = com.google.common.collect.Lists.newLinkedList ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupMember m : added ) { com.google.gerrit.reviewdb.client.AccountGroupMemberAudit audit = new com.google.gerrit.reviewdb.client.AccountGroupMemberAudit ( m , me , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; auditInserts.add ( audit ) ; } try { db.get ( ) . accountGroupMembersAudit ( ) . insert ( auditInserts ) ; } catch ( com.google.gwtorm.server.OrmException e ) { logOrmExceptionForAccounts ( "Cannot log add accounts to group event performed by user" , me , added , e ) ; } }

Target:
public void onAddAccountsToGroup ( com.google.gerrit.reviewdb.client.Account.Id me , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupMember > added ) { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMemberAudit > auditInserts = com.google.common.collect.Lists.newLinkedList ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupMember m : added ) { com.google.gerrit.reviewdb.client.AccountGroupMemberAudit audit = new com.google.gerrit.reviewdb.client.AccountGroupMemberAudit ( m , me , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; auditInserts.add ( audit ) ; } try { db.get ( ) . accountGroupMembersAudit ( ) . insert ( auditInserts ) ; } catch ( com.google.gwtorm.server.OrmException e ) { logOrmExceptionForAccounts ( "Cannot log add accounts to group event performed by user" , me , added , e ) ; } }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.builtin.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.exceptions.TermException ( a1 ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.exceptions.TermException ( a1 ) ; }
Source:
private boolean isUnMuteable ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return ( isMuted ( rsrc ) ) && ( ! ( stars.isIgnored ( rsrc ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Unmute.log.error ( "failed to check ignored star" , e ) ; } return false ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( isMuted ( rsrc ) ) ; }
Source:
public java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getDraftRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( allUsers ) ) { return getDraftRefs ( repo , changeId ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getDraftRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { return getDraftRefs ( repo , changeId ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd , boolean hideSensitive ) { if ( dcmd == null ) { return "Command was already destroyed" ; } return hideSensitive ? dcmd.getFormattedMaskedArguments ( "." ) : extractWhat ( dcmd ) ; }

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 void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } resizeCodeMirror ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; handlers.add ( com.google.gwtexpui.user.client.UserAgent.addDialogVisibleHandler ( new com.google.gwtexpui.user.client.DialogVisibleHandler ( ) { @ java.lang.Override public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { diffTable.getElement ( ) . getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; } } ) ) ; resizeCodeMirror ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; cmA.setOption ( "viewportMargin" , 10 ) ; cmB.setOption ( "viewportMargin" , 10 ) ; cmB.focus ( ) ; }
Source:
public void testSubscriptionWildcardACLForMissingGitmodules ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/*" , "super-project" , "refs/heads/*" ) ; pushChangeTo ( superRepo , "master" ) ; pushChangeTo ( subRepo , "master" ) ; }

Target:
public void testSubscriptionWildcardACLForMissingGitmodules ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/*" , "super-project" , "refs/heads/*" ) ; pushChangeTo ( superRepo , "master" ) ; pushChangeTo ( subRepo , "master" ) ; }
Source:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , 1 , account.getFullName ( ) ) ; info.setText ( 1 , 1 , account.getPreferredEmail ( ) ) ; info.setText ( 2 , 1 , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; }

Target:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 1 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 2 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; prefsPanel.display ( account ) ; }
Source:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { setKeyExchangeFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.KeyExchange > > asList ( new org.apache.sshd.server.kex.DHG14.Factory ( ) , new org.apache.sshd.server.kex.DHG1.Factory ( ) ) ) ; org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = new org.apache.sshd.common.random.BouncyCastleRandom.Factory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }

Target:
private void initKeyExchanges ( org.eclipse.jgit.lib.Config cfg ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.kex.KeyExchange > > a = org.apache.sshd.server.ServerBuilder.setUpDefaultKeyExchanges ( true ) ; setKeyExchangeFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "kex" , ( ( org.apache.sshd.common.NamedFactory < org.apache.sshd.common.kex.KeyExchange > [ ] ) ( a.toArray ( new org.apache.sshd.common.NamedFactory [ a.size ( ) ] ) ) ) ) ) ; }
Source:
public void run ( ) { double now = ( ( double ) ( java.lang.System.currentTimeMillis ( ) ) ) ; if ( ( ( cm.getScrollSetBy ( ) ) == other ) && ( ( ( cm.getScrollSetAt ( ) ) + 50 ) > now ) ) { return ; } other.scrollToY ( cm.getScrollInfo ( ) . getTop ( ) ) ; other.setScrollSetBy ( cm ) ; other.setScrollSetAt ( now ) ; }

Target:
public void run ( ) { double now = ( ( double ) ( java.lang.System.currentTimeMillis ( ) ) ) ; if ( ( ( cm.getScrollSetBy ( ) ) == other ) && ( ( ( cm.getScrollSetAt ( ) ) + 30 ) > now ) ) { return ; } other.scrollToY ( cm.getScrollInfo ( ) . getTop ( ) ) ; other.setScrollSetBy ( cm ) ; other.setScrollSetAt ( now ) ; }
Source:
public static java.lang.String readString ( final java.io.InputStream input ) throws java.io.IOException { final byte [ ] bin = com.google.gerrit.server.ioutil.BasicSerialization.readBytes ( input ) ; if ( ( bin.length ) == 0 ) { return null ; } return new java.lang.String ( bin , 0 , bin.length , "UTF-8" ) ; }

Target:
public static java.lang.String readString ( final java.io.InputStream input ) throws java.io.IOException { final byte [ ] bin = com.google.gerrit.server.ioutil.BasicSerialization.readBytes ( input ) ; if ( ( bin.length ) == 0 ) { return null ; } return new java.lang.String ( bin , 0 , bin.length , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) { public void onSuccess ( final com.google.gerrit.common.data.ChangeDetail result ) { if ( result != null ) { detailCache.set ( result ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } } } ) ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.change.RevisionResource resource ) { return resource.getControl ( ) . canSubmit ( ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( java.lang.String.format ( "Submit Revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }