auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setVisibleToAll ( groupOptions.isVisibleToAll ( ) ) ; group.setEmailOnlyAuthors ( groupOptions.isEmailOnlyAuthors ( ) ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setVisibleToAll ( groupOptions.isVisibleToAll ( ) ) ; group.setEmailOnlyAuthors ( groupOptions.isEmailOnlyAuthors ( ) ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
private void extractMailExample ( java.lang.String orig ) throws java.lang.Exception { java.io.File ex = new java.io.File ( site.mail_dir , ( orig + ".example" ) ) ; com.google.gerrit.pgm.init.api.InitUtil.extract ( ex , com.google.gerrit.server.mail.OutgoingEmail.class , orig ) ; com.google.gerrit.common.FileUtil.chmod ( 292 , ex ) ; }

Target:
private void extractMailExample ( java.lang.String orig ) throws java.lang.Exception { java.io.File ex = new java.io.File ( site.mail_dir , ( orig + ".example" ) ) ; com.google.gerrit.pgm.init.api.InitUtil.extract ( ex.toPath ( ) , com.google.gerrit.server.mail.OutgoingEmail.class , orig ) ; com.google.gerrit.common.FileUtil.chmod ( 292 , ex ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }
Source:
public void onFailure ( final java.lang.Throwable error ) { if ( error instanceof com.google.gwtorm.client.OrmException ) { onInternalFailure ( error ) ; } else { super . onFailure ( error ) ; } }

Target:
public void onFailure ( final java.lang.Throwable error ) { if ( ( error instanceof java.lang.IllegalArgumentException ) || ( error instanceof java.lang.IllegalStateException ) ) { super . onFailure ( error ) ; } else if ( ( error instanceof com.google.gwtorm.client.OrmException ) || ( error instanceof java.lang.RuntimeException ) ) { onInternalFailure ( error ) ; } else { super . onFailure ( error ) ; } }
Source:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changeJson.get ( ) . addOptions ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.CurrentUser u = user.get ( ) ; if ( u.isIdentifiedUser ( ) ) { ( ( com.google.gerrit.server.IdentifiedUser ) ( u ) ) . clearStarredChanges ( ) ; } return changeJson.get ( ) . addOptions ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.events.Event 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 ) ; itsConfig = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( itsConfig ) ; }
Source:
private void configureWebsessiosSection ( ) { ui.header ( "Websession section" ) ; promptAndSetString ( "Cleanup interval" , com.ericsson.gerrit.plugins.highavailability.WEBSESSION_SECTION , com.ericsson.gerrit.plugins.highavailability.CLEANUP_INTERVAL_KEY , com.ericsson.gerrit.plugins.highavailability.DEFAULT_CLEANUP_INTERVAL ) ; }

Target:
private void configureHttp ( ) { ui.header ( "Http section" ) ; promptAndSetString ( "User" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.USER_KEY , null ) ; promptAndSetString ( "Password" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.PASSWORD_KEY , null ) ; promptAndSetString ( "Max number of tries to forward to remote peer" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.MAX_TRIES_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_MAX_TRIES ) ) ; promptAndSetString ( "Retry interval [ms]" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.RETRY_INTERVAL_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_RETRY_INTERVAL ) ) ; promptAndSetString ( "Connection timeout [ms]" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CONNECTION_TIMEOUT_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_TIMEOUT_MS ) ) ; promptAndSetString ( "Socket timeout [ms]" , com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.SOCKET_TIMEOUT_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_TIMEOUT_MS ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } setPatchSets ( null ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { try { notes = notesFactory.createChecked ( db , project , legacyId ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) , e ) ; } change = notes.getChange ( ) ; setPatchSets ( null ) ; return change ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi create ( com.google.gerrit.extensions.common.ChangeInfo in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.ChangeInfo out = createChange.apply ( TopLevelResource.INSTANCE , in ) . value ( ) ; return api.create ( changes.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( out._number ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi create ( com.google.gerrit.extensions.common.ChangeInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.ChangeInfo out = createChange.apply ( TopLevelResource.INSTANCE , in ) . value ( ) ; return api.create ( changes.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( out._number ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create change" , e ) ; } }
Source:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.ConfigNotesMigration.Table t : com.google.gerrit.server.notedb.ConfigNotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.READ , true ) ; } return cfg ; }

Target:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.ConfigNotesMigration.Table t : com.google.gerrit.server.notedb.ConfigNotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTE_DB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTE_DB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.READ , true ) ; } return cfg ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester commented to Owner\\n>>>" + ( ( "testproject (master): This is the first line\n" + "And the second line. (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester commented on - testproject (master) - change 1234 - https://change/\",\n" ) + " \"pretext\": \"Unit Tester commented on\",\n" ) + " \"title\": \"testproject (master) - change 1234\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"This is the first line\n" ) + "And the second line.\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
private void expandBefore ( ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.getFrom ( ) . getLine ( ) ; int newStart = oldStart + ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ; int end = range.getTo ( ) . getLine ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }

Target:
private void expandSideBefore ( int cnt ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.getFrom ( ) . getLine ( ) ; int newStart = oldStart + cnt ; int end = range.getTo ( ) . getLine ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { @ java.lang.SuppressWarnings ( value = "deprecation" ) com.google.gerrit.server.notedb.RepoSequence.Seed accountSeed = ( ) -> db.nextAccountId ( ) ; com.google.gerrit.server.notedb.RepoSequence accountSeq = new com.google.gerrit.server.notedb.RepoSequence ( repoManager , allUsersName , com.google.gerrit.server.Sequences.NAME_ACCOUNTS , accountSeed , 1 ) ; accountSeq.next ( ) ; }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { @ java.lang.SuppressWarnings ( value = "deprecation" ) com.google.gerrit.server.notedb.RepoSequence.Seed accountSeed = ( ) -> db.nextAccountId ( ) ; com.google.gerrit.server.notedb.RepoSequence accountSeq = new com.google.gerrit.server.notedb.RepoSequence ( repoManager , com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , com.google.gerrit.server.Sequences.NAME_ACCOUNTS , accountSeed , 1 ) ; accountSeq.next ( ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ; if ( p == null ) { p = com.google.gerrit.reviewdb.client.AccountDiffPreference.createDefault ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setAccountDiffPreference ( p ) ; } } ) ; close ( ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.extensions.client.DiffPreferencesInfo p = com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ; result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setDiffPreferences ( p ) ; } } ) ; if ( ( view ) != null ) { close ( ) ; } }
Source:
private static com.google.gerrit.client.change.RelatedChangesTab.MyTable getMyTable ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gerrit.client.change.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.RelatedChangesTab.MyTable ) { return ( ( com.google.gerrit.client.change.RelatedChangesTab.MyTable ) ( l ) ) ; } } return null ; }

Target:
private com.google.gwt.user.client.Element getRow ( com.google.gwt.user.client.Element e ) { for ( com.google.gwt.user.client.Element prev = e ; e != null ; prev = e ) { if ( ( e = com.google.gwt.user.client.DOM.getParent ( e ) ) == ( body ) ) { return prev ; } } return null ; }
Source:
private static com.google.gson.Gson newGson ( ) { return new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( java.sql.Timestamp.class , new com.google.gwtjsonrpc.server.SqlTimestampDeserializer ( ) ) . create ( ) ; }

Target:
protected void assertSubmitter ( java.lang.String changeId , int psId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.ChangeNotes cn = notesFactory.create ( com.google.common.collect.Iterables.getOnlyElement ( db.changes ( ) . byKey ( new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) ) ) ) ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , cn , new com.google.gerrit.reviewdb.client.PatchSet.Id ( cn.getChangeId ( ) , psId ) ) ; org.junit.Assert.assertTrue ( submitter.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( admin.getId ( ) , submitter.getAccountId ( ) ) ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; getCm ( ) . focus ( ) ; } }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; if ( autoClosed ) { setOpen ( false ) ; } getCm ( ) . focus ( ) ; } }
Source:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . addParameterTrue ( "suggest" ) . addParameter ( "q" , query ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }

Target:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . addParameterTrue ( "suggest" ) . addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( query ) ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }
Source:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; list.setMatchPrefix ( this . getPrefix ( ) ) ; list.setMatchSubstring ( this . getSubstring ( ) ) ; list.setMatchRegex ( this . getRegex ( ) ) ; return list.apply ( ) ; }

Target:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; list.setMatchPrefix ( this . getPrefix ( ) ) ; list.setMatchSubstring ( this . getSubstring ( ) ) ; list.setMatchRegex ( this . getRegex ( ) ) ; return list.apply ( TopLevelResource.INSTANCE ) ; }
Source:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( org.eclipse.jetty.servlet.ServletContextHandler app ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = com.google.gerrit.pgm.http.jetty.JettyServer.unpackWar ( com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( app ) ; } else { throw err ; } } } return baseResource ; }

Target:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( org.eclipse.jetty.servlet.ServletContextHandler app ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = com.google.gerrit.pgm.http.jetty.JettyServer.unpackWar ( com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ) ; } catch ( java.io.FileNotFoundException err ) { if ( GerritLauncher.NOT_ARCHIVED.equals ( err.getMessage ( ) ) ) { baseResource = useDeveloperBuild ( app ) ; } else { throw err ; } } } return baseResource ; }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.AccountGroup.NameKey ( n ) ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getId ( ) ) ; return 1 ; }

Target:
private com.google.gerrit.reviewdb.AccountGroup get ( java.lang.String name ) { return com.google.gerrit.server.util.FutureUtil.getOrNull ( groupCache.get ( new com.google.gerrit.reviewdb.AccountGroup.NameKey ( name ) ) ) ; }
Source:
public void newPatchSetByOwnerOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOwnerOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; related.registerKeys ( ) ; }

Target:
void onChangeRevision ( com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }
Source:
public java.lang.String encode ( java.lang.String s ) { try { java.security.Key sKey = generateKey ( ) ; javax.crypto.Cipher encoder = getCipher ( ) ; encoder.init ( javax.crypto.Cipher.ENCRYPT_MODE , sKey , getCipherParameterSpec ( ) ) ; return new java.lang.String ( java.util.Base64.getEncoder ( ) . encodeToString ( encoder.doFinal ( s.getBytes ( config.getEncoding ( ) ) ) ) ) ; } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.secureconfig.PBECodec.log.error ( "encode() failed" , e ) ; throw new java.lang.IllegalArgumentException ( "encode() failed" , e ) ; } }

Target:
public java.lang.String encode ( java.lang.String s ) { try { java.security.Key sKey = generateKey ( ) ; javax.crypto.Cipher encoder = getCipher ( ) ; encoder.init ( javax.crypto.Cipher.ENCRYPT_MODE , sKey , getCipherParameterSpec ( ) ) ; return new java.lang.String ( org.apache.commons.codec.binary.Base64.encodeBase64 ( encoder.doFinal ( s.getBytes ( config.getEncoding ( ) ) ) ) ) ; } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.secureconfig.PBECodec.log.error ( "encode() failed" , e ) ; throw new java.lang.IllegalArgumentException ( "encode() failed" , e ) ; } }
Source:
private com.google.gerrit.server.change.ChangeResource parseResource ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( r.getChangeId ( ) , atrScope.get ( ) . getUser ( ) ) ; com.google.common.truth.Truth.assertThat ( ctls ) . hasSize ( 1 ) ; return new com.google.gerrit.server.change.ChangeResource ( ctls.get ( 0 ) ) ; }

Target:
private com.google.gerrit.server.change.ChangeResource parseResource ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( r.getChangeId ( ) , atrScope.get ( ) . getUser ( ) ) ; com.google.common.truth.Truth.assertThat ( ctls ) . hasSize ( 1 ) ; return changeResourceFactory.create ( ctls.get ( 0 ) ) ; }
Source:
private GitilesView.Builder parseDiffCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { path = com.google.gitiles.ViewFilter.trimLeadingSlash ( path ) ; com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } return parseDiffCommand ( repoName , result , path ) ; }

Target:
static java.lang.String trimLeadingSlash ( java.lang.String str ) { return com.google.gitiles.ViewFilter.checkLeadingSlash ( str ) . substring ( 1 ) ; }
Source:
private void initFrom ( ) throws javax.mail.MessagingException , javax.mail.internet.AddressException { javax.mail.Address addr ; if ( ( fromId ) != null ) { addr = toAddress ( fromId ) ; } else { final org.spearce.jgit.lib.PersonIdent pi = server.newGerritPersonIdent ( ) ; try { addr = new javax.mail.internet.InternetAddress ( pi.getName ( ) , pi.getEmailAddress ( ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { addr = new javax.mail.internet.InternetAddress ( pi.getEmailAddress ( ) ) ; } } msg.setFrom ( addr ) ; }

Target:
private void initListId ( final java.lang.String messageClass ) throws javax.mail.MessagingException { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( messageClass ) ; listid.append ( "-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( gerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; msg.setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; msg.setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( settingsUrl ( ) ) != null ) { msg.setHeader ( "List-Unsubscribe" , ( ( "<" + ( settingsUrl ( ) ) ) + ">" ) ) ; } }
Source:
private com.google.gerrit.server.query.Predicate < T > operator ( java.lang.String name , java.lang.String value ) throws com.google.gerrit.index.query.QueryParseException { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gerrit.server.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( this , value ) ; }

Target:
private com.google.gerrit.index.query.Predicate < T > operator ( java.lang.String name , java.lang.String value ) throws com.google.gerrit.index.query.QueryParseException { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gerrit.index.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.index.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( this , value ) ; }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.permissions.PermissionBackendException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } return permissionBackend.user ( user ) . ref ( branchName ) . test ( RefPermission.READ ) ; }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.permissions.PermissionBackendException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } return ( pe.statePermitsRead ( ) ) && ( permissionBackend.user ( user ) . ref ( branchName ) . test ( RefPermission.READ ) ) ; }
Source:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.Lists.newLinkedList ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; validators.add ( projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId ) ; } }

