auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , pluginDataDir , scriptEngine.getClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.scripting.scala.PluginDescription description ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , description.canonicalUrl , description.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , description.dataDir , scriptEngine.getClassLoader ( ) ) ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.server.account.AccountAgreementsCacheImpl.AccountAgreementsList > > byAccountIdType = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.server.account.AccountAgreementsCacheImpl.AccountAgreementsList > > ( ) { } ; core ( byAccountIdType , com.google.gerrit.server.account.AccountAgreementsCacheImpl.BY_ACCOUNT_ID ) . populateWith ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.ByAccountIdLoader.class ) ; bind ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.class ) ; bind ( com.google.gerrit.server.account.AccountAgreementsCache.class ) . to ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.server.account.AccountAgreementsCacheImpl.AccountAgreementsList > > byAccountIdType = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.server.account.AccountAgreementsCacheImpl.AccountAgreementsList > > ( ) { } ; cache ( byAccountIdType , com.google.gerrit.server.account.AccountAgreementsCacheImpl.BY_ACCOUNT_ID ) . populateWith ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.ByAccountIdLoader.class ) ; bind ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.class ) ; bind ( com.google.gerrit.server.account.AccountAgreementsCache.class ) . to ( com.google.gerrit.server.account.AccountAgreementsCacheImpl.class ) ; }
Source:
public void run ( ) { skipManager.removeAll ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { db = unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , com.google.gerrit.server.notedb.ChangeBundle.fromReviewDb ( db , changeId ) ) ; return execute ( db , changeId , manager ) ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , com.google.gerrit.server.notedb.ChangeBundle.fromReviewDb ( db , changeId ) ) ; return execute ( db , changeId , manager ) ; }
Source:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }
Source:
private void assertMembers ( java.util.List < com.google.gerrit.server.account.AccountInfo > ai , com.google.gerrit.acceptance.TestAccount ... members ) { java.util.Map < java.lang.Integer , com.google.gerrit.server.account.AccountInfo > infoById = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.server.account.AccountInfo i : ai ) { infoById.put ( i._account_id , i ) ; } for ( com.google.gerrit.acceptance.TestAccount a : members ) { com.google.gerrit.server.account.AccountInfo i = infoById.get ( a.id.get ( ) ) ; org.junit.Assert.assertNotNull ( i ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( a , i ) ; } org.junit.Assert.assertEquals ( ai.size ( ) , members.length ) ; }

Target:
private void assertMembers ( java.util.List < com.google.gerrit.server.account.AccountInfo > ai , com.google.gerrit.acceptance.TestAccount ... members ) { java.util.Map < java.lang.Integer , com.google.gerrit.server.account.AccountInfo > infoById = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.server.account.AccountInfo i : ai ) { infoById.put ( i._accountId , i ) ; } for ( com.google.gerrit.acceptance.TestAccount a : members ) { com.google.gerrit.server.account.AccountInfo i = infoById.get ( a.id.get ( ) ) ; org.junit.Assert.assertNotNull ( i ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( a , i ) ; } org.junit.Assert.assertEquals ( ai.size ( ) , members.length ) ; }
Source:
public boolean hasGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { return groupsByUUID.containsKey ( uuid ) ; }

Target:
public void replace ( com.google.gerrit.common.data.AccessSection section ) { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { rule.setGroup ( resolve ( rule.getGroup ( ) ) ) ; } } accessSections.put ( section.getRefPattern ( ) , section ) ; }
Source:
private void saveQuerySettings ( ) { getApp ( ) . getConfigManager ( ) . setQueryConfig ( new com.google.reviewit.app.QueryConfig.Builder ( ) . setServerId ( getServerId ( ) ) . setQuery ( textOf ( R.id.queryInput ) ) . setLabel ( textOf ( R.id.labelInput ) ) . build ( ) ) ; switch ( getApp ( ) . getPrefs ( ) . startScreen ) { case REVIEW_SCREEN : display ( com.google.reviewit.ReviewChangesFragment.class ) ; break ; case SORT_SCREEN : default : display ( com.google.reviewit.SortChangesFragment.class ) ; } }

Target:
private void saveQuerySettings ( ) { getApp ( ) . getConfigManager ( ) . setQueryConfig ( new com.google.reviewit.app.QueryConfig.Builder ( ) . setServerId ( getServerId ( ) ) . setQuery ( textOf ( R.id.queryInput ) ) . setLabel ( textOf ( R.id.labelInput ) ) . build ( ) ) ; widgetUtil.toast ( R.string.query_saved ) ; switch ( getApp ( ) . getPrefs ( ) . startScreen ) { case REVIEW_SCREEN : display ( com.google.reviewit.ReviewChangesFragment.class ) ; break ; case SORT_SCREEN : default : display ( com.google.reviewit.SortChangesFragment.class ) ; } }
Source:
public java.util.Collection < com.google.gerrit.common.data.GroupReference > suggest ( java.lang.String name , com.google.gerrit.server.project.ProjectControl project ) { if ( ! ( name.startsWith ( com.googlesource.gerrit.plugins.github.group.GitHubOrganisationGroup.NAME_PREFIX ) ) ) { return java.util.Collections.emptyList ( ) ; } java.lang.String orgNamePrefix = name.substring ( com.googlesource.gerrit.plugins.github.group.GitHubOrganisationGroup.NAME_PREFIX.length ( ) ) ; return listByPrefix ( orgNamePrefix ) ; }

Target:
public java.util.Collection < com.google.gerrit.common.data.GroupReference > suggest ( java.lang.String name , com.google.gerrit.server.project.ProjectControl project ) { if ( ! ( name.startsWith ( com.googlesource.gerrit.plugins.github.group.GitHubGroup.NAME_PREFIX ) ) ) { return java.util.Collections.emptyList ( ) ; } java.lang.String orgNamePrefix = name.substring ( com.googlesource.gerrit.plugins.github.group.GitHubGroup.NAME_PREFIX.length ( ) ) ; return listByPrefix ( orgNamePrefix ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > names = com.google.common.collect.Sets.newTreeSet ( ) ; for ( org.eclipse.jgit.storage.dfs.DfsRepository repo : repos.values ( ) ) { names.add ( new com.google.gerrit.reviewdb.client.Project.NameKey ( repo.getDescription ( ) . getRepositoryName ( ) ) ) ; } return com.google.common.collect.ImmutableSortedSet.copyOf ( names ) ; }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > names = com.google.common.collect.Sets.newTreeSet ( ) ; for ( org.eclipse.jgit.internal.storage.dfs.DfsRepository repo : repos.values ( ) ) { names.add ( new com.google.gerrit.reviewdb.client.Project.NameKey ( repo.getDescription ( ) . getRepositoryName ( ) ) ) ; } return com.google.common.collect.ImmutableSortedSet.copyOf ( names ) ; }
Source:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.Change > bumpLastUpdatedOn ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; c.setLastUpdatedOn ( ctx.getWhen ( ) ) ; return java.util.Collections.singleton ( c ) ; }

Target:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.Change > bumpLastUpdatedOn ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( c.getLastUpdatedOn ( ) . before ( ctx.getWhen ( ) ) ) { c.setLastUpdatedOn ( ctx.getWhen ( ) ) ; } return java.util.Collections.singleton ( c ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( com.google.gerrit.server.account.AccountResource account , java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { com.google.gerrit.extensions.common.GpgKeysInput in = new com.google.gerrit.extensions.common.GpgKeysInput ( ) ; in.add = add ; in.delete = delete ; try { return postGpgKeys.get ( ) . apply ( account , in ) ; } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > putGpgKeys ( com.google.gerrit.server.account.AccountResource account , java.util.List < java.lang.String > add , java.util.List < java.lang.String > delete ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { com.google.gerrit.extensions.api.accounts.GpgKeysInput in = new com.google.gerrit.extensions.api.accounts.GpgKeysInput ( ) ; in.add = add ; in.delete = delete ; try { return postGpgKeys.get ( ) . apply ( account , in ) ; } catch ( org.bouncycastle.openpgp.PGPException | com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }
Source:
public void currentPatchSetMissing ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( ctl.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }

Target:
public void currentPatchSetMissing ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( ctl.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }
Source:
private void add ( final com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel ) { body.add ( patchSetPanel ) ; int patchSetId = patchSetPanel.getPatchSet ( ) . getPatchSetId ( ) ; com.google.gerrit.client.changes.PatchSetsBlock.ActivationHandler activationHandler = new com.google.gerrit.client.changes.PatchSetsBlock.ActivationHandler ( patchSetId ) ; patchSetPanel.addOpenHandler ( activationHandler ) ; patchSetPanel.addClickHandler ( activationHandler ) ; patchSetPanels.put ( patchSetId , patchSetPanel ) ; }

Target:
private void add ( final com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel ) { body.add ( patchSetPanel ) ; final com.google.gerrit.reviewdb.PatchSet.Id id = patchSetPanel.getPatchSet ( ) . getId ( ) ; com.google.gerrit.client.changes.PatchSetsBlock.ActivationHandler activationHandler = new com.google.gerrit.client.changes.PatchSetsBlock.ActivationHandler ( id ) ; patchSetPanel.addOpenHandler ( activationHandler ) ; patchSetPanel.addClickHandler ( activationHandler ) ; patchSetPanels.put ( id , patchSetPanel ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } return getValue ( ) . equals ( change.getTopic ( ) ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } java.lang.String t = change.getTopic ( ) ; if ( ( t == null ) && ( ( getField ( ) ) == ( com.google.gerrit.server.index.ChangeField.TOPIC ) ) ) { t = "" ; } return getValue ( ) . equals ( t ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities result ) { if ( result.canPerform ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) { com.google.gerrit.client.Gerrit.addLink ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPluginsInstalled ( ) , PageLinks.ADMIN_PLUGINS ) ; com.google.gerrit.client.Gerrit.menuLeft.add ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPlugins ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities result ) { if ( result.canPerform ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) { com.google.gerrit.client.Gerrit.addLink ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPluginsInstalled ( ) , PageLinks.ADMIN_PLUGINS ) ; com.google.gerrit.client.Gerrit.menuLeft.insert ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPlugins ( ) , ( ( com.google.gerrit.client.Gerrit.menuLeft.getWidgetIndex ( groupsBar ) ) + 1 ) ) ; } }
Source:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( expectedRequest ) ) { try { checkPoint.await ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.BrokenBarrierException e ) { org.junit.Assert.fail ( ) ; } } }

Target:
public void doAction ( ) throws java.lang.Exception { gApi.accounts ( ) . id ( testAccount.id.get ( ) ) . setActive ( false ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.cache.CacheRemovalListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheEvictionHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.cache.CacheRemovalListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheEvictionHandler.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( final com.google.gerrit.reviewdb.client.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.reviewdb.client.Change c , java.lang.String body ) { java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , com.google.gerrit.common.TimeUtil.nowTs ( ) , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }
Source:
protected void movePointerTo ( final int newRow ) { super . movePointerTo ( newRow ) ; if ( ( ( 0 <= newRow ) && ( newRow < ( table.getRowCount ( ) ) ) ) && ( ( getRowItem ( newRow ) ) != null ) ) { delSel.setEnabled ( true ) ; } else { delSel.setEnabled ( false ) ; } }

Target:
private void toggleCurrentRow ( ) { final com.google.gwt.user.client.ui.CheckBox cb = ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( getCurrentRow ( ) , 1 ) ) ) ; cb.setChecked ( ( ! ( cb.isChecked ( ) ) ) ) ; }
Source:
public void select ( java.lang.String urlType ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( d.getUrlType ( ) . equals ( urlType ) ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }

Target:
public void select ( java.lang.String schemeName ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( d.getSchemeName ( ) . equals ( schemeName ) ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.reviewdb.client.Project.NameKey project = result.project_name_key ( ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( project , group.add ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; com.google.gerrit.client.diff.DiffInfo diffInfo = diff ; diff = null ; display ( diffInfo ) ; } } ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.reviewdb.client.Project.NameKey project = result.project_name_key ( ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( project , group.addFinal ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; com.google.gerrit.client.diff.DiffInfo diffInfo = diff ; diff = null ; display ( diffInfo ) ; } } ) ) ; }
Source:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = tempSiteDir.newFolder ( "plugins" ) . toPath ( ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( "/config/server/info/" ) ; com.google.gerrit.server.config.GetServerInfo.ServerInfo i = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.config.GetServerInfo.ServerInfo.class ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }

Target:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = tempSiteDir.newFolder ( "plugins" ) . toPath ( ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.server.config.GetServerInfo.ServerInfo i = getServerConfig ( ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.pgm.init.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; java.util.List < java.lang.String > plugins = com.google.common.base.Objects.firstNonNull ( getInstallPlugins ( ) , com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; bind ( new com.google.inject.TypeLiteral < java.util.List < java.lang.String > > ( ) { } ) . annotatedWith ( com.google.gerrit.pgm.init.InstallPlugins.class ) . toInstance ( plugins ) ; bind ( com.google.gerrit.pgm.init.PluginsDistribution.class ) . toInstance ( pluginsDistribution ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.pgm.init.api.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; java.util.List < java.lang.String > plugins = com.google.common.base.Objects.firstNonNull ( getInstallPlugins ( ) , com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; bind ( new com.google.inject.TypeLiteral < java.util.List < java.lang.String > > ( ) { } ) . annotatedWith ( com.google.gerrit.pgm.init.api.InstallPlugins.class ) . toInstance ( plugins ) ; bind ( com.google.gerrit.pgm.init.PluginsDistribution.class ) . toInstance ( pluginsDistribution ) ; }
Source:
private void setDownloadScheme ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences p , java.lang.String scheme ) throws com.google.gerrit.extensions.restapi.BadRequestException { for ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.extensions.config.DownloadScheme > e : downloadSchemes ) { if ( ( e.getExportName ( ) . equals ( scheme ) ) && ( e.getProvider ( ) . get ( ) . isEnabled ( ) ) ) { p.setDownloadUrl ( scheme ) ; return ; } } throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Unsupported download scheme: " + scheme ) ) ; }

Target:
private void checkDownloadScheme ( java.lang.String downloadScheme ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( com.google.common.base.Strings.isNullOrEmpty ( downloadScheme ) ) { return ; } for ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.extensions.config.DownloadScheme > e : downloadSchemes ) { if ( ( e.getExportName ( ) . equals ( downloadScheme ) ) && ( e.getProvider ( ) . get ( ) . isEnabled ( ) ) ) { return ; } } throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Unsupported download scheme: " + downloadScheme ) ) ; }
Source:
private com.google.gerrit.reviewdb.RefRight grant ( com.google.gerrit.reviewdb.ApprovalCategory.Id categoryId , com.google.gerrit.reviewdb.AccountGroup.Id group , java.lang.String ref , int maxValue ) { return grant ( categoryId , group , ref , maxValue , maxValue ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , devs , "refs/heads/*" , 1 , 2 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canPushToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
private void finishModuleLoad ( ) { if ( "" . equals ( com.google.gwt.user.client.History.getToken ( ) ) ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gwt.user.client.History.newItem ( Link.MINE ) ; } else { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } } else { com.google.gwt.user.client.History.fireCurrentHistoryState ( ) ; } }

Target:
private void showInitialScreen ( ) { com.google.gwt.user.client.History.addHistoryListener ( new com.google.gerrit.client.Link ( ) ) ; if ( "" . equals ( com.google.gwt.user.client.History.getToken ( ) ) ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gwt.user.client.History.newItem ( Link.MINE ) ; } else { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } } else { com.google.gwt.user.client.History.fireCurrentHistoryState ( ) ; } }
Source:
public void flushWebSessions_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "projects" ) ) ) ; r.assertOK ( ) ; r.consume ( ) ; userSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "web_sessions" ) ) ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; } }

Target:
public void flushWebSessions_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userRestSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "projects" ) ) ) ; r.assertOK ( ) ; r.consume ( ) ; userRestSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "web_sessions" ) ) ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; } }
Source:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } } }

Target:
void onIndentUnit ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.indentUnit ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.setIndentUnit ( prefs.indentUnit ( ) ) ; } } }
Source:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( ! ( jar.getName ( ) . endsWith ( ".disabled" ) ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
public void rangeOfFixReplacementNeedsToBeValid ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; fixReplacementInfo.range = createRange ( 13 , 9 , 5 , 10 ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( java.lang.String.format ( ( "Range (13:9 - 5:10) is not " + "valid for the replacement of the robot comment on %s" ) , withFixRobotCommentInput.path ) ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; }

Target:
public void rangeOfFixReplacementNeedsToBeValid ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; fixReplacementInfo.range = createRange ( 13 , 9 , 5 , 10 ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( new org.hamcrest.core.StringContains ( "Range (13:9 - 5:10)" ) ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parseAllSections ( ) { java.util.List < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parsedSubscriptions = new java.util.ArrayList < > ( ) ; for ( final java.lang.String id : bbc.getSubsections ( "submodule" ) ) { final com.google.gerrit.reviewdb.client.SubmoduleSubscription subscription = parse ( id ) ; if ( subscription != null ) { parsedSubscriptions.add ( subscription ) ; } } return parsedSubscriptions ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parseAllSections ( ) { java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parsedSubscriptions = com.google.common.collect.Sets.newHashSet ( ) ; for ( final java.lang.String id : bbc.getSubsections ( "submodule" ) ) { final com.google.gerrit.reviewdb.client.SubmoduleSubscription subscription = parse ( id ) ; if ( subscription != null ) { parsedSubscriptions.add ( subscription ) ; } } return parsedSubscriptions ; }
Source:
private static boolean fail ( final java.lang.String username , final org.apache.sshd.server.session.ServerSession session , final java.lang.String err ) { session.setAttribute ( com.google.gerrit.sshd.SshUtil.AUTH_ATTEMPTED_AS , username ) ; session.setAttribute ( com.google.gerrit.sshd.SshUtil.AUTH_ERROR , err ) ; return false ; }

Target:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.sshd.SshKeyCacheEntry key ) { return userFactory.create ( AccessPath.SSH , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , key.getAccount ( ) ) ; }
Source:
private static synchronized void scheduleImp ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.RemoteConfig srcConf , final org.spearce.jgit.transport.URIish uri ) { com.google.gerrit.git.PushOp e = com.google.gerrit.git.PushQueue.pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( project.get ( ) , srcConf , uri ) ; com.google.gerrit.git.WorkQueue.schedule ( e , com.google.gerrit.git.PushQueue.startDelay , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.PushQueue.pending.put ( uri , e ) ; } e.addRef ( ref ) ; }

Target:
private static synchronized void scheduleImp ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final com.google.gerrit.git.PushQueue.ReplicationConfig config , final org.spearce.jgit.transport.URIish uri ) { com.google.gerrit.git.PushOp e = com.google.gerrit.git.PushQueue.pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( project.get ( ) , config.remote , uri ) ; com.google.gerrit.git.WorkQueue.schedule ( e , config.delay , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.PushQueue.pending.put ( uri , e ) ; } e.addRef ( ref ) ; }
Source:
private static boolean hasNoBody ( javax.servlet.http.HttpServletRequest req ) { int len = req.getContentLength ( ) ; java.lang.String type = req.getContentType ( ) ; return ( ( len <= 0 ) && ( type == null ) ) || ( ( len == 0 ) && ( com.google.gerrit.httpd.restapi.RestApiServlet.isType ( "application/x-www-form-urlencoded" , type ) ) ) ; }

Target:
private static boolean hasNoBody ( javax.servlet.http.HttpServletRequest req ) { int len = req.getContentLength ( ) ; java.lang.String type = req.getContentType ( ) ; return ( ( len <= 0 ) && ( type == null ) ) || ( ( len == 0 ) && ( com.google.gerrit.httpd.restapi.RestApiServlet.isType ( com.google.gerrit.httpd.restapi.RestApiServlet.FORM_TYPE , type ) ) ) ; }
Source:
public java.lang.String formatValue ( ) { if ( ( getValue ( ) ) < 0 ) { return java.lang.Short.toString ( getValue ( ) ) ; } else if ( ( getValue ( ) ) == 0 ) { return " 0" ; } else { return "+" + ( java.lang.Short.toString ( getValue ( ) ) ) ; } }

Target:
public java.lang.String formatValue ( ) { return com.google.gerrit.reviewdb.client.ApprovalCategoryValue.formatValue ( getValue ( ) ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( com.google.gerrit.server.patch.PatchListKey.eq ( oldId , k.oldId ) ) && ( com.google.gerrit.server.patch.PatchListKey.eq ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public org.eclipse.jgit.lib.ObjectId getNewId ( ) { if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } return newId ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , null , null ) ; }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.UseSsh.class , testDesc.getTestClass ( ) ) , null , null ) ; }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; java.lang.String gy = group ( "gy" , "Administrators" ) ; java.lang.String gz = group ( "gz" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gz ) ) ; assertIncludes ( GET ( ( ( "/groups/" + gx ) + "/groups/" ) ) , gy , gz ) ; }

Target:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy ) ; }
Source:
private void setReviewed ( com.google.gerrit.client.diff.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }

Target:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.restoreContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceiveCommand cmd ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) , cmd.getType ( ) ) ; }
Source:
public void remove ( ) { if ( ref.compareAndSet ( item , null ) ) { items.remove ( ref ) ; } }

Target:
public com.google.gerrit.extensions.registration.DynamicSet < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { if ( ref.compareAndSet ( item , newItem ) ) { return new ReloadableHandle ( ref , newKey , newItem ) ; } return null ; }
Source:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }

Target:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) ) ; doAssertApproval ( expected , c ) ; }
Source:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentLink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.server.query.change.ChangeData cd , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput f ) { reset ( ) ; try { return check ( cd.change ( ) , f ) ; } catch ( com.google.gwtorm.server.OrmException e ) { error ( "Error looking up change" , e ) ; return com.google.gerrit.server.change.ConsistencyChecker.Result.create ( cd.getId ( ) , problems ) ; } }

Target:
private void checkOwner ( ) { try { if ( ( db.get ( ) . accounts ( ) . get ( change ( ) . getOwner ( ) ) ) == null ) { problem ( ( "Missing change owner: " + ( change ( ) . getOwner ( ) ) ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { error ( "Failed to look up owner" , e ) ; } }
Source:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotUpload ( "refs/heads/master" , u ) ; }

Target:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotCreateChange ( "refs/heads/master" , u ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }