auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id psId , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.PatchSetApproval ca = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }

Target:
public java.lang.String toString ( ) { return "send-email newchange" ; }
Source:
private void addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountInfo > map , com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.server.account.AccountInfo info , com.google.gerrit.server.change.SuggestReviewers.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { if ( ( ( ( ! ( map.containsKey ( account.getId ( ) ) ) ) && ( account.isActive ( ) ) ) && ( visibilityControl.isVisibleTo ( account ) ) ) && ( accountControlFactory.get ( ) . canSee ( account ) ) ) { map.put ( account.getId ( ) , info ) ; } }

Target:
private void addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.extensions.common.AccountInfo info , com.google.gerrit.server.change.SuggestReviewers.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { if ( ( ( ( ! ( map.containsKey ( account.getId ( ) ) ) ) && ( account.isActive ( ) ) ) && ( visibilityControl.isVisibleTo ( account ) ) ) && ( accountControlFactory.get ( ) . canSee ( account ) ) ) { map.put ( account.getId ( ) , info ) ; } }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return gpgApiAdapter.putGpgKeys ( account , add , delete ) ; } catch ( com.google.gerrit.server.GpgException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot add GPG key" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return gpgApiAdapter.putGpgKeys ( account , add , delete ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot add GPG key" , e ) ; } }
Source:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( context ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.pgm.util.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.pgm.util.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( context ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
public boolean canAccessRepository ( java.lang.String repositoryName ) { boolean result = false ; try { com.google.gerrit.server.project.ProjectControl control = projectControlFactory.validateFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( repositoryName ) ) ; result = control != null ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }

Target:
public boolean canAccessRepository ( java.lang.String repositoryName ) { boolean result = false ; try { com.google.gerrit.server.project.ProjectControl control = projectControlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( repositoryName ) ) ; result = control != null ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }
Source:
protected void configure ( ) { factory ( AbandonedSender.Factory.class ) ; factory ( CommentSender.Factory.class ) ; factory ( RevertedSender.Factory.class ) ; factory ( RestoredSender.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonedSender.Factory.class ) ; factory ( CommentSender.Factory.class ) ; factory ( DeleteReviewerSender.Factory.class ) ; factory ( DeleteVoteSender.Factory.class ) ; factory ( RestoredSender.Factory.class ) ; factory ( RevertedSender.Factory.class ) ; }
Source:
public static java.lang.String toProjectOpen ( final com.google.gerrit.client.reviewdb.Project.NameKey proj ) { return ( "project,open," + ( proj.toString ( ) ) ) + ",n,z" ; }

Target:
public static java.lang.String toProject ( final com.google.gerrit.client.reviewdb.Project.NameKey proj , com.google.gerrit.client.reviewdb.Change.Status status ) { switch ( status ) { case ABANDONED : return ( "project,abandoned," + ( proj.toString ( ) ) ) + ",n,z" ; case MERGED : return ( "project,merged," + ( proj.toString ( ) ) ) + ",n,z" ; case NEW : case SUBMITTED : default : return ( "project,open," + ( proj.toString ( ) ) ) + ",n,z" ; } }
Source:
public void onSuccess ( final com.google.gerrit.client.reviewdb.PatchLineComment result ) { comment = result ; text.setReadOnly ( false ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.reviewdb.PatchLineComment result ) { if ( isNew ( ) ) { notifyDraftDelta ( 1 ) ; } comment = result ; text.setReadOnly ( false ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; }
Source:
public com.google.gerrit.metrics.Timer newTimer ( java.lang.String name , com.google.gerrit.metrics.Description desc ) { com.google.gerrit.metrics.Timer m = root.newTimer ( ( ( prefix ) + name ) , desc ) ; cleanup.add ( m ) ; return m ; }

Target:
public < F1 > com.google.gerrit.metrics.Counter1 < F1 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.Counter1 < F1 > m = root.newCounter ( ( ( prefix ) + name ) , desc , field1 ) ; cleanup.add ( m ) ; return m ; }
Source:
public static void deleteRevision ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.revision ( id , commit ) . delete ( cb ) ; }

Target:
public static void submit ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "submit" ) . post ( in , cb ) ; }
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 void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? assignee.name ( ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
public void postRun ( ) throws java.lang.Exception { }

Target:
private void initSignedPush ( ) { boolean def = flags.cfg.getBoolean ( com.google.gerrit.pgm.init.InitAuth.RECEIVE , com.google.gerrit.pgm.init.InitAuth.ENABLE_SIGNED_PUSH , false ) ; boolean enable = ui.yesno ( def , "Enable signed push support" ) ; receive.set ( "enableSignedPush" , java.lang.Boolean.toString ( enable ) ) ; if ( enable ) { libraries.bouncyCastleProvider.downloadRequired ( ) ; libraries.bouncyCastlePGP.downloadRequired ( ) ; } }
Source:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.sshd.args4j.AccountIdHandler.class ) ; registerOptionHandler ( AccountGroup.Id.class , com.google.gerrit.sshd.args4j.AccountGroupIdHandler.class ) ; registerOptionHandler ( AccountGroup.UUID.class , com.google.gerrit.sshd.args4j.AccountGroupUUIDHandler.class ) ; registerOptionHandler ( org.eclipse.jgit.lib.ObjectId.class , com.google.gerrit.sshd.args4j.ObjectIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.sshd.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.sshd.args4j.ProjectControlHandler.class ) ; registerOptionHandler ( java.net.SocketAddress.class , com.google.gerrit.sshd.args4j.SocketAddressHandler.class ) ; }

Target:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.sshd.args4j.AccountIdHandler.class ) ; registerOptionHandler ( AccountGroup.Id.class , com.google.gerrit.sshd.args4j.AccountGroupIdHandler.class ) ; registerOptionHandler ( AccountGroup.UUID.class , com.google.gerrit.sshd.args4j.AccountGroupUUIDHandler.class ) ; registerOptionHandler ( Change.Id.class , com.google.gerrit.sshd.args4j.ChangeIdHandler.class ) ; registerOptionHandler ( org.eclipse.jgit.lib.ObjectId.class , com.google.gerrit.sshd.args4j.ObjectIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.sshd.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.sshd.args4j.ProjectControlHandler.class ) ; registerOptionHandler ( java.net.SocketAddress.class , com.google.gerrit.sshd.args4j.SocketAddressHandler.class ) ; }
Source:
public java.lang.String getRequestURI ( ) { java.lang.String uri = ( ( contextPath ) + ( servletPath ) ) + ( path ) ; if ( ! ( parameters.isEmpty ( ) ) ) { uri += "?" + ( com.google.gerrit.util.http.testutil.FakeHttpServletRequest.paramsToString ( parameters ) ) ; } return uri ; }

Target:
public java.lang.String getRequestURI ( ) { java.lang.String uri = ( ( contextPath ) + ( servletPath ) ) + ( path ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( queryString ) ) ) { uri += '?' + ( queryString ) ; } return uri ; }
Source:
protected void addQuery ( final com.google.gwtorm.schema.QueryModel q ) { queries.add ( q ) ; }

Target:
protected void addQuery ( final com.google.gwtorm.schema.QueryModel q ) throws com.google.gwtorm.client.OrmException { for ( com.google.gwtorm.schema.QueryModel e : queries ) { if ( e.getName ( ) . equals ( q.getName ( ) ) ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( "Duplicate query " + ( q.getName ( ) ) ) + " in " ) + ( getAccessInterfaceName ( ) ) ) ) ; } } queries.add ( q ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInNoteDb ( ) 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%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . to ( sc.owner , sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , sc.ccer ) . noOneElse ( ) ; }
Source:
private void refreshObjectIds ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } }

Target:
public int hashCode ( ) { int h = 0 ; if ( ( oldIdName ) != null ) { h = ( h * 31 ) + ( getOldId ( ) . hashCode ( ) ) ; } h = ( h * 31 ) + ( getNewId ( ) . hashCode ( ) ) ; h = ( h * 31 ) + ( whitespaceCode ) ; return h ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.change.ChangeResource resource ) { return ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) && ( resource.getControl ( ) . getRefControl ( ) . canUpload ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) && ( resource.getControl ( ) . getRefControl ( ) . canUpload ( ) ) ) ) ; }
Source:
public com.google.gerrit.server.notedb.BatchMetaDataUpdate openUpdate ( com.google.gerrit.server.git.MetaDataUpdate update ) throws java.io.IOException { if ( migration.write ( ) ) { return super . openUpdate ( update ) ; } return new com.google.gerrit.server.notedb.BatchMetaDataUpdate ( ) { @ java.lang.Override public void write ( org.eclipse.jgit.lib.CommitBuilder commit ) { } @ java.lang.Override public void write ( com.google.gerrit.server.git.VersionedMetaData config , org.eclipse.jgit.lib.CommitBuilder commit ) { } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit createRef ( java.lang.String refName ) { return null ; } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit commit ( ) { return null ; } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit commitAt ( org.eclipse.jgit.lib.ObjectId revision ) { return null ; } @ java.lang.Override public void close ( ) { } } ; }

Target:
private void load ( ) throws java.io.IOException { if ( ( migration.write ( ) ) && ( ( getRevision ( ) ) == null ) ) { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( getChange ( ) . getProject ( ) ) ; try { load ( repo ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } finally { repo.close ( ) ; } } }
Source:
public void onPostReceive ( org.eclipse.jgit.transport.ReceivePack rp , java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { com.google.gerrit.reviewdb.client.Project.NameKey project = projectName ( rp ) ; try { cache.get ( project ) . getAndAdd ( rp.getPackSize ( ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.log.warn ( ( "Couldn't process onPostReceive for " + ( project.get ( ) ) ) , e ) ; } }

Target:
public void onPostReceive ( org.eclipse.jgit.transport.ReceivePack rp , java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { com.google.gerrit.reviewdb.client.Project.NameKey project = projectNameResolver.projectName ( rp.getRepository ( ) ) ; try { cache.get ( project ) . getAndAdd ( rp.getPackSize ( ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.log.warn ( ( "Couldn't process onPostReceive for " + ( project.get ( ) ) ) , e ) ; } }
Source:
private static java.lang.String oldFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { return fh.getOldName ( ) ; } if ( ( key.getSourceFileName ( ) ) != null ) { return key.getSourceFileName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String newFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getNewMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getNewName ( ) ) ) { return null ; } return fh.getNewName ( ) ; } return key.getFileName ( ) ; }
Source:
private void replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { config.commit ( md ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.project.ChangeControl ctl ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , perm , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }
Source:
private void setBase ( ) throws java.io.IOException { org.eclipse.jgit.lib.Ref notesBranch = db.getRef ( com.google.gerrit.server.git.CreateCodeReviewNotes.REFS_NOTES_REVIEW ) ; if ( notesBranch != null ) { baseCommit = revWalk.parseCommit ( notesBranch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } }

Target:
public void loadBase ( ) throws java.io.IOException { org.eclipse.jgit.lib.Ref notesBranch = db.getRef ( com.google.gerrit.server.git.GitRepositoryManager.REFS_NOTES_REVIEW ) ; if ( notesBranch != null ) { baseCommit = revWalk.parseCommit ( notesBranch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } if ( ( baseCommit ) != null ) { ours = org.eclipse.jgit.notes.NoteMap.read ( db.newObjectReader ( ) , baseCommit ) ; } else { ours = org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } }
Source:
public void run ( ) { cm.execCommand ( "jumpToLine" ) ; }

Target:
public void run ( ) { java.lang.String n = com.google.gwt.user.client.Window.prompt ( EditConstants.I.gotoLineNumber ( ) , "" ) ; if ( n != null ) { try { int line = java.lang.Integer.parseInt ( n ) ; line -- ; if ( line >= 0 ) { cm.scrollToLine ( line ) ; } } catch ( java.lang.NumberFormatException e ) { } } }
Source:
protected void configure ( ) { get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.PutConfig.class ) ; get ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "verifications" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.GetVerifications.class ) ; post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "verifications" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.PostVerification.class ) ; }

Target:
protected void configure ( ) { get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.PutConfig.class ) ; get ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "verifications" ) . to ( com.googlesource.gerrit.plugins.verifystatus.server.GetVerifications.class ) ; post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "verifications" ) . to ( com.googlesource.gerrit.plugins.verifystatus.PostVerification.class ) ; }
Source:
boolean isDraft ( ) { return draft ; }

Target:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
public void testAddSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" ) . inOrder ( ) ; }

Target:
public void testAddSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; assertMessage ( r , "Hashtag added: tag2" ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" ) . inOrder ( ) ; assertMessage ( r , "Hashtag added: tag1" ) ; }
Source:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; com.google.gerrit.server.notedb.ConfigNotesMigration.setAllEnabledConfig ( cfg ) ; return cfg ; }

Target:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.ConfigNotesMigration.Table t : com.google.gerrit.server.notedb.ConfigNotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.READ , true ) ; } return cfg ; }
Source:
void onPost ( com.google.gwt.event.dom.client.ClickEvent e ) { in.message ( getMessage ( ) ) ; in.prePost ( ) ; com.google.gerrit.client.changes.ChangeApi.revision ( psId.getParentKey ( ) . get ( ) , revision ) . view ( "review" ) . post ( in , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId.getParentKey ( ) , java.lang.String.valueOf ( psId.get ( ) ) ) ) ; } } ) ; hide ( ) ; }

Target:
void onPost ( com.google.gwt.event.dom.client.ClickEvent e ) { postReview ( ) ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.client.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } com.google.gerrit.client.FormatUtil.setPreferences ( com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; onModuleLoad2 ( result ) ; }
Source:
private static void query ( final java.lang.String token ) { final java.lang.String s = com.google.gerrit.client.Dispatcher.skip ( token ) ; final int c = s.indexOf ( ',' ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.QueryScreen ( s.substring ( 0 , c ) , s.substring ( ( c + 1 ) ) ) ) ; }

Target:
private static void extension ( final java.lang.String token ) { com.google.gerrit.client.api.ExtensionScreen view = new com.google.gerrit.client.api.ExtensionScreen ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ; if ( view.isFound ( ) ) { com.google.gerrit.client.Gerrit.display ( token , view ) ; } else { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( com.google.gerrit.reviewdb.client.AccountGroup.UUID key ) throws com.google.gwtorm.server.OrmException { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getParentGroups ( db , key ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( com.google.gerrit.reviewdb.client.AccountGroup.UUID key ) throws com.google.gwtorm.server.OrmException { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getParentGroups ( db , key ) . map ( groupCache :: get ) . map ( AccountGroup :: getGroupUUID ) . filter ( java.util.Objects :: nonNull ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } }
Source:
public java.util.Collection < com.google.gerrit.common.data.SubmitRecord > evaluate ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.server.project.SubmitRuleOptions opts ) { return getEvaluator ( cd , opts ) . evaluate ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.common.data.SubmitRecord > evaluate ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.server.project.SubmitRuleOptions opts ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( cd.project ( ) ) ; if ( ( projectState == null ) || ( ! ( projectState.hasPrologRules ( ) ) ) ) { return java.util.Collections.emptyList ( ) ; } return getEvaluator ( cd , opts ) . evaluate ( ) ; }
Source:
private java.util.Set < java.lang.String > getRequestedFields ( ) { if ( ( requestedFields ) != null ) { return requestedFields ; } com.google.gerrit.server.index.ChangeIndex index = indexes.getSearchIndex ( ) ; return index != null ? index.getSchema ( ) . getStoredFields ( ) . keySet ( ) : com.google.common.collect.ImmutableSet.< java.lang.String > of ( ) ; }

Target:
private java.util.Set < java.lang.String > getRequestedFields ( ) { if ( ( requestedFields ) != null ) { return requestedFields ; } com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; return index != null ? index.getSchema ( ) . getStoredFields ( ) . keySet ( ) : com.google.common.collect.ImmutableSet.< java.lang.String > of ( ) ; }
Source:
void insertPatchSetWithoutBatchUpdate ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , java.io.IOException { try ( com.google.gerrit.server.git.BatchUpdate bu = batchUpdateFactory.create ( db , projectControl.getProject ( ) . getNameKey ( ) , user , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ) { bu.setRepository ( repo , rp.getRevWalk ( ) , ins ) ; addOps ( bu , replaceProgress ) ; bu.execute ( ) ; } }

Target:
void insertPatchSetWithoutBatchUpdate ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , java.io.IOException { try ( com.google.gerrit.server.git.BatchUpdate bu = batchUpdateFactory.create ( db , projectControl.getProject ( ) . getNameKey ( ) , user , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ) { bu.setRepository ( repo , rp.getRevWalk ( ) , ins ) ; bu.setRequestId ( receiveId ) ; addOps ( bu , replaceProgress ) ; bu.execute ( ) ; } }
Source:
private com.google.template.soy.data.SoyMapData toSoyMapData ( com.google.gitiles.RepositoryDescription desc , com.google.gitiles.GitilesView view ) { return new com.google.template.soy.data.SoyMapData ( "name" , desc.name , "description" , com.google.common.base.Strings.nullToEmpty ( desc.description ) , "url" , com.google.gitiles.GitilesView.repositoryIndex ( ) . copyFrom ( view ) . setRepositoryName ( desc.name ) . toUrl ( ) ) ; }

Target:
private com.google.template.soy.data.SoyMapData toSoyMapData ( com.google.gitiles.RepositoryDescription desc , @ javax.annotation.Nullable java.lang.String prefix , com.google.gitiles.GitilesView view ) { return new com.google.template.soy.data.SoyMapData ( "name" , com.google.gitiles.HostIndexServlet.stripPrefix ( prefix , desc.name ) , "description" , com.google.common.base.Strings.nullToEmpty ( desc.description ) , "url" , com.google.gitiles.GitilesView.repositoryIndex ( ) . copyFrom ( view ) . setRepositoryName ( desc.name ) . toUrl ( ) ) ; }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , remote , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
public void abandonWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > fastHideRefsMetaConfig ( java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs ) { if ( ( refs.containsKey ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ) && ( ! ( projectCtl.controlForRef ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) . isVisible ( ) ) ) ) { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > r = new java.util.HashMap ( refs ) ; r.remove ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ; return r ; } return refs ; }

Target:
private boolean canReadRef ( java.lang.String ref ) { try { permissionBackend.user ( user ) . project ( projectCtl.getProject ( ) . getNameKey ( ) ) . ref ( ref ) . check ( RefPermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { com.google.gerrit.server.git.VisibleRefFilter.log.error ( "unable to check permissions" , e ) ; return false ; } return true ; }
Source:
public void removeOldEvents ( int maxAge ) throws java.sql.SQLException { execute ( java.lang.String.format ( "DELETE FROM %s WHERE %s < '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , new java.sql.Timestamp ( ( ( java.lang.System.currentTimeMillis ( ) ) - ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( maxAge , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ) ) ; }

Target:
void removeOldEvents ( int maxAge ) { try { execute ( java.lang.String.format ( "DELETE FROM %s WHERE %s < '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , new java.sql.Timestamp ( ( ( java.lang.System.currentTimeMillis ( ) ) - ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( maxAge , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ) ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLClient.log.warn ( "Cannot remove old event entries from database" , e ) ; } }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }

Target:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.toAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }
Source:
protected void postExecute ( java.lang.String errorMsg ) { if ( errorMsg != null ) { v.setEnabled ( true ) ; v.setBackgroundColor ( widgetUtil.color ( R.color.button ) ) ; widgetUtil.showError ( errorMsg ) ; } else { display ( com.google.reviewit.SortChangesFragment.class ) ; } }

Target:
public void onActivityCreated ( android.os.Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; com.google.reviewit.util.TaskObserver.enableProgressBar ( getWindow ( ) ) ; getWindow ( ) . setSoftInputMode ( WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN ) ; int vote = getArguments ( ) . getInt ( com.google.reviewit.PostReviewFragment.VOTE ) ; com.google.reviewit.app.Change change = getApp ( ) . getCurrentChange ( ) ; setTitle ( getString ( R.string.detailed_change_title , change.info._number ) ) ; ( ( com.google.reviewit.widget.PostReviewView ) ( v ( R.id.postReview ) ) ) . init ( getApp ( ) , this , vote , com.google.reviewit.SortChangesFragment.class ) ; }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( accountCache , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( accountCache , accounts , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ( fg && ( ( revision ) != null ) ? com.google.gerrit.common.changes.ListChangesOption.ALL_REVISIONS : com.google.gerrit.common.changes.ListChangesOption.CURRENT_REVISION ) ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , boolean isChangeOwner ) { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else if ( SystemGroupBackend.CHANGE_OWNER.equals ( uuid ) ) { return isChangeOwner ; } else { return user.getEffectiveGroups ( ) . contains ( uuid ) ; } }

Target:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , boolean isChangeOwner ) { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else if ( SystemGroupBackend.CHANGE_OWNER.equals ( uuid ) ) { return isChangeOwner ; } else { return user.memberOf ( uuid ) ; } }
Source:
public com.google.gerrit.server.account.AccountInfo get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountInfo.Loader accountLoader = accountLoaderFactory.create ( true ) ; try { com.google.gerrit.server.account.AccountInfo ai = accountLoader.get ( account.getUser ( ) . getAccountId ( ) ) ; accountLoader.fill ( ) ; return com.google.gerrit.server.api.accounts.AccountInfoMapper.fromAcountInfo ( ai ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.AccountInfo get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountLoader accountLoader = accountLoaderFactory.create ( true ) ; try { com.google.gerrit.extensions.common.AccountInfo ai = accountLoader.get ( account.getUser ( ) . getAccountId ( ) ) ; accountLoader.fill ( ) ; return ai ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse change" , e ) ; } }
Source:
public final com.google.gerrit.extensions.client.EditPreferencesInfo copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; return p ; }

Target:
public final com.google.gerrit.extensions.client.EditPreferencesInfo copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.indentUnit = indentUnit ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; return p ; }
Source:
public static void addMembers ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , java.util.Set < java.lang.String > members , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.groups.MemberInfo > > cb ) { com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.groups.GroupApi.membersBase ( groupUUID ) ) ; com.google.gerrit.client.groups.GroupApi.MemberInput input = com.google.gerrit.client.groups.GroupApi.MemberInput.create ( ) ; for ( java.lang.String member : members ) { input.add_member ( member ) ; } call.data ( input ) . put ( cb ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { cb.onFailure ( caught ) ; }
Source:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; createProject ( someProject.get ( ) ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . get ( ) ) . containsExactly ( allProjects , allUsers , project , someProject ) . inOrder ( ) ; }

Target:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = createProject ( "some-project" ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( filter ( gApi.projects ( ) . list ( ) . get ( ) ) ) . containsExactly ( allProjects , allUsers , project , someProject ) . inOrder ( ) ; }
Source:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotForceUpdate ( "refs/heads/master" , u ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > cacheInfos = new java.util.TreeMap < > ( ) ; for ( java.util.Map.Entry < java.lang.String , com.google.common.cache.Cache < ? , ? > > entry : getCaches ( ) . entrySet ( ) ) { cacheInfos.put ( entry.getKey ( ) , new com.google.gerrit.server.config.ListCaches.CacheInfo ( entry.getValue ( ) ) ) ; } return cacheInfos ; }

Target:
public com.google.gerrit.server.config.ListCaches setFormat ( com.google.gerrit.server.config.ListCaches.OutputFormat format ) { this . format = format ; return this ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; int rest = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 30 ; cm.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ) ) ; cm.refresh ( ) ; cm.focus ( ) ; }

Target:
public void run ( ) { java.lang.String n = com.google.gwt.user.client.Window.prompt ( EditConstants.I.gotoLineNumber ( ) , "" ) ; if ( n != null ) { try { int line = java.lang.Integer.parseInt ( n ) ; line -- ; if ( line >= 0 ) { cm.scrollToLine ( line ) ; } } catch ( java.lang.NumberFormatException e ) { } } }
Source:
public java.lang.String toRefName ( ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; int change = changeId.get ( ) ; int m = change % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( change ) ; r.append ( '/' ) ; r.append ( patchSetId ) ; return r.toString ( ) ; }

Target:
public java.lang.String toRefName ( ) { return changeId.refPrefixBuilder ( ) . append ( patchSetId ) . toString ( ) ; }
Source:
public void testKeyObjectId ( ) throws java.lang.Exception { org.bouncycastle.openpgp.PGPPublicKey key = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) . getPublicKey ( ) ; java.lang.String objId = com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key.getKeyID ( ) ) . name ( ) ; org.junit.Assert.assertEquals ( "ed0625dc46328a8c000000000000000000000000" , objId ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) . toLowerCase ( ) , objId.substring ( 8 , 16 ) ) ; }

Target:
public void testKeyObjectId ( ) throws java.lang.Exception { org.bouncycastle.openpgp.PGPPublicKey key = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) . getPublicKey ( ) ; java.lang.String objId = com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key.getKeyID ( ) ) . name ( ) ; org.junit.Assert.assertEquals ( "ed0625dc46328a8c000000000000000000000000" , objId ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) . toLowerCase ( ) , objId.substring ( 8 , 16 ) ) ; }