Target:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.Lists.newLinkedList ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; validators.add ( projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setCopyMinScore ( false ) ; codeReview.setCopyMaxScore ( false ) ; codeReview.setCopyAllScoresOnTrivialRebase ( false ) ; codeReview.setCopyAllScoresIfNoCodeChange ( false ) ; codeReview.setCopyAllScoresIfNoChange ( false ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }

Target:
public void noCopyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( false ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
private void enableForm ( final boolean on ) { groupNameTxt.setEnabled ( on ) ; descTxt.setEnabled ( on ) ; addMember.setEnabled ( on ) ; nameTxtBox.setEnabled ( on ) ; delMember.setEnabled ( on ) ; }

Target:
private void enableForm ( final boolean on ) { ownerTxtBox.setEnabled ( on ) ; groupNameTxt.setEnabled ( on ) ; descTxt.setEnabled ( on ) ; addMember.setEnabled ( on ) ; nameTxtBox.setEnabled ( on ) ; delMember.setEnabled ( on ) ; }
Source:
public void trustCycle ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kf = add ( com.google.gerrit.gpg.PublicKeyCheckerTest.keyF ( ) ) ; com.google.gerrit.gpg.testutil.TestKey kg = add ( com.google.gerrit.gpg.PublicKeyCheckerTest.keyG ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.PublicKeyCheckerTest.keyA ( ) ) ; assertProblems ( checker , kf , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( kg ) ) ; assertProblems ( checker , kg , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( kf ) ) ; }

Target:
public void trustCycle ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kf = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyF ( ) ) ; com.google.gerrit.gpg.testutil.TestKey kg = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyG ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testutil.TestTrustKeys.keyA ( ) ) ; assertProblems ( checker , kf , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( kg ) ) ; assertProblems ( checker , kg , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( kf ) ) ; }
Source:
protected void beforeTestServerStarts ( ) throws java.lang.Exception { java.lang.String url = "jdbc:h2:mem:TestCiDB;DB_CLOSE_DELAY=-1" ; java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , "org.h2.Driver" ) ; p.setProperty ( "url" , url ) ; setPluginConfigString ( "dbType" , "h2" ) ; setPluginConfigString ( "dbUrl" , url ) ; com.google.gwtorm.jdbc.SimpleDataSource sds = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; try ( java.sql.Connection c = sds.getConnection ( ) ; java.sql.Statement s = c.createStatement ( ) ) { s.executeUpdate ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.CREATE_TABLE ) ; s.execute ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.DELETE_TABLE ) ; } }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability.getName ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.NAME ) ) ; java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , "org.h2.Driver" ) ; p.setProperty ( "url" , com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.URL ) ; com.google.gwtorm.jdbc.SimpleDataSource sds = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; try ( java.sql.Connection c = sds.getConnection ( ) ; java.sql.Statement s = c.createStatement ( ) ) { s.executeUpdate ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.CREATE_TABLE ) ; s.execute ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.DELETE_TABLE ) ; } }
Source:
com.google.gerrit.server.change.PostReviewers.Addition ccCurrentUser ( com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.change.RevisionResource revision ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( user.getUserName ( ) , revision.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( user.getAccountId ( ) , revision.getControl ( ) ) , null , com.google.gerrit.extensions.client.ReviewerState.CC , com.google.gerrit.extensions.api.changes.NotifyHandling.NONE , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }

Target:
com.google.gerrit.server.change.PostReviewers.Addition ccCurrentUser ( com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.change.RevisionResource revision ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( user.getUserName ( ) , revision.getChangeResource ( ) , com.google.common.collect.ImmutableSet.of ( user.getAccountId ( ) ) , null , com.google.gerrit.extensions.client.ReviewerState.CC , com.google.gerrit.extensions.api.changes.NotifyHandling.NONE , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet getPatchSet ( com.google.gerrit.extensions.common.RevisionInfo info ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.common.ChangeHookApiListener.unwrap ( db.get ( ) ) . patchSets ( ) . get ( PatchSet.Id.fromRef ( info.ref ) ) ; }

Target:
public void onReviewerAdded ( com.google.gerrit.extensions.events.ReviewerAddedListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doReviewerAddedHook ( notes.getChange ( ) , getAccount ( ev.getReviewer ( ) ) , psUtil.current ( db.get ( ) , notes ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ReviewerAdded hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = ctl.getProject ( ) . getNameKey ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = ctl.getProject ( ) . getNameKey ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.plugins.ServerPluginProvider.class ) ; bind ( com.google.gerrit.server.plugins.UniversalServerPluginProvider.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.plugins.ServerPluginProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.plugins.ServerPluginProvider.class ) . to ( com.google.gerrit.server.plugins.JarPluginProvider.class ) ; bind ( com.google.gerrit.server.plugins.UniversalServerPluginProvider.class ) ; }
Source:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , ctl.getNotes ( ) ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = ctl.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }

Target:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , notes ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = notes.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }
Source:
private java.util.Set < java.lang.String > allRefPatterns ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { final java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getLocalRights ( actionId ) ) { all.add ( pr.getRefPattern ( ) ) ; } if ( actionId.canInheritFromWildProject ( ) ) { for ( final com.google.gerrit.reviewdb.RefRight pr : state.getInheritedRights ( actionId ) ) { all.add ( pr.getRefPattern ( ) ) ; } } return all ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { final java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { all.add ( pr.getRefPattern ( ) ) ; } return all ; }
Source:
private byte [ ] formatAsHtml ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig cfg , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter formatter , java.lang.String raw ) throws java.io.IOException { switch ( formatter ) { case MARKDOWN : return formatMarkdownAsHtml ( cfg , raw ) ; default : throw new java.lang.IllegalStateException ( ( "Unsupported formatter: " + ( formatter.name ( ) ) ) ) ; } }

Target:
private byte [ ] formatAsHtml ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig cfg , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.Formatter formatter , java.lang.String raw ) throws java.io.IOException { switch ( formatter ) { case MARKDOWN : return formatMarkdownAsHtml ( cfg , raw ) ; case PLAIN_TEXT : return formatTxtAsHtml ( raw ) ; default : throw new java.lang.IllegalStateException ( ( "Unsupported formatter: " + ( formatter.name ( ) ) ) ) ; } }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }

Target:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { commentManager.resizePadding ( handle ) ; if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { defer ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }