auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.common.collect.ListMultimap < java.lang.String , com.ericsson.gerrit.plugins.eventslog.sql.SQLEntry > getEvents ( java.lang.String query ) throws com.ericsson.gerrit.plugins.eventslog.EventsLogException { java.sql.Connection conn = null ; java.sql.Statement stat = null ; try { conn = ds.getConnection ( ) ; stat = conn.createStatement ( ) ; return listEvents ( stat , query ) ; } catch ( java.sql.SQLException e ) { throw new com.ericsson.gerrit.plugins.eventslog.EventsLogException ( "Cannot query database" , e ) ; } finally { closeStatement ( stat ) ; closeConnection ( conn ) ; } }

Target:
public com.google.common.collect.ListMultimap < java.lang.String , com.ericsson.gerrit.plugins.eventslog.sql.SQLEntry > getEvents ( java.lang.String query ) throws com.ericsson.gerrit.plugins.eventslog.EventsLogException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { return listEvents ( stat , query ) ; } catch ( java.sql.SQLException e ) { throw new com.ericsson.gerrit.plugins.eventslog.EventsLogException ( "Cannot query database" , e ) ; } }
Source:
public void restoreReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , admin , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void restoreReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , admin , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy toEmailStrategy ( java.lang.String v , boolean emailStrategyColumnExists ) throws com.google.gwtorm.server.OrmException { if ( v == null ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } if ( emailStrategyColumnExists ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.valueOf ( v ) ; } else { if ( v.equals ( "N" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } else if ( v.equals ( "Y" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ; } else { throw new com.google.gwtorm.server.OrmException ( ( "invalid value in accounts.copy_self_on_email: " + v ) ) ; } } }

Target:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy toEmailStrategy ( java.lang.String v , boolean emailStrategyColumnExists ) throws com.google.gwtorm.server.OrmException { if ( v == null ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } if ( emailStrategyColumnExists ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.valueOf ( v ) ; } if ( v.equals ( "N" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } else if ( v.equals ( "Y" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ; } else { throw new com.google.gwtorm.server.OrmException ( ( "invalid value in accounts.copy_self_on_email: " + v ) ) ; } }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > byChange ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { try { return byChange ( changeControlFactory.controlFor ( change , user.get ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > byChange ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { try { return byChange ( changeControlFactory.controlFor ( db.get ( ) , change , user.get ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( account.getId ( ) ) ; accountConfig.load ( allUsersRepo ) ; accountConfig.setAccount ( account ) ; accountConfig.commit ( md ) ; }

Target:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; new com.google.gerrit.server.account.AccountConfig ( account.getId ( ) , allUsersRepo ) . load ( ) . setAccount ( account ) . commit ( md ) ; }
Source:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; names.add ( "accounts" ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }

Target:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }
Source:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } indexer.index ( db.get ( ) , change ) ; }

Target:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; try ( org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ) { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } indexer.index ( db.get ( ) , change ) ; }
Source:
public void run ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.client.workflow.FunctionState state ) { for ( final com.google.gerrit.client.data.ApprovalType t : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { state.valid ( at , false ) ; return ; } } state.valid ( at , true ) ; }

Target:
private static boolean valid ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.client.workflow.FunctionState state ) { for ( final com.google.gerrit.client.data.ApprovalType t : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { return false ; } } return true ; }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; 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 ) ; }

Target:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId writeNewTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , org.eclipse.jgit.revwalk.RevCommit prevEdit , org.eclipse.jgit.lib.ObjectReader reader , java.lang.String fileName , byte [ ] content , org.eclipse.jgit.revwalk.RevCommit base ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { org.eclipse.jgit.dircache.DirCache newTree = com.google.gerrit.server.edit.ChangeEditModifier.createTree ( reader , prevEdit ) ; com.google.gerrit.server.edit.ChangeEditModifier.editTree ( op , repo , rw , base , newTree.editor ( ) , ins , fileName , content ) ; return newTree.writeTree ( ins ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId writeNewTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , org.eclipse.jgit.revwalk.RevCommit prevEdit , org.eclipse.jgit.lib.ObjectReader reader , java.lang.String fileName , byte [ ] content , org.eclipse.jgit.revwalk.RevCommit base ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { org.eclipse.jgit.dircache.DirCache newTree = com.google.gerrit.server.edit.ChangeEditModifier.createTree ( reader , prevEdit ) ; com.google.gerrit.server.edit.ChangeEditModifier.editTree ( op , rw , base , newTree.editor ( ) , ins , fileName , content ) ; return newTree.writeTree ( ins ) ; }
Source:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo revisionInfo ) { com.google.common.truth.Truth.assertThat ( changeInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changeInfo._number ) . isEqualTo ( origChange._number ) ; com.google.common.truth.Truth.assertThat ( revisionInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( revisionInfo._number ) . isEqualTo ( 1 ) ; if ( name.equals ( "cherrypick" ) ) { return false ; } if ( name.equals ( "rebase" ) ) { actionInfo.label = "All Your Base" ; } return true ; }

Target:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo revisionInfo ) { com.google.common.truth.Truth.assertThat ( changeInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changeInfo._number ) . isEqualTo ( origChange._number ) ; com.google.common.truth.Truth.assertThat ( revisionInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( revisionInfo._number ) . isEqualTo ( 2 ) ; if ( name.equals ( "cherrypick" ) ) { return false ; } if ( name.equals ( "rebase" ) ) { actionInfo.label = "All Your Base" ; } return true ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) , batch ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { return create ( name , mgr.openRepository ( name ) , user , batch ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ( names ) == null ) || ( names.isEmpty ( ) ) ) { loader.rescan ( true ) ; } else { try { loader.reload ( names ) ; } catch ( com.google.gerrit.server.plugins.InvalidPluginException e ) { throw die ( e.getMessage ( ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { throw die ( e.getMessage ( ) ) ; } } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ( names ) == null ) || ( names.isEmpty ( ) ) ) { loader.rescan ( ) ; } else { try { loader.reload ( names ) ; } catch ( com.google.gerrit.server.plugins.InvalidPluginException e ) { throw die ( e.getMessage ( ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { throw die ( e.getMessage ( ) ) ; } } }
Source:
private java.lang.String getDisplayName ( final com.google.gerrit.reviewdb.Account account ) { if ( account != null ) { java.lang.String result = ( ( account.getFullName ( ) ) == null ) ? anonymousCowardName : account.getFullName ( ) ; if ( ( account.getPreferredEmail ( ) ) != null ) { result += ( " (" + ( account.getPreferredEmail ( ) ) ) + ")" ; } return result ; } return anonymousCowardName ; }

Target:
private java.lang.String getDisplayName ( final com.google.gerrit.reviewdb.client.Account account ) { if ( account != null ) { java.lang.String result = ( ( account.getFullName ( ) ) == null ) ? anonymousCowardName : account.getFullName ( ) ; if ( ( account.getPreferredEmail ( ) ) != null ) { result += ( " (" + ( account.getPreferredEmail ( ) ) ) + ")" ; } return result ; } return anonymousCowardName ; }
Source:
private org.apache.lucene.document.Document toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { org.apache.lucene.document.Document result = new org.apache.lucene.document.Document ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > vs : schema.buildFields ( cd , fillArgs ) ) { if ( ( vs.getValues ( ) ) != null ) { add ( result , vs ) ; } } return result ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }

Target:
private org.apache.lucene.document.Document toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.document.Document result = new org.apache.lucene.document.Document ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > vs : schema.buildFields ( cd , fillArgs ) ) { if ( ( vs.getValues ( ) ) != null ) { add ( result , vs ) ; } } return result ; }
Source:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewersWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeNotifyOwnerReviewersWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }
Source:
protected com.google.inject.Injector createInjector ( ) { org.eclipse.jgit.lib.Config cfg = com.google.gerrit.testutil.InMemoryModule.newDefaultConfig ( ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , 4 ) ; return com.google.inject.Guice.createInjector ( new com.google.gerrit.testutil.InMemoryModule ( cfg ) ) ; }

Target:
protected com.google.inject.Injector createInjector ( ) { return com.google.inject.Guice.createInjector ( new com.google.gerrit.testutil.InMemoryModule ( ) ) ; }
Source:
private com.google.gerrit.server.account.AuthResult byAccountId ( final java.lang.String idStr ) { final com.google.gerrit.reviewdb.client.Account.Id id ; try { id = Account.Id.parse ( idStr ) ; } catch ( java.lang.NumberFormatException nfe ) { return null ; } try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { return auth ( db.accounts ( ) . get ( id ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byAccountId ( final java.lang.String idStr ) { final com.google.gerrit.reviewdb.client.Account.Id id ; try { id = Account.Id.parse ( idStr ) ; } catch ( java.lang.NumberFormatException nfe ) { return null ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return auth ( db.accounts ( ) . get ( id ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.manager.PluginManagerTopMenu.class ) ; bind ( com.googlesource.gerrit.plugins.manager.repository.PluginsRepository.class ) . to ( com.googlesource.gerrit.plugins.manager.repository.JenkinsCiPluginsRepository.class ) ; install ( com.googlesource.gerrit.plugins.manager.PluginsCentralCache.module ( ) ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.googlesource.gerrit.plugins.manager.OnStartStop.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.manager.PluginManagerTopMenu.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.googlesource.gerrit.plugins.manager.repository.PluginsRepository.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.googlesource.gerrit.plugins.manager.repository.PluginsRepository.class ) . to ( com.googlesource.gerrit.plugins.manager.repository.JenkinsCiPluginsRepository.class ) ; install ( com.googlesource.gerrit.plugins.manager.PluginsCentralCache.module ( ) ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.googlesource.gerrit.plugins.manager.OnStartStop.class ) ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.server.CurrentUser who , final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.common.data.GroupDescription.Basic group = groupBackend.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( who , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.server.CurrentUser who , final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.common.data.GroupDescription.Basic group = groupBackend.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( who , group , groupBackend ) ; }
Source:
void setShowLineNumbers ( boolean b ) { if ( b ) { diffTable.addStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } else { diffTable.removeStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } cm.refresh ( ) ; }

Target:
void setShowLineNumbers ( boolean b ) { super . setShowLineNumbers ( b ) ; cm.refresh ( ) ; }
Source:
public static com.google.common.collect.FluentIterable < com.google.gerrit.reviewdb.client.Account.Id > ids ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.acceptance.TestAccount , com.google.gerrit.reviewdb.client.Account.Id > ( ) { @ java.lang.Override public Account.Id apply ( com.google.gerrit.acceptance.TestAccount in ) { return in.id ; } } ) ; }

Target:
public static com.google.common.collect.FluentIterable < com.google.gerrit.reviewdb.client.Account.Id > ids ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( ( a ) -> a.id ) ; }
Source:
private < T extends com.google.gwt.core.client.JavaScriptObject > void send ( com.google.gwt.http.client.RequestBuilder.Method method , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } request ( method ) . sendRequest ( null , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void send ( com.google.gwt.http.client.RequestBuilder.Method method , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } request ( method ) . sendRequest ( null , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot delete project on remote site {}. " + ( "Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ; } }

Target:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot delete project on remote site {}. " + ( "Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ; } }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo publisher , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.DraftPublished.Event event = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher , when ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { try { l.onDraftPublished ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.DraftPublished.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo publisher , java.sql.Timestamp when ) { com.google.gerrit.server.extensions.events.DraftPublished.Event event = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher , when ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { try { l.onDraftPublished ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.DraftPublished.log , e ) ; } } }
Source:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , java.lang.String cmd ) { final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; auditService.dispatch ( new com.google.gerrit.audit.SshAuditEvent ( sid , extractCurrentUser ( ctx ) , cmd , created , null , result ) ) ; }

Target:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , java.lang.String cmd ) { audit ( ctx , result , cmd , null ) ; }
Source:
public void testNoEscaping ( ) { java.lang.String find = "find" ; java.lang.String link = "link" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( find , link ) ; org.junit.Assert.assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; org.junit.Assert.assertEquals ( "<a href=\"link\">find</a>" , a.replace ( find ) ) ; org.junit.Assert.assertEquals ( ( ( ( "find = " + find ) + ", link = " ) + link ) , a.toString ( ) ) ; }

Target:
public void testNoEscaping ( ) { java.lang.String find = "find" ; java.lang.String link = "link" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( find , link ) ; com.google.common.truth.Truth.assertThat ( a.pattern ( ) . getSource ( ) ) . isEqualTo ( find ) ; com.google.common.truth.Truth.assertThat ( a.replace ( find ) ) . isEqualTo ( "<a href=\"link\">find</a>" ) ; com.google.common.truth.Truth.assertThat ( a.toString ( ) ) . isEqualTo ( ( ( ( "find = " + find ) + ", link = " ) + link ) ) ; }
Source:
public static long parseSortKey ( java.lang.String sortKey ) { if ( "z" . equals ( sortKey ) ) { return java.lang.Long.MAX_VALUE ; } java.lang.String ts = sortKey.substring ( 0 , 8 ) ; int i = 0 ; while ( ( i < 8 ) && ( ( ts.charAt ( i ) ) == '0' ) ) i ++ ; return java.lang.Long.parseLong ( ts.substring ( i ) , 16 ) ; }

Target:
public static long parseSortKey ( java.lang.String sortKey ) { if ( "z" . equals ( sortKey ) ) { return java.lang.Long.MAX_VALUE ; } return java.lang.Long.parseLong ( sortKey.substring ( 0 , 8 ) , 16 ) ; }
Source:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . background ( ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { com.google.gerrit.client.projects.ProjectMap.projects ( ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . background ( ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( row ) ; } else if ( ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) || ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_REVIEWERS ) ) ) { } else if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } }

Target:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( row ) ; } else if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) { } else if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } }
Source:
private static < C extends com.google.gerrit.extensions.client.Comment > C populate ( C c , java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , java.lang.String message ) { c.path = path ; c.side = side ; c.line = ( line != 0 ) ? line : null ; c.message = message ; if ( line != 0 ) { com.google.gerrit.extensions.client.Comment.Range range = new com.google.gerrit.extensions.client.Comment.Range ( ) ; range.startLine = 1 ; range.startCharacter = 1 ; range.endLine = 1 ; range.endCharacter = 5 ; c.range = range ; } return c ; }

Target:
private static < C extends com.google.gerrit.extensions.client.Comment > C populate ( C c , java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , java.lang.String message ) { c.path = path ; c.side = side ; c.line = ( line != 0 ) ? line : null ; c.message = message ; if ( line != 0 ) { com.google.gerrit.extensions.client.Comment.Range range = new com.google.gerrit.extensions.client.Comment.Range ( ) ; range.startLine = line ; range.startCharacter = 1 ; range.endLine = line ; range.endCharacter = 5 ; c.range = range ; } return c ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeManageServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.changedetail.ChangeDetailServiceImpl.class ) ; }
Source:
public com.google.gerrit.common.data.GroupInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.GroupInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.GroupInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroup a : out.values ( ) ) { r.add ( new com.google.gerrit.common.data.GroupInfo ( a ) ) ; } return new com.google.gerrit.common.data.GroupInfoCache ( r ) ; }

Target:
public com.google.gerrit.common.data.GroupInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.GroupInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.GroupInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroup a : out.values ( ) ) { if ( a == null ) continue ; r.add ( new com.google.gerrit.common.data.GroupInfo ( a ) ) ; } return new com.google.gerrit.common.data.GroupInfoCache ( r ) ; }
Source:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) { if ( migration.writeChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( comment.getRevId ( ) ) != null ) ) ; } com.google.common.base.Preconditions.checkArgument ( comment.getAuthor ( ) . equals ( accountId ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , accountId , comment ) ; }

Target:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) { com.google.common.base.Preconditions.checkArgument ( comment.getAuthor ( ) . equals ( accountId ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , accountId , comment ) ; }
Source:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null , null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }

Target:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ReviewerAdded.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ReviewerAdded.log , e ) ; } } }
Source:
public com.google.gerrit.gpg.CheckResult checkCustom ( org.bouncycastle.openpgp.PGPPublicKey key , int depth ) { try { if ( ( depth == 0 ) && ( ( expectedUser ) != null ) ) { return checkIdsForExpectedUser ( key ) ; } else { return checkIdsForArbitraryUser ( key ) ; } } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException e ) { java.lang.String msg = "Error checking user IDs for key" ; com.google.gerrit.gpg.GerritPublicKeyChecker.log.warn ( ( ( msg + " " ) + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) ) ) , e ) ; return com.google.gerrit.gpg.CheckResult.bad ( msg ) ; } }

Target:
public com.google.gerrit.gpg.CheckResult checkCustom ( org.bouncycastle.openpgp.PGPPublicKey key , int depth ) { try { if ( ( depth == 0 ) && ( ( expectedUser ) != null ) ) { return checkIdsForExpectedUser ( key ) ; } return checkIdsForArbitraryUser ( key ) ; } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException e ) { java.lang.String msg = "Error checking user IDs for key" ; com.google.gerrit.gpg.GerritPublicKeyChecker.log.warn ( ( ( msg + " " ) + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) ) ) , e ) ; return com.google.gerrit.gpg.CheckResult.bad ( msg ) ; } }
Source:
public org.scribe.model.Token extract ( java.lang.String response ) { org.scribe.utils.Preconditions.checkEmptyString ( response , "Cannot extract a token from a null or empty String" ) ; java.util.regex.Matcher matcher = accessTokenPattern.matcher ( response ) ; if ( matcher.find ( ) ) { return new org.scribe.model.Token ( matcher.group ( 1 ) , "" , response ) ; } else { throw new org.scribe.exceptions.OAuthException ( ( "Cannot extract an acces token. Response was: " + response ) ) ; } }

Target:
public org.scribe.model.Token extract ( java.lang.String response ) { org.scribe.utils.Preconditions.checkEmptyString ( response , "Cannot extract a token from a null or empty String" ) ; java.util.regex.Matcher matcher = accessTokenPattern.matcher ( response ) ; if ( matcher.find ( ) ) { return new org.scribe.model.Token ( matcher.group ( 1 ) , "" , response ) ; } throw new org.scribe.exceptions.OAuthException ( ( "Cannot extract an acces token. Response was: " + response ) ) ; }
Source:
private void executeIndexTask ( com.google.gerrit.reviewdb.client.Change.Id id , boolean deleted ) { if ( ! ( com.ericsson.gerrit.plugins.syncindex.Context.isForwardedEvent ( ) ) ) { com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask syncIndexTask = new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( id.get ( ) , deleted ) ; if ( queuedTasks.add ( syncIndexTask ) ) { executor.execute ( syncIndexTask ) ; } } }

Target:
private void executeIndexTask ( int id , boolean deleted ) { if ( ! ( com.ericsson.gerrit.plugins.syncindex.Context.isForwardedEvent ( ) ) ) { com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask syncIndexTask = new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( id , deleted ) ; if ( queuedTasks.add ( syncIndexTask ) ) { executor.execute ( syncIndexTask ) ; } } }
Source:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { return ( permissionBackend.user ( userProvider ) . testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , CreateServiceUserCapability.ID ) ) ) && ( permissionBackend.user ( userProvider ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ; } else { return false ; } }

Target:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { return ( permissionBackend.user ( userProvider ) . testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , CreateServiceUserCapability.ID ) ) ) || ( permissionBackend.user ( userProvider ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ; } else { return false ; } }
Source:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( contributorAgreements , result.useContributorAgreements ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( signedOffBy , result.useSignedOffBy ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( contentMerge , result.useContentMerge ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; saveProject.setEnabled ( false ) ; }

Target:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; setBool ( contributorAgreements , result.useContributorAgreements ) ; setBool ( signedOffBy , result.useSignedOffBy ) ; setBool ( contentMerge , result.useContentMerge ) ; setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; saveProject.setEnabled ( false ) ; }
Source:
public void testToString ( ) { org.junit.Assert.assertEquals ( "author:bob" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "bob" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "author:\"\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "owner:\"A U Thor\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "owner" , "A U Thor" ) . toString ( ) ) ; }

Target:
public void testToString ( ) { org.junit.Assert.assertEquals ( "author:bob" , f ( "author" , "bob" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "author:\"\"" , f ( "author" , "" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "owner:\"A U Thor\"" , f ( "owner" , "A U Thor" ) . toString ( ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm subtract ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) return new com.googlecode.prolog_cafe.lang.DoubleTerm ( ( ( this . doubleValue ( ) ) - ( t.doubleValue ( ) ) ) ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) - ( t.intValue ( ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm subtract ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) return new com.googlecode.prolog_cafe.lang.DoubleTerm ( ( ( this . doubleValue ( ) ) - ( t.doubleValue ( ) ) ) ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) - ( t.intValue ( ) ) ) ) ; }
Source:
public void onUnload ( ) { setRegisterKeys ( false ) ; if ( ( ( saveId ) != null ) && ( ( currentRow ) >= 0 ) ) { final RowItem c = com.google.gerrit.client.ui.NavigationTable.getRowItem ( currentRow ) ; if ( c != null ) { com.google.gerrit.client.ui.NavigationTable.savedPositions.put ( saveId , getRowItemKey ( c ) ) ; } } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { setRegisterKeys ( false ) ; if ( ( ( saveId ) != null ) && ( ( currentRow ) >= 0 ) ) { final RowItem c = com.google.gerrit.client.ui.NavigationTable.getRowItem ( currentRow ) ; if ( c != null ) { com.google.gerrit.client.ui.NavigationTable.savedPositions.put ( saveId , getRowItemKey ( c ) ) ; } } super . onUnload ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public void printJson ( final java.lang.StringBuilder sb , final org.eclipse.jgit.diff.Edit o ) { sb.append ( '[' ) ; sb.append ( o.getBeginA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getBeginB ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndB ( ) ) ; sb.append ( ']' ) ; }

Target:
private void append ( final java.lang.StringBuilder sb , final org.eclipse.jgit.diff.Edit o ) { sb.append ( o.getBeginA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getBeginB ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndB ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval getSubmitter ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( db , c ) . load ( ) ; return approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval getSubmitter ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( c ) . load ( ) ; return approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; }