auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState , result.canModifyMaxObjectSizeLimit ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.reviewdb.client.Project.NameKey result ) { parent = result ; }
Source:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , ref , event ) ; }

Target:
void onRefReplicatedToAllNodes ( java.lang.String project , java.lang.String ref , int nodesCount ) { postEvent ( new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( project , ref , nodesCount ) ) ; }
Source:
private void initDescription ( ) { final com.google.gwt.user.client.ui.VerticalPanel vp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; vp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingDescription ( ) ) ) ; descTxt = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; descTxt.setVisibleLines ( 6 ) ; descTxt.setCharacterWidth ( 60 ) ; vp.add ( descTxt ) ; add ( vp ) ; new com.google.gerrit.client.ui.TextSaveButtonListener ( descTxt , saveProject ) ; }

Target:
private void initDescription ( ) { final com.google.gwt.user.client.ui.VerticalPanel vp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; vp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingDescription ( ) ) ) ; descTxt = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; descTxt.setVisibleLines ( 6 ) ; descTxt.setCharacterWidth ( 60 ) ; vp.add ( descTxt ) ; add ( vp ) ; saveEnabler = new com.google.gerrit.client.ui.OnEditEnabler ( saveProject ) ; saveEnabler.listenTo ( descTxt ) ; }
Source:
private static java.lang.String getLabel ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui ) { if ( ui == null ) { return "" ; } switch ( ui ) { case OLD_UI : return Util.C.changeScreenOldUi ( ) ; case CHANGE_SCREEN2 : return Util.C.changeScreenNewUi ( ) ; default : return ui.name ( ) ; } }

Target:
private void display ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.extensions.TopMenuItem > items ) { java.util.List < java.util.List < java.lang.String > > values = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.client.extensions.TopMenuItem item : com.google.gerrit.client.rpc.Natives.asList ( items ) ) { values.add ( java.util.Arrays.asList ( item.getName ( ) , item.getUrl ( ) ) ) ; } myMenus.display ( values ) ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; if ( ( args.length ) > 1 ) { return ( commandName + "." ) + ( args [ 1 ] ) ; } return commandName ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; for ( java.lang.String arg : dcmd.getArguments ( ) ) { commandName = ( commandName + "." ) + arg ; } return commandName ; }
Source:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.get ( ) . completeChangeSet ( db , change.change ( ) , user ( admin ) ) ; com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) . isEmpty ( ) ) . isEqualTo ( expected ) ; }

Target:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.submit.ChangeSet cs = mergeSuperSet.get ( ) . completeChangeSet ( db , change.change ( ) , user ( admin ) ) ; com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) . isEmpty ( ) ) . isEqualTo ( expected ) ; }
Source:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( repoManager , allUsers , getChangeId ( ) , author ) ; draftCommentNotes.load ( ) ; } }

Target:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( repoManager , migration , allUsers , getChangeId ( ) , author ) ; draftCommentNotes.load ( ) ; } }
Source:
private com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.BranchInfo > filterBranches ( com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.BranchInfo > branches ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchSubstring ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.SubstringPredicate ( matchSubstring ) ) ; } else if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchRegex ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.RegexPredicate ( matchRegex ) ) ; } return branches ; }

Target:
private com.google.common.collect.FluentIterable < com.google.gerrit.extensions.api.projects.BranchInfo > filterBranches ( com.google.common.collect.FluentIterable < com.google.gerrit.extensions.api.projects.BranchInfo > branches ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchSubstring ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.SubstringPredicate ( matchSubstring ) ) ; } else if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchRegex ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.RegexPredicate ( matchRegex ) ) ; } return branches ; }
Source:
protected void ccAllApprovals ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . values ( ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that reviewed updated change" , err ) ; } }

Target:
protected void ccAllApprovals ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . values ( ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that reviewed updated change" , err ) ; } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final boolean val = showSiteHeader.getValue ( ) ; Util.ACCOUNT_SVC.changeShowSiteHeader ( val , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { com.google.gerrit.client.Gerrit.getUserAccount ( ) . setShowSiteHeader ( val ) ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { showSiteHeader.setValue ( ( ! val ) ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { save.setEnabled ( true ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; return list.apply ( checkExists ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list children" , e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.common.data.AgreementInfo result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet ( result.accepted ) ; postRPC ( ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.AgreementInfo > result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.client.account.AgreementInfo info : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { mySigned.add ( info.name ( ) ) ; } postRPC ( ) ; } }
Source:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
public static java.lang.String toUnified ( com.google.gerrit.reviewdb.client.PatchSet.Id diffBase , com.google.gerrit.reviewdb.client.PatchSet.Id revision , java.lang.String fileName ) { return com.google.gerrit.client.Dispatcher.toPatch ( "unified" , diffBase , revision , fileName , null , 0 ) ; }
Source:
public void testWithAnInvalidSection ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p1 = createProject ( "a" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p2 = createProject ( "b" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p3 = createProject ( "d" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p4 = createProject ( "e" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\n" + ( ( "[submodule \"a\"]\n" + " path = a\n" ) + " url = ssh://localhost/" ) ) + ( p1.get ( ) ) ) + "\n" ) + " branch = .\n" ) + "[submodule \"b\"]\n" ) + " url = http://localhost:80/" ) + ( p2.get ( ) ) ) + "\n" ) + " branch = master\n" ) + "[submodule \"c\"]\n" ) + " path = c\n" ) + " branch = .\n" ) + "[submodule \"d\"]\n" ) + " path = d-parent/the-d-folder\n" ) + " url = ssh://localhost/" ) + ( p3.get ( ) ) ) + "\n" ) + "[submodule \"e\"]\n" ) + " path = e\n" ) + " url = ssh://localhost/" ) + ( p4.get ( ) ) ) + "\n" ) + " branch = refs/heads/master\n" ) ) ; java.lang.String thisServer = com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , thisServer , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p1 , "master" ) , "a" ) , new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p4 , "master" ) , "e" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testWithSectionOfNonexistingProject ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( "\n" + ( ( ( "[submodule \"a\"]\n" + "path = a\n" ) + "url = ssh://non-localhost/a\n" ) + "branch = .\\n" ) ) ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch ) . parseAllSections ( ) ; com.google.common.truth.Truth.assertThat ( res ) . isEmpty ( ) ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertCanRead ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > closed ( ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isClosed ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }

Target:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > closed ( ) { return com.google.gerrit.server.query.change.ChangeStatusPredicate.CLOSED ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( argNo ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( objType ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.lang.ExistenceException.EXISTENCE_ERROR , args ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( argNo ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( objType ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.exceptions.ExistenceException.EXISTENCE_ERROR , args ) ; }
Source:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.baseRevision = edit.getBasePatchSet ( ) . getRevision ( ) . get ( ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }

Target:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.baseRevision = edit.getBasePatchSet ( ) . getRevision ( ) . get ( ) ; out.basePatchSetNumber = edit.getBasePatchSet ( ) . getPatchSetId ( ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }
Source:
final java.lang.String get ( com.google.gerrit.prettify.common.SparseFileContent src , com.google.gerrit.prettify.common.EditList.Hunk hunk ) { return src.get ( getCur ( hunk ) ) ; }

Target:
private int compare ( int index , org.eclipse.jgit.diff.Edit edit ) { if ( index < ( side.getBegin ( edit ) ) ) { return - 1 ; } else if ( index < ( side.getEnd ( edit ) ) ) { return 0 ; } else { return 1 ; } }
Source:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) ) ; }

Target:
public void display ( com.google.gerrit.common.data.ChangeDetail chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.getChange ( ) . currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) ) ; }
Source:
private static byte [ ] compress ( final byte [ ] raw ) throws java.io.IOException { final java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; final java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( out ) ; gz.write ( raw ) ; gz.finish ( ) ; gz.flush ( ) ; return out.toByteArray ( ) ; }

Target:
public com.google.gerrit.httpd.raw.StaticServlet.Resource load ( java.lang.String name ) throws java.lang.Exception { return loadResource ( name ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.account.AccountsCollection.class ) ; bind ( com.google.gerrit.server.account.Capabilities.class ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; get ( com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) . to ( GetCapabilities.CheckOne.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.account.AccountsCollection.class ) ; bind ( com.google.gerrit.server.account.Capabilities.class ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "groups" ) . to ( com.google.gerrit.server.account.GetGroups.class ) ; get ( com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) . to ( GetCapabilities.CheckOne.class ) ; }
Source:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; }

Target:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.unset ( "cache" , null , "directory" ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; }
Source:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canEditTopicName ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return refControl.canForceEditTopicName ( ) ; }

Target:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canPerform ( Permission.EDIT_TOPIC_NAME ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return refControl.canForceEditTopicName ( ) ; }
Source:
public void groupCannotBeRenamedWhenUuidIsWrong ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anotherGroupUuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "admins-ABC" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; expectedException.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; expectedException.expectMessage ( groupUuid.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.loadForRename ( repo , anotherGroupUuid , groupName , anotherName ) ; }

Target:
public void groupCannotBeRenamedWhenUuidIsWrong ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anotherGroupUuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "admins-ABC" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; expectedException.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; expectedException.expectMessage ( groupUuid.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.forRename ( repo , anotherGroupUuid , groupName , anotherName ) ; }
Source:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScopes.Context old = SshScopes.current.get ( ) ; try { SshScopes.current.set ( ctx ) ; cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; SshScopes.current.set ( old ) ; } } } }

Target:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; com.google.gerrit.sshd.SshScope.set ( old ) ; } } } }
Source:
private void setListIdHeader ( ) { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( getGerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }

Target:
public java.lang.String getListId ( ) throws com.google.gerrit.server.mail.EmailException { return velocify ( "gerrit-$projectName.replace('/', '-')@$email.gerritHost" ) ; }
Source:
private void checkResult ( org.eclipse.jgit.lib.RefUpdate.Result result ) throws com.google.gwtorm.server.OrmException { if ( ( result != ( RefUpdate.Result.NEW ) ) && ( result != ( RefUpdate.Result.FORCED ) ) ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( "failed to update " + ( refName ) ) + ": " ) + result ) ) ; } }

Target:
private void checkResult ( org.eclipse.jgit.lib.RefUpdate.Result result ) throws com.google.gwtorm.server.OrmException { if ( ( ( result != ( RefUpdate.Result.NEW ) ) && ( result != ( RefUpdate.Result.FORCED ) ) ) && ( result != ( RefUpdate.Result.NO_CHANGE ) ) ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( "failed to update " + ( refName ) ) + ": " ) + result ) ) ; } }
Source:
private void insertDummyChangeApproval ( final com.google.gerrit.server.ssh.commands.Receive.ReplaceResult result , final com.google.gerrit.client.reviewdb.Account.Id forAccount , final com.google.gerrit.client.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.ChangeApproval ca = new com.google.gerrit.client.reviewdb.ChangeApproval ( new com.google.gerrit.client.reviewdb.ChangeApproval.Key ( result.change.getId ( ) , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( result.change ) ; db.changeApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) , txn ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.server.ssh.commands.Receive.ReplaceResult result , final com.google.gerrit.client.reviewdb.Account.Id forAccount , final com.google.gerrit.client.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db , txn ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountGroupName > result ) { final java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > ( result.size ( ) ) ; for ( final com.google.gerrit.reviewdb.AccountGroupName p : result ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( p ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.GroupReference > result ) { priorResults.clear ( ) ; final java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.GroupReference p : result ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( p ) ) ; priorResults.put ( p.getName ( ) , p.getUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
private static boolean acceptsPutInput ( java.lang.Class < java.lang.Object > type ) { for ( java.lang.reflect.Field f : type.getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.PutInput.class ) ) { return true ; } } return false ; }

Target:
private static boolean acceptsRawInput ( java.lang.reflect.Type type ) { if ( type instanceof java.lang.Class ) { for ( java.lang.reflect.Field f : ( ( java.lang.Class ) ( type ) ) . getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.RawInput.class ) ) { return true ; } } } return false ; }
Source:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , change , author , autoRebuild ) ; draftCommentNotes.load ( ) ; } }

Target:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , change , author , autoRebuild , rebuildResult ) ; draftCommentNotes.load ( ) ; } }
Source:
public static void setCacheablePublic ( javax.servlet.http.HttpServletResponse res , long age , java.util.concurrent.TimeUnit unit ) { long now = java.lang.System.currentTimeMillis ( ) ; long sec = com.google.gwtexpui.server.CacheHeaders.maxAgeSeconds ( age , unit ) ; res.setDateHeader ( "Expires" , ( now + ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( sec ) ) ) ) ; res.setDateHeader ( "Date" , now ) ; com.google.gwtexpui.server.CacheHeaders.cache ( res , "public" , age , unit ) ; }

Target:
public static void setCacheablePublic ( javax.servlet.http.HttpServletResponse res , long age , java.util.concurrent.TimeUnit unit , boolean mustRevalidate ) { long now = java.lang.System.currentTimeMillis ( ) ; long sec = com.google.gwtexpui.server.CacheHeaders.maxAgeSeconds ( age , unit ) ; res.setDateHeader ( "Expires" , ( now + ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( sec ) ) ) ) ; res.setDateHeader ( "Date" , now ) ; com.google.gwtexpui.server.CacheHeaders.cache ( res , "public" , age , unit , mustRevalidate ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { setAccountInfoCache ( r.getAccounts ( ) ) ; display ( r.getChange ( ) , r.getMissingApprovals ( ) , r.getApprovals ( ) ) ; } } } ) ; }
Source:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.reviewdb.client.AccountExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( java.util.Objects.equals ( ext.getEmailAddress ( ) , email ) ) { return true ; } } return false ; }

Target:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.reviewdb.client.AccountExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( ( email != null ) && ( email.equalsIgnoreCase ( ext.getEmailAddress ( ) ) ) ) { return true ; } } return false ; }
Source:
public void deleteSshKey ( int seq ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.SshKey sshKeyRes = sshKeys.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( java.lang.Integer.toString ( seq ) ) ) ; deleteSshKey.apply ( sshKeyRes , null ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete SSH key" , e ) ; } }

Target:
public void deleteSshKey ( int seq ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.SshKey sshKeyRes = sshKeys.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( java.lang.Integer.toString ( seq ) ) ) ; deleteSshKey.apply ( sshKeyRes , null ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot delete SSH key" , e ) ; } }
Source:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } saveProjectConfig ( allProjects , pc ) ; }

Target:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } com.google.gerrit.server.project.Util.allow ( pc , Permission.READ , admins , "refs/*" ) ; saveProjectConfig ( allProjects , pc ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.testutil.TestDatabase.dbCnt ) ) ) ) ; final javax.sql.DataSource dataSource = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; return dataSource ; }

Target:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.testutil.InMemoryDatabase.dbCnt ) ) ) ) ; final javax.sql.DataSource dataSource = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; return dataSource ; }
Source:
protected void blockRead ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }
Source:
public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.FileSystemView getNormalizedView ( ) { return this ; } } ; }

Target:
public boolean isOpen ( ) { return false ; }
Source:
public com.google.gerrit.server.group.SubgroupResource parse ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.common.data.GroupDescription.Internal parent = resource.asInternalGroup ( ) . orElseThrow ( MethodNotAllowedException :: new ) ; com.google.gerrit.common.data.GroupDescription.Basic member = groupsCollection.parse ( TopLevelResource.INSTANCE , id ) . getGroup ( ) ; if ( ( resource.getControl ( ) . canSeeGroup ( ) ) && ( com.google.gerrit.server.restapi.group.SubgroupsCollection.isSubgroup ( parent , member ) ) ) { return new com.google.gerrit.server.group.SubgroupResource ( resource , member ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.group.SubgroupResource parse ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.restapi.group.NotInternalGroupException { com.google.gerrit.common.data.GroupDescription.Internal parent = resource.asInternalGroup ( ) . orElseThrow ( NotInternalGroupException :: new ) ; com.google.gerrit.common.data.GroupDescription.Basic member = groupsCollection.parse ( TopLevelResource.INSTANCE , id ) . getGroup ( ) ; if ( ( resource.getControl ( ) . canSeeGroup ( ) ) && ( com.google.gerrit.server.restapi.group.SubgroupsCollection.isSubgroup ( parent , member ) ) ) { return new com.google.gerrit.server.group.SubgroupResource ( resource , member ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public void run ( ) { try { future.get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { fail ( e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( e ) ; } catch ( java.lang.Error e ) { failAndThrow ( e ) ; } finally { synchronized ( progress ) { progress.update ( 1 ) ; } } }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.util.concurrent.RejectedExecutionException e ) { failSilently ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { fail ( e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( e ) ; } catch ( java.lang.Error e ) { failAndThrow ( e ) ; } finally { synchronized ( progress ) { progress.update ( 1 ) ; } } }
Source:
public boolean retryRequest ( org.apache.http.HttpResponse response , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( executionCount > ( cfg.getMaxTries ( ) ) ) { return false ; } if ( ( response.getStatusLine ( ) . getStatusCode ( ) ) >= ( com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.ERROR_CODES ) ) { logRetry ( response.getStatusLine ( ) . getReasonPhrase ( ) ) ; return true ; } return false ; }

Target:
public boolean retryRequest ( org.apache.http.HttpResponse response , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( executionCount > ( cfg.getMaxTries ( ) ) ) { return false ; } if ( ( response.getStatusLine ( ) . getStatusCode ( ) ) >= ( com.ericsson.gerrit.plugins.highavailability.HttpClientProvider.ERROR_CODES ) ) { logRetry ( response.getStatusLine ( ) . getReasonPhrase ( ) ) ; return true ; } return false ; }
Source:
protected void updateValue ( java.lang.String newValue ) { label.setText ( newValue ) ; label.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( newValue ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }

Target:
protected void updateValue ( java.lang.String newValue ) { label.setText ( newValue ) ; label.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( newValue ) ; save.setVisible ( false ) ; if ( ( warning ) != null ) { warning.setVisible ( false ) ; } save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountSshKey k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountSshKey k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } if ( ( table.getRowCount ( ) ) == 1 ) { showAddKeyBlock ( true ) ; } }
Source:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; }

Target:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; diffView = null ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.maybeGet ( id ) . map ( AccountState :: getGeneralPreferences ) . orElseThrow ( ResourceNotFoundException :: new ) ; }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . map ( AccountState :: getGeneralPreferences ) . orElseThrow ( ( ) -> new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id.toString ( ) ) ) ) ; }