auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; reviewerDeleted.fire ( currChange , currPs , reviewer , ctx.getAccount ( ) , changeMessage.getMessage ( ) , newApprovals , oldApprovals , ctx.getWhen ( ) ) ; }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { if ( ( input.notify.compareTo ( NotifyHandling.NONE ) ) > 0 ) { emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; } reviewerDeleted.fire ( currChange , currPs , reviewer , ctx.getAccount ( ) , changeMessage.getMessage ( ) , newApprovals , oldApprovals , input.notify , ctx.getWhen ( ) ) ; }
Source:
public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { cmB.focus ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
Source:
public java.lang.String getLine ( final int i ) { final int s = lines.get ( ( i + 1 ) ) ; int e = lines.get ( ( i + 2 ) ) ; if ( ( content [ ( e - 1 ) ] ) == '\n' ) { e -- ; } return org.eclipse.jgit.util.RawParseUtils.decode ( Constants.CHARSET , content , s , e ) ; }

Target:
private int getLineStart ( final int i ) { return lines.get ( ( i + 1 ) ) ; }
Source:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }
Source:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewersWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewersWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
private java.util.Date parseDate ( java.lang.String date ) throws java.text.ParseException { java.util.Date parsedDate ; try { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_TIME_FORMAT.get ( ) . parse ( date ) ; } catch ( java.text.ParseException e ) { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_ONLY_FORMAT.get ( ) . parse ( date ) ; } return parsedDate ; }

Target:
private java.time.LocalDateTime parseDate ( java.lang.String date ) throws java.time.format.DateTimeParseException { java.time.LocalDateTime parsedDate ; try { parsedDate = java.time.LocalDateTime.parse ( date , com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_TIME_FORMAT ) ; } catch ( java.time.format.DateTimeParseException e ) { java.time.LocalDate localDate = java.time.LocalDate.parse ( date , com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_ONLY_FORMAT ) ; parsedDate = localDate.atStartOfDay ( ) ; } return parsedDate ; }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.LOG.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; response.sendRedirect ( getAuthorizationUrl ( scopesString , ( ( me ( ) ) + ( request.getRequestURI ( ) . toString ( ) ) ) ) ) ; BRANCH ( f8cac0 ) ; com.googlesource.gerrit.plugins.github.oauth.Avoid NPE ; com.googlesource.gerrit.plugins.github.oauth.getting groups ; com.googlesource.gerrit.plugins.github.oauth.anonymous users ; }

Target:
public com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken loginPhase2 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String state ) throws java.io.IOException { java.lang.String requestState = request.getParameter ( "state" ) ; if ( ! ( java.util.Objects.equals ( state , requestState ) ) ) { throw new java.io.IOException ( "Invalid authentication state" ) ; } return getAccessToken ( new com.google.gerrit.extensions.auth.oauth.OAuthVerifier ( request.getParameter ( "code" ) ) ) ; }
Source:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; dst.scrollTo ( si.getLeft ( ) , align ( si.getTop ( ) ) ) ; state = 0 ; } }

Target:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; dst.scrollTo ( si.left ( ) , align ( si.top ( ) ) ) ; state = 0 ; } }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; assigneeLink.setText ( ( ( info.assignee ( ) ) != null ? info.assignee ( ) . name ( ) : "" ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }

Target:
private com.google.gerrit.client.change.Reviewers getReviewers ( ) { com.google.gwt.dom.client.Element e = com.google.gwt.user.client.DOM.getParent ( getElement ( ) ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.ChangeScreen ) { com.google.gerrit.client.change.ChangeScreen screen = ( ( com.google.gerrit.client.change.ChangeScreen ) ( l ) ) ; return screen.reviewers ; } } return null ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.createProjectTitle ( ) ) ; addCreateProjectPanel ( ) ; projectsPopup = new com.google.gerrit.client.ui.ProjectListPopup ( ) { @ java.lang.Override protected void onMovePointerTo ( java.lang.String projectName ) { if ( ( ! ( projectsPopup.isPoppingUp ( ) ) ) || ( "" . equals ( parent.getText ( ) ) ) ) { parent.setText ( projectName ) ; } } } ; projectsPopup.initPopup ( Util.C.projects ( ) , PageLinks.ADMIN_PROJECTS ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( AdminConstants.I.createProjectTitle ( ) ) ; addCreateProjectPanel ( ) ; projectsPopup = new com.google.gerrit.client.ui.ProjectListPopup ( ) { @ java.lang.Override protected void onMovePointerTo ( java.lang.String projectName ) { if ( ( ! ( projectsPopup.isPoppingUp ( ) ) ) || ( "" . equals ( parent.getText ( ) ) ) ) { parent.setText ( projectName ) ; } } } ; projectsPopup.initPopup ( AdminConstants.I.projects ( ) , PageLinks.ADMIN_PROJECTS ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.jdbc.JdbcSchema schema = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; com.google.gwtorm.schema.sql.SqlDialect dialect = schema.getDialect ( ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { dialect.dropIndex ( e , "accounts" , "accounts_byFullName" ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.jdbc.JdbcSchema schema = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; com.google.gwtorm.schema.sql.SqlDialect dialect = schema.getDialect ( ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { dialect.dropIndex ( e , "accounts" , "accounts_byFullName" ) ; } catch ( com.google.gwtorm.server.OrmException ex ) { } }
Source:
public void testParseWHeader ( ) throws java.lang.Exception { com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , ( ( com.google.gerrit.server.git.DestinationListTest.HEADER ) + ( com.google.gerrit.server.git.DestinationListTest.F_SIMPLE ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.git.DestinationListTest.D_SIMPLE ) ; }

Target:
public void testParseWHeader ( ) throws java.lang.Exception { com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , ( ( com.google.gerrit.server.account.DestinationListTest.HEADER ) + ( com.google.gerrit.server.account.DestinationListTest.F_SIMPLE ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.account.DestinationListTest.D_SIMPLE ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; git = com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return user ; }

Target:
public void setUpInjector ( ) throws java.lang.Exception { com.google.inject.Injector injector = createInjector ( ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( userId ) ; requestContext.setContext ( newRequestContext ( userAccount.getId ( ) ) ) ; }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; java.lang.String gy = group ( "gy" , "Administrators" ) ; java.lang.String gz = group ( "gz" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gz ) ) ; assertIncludes ( GET ( ( ( "/groups/" + gx ) + "/groups/" ) ) , gy , gz ) ; }

Target:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; java.lang.String gz = group ( "gz" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gz ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy , gz ) ; }
Source:
public static com.google.gerrit.server.patch.IntraLineDiffArgs create ( com.google.gerrit.server.patch.Text aText , com.google.gerrit.server.patch.Text bText , java.util.List < org.eclipse.jgit.diff.Edit > edits , com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.ObjectId commit , java.lang.String path ) { return new com.google.gerrit.server.patch.AutoValue_IntraLineDiffArgs ( aText , bText , com.google.gerrit.server.patch.IntraLineDiffArgs.deepCopyEdits ( edits ) , project , commit , path ) ; }

Target:
public static com.google.gerrit.server.patch.IntraLineDiffArgs create ( com.google.gerrit.server.patch.Text aText , com.google.gerrit.server.patch.Text bText , java.util.List < org.eclipse.jgit.diff.Edit > edits , java.util.Set < org.eclipse.jgit.diff.Edit > editsDueToRebase , com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.ObjectId commit , java.lang.String path ) { return new com.google.gerrit.server.patch.AutoValue_IntraLineDiffArgs ( aText , bText , com.google.gerrit.server.patch.IntraLineDiffArgs.deepCopyEdits ( edits ) , com.google.gerrit.server.patch.IntraLineDiffArgs.deepCopyEdits ( editsDueToRebase ) , project , commit , path ) ; }
Source:
public void createNewDraftChange ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isTrue ( ) ; assertCreateSucceeds ( newChangeInput ( ChangeStatus.DRAFT ) ) ; }

Target:
public void createChangeWithoutAccessToParentCommitFails ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.acceptance.PushOneCommit.Result > results = changeInTwoBranches ( "invisible-branch" , "a.txt" , "visible-branch" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "visible-branch" ; in.baseChange = results.get ( "invisible-branch" ) . getChangeId ( ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.UnprocessableEntityException.class , ( "Base change not found: " + ( in.baseChange ) ) ) ; }
Source:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : case OAUTH : return true ; case OPENID_SSO : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.client.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }

Target:
public boolean isIdentityTrustable ( java.util.Collection < com.google.gerrit.server.account.ExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : case OAUTH : return true ; case OPENID_SSO : return true ; case OPENID : for ( com.google.gerrit.server.account.ExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
private boolean submittable ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.common.data.SubmitRecord > records = new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . evaluate ( ) ; for ( com.google.gerrit.common.data.SubmitRecord sr : records ) { if ( ( sr.status ) == ( SubmitRecord.Status.OK ) ) { return true ; } } return false ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return cd.submitRecords ( com.google.gerrit.server.change.ChangeJson.SUBMIT_RULE_OPTIONS_LENIENT ) ; }
Source:
private void initProviderJce ( ) { setKeyExchangeFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.KeyExchange > > asList ( new org.apache.sshd.server.kex.DHG1.Factory ( ) ) ) ; setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( new org.apache.sshd.common.random.JceRandom.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 java.util.Optional < com.google.gerrit.extensions.common.EditInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.EditInfo > edit = editDetail.apply ( changeResource ) ; return edit.isNone ( ) ? java.util.Optional.empty ( ) : java.util.Optional.of ( edit.value ( ) ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change edit" , e ) ; } }

Target:
public java.util.Optional < com.google.gerrit.extensions.common.EditInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.EditInfo > edit = editDetail.apply ( changeResource ) ; return edit.isNone ( ) ? java.util.Optional.empty ( ) : java.util.Optional.of ( edit.value ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve change edit" , e ) ; } }
Source:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { updateGroups ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { updateGroups ( db ) ; } } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { updateGroups ( state ) ; } return null ; }
Source:
private static com.google.gerrit.client.ui.Screen mine ( final java.lang.String token ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } else { com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; } }

Target:
private static void unified1 ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; } } ) ; }
Source:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.restoreContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.restore ( curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
private void addExternalIdEmail ( com.google.gerrit.acceptance.TestAccount account , java.lang.String email ) throws java.lang.Exception { com.google.common.base.Preconditions.checkNotNull ( email ) ; com.google.gerrit.reviewdb.client.AccountExternalId extId = new com.google.gerrit.reviewdb.client.AccountExternalId ( account.getId ( ) , new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( name ( "test" ) , email ) ) ; extId.setEmailAddress ( email ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( extId ) ) ; }

Target:
private void addExternalIdEmail ( com.google.gerrit.acceptance.TestAccount account , java.lang.String email ) throws java.lang.Exception { com.google.common.base.Preconditions.checkNotNull ( email ) ; com.google.gerrit.reviewdb.client.AccountExternalId extId = new com.google.gerrit.reviewdb.client.AccountExternalId ( account.getId ( ) , new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( name ( "test" ) , email ) ) ; extId.setEmailAddress ( email ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( extId ) ) ; accountCache.evict ( account.getId ( ) ) ; setApiUser ( account ) ; }
Source:
public static com.google.gerrit.client.account.AccountInfo asInfo ( com.google.gerrit.client.account.AccountInfo acct ) { if ( acct == null ) { return com.google.gerrit.client.account.AccountInfo.create ( 0 , null , null ) ; } return com.google.gerrit.client.account.AccountInfo.create ( ( ( acct.getId ( ) ) != null ? acct.getId ( ) . get ( ) : 0 ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) ) ; }

Target:
public static com.google.gerrit.client.account.AccountInfo asInfo ( com.google.gerrit.client.account.AccountInfo acct ) { if ( acct == null ) { return com.google.gerrit.client.account.AccountInfo.create ( 0 , null , null , null ) ; } return com.google.gerrit.client.account.AccountInfo.create ( ( ( acct.getId ( ) ) != null ? acct.getId ( ) . get ( ) : 0 ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) , acct.getUsername ( ) ) ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.common.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.client.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { return gApi.changes ( ) . id ( id ) . get ( com.google.common.collect.Sets.newEnumSet ( java.util.Arrays.asList ( options ) , com.google.gerrit.extensions.client.ListChangesOption.class ) ) ; }
Source:
public void customConflictMessageWithConflictSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch}: ${conflict}" , topic ) ; java.lang.String branch1String = "branch1: branch1 merge conflict" ; java.lang.String branch2String = "branch2: branch2 merge conflict" ; java.lang.String branch3String = "branch3: branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithConflictSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${branch}: ${conflict}" , topic ) ; java.lang.String branch1String = "branch1: branch1 merge conflict" ; java.lang.String branch2String = "branch2: branch2 merge conflict" ; java.lang.String branch3String = "branch3: branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
private < T > org.elasticsearch.index.query.QueryBuilder not ( com.google.gerrit.server.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.query.Predicate < T > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.server.index.TimestampRangePredicate < T > ) ( n ) ) ) ; } org.elasticsearch.index.query.BoolQueryBuilder q = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; q.must ( org.elasticsearch.index.query.QueryBuilders.matchAllQuery ( ) ) ; q.mustNot ( toQueryBuilder ( n ) ) ; return q ; }

Target:
private < T > org.elasticsearch.index.query.QueryBuilder not ( com.google.gerrit.index.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.index.query.Predicate < T > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.index.query.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.index.query.TimestampRangePredicate < T > ) ( n ) ) ) ; } org.elasticsearch.index.query.BoolQueryBuilder q = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; q.must ( org.elasticsearch.index.query.QueryBuilders.matchAllQuery ( ) ) ; q.mustNot ( toQueryBuilder ( n ) ) ; return q ; }
Source:
private < T > org.elasticsearch.index.query.QueryBuilder notTimestamp ( com.google.gerrit.server.index.TimestampRangePredicate < T > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.elasticsearch.index.query.QueryBuilders.rangeQuery ( r.getField ( ) . getName ( ) ) . gt ( new org.joda.time.DateTime ( r.getMaxTimestamp ( ) . getTime ( ) ) ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }

Target:
private < T > org.elasticsearch.index.query.QueryBuilder notTimestamp ( com.google.gerrit.server.index.TimestampRangePredicate < T > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.elasticsearch.index.query.QueryBuilders.rangeQuery ( r.getField ( ) . getName ( ) ) . gt ( java.time.Instant.ofEpochMilli ( r.getMaxTimestamp ( ) . getTime ( ) ) ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }
Source:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return get ( accountCache , emails , repo , changeData , changeData.currentPatchSet ( ) . getId ( ) . get ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return get ( projectState , accountCache , emails , repo , changeData , changeData.currentPatchSet ( ) . getId ( ) . get ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.PatchSetApproval dummyApproval ( final com.google.gerrit.reviewdb.PatchSet.Id patchSetId , final com.google.gerrit.reviewdb.Account.Id reviewerId ) { return new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( patchSetId , reviewerId , addReviewerCategoryId ) , ( ( short ) ( 0 ) ) ) ; }

Target:
private com.google.gerrit.reviewdb.PatchSetApproval dummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id patchSetId , final com.google.gerrit.reviewdb.Account.Id reviewerId ) { final com.google.gerrit.reviewdb.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( patchSetId , reviewerId , addReviewerCategoryId ) , ( ( short ) ( 0 ) ) ) ; dummyApproval.cache ( change ) ; return dummyApproval ; }
Source:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; pendingGroup = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , pendingGroup.addFinal ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { pendingGroup = null ; removeUI ( ) ; } } ) ) ; } }

Target:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; pendingGroup = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( Project.NameKey.asStringOrNull ( project ) , psId , comment.id ( ) , pendingGroup.addFinal ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { pendingGroup = null ; removeUI ( ) ; } } ) ) ; } }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( new com.google.gerrit.server.notedb.NoteDbModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; install ( new com.google.gerrit.server.notedb.NoteDbModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.change ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.notes ( ) ) ; } return r ; }
Source:
boolean isSingleProjectMatch ( ) { boolean ret = ( projects.length ) == 1 ; if ( ret ) { java.lang.String projectMatch = projects [ 0 ] ; if ( ( com.googlesource.gerrit.plugins.replication.Destination.isRE ( projectMatch ) ) || ( com.googlesource.gerrit.plugins.replication.Destination.isWildcard ( projectMatch ) ) ) { ret = false ; } } return ret ; }

Target:
boolean isSingleProjectMatch ( ) { boolean ret = ( projects.length ) == 1 ; if ( ret ) { java.lang.String projectMatch = projects [ 0 ] ; if ( ( com.googlesource.gerrit.plugins.replication.ReplicationFilter.getPatternType ( projectMatch ) ) != ( ReplicationFilter.PatternType.EXACT_MATCH ) ) { ret = false ; } } return ret ; }
Source:
private static java.lang.String pad ( int len , java.lang.String src ) { if ( len <= ( src.length ( ) ) ) { return src ; } java.lang.StringBuilder r = new java.lang.StringBuilder ( len ) ; r.append ( src ) ; while ( ( r.length ( ) ) < len ) { r.append ( ' ' ) ; } return r.toString ( ) ; }

Target:
private void saveGroupList ( ) throws java.io.IOException { saveUTF8 ( GroupList.FILE_NAME , groupList.asText ( ) ) ; }
Source:
private void onFailure ( java.lang.Throwable caught ) { if ( failed ) { return ; } failed = true ; for ( java.lang.Object o : callbacks ) { if ( o instanceof com.google.gwt.user.client.rpc.AsyncCallback ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Object > cb = ( ( com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Object > ) ( o ) ) ; cb.onFailure ( caught ) ; } else { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.gwtjsonrpc.common.AsyncCallback < java.lang.Object > cb = ( ( com.google.gwtjsonrpc.common.AsyncCallback < java.lang.Object > ) ( o ) ) ; cb.onFailure ( caught ) ; } } }

Target:
void applySuccess ( ) { com.google.gwt.user.client.rpc.AsyncCallback < T > cb = delegate ; if ( cb != null ) { delegate = null ; cb.onSuccess ( result ) ; result = null ; } }
Source:
public java.util.Set < com.google.gerrit.server.permissions.GlobalPermission > test ( java.util.Collection < com.google.gerrit.server.permissions.GlobalPermission > permSet ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.EnumSet < com.google.gerrit.server.permissions.GlobalPermission > ok = java.util.EnumSet.noneOf ( com.google.gerrit.server.permissions.GlobalPermission.class ) ; for ( com.google.gerrit.server.permissions.GlobalPermission perm : permSet ) { if ( can ( perm ) ) { ok.add ( perm ) ; } } return ok ; }

Target:
public < T extends com.google.gerrit.server.permissions.GlobalOrPluginPermission > java.util.Set < T > test ( java.util.Collection < T > permSet ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.Set < T > ok = com.google.gerrit.server.project.DefaultPermissionBackend.newSet ( permSet ) ; for ( T perm : permSet ) { if ( can ( perm ) ) { ok.add ( perm ) ; } } return ok ; }
Source:
private void initSystemConfig ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.SystemConfig s = com.google.gerrit.client.reviewdb.SystemConfig.create ( ) ; s.xsrfPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.accountPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; c.systemConfig ( ) . insert ( java.util.Collections.singleton ( s ) ) ; }

Target:
private void initSystemConfig ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.SystemConfig s = com.google.gerrit.client.reviewdb.SystemConfig.create ( ) ; s.xsrfPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.accountPrivateKey = com.google.gwtjsonrpc.server.SignedToken.generateRandomKey ( ) ; s.sshdPort = 29418 ; c.systemConfig ( ) . insert ( java.util.Collections.singleton ( s ) ) ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; com.google.gerrit.client.diff.PreferencesBox pb = new com.google.gerrit.client.diff.PreferencesBox ( null ) ; pb.set ( com.google.gerrit.client.account.DiffPreferences.create ( com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ) ) ; com.google.gwt.user.client.ui.FlowPanel p = new com.google.gwt.user.client.ui.FlowPanel ( ) ; p.setStyleName ( pb.getStyle ( ) . dialog ( ) ) ; p.add ( pb ) ; add ( p ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; com.google.gerrit.client.diff.PreferencesBox pb = new com.google.gerrit.client.diff.PreferencesBox ( null ) ; pb.set ( com.google.gerrit.client.account.DiffPreferences.create ( com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ) ) ; com.google.gwt.user.client.ui.FlowPanel p = new com.google.gwt.user.client.ui.FlowPanel ( ) ; p.setStyleName ( pb.getStyle ( ) . dialog ( ) ) ; p.add ( pb ) ; add ( p ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.common.base.Optional < com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > > ( ) { } ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.peers.PluginConfigPeerInfoProvider.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.common.base.Optional < com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > > ( ) { } ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoProvider.class ) ; if ( ( strategy ) == ( Configuration.PeerInfoStrategy.JGROUPS ) ) { listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.class ) ; } }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.common.errors.EmailException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) . forUser ( identifiedUserFactory.create ( id ) ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( id , control ) ) ; return result ; }
Source:
private void load ( ) throws java.io.IOException { close ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { tip = rw.parseCommit ( ref.getObjectId ( ) ) ; notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tip ) ; } }

Target:
private void load ( ) throws java.io.IOException { reset ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { tip = rw.parseCommit ( ref.getObjectId ( ) ) ; notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tip ) ; } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { return getGroupMembers ( groupCache.get ( groupUUID ) , project , seen ) ; } }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } else { return java.util.Collections.emptySet ( ) ; } } }
Source:
public static com.google.gerrit.reviewdb.client.PatchSet newPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , org.eclipse.jgit.lib.ObjectId revision , com.google.gerrit.reviewdb.client.Account.Id userId ) { com.google.gerrit.reviewdb.client.PatchSet ps = new com.google.gerrit.reviewdb.client.PatchSet ( id ) ; ps.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( revision.name ( ) ) ) ; ps.setUploader ( userId ) ; ps.setCreatedOn ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; return ps ; }

Target:
public static com.google.gerrit.reviewdb.client.PatchSet newPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , org.eclipse.jgit.lib.ObjectId revision , com.google.gerrit.reviewdb.client.Account.Id userId ) { return com.google.gerrit.testutil.TestChanges.newPatchSet ( id , revision.name ( ) , userId ) ; }
Source:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else { return ( session.isSignedIn ( ) ) && ( session.isValidAuthorization ( keyIn ) ) ; } }

Target:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else if ( ( session.isSignedIn ( ) ) && ( session.isValidAuthorization ( keyIn ) ) ) { session.getCurrentUser ( ) . setAccessPath ( AccessPath.JSON_RPC ) ; return true ; } return false ; }
Source:
public void testIsEnabledEventMultiBranchMixedMatchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" , "refs/heads/foo.*" } ; 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 testIsEnabledEventMultiBranchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/foo" , "refs/heads/testBranch" } ; 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 ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }