auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.googlesource.gerrit.plugins.importer.ImportGroup.Input input ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.PreconditionFailedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.group.GroupJson.GroupInfo groupInfo ; this . api = apiFactory.create ( input.from , input.user , input.pass ) ; groupInfo = api.getGroup ( group.get ( ) ) ; validate ( input , groupInfo ) ; createGroup ( input , groupInfo ) ; return com.google.gerrit.extensions.restapi.Response.< java.lang.String > ok ( "OK" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.googlesource.gerrit.plugins.importer.ImportGroup.Input input ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.PreconditionFailedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.common.GroupInfo groupInfo ; this . api = apiFactory.create ( input.from , input.user , input.pass ) ; groupInfo = api.getGroup ( group.get ( ) ) ; validate ( input , groupInfo ) ; createGroup ( input , groupInfo ) ; return com.google.gerrit.extensions.restapi.Response.< java.lang.String > ok ( "OK" ) ; }
Source:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { try { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.Change > query ( com.google.gerrit.reviewdb.server.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.server.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; } catch ( com.google.gerrit.common.errors.InvalidQueryException e ) { callback.onFailure ( e ) ; } }

Target:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { try { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.Change > query ( com.google.gerrit.reviewdb.server.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.server.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; } catch ( com.google.gerrit.common.errors.InvalidQueryException e ) { callback.onFailure ( e ) ; } }
Source:
public java.lang.String getGerritPluginName ( java.io.File srcFile ) { java.lang.String fileName = srcFile.getName ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( fileName ) ) { return fileName.substring ( 0 , ( ( fileName.length ( ) ) - 3 ) ) ; } if ( serverPluginFactory.handles ( srcFile ) ) { return serverPluginFactory.getPluginName ( srcFile ) ; } return null ; }

Target:
public java.lang.String getGerritPluginName ( java.nio.file.Path srcPath ) { java.lang.String fileName = srcPath.getFileName ( ) . toString ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( fileName ) ) { return fileName.substring ( 0 , ( ( fileName.length ( ) ) - 3 ) ) ; } if ( serverPluginFactory.handles ( srcPath ) ) { return serverPluginFactory.getPluginName ( srcPath ) ; } return null ; }
Source:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }

Target:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }
Source:
private boolean canSetPrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return ( user.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) ; }

Target:
private com.google.gerrit.extensions.conditions.BooleanCondition canSetPrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return com.google.gerrit.extensions.conditions.BooleanCondition.or ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) , user.testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ; }
Source:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; com.google.gerrit.server.GerritServer.impl.reloadMergeQueue ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }

Target:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; com.google.gerrit.server.GerritServer.impl.reloadSubmitQueue ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }
Source:
private void testGetGroup ( java.lang.String url , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; com.google.gerrit.server.group.GroupJson.GroupInfo group = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }

Target:
private void testGetGroup ( java.lang.String url , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; com.google.gerrit.extensions.common.GroupInfo group = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.GroupInfo.class ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }
Source:
private org.apache.lucene.search.Sort getSort ( ) { if ( useDocValuesForSorting ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.UPDATED_SORT_FIELD , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.ID_SORT_FIELD , SortField.Type.LONG , true ) ) ; } else { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; } }

Target:
private org.apache.lucene.search.Sort getSort ( ) { if ( useDocValuesForSorting ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.UPDATED_SORT_FIELD , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( idSortField , SortField.Type.LONG , true ) ) ; } else { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; } }
Source:
protected void init ( ) throws com.google.gerrit.server.mail.EmailException { super . init ( ) ; ccAllApprovals ( ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.ALL_COMMENTS ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( notify.compareTo ( NotifyHandling.OWNER_REVIEWERS ) ) >= 0 ) { ccAllApprovals ( ) ; } if ( ( notify.compareTo ( NotifyHandling.ALL ) ) >= 0 ) { bccStarredBy ( ) ; includeWatchers ( NotifyType.ALL_COMMENTS ) ; } }
Source:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } if ( ( regDetailCache ) != null ) { regDetailCache.removeHandler ( ) ; regDetailCache = null ; } super . onUnload ( ) ; }
Source:
public void visit ( org.pegdown.ast.MailLinkNode node ) { java.lang.String addr = node.getText ( ) ; html.open ( "a" ) . attribute ( "href" , ( "mailto:" + addr ) ) . appendAndEscape ( addr ) . close ( "a" ) ; }

Target:
public void visit ( org.commonmark.node.Link node ) { html.open ( "a" ) . attribute ( "href" , href ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; }
Source:
public void onDraftPublished ( com.google.gerrit.extensions.events.DraftPublishedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) . email ) ; }

Target:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return new com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.server.ReviewDb get ( ) { if ( ( db ) == null ) { try { db = schemaFactory.open ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.inject.ProvisionException ( "Cannot open ReviewDb" , e ) ; } } return db ; } } ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetInfo getPatchSetInfo ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevWalk rw = ctx.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( com.google.common.base.Preconditions.checkNotNull ( patchSet ) . getRevision ( ) . get ( ) ) ) ; return patchSetInfoFactory.get ( rw , commit , psId ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetInfo getPatchSetInfo ( com.google.gerrit.server.update.ChangeContext ctx ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevWalk rw = ctx.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( com.google.common.base.Preconditions.checkNotNull ( patchSet ) . getRevision ( ) . get ( ) ) ) ; return patchSetInfoFactory.get ( rw , commit , psId ) ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm mod ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) % ( t.intValue ( ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm mod ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) % ( t.intValue ( ) ) ) ) ; }
Source:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; }

Target:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy strategy = ui.readEnum ( PeerInfoStrategy.JGROUPS , "Peer info strategy" ) ; config.setEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; } }
Source:
private java.lang.String getToken ( com.googlesource.gerrit.plugins.its.jira.JiraSession token ) { return token == null ? null : token.getToken ( ) ; }

Target:
private com.atlassian.jira.rest.client.api.domain.Transition getTransitionByName ( java.lang.Iterable < com.atlassian.jira.rest.client.api.domain.Transition > transitions , java.lang.String transition ) { com.atlassian.jira.rest.client.api.domain.Transition ret = null ; for ( com.atlassian.jira.rest.client.api.domain.Transition t : transitions ) { if ( transition.equals ( t.getName ( ) ) ) { ret = t ; break ; } } return ret ; }
Source:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.getApprovalType ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }

Target:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.byId ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }
Source:
public static void setAllEnabledConfig ( org.eclipse.jgit.lib.Config cfg ) { 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 ) ; } }

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:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; }
Source:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canEditHashtags ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; }

Target:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canPerform ( Permission.EDIT_HASHTAGS ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; }
Source:
public static void revert ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "revert" ) . data ( input ) . post ( cb ) ; }

Target:
public static void revert ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "revert" ) . data ( input ) . post ( cb ) ; }
Source:
private Account.Id user ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.server.account.AccountState s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.get ( org.easymock.EasyMock.eq ( s.getAccount ( ) . getId ( ) ) ) ) . andReturn ( s ) ; return s.getAccount ( ) . getId ( ) ; }

Target:
private Account.Id user ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.server.account.AccountState s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.maybeGet ( org.easymock.EasyMock.eq ( s.getAccount ( ) . getId ( ) ) ) ) . andReturn ( java.util.Optional.of ( s ) ) ; return s.getAccount ( ) . getId ( ) ; }
Source:
public void rescheduleOnError ( ) 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 ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; 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 rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; 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:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { setEdit ( false ) ; getCm ( ) . focus ( ) ; }

Target:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } parent.removeDraft ( this , comment.side ( ) , ( ( comment.line ( ) ) - 1 ) ) ; removeFromParent ( ) ; getSelfWidget ( ) . clear ( ) ; com.google.gerrit.client.diff.PaddingManager manager = getPaddingManager ( ) ; manager.remove ( this ) ; manager.resizePaddingWidget ( ) ; cm.focus ( ) ; }
Source:
protected void configureServlets ( ) { bind ( com.googlesource.gerrit.plugins.manager.AvailablePluginsCollection.class ) ; serve ( "/available*" ) . with ( com.googlesource.gerrit.plugins.manager.PluginManagerRestApiServlet.class ) ; filterRegex ( ".*plugin-manager\\.js" ) . through ( com.googlesource.gerrit.plugins.manager.XAuthFilter.class ) ; }

Target:
protected void configureServlets ( ) { bind ( com.googlesource.gerrit.plugins.manager.AvailablePluginsCollection.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.httpd.WebLoginListener.class ) . to ( com.googlesource.gerrit.plugins.manager.FirstWebLoginListener.class ) ; serve ( "/available*" ) . with ( com.googlesource.gerrit.plugins.manager.PluginManagerRestApiServlet.class ) ; filterRegex ( ".*plugin-manager\\.js" ) . through ( com.googlesource.gerrit.plugins.manager.XAuthFilter.class ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId commit ( final org.eclipse.jgit.merge.Merger m , final org.eclipse.jgit.lib.Commit mergeCommit ) throws java.io.IOException , java.io.UnsupportedEncodingException { org.eclipse.jgit.lib.ObjectInserter oi = m.getObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_COMMIT , oi.format ( mergeCommit ) ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.lib.ObjectId commit ( final org.eclipse.jgit.merge.Merger m , final org.eclipse.jgit.lib.CommitBuilder mergeCommit ) throws java.io.IOException , java.io.UnsupportedEncodingException { org.eclipse.jgit.lib.ObjectInserter oi = m.getObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( mergeCommit ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.lang.String value ) { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > eqPath = new com.google.gerrit.server.query.change.EqualsPathPredicate ( ChangeQueryBuilder.FIELD_FILE , value ) ; if ( ! ( args.getSchema ( ) . hasField ( ChangeField.FILE_PART ) ) ) { return eqPath ; } return com.google.gerrit.server.query.Predicate.or ( eqPath , new com.google.gerrit.server.query.change.EqualsFilePredicate ( value ) ) ; }

Target:
public static com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.lang.String value ) { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > eqPath = new com.google.gerrit.server.query.change.EqualsPathPredicate ( ChangeQueryBuilder.FIELD_FILE , value ) ; if ( ! ( args.getSchema ( ) . hasField ( ChangeField.FILE_PART ) ) ) { return eqPath ; } return com.google.gerrit.index.query.Predicate.or ( eqPath , new com.google.gerrit.server.query.change.EqualsFilePredicate ( value ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public SiteIndexer.Result indexAll ( com.google.gerrit.server.index.group.GroupIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.AccountGroup.UUID > uuids ; try { uuids = collectGroups ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.group.AllGroupsIndexer.log.error ( "Error collecting groups" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexGroups ( index , uuids , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( com.google.gerrit.server.index.group.GroupIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.AccountGroup.UUID > uuids ; try { uuids = collectGroups ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.group.AllGroupsIndexer.log.error ( "Error collecting groups" , e ) ; return new com.google.gerrit.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexGroups ( index , uuids , progress ) ; }
Source:
public void populate ( ) { top.clear ( ) ; checkBoxTop = createReviewedCheckbox ( ) ; top.add ( checkBoxTop ) ; top.add ( createReviewedAnchor ( ) ) ; bottom.clear ( ) ; checkBoxBottom = createReviewedCheckbox ( ) ; bottom.add ( checkBoxBottom ) ; bottom.add ( createReviewedAnchor ( ) ) ; }

Target:
public void populate ( com.google.gerrit.reviewdb.client.Patch.Key pk , com.google.gerrit.client.changes.PatchTable pt , int patchIndex , com.google.gerrit.client.patches.PatchScreen.Type patchScreenType ) { patchKey = pk ; fileList = pt ; reviewedLink = createReviewedLink ( patchIndex , patchScreenType ) ; top.clear ( ) ; checkBoxTop = createReviewedCheckbox ( ) ; top.add ( checkBoxTop ) ; top.add ( createReviewedAnchor ( ) ) ; bottom.clear ( ) ; checkBoxBottom = createReviewedCheckbox ( ) ; bottom.add ( checkBoxBottom ) ; bottom.add ( createReviewedAnchor ( ) ) ; }
Source:
com.google.gerrit.client.diff.DraftBox addReply ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.common.changes.Side side = replyTo.side ( ) ; int line = replyTo.line ( ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , line , replyTo.id ( ) , initMessage ) ; return addDraftBox ( info , doSave ) ; }

Target:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ! ( replyTo.has_line ( ) ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createLine ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; } }
Source:
private static java.lang.String H ( java.lang.String data ) { try { java.security.MessageDigest md = com.google.gerrit.httpd.ProjectDigestFilter.newMD5 ( ) ; md.update ( data.getBytes ( "UTF-8" ) ) ; return com.google.gerrit.httpd.ProjectDigestFilter.LHEX ( md.digest ( ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "UTF-8 encoding not available" , e ) ; } }

Target:
private static java.lang.String H ( java.lang.String data ) { java.security.MessageDigest md = com.google.gerrit.httpd.ProjectDigestFilter.newMD5 ( ) ; md.update ( data.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return com.google.gerrit.httpd.ProjectDigestFilter.LHEX ( md.digest ( ) ) ; }
Source:
private com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo getPluginInfo ( ) { com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo info = new com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo ( ) ; info.hasAvatars = com.google.gerrit.server.config.GetServerInfo.toBoolean ( ( ( avatar.get ( ) ) != null ) ) ; return info ; }

Target:
private com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo getPluginInfo ( ) { com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo info = new com.google.gerrit.server.config.GetServerInfo.PluginConfigInfo ( ) ; info.hasAvatars = com.google.gerrit.server.config.GetServerInfo.toBoolean ( ( ( avatar.get ( ) ) != null ) ) ; info.jsResourcePaths = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { info.jsResourcePaths.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } return info ; }
Source:
private void checkGlobalCapabilityPermissions ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( allProjects.equals ( projectName ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( ( "Cannot edit global capabilities " + "for projects other than " ) + ( allProjects.get ( ) ) ) ) ; } if ( ! ( identifiedUser.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( ( "Editing global capabilities " + "requires " ) + ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) ) ; } }

Target:
private void checkGlobalCapabilityPermissions ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( allProjects.equals ( projectName ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Cannot edit global capabilities for projects other than " + ( allProjects.get ( ) ) ) ) ; } if ( ! ( identifiedUser.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( "Editing global capabilities requires " + ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) ) ; } }
Source:
public abstract org.apache.commons.compress.archivers.ArchiveEntry prepareArchiveEntry ( final java.lang.String fileName ) ;

Target:
public < T extends java.io.Closeable > void putEntry ( T out , java.lang.String path , byte [ ] data ) throws java.io.IOException { @ java.lang.SuppressWarnings ( value = "unchecked" ) org.eclipse.jgit.api.ArchiveCommand.Format < T > fmt = ( ( org.eclipse.jgit.api.ArchiveCommand.Format < T > ) ( format ) ) ; fmt.putEntry ( out , path , FileMode.REGULAR_FILE , new org.eclipse.jgit.lib.ObjectLoader.SmallObject ( org.eclipse.jgit.lib.FileMode.TYPE_FILE , data ) ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( id ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; }
Source:
public void testUsernamePatternNonRegex ( ) { grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "u" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "d" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testUsernamePatternNonRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "u" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "d" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; }
Source:
protected java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.Label label ) throws java.io.IOException { java.lang.ProcessBuilder proc = new java.lang.ProcessBuilder ( "bazel" , "build" , label.fullName ( ) ) ; return proc ; }

Target:
protected java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.Label label ) throws java.io.IOException { java.util.Properties properties = loadBuildProperties ( sourceRoot.resolve ( ".primary_build_tool" ) ) ; java.lang.String buck = com.google.common.base.MoreObjects.firstNonNull ( properties.getProperty ( "bazel" ) , "bazel" ) ; java.lang.ProcessBuilder proc = new java.lang.ProcessBuilder ( buck , "build" , label.fullName ( ) ) ; if ( properties.containsKey ( "PATH" ) ) { proc.environment ( ) . put ( "PATH" , properties.getProperty ( "PATH" ) ) ; } return proc ; }
Source:
abstract void setShowLineNumbers ( boolean b ) ;

Target:
void setShowLineNumbers ( boolean b ) { if ( b ) { getDiffTable ( ) . addStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } else { getDiffTable ( ) . removeStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } }
Source:
public void multipleSlashes ( ) throws java.lang.Exception { repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; org.junit.Assert.assertEquals ( Type.HOST_INDEX , getView ( "//" ) . getType ( ) ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo" ) . getType ( ) ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo//" ) . getType ( ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+//master" ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+/refs//heads//master" ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+//master//" ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+//master/foo//bar" ) ) ; }

Target:
public void multipleSlashes ( ) throws java.lang.Exception { repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; com.google.common.truth.Truth.assertThat ( getView ( "//" ) . getType ( ) ) . isEqualTo ( Type.HOST_INDEX ) ; com.google.common.truth.Truth.assertThat ( getView ( "//repo" ) . getType ( ) ) . isEqualTo ( Type.REPOSITORY_INDEX ) ; com.google.common.truth.Truth.assertThat ( getView ( "//repo//" ) . getType ( ) ) . isEqualTo ( Type.REPOSITORY_INDEX ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+//master" ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+/refs//heads//master" ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+//master//" ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+//master/foo//bar" ) ) . isNull ( ) ; }
Source:
private com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > createEdit ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { editModifier.createEdit ( change , db.get ( ) . patchSets ( ) . get ( change.currentPatchSetId ( ) ) ) ; return editUtil.byChange ( change ) ; }

Target:
private com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > createEdit ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { editModifier.createEdit ( change , psUtil.current ( db.get ( ) , resource.getNotes ( ) ) ) ; return editUtil.byChange ( change ) ; }
Source:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { out.writeInt ( accountId.get ( ) ) ; out.writeLong ( refreshCookieAt ) ; }

Target:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 1 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , accountId.get ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 2 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt64 ( out , refreshCookieAt ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 3 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , ( persistentCookie ? 1 : 0 ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 0 ) ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.server.git.ReceiveCommits.ReplaceResult result , 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 { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSet.Id psId , final com.google.gerrit.reviewdb.client.Account.Id forAccount , final com.google.gerrit.reviewdb.client.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.PatchSetApproval ca = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }
Source:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent e , int idx ) { if ( com.google.gerrit.client.change.FileTable.link.handleAsClick ( e.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.change.FileTable.MyTable t = com.google.gerrit.client.change.FileTable.getMyTable ( e ) ; if ( t != null ) { t.onOpenRow ( ( 1 + idx ) ) ; e.preventDefault ( ) ; return false ; } } return true ; }

Target:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent e , int idx ) { if ( com.google.gerrit.client.change.FileTable.link.handleAsClick ( e.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.change.FileTable.MyTable t = com.google.gerrit.client.change.FileTable.getMyTable ( e ) ; if ( t != null ) { t.onOpenRow ( ( 1 + idx ) ) ; e.preventDefault ( ) ; e.stopPropagation ( ) ; return false ; } } return true ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource ) { com.google.gerrit.reviewdb.client.Project project = resource.getControl ( ) . getProject ( ) ; com.google.gerrit.server.project.GetProject.ProjectInfo info = new com.google.gerrit.server.project.GetProject.ProjectInfo ( ) ; info.name = resource.getName ( ) ; info.parent = com.google.common.base.Strings.emptyToNull ( project.getParentName ( ) ) ; info.description = com.google.common.base.Strings.emptyToNull ( project.getDescription ( ) ) ; info.finish ( ) ; return info ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource ) { com.google.gerrit.reviewdb.client.Project project = resource.getControl ( ) . getProject ( ) ; com.google.gerrit.server.project.GetProject.ProjectInfo info = new com.google.gerrit.server.project.GetProject.ProjectInfo ( ) ; info.name = resource.getName ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey parentName = project.getParent ( allProjects ) ; info.parent = ( parentName != null ) ? parentName.get ( ) : null ; info.description = com.google.common.base.Strings.emptyToNull ( project.getDescription ( ) ) ; info.finish ( ) ; return info ; }
Source:
public com.google.gitiles.GitilesView.Builder setTreePath ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , psId , rw , repoConfig , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.client.PatchSet.Id psId , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , notes , user , psId , rw , repoConfig , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }