auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }
Source:
private void initIncludedInAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacy_id ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }

Target:
private void initRevisionsAction ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { revisionsAction = new com.google.gerrit.client.change.RevisionsAction ( info.legacy_id ( ) , revision , style , headerLine , revisions ) ; }
Source:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.LoginServlet.forceLogout ( rsp ) ; final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; url.append ( "&" ) ; com.google.gerrit.server.LoginServlet.appendCallbackParameter ( req , url ) ; rsp.sendRedirect ( url.toString ( ) ) ; }

Target:
private static java.lang.String getCookie ( final javax.servlet.http.HttpServletRequest req , final java.lang.String name ) { final javax.servlet.http.Cookie [ ] allCookies = req.getCookies ( ) ; if ( allCookies != null ) { for ( final javax.servlet.http.Cookie c : allCookies ) { if ( name.equals ( c.getName ( ) ) ) { return c.getValue ( ) ; } } } return null ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( ( ( rsrc.isCurrent ( ) ) && ( permissionBackend.user ( user ) . project ( rsrc.getProject ( ) ) . testOrFalse ( ProjectPermission.CREATE_CHANGE ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( rsrc.isCurrent ( ) , permissionBackend.user ( user ) . project ( rsrc.getProject ( ) ) . testCond ( ProjectPermission.CREATE_CHANGE ) ) ) ; }
Source:
public void testDeleteOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; schema.people ( ) . delete ( java.util.Collections.singleton ( bob ) ) ; }

Target:
public void testDeleteOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.Person bob = new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; schema.people ( ) . delete ( java.util.Collections.singleton ( bob ) ) ; }
Source:
protected void setPluginConfigString ( java.lang.String name , java.lang.String value ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.config.SitePaths sitePath = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.acceptance.PluginDaemonTest.testSite ) ; org.eclipse.jgit.storage.file.FileBasedConfig cfg = getGerritConfigFile ( sitePath ) ; cfg.load ( ) ; cfg.setString ( "plugin" , pluginName , name , value ) ; cfg.save ( ) ; }

Target:
protected void setPluginConfigString ( java.lang.String name , java.lang.String value ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.config.SitePaths sitePath = new com.google.gerrit.server.config.SitePaths ( testSite ) ; org.eclipse.jgit.storage.file.FileBasedConfig cfg = getGerritConfigFile ( sitePath ) ; cfg.load ( ) ; cfg.setString ( "plugin" , pluginName , name , value ) ; cfg.save ( ) ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "upload" , new com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "settings" , new com.googlesource.gerrit.plugins.imagare.client.ImagareAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "preferences" , new com.googlesource.gerrit.plugins.imagare.client.ImagarePreferenceScreen.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "upload" , new com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "settings" , new com.googlesource.gerrit.plugins.imagare.client.ImagareAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . settingsScreen ( "preferences" , ( ( com.google.gerrit.plugin.client.Plugin.get ( ) . getName ( ) ) + " Preferences" ) , new com.googlesource.gerrit.plugins.imagare.client.ImagarePreferenceScreen.Factory ( ) ) ; }
Source:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { com.google.gitiles.GitilesView view = com.google.gitiles.ViewFilter.getView ( req ) ; java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs = com.google.gitiles.RefServlet.getRefs ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) . getRefDatabase ( ) , view.getTreePath ( ) ) ; com.google.gitiles.RefServlet.TextRefAdvertiser adv = new com.google.gitiles.RefServlet.TextRefAdvertiser ( startRenderText ( req , res ) ) ; adv.setDerefTags ( true ) ; adv.send ( refs ) ; adv.end ( ) ; }

Target:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { com.google.gitiles.GitilesView view = com.google.gitiles.ViewFilter.getView ( req ) ; java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs = com.google.gitiles.RefServlet.getRefs ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) . getRefDatabase ( ) , view.getPathPart ( ) ) ; com.google.gitiles.RefServlet.TextRefAdvertiser adv = new com.google.gitiles.RefServlet.TextRefAdvertiser ( startRenderText ( req , res ) ) ; adv.setDerefTags ( true ) ; adv.send ( refs ) ; adv.end ( ) ; }
Source:
public void inheritRead_OverrideWithDeny ( ) { 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.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; assertAccessDenied ( user ( local ) ) ; }

Target:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }
Source:
private void assertDeleteSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { java.lang.String branchRev = branch ( branch ) . get ( ) . revision ; branch ( branch ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch.get ( ) , null , branchRev , branchRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( branch ) . get ( ) ; }

Target:
private void assertDeleteSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( branch ( branch ) . get ( ) . canDelete ) . isTrue ( ) ; java.lang.String branchRev = branch ( branch ) . get ( ) . revision ; branch ( branch ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch.get ( ) , null , branchRev , branchRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( branch ) . get ( ) ; }
Source:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
Source:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( info.getBaseUri ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Health check on sysinfo result: {}" , result ) ; return result ; }

Target:
public java.lang.String healthCheck ( com.googlesource.gerrit.plugins.its.jira.Check check ) throws java.io.IOException { return execute ( ( ) -> { if ( check.equals ( Check.ACCESS ) ) { return client ( ) . healthCheckAccess ( ) ; } return client ( ) . healthCheckSysinfo ( ) ; } ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) { throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , a1 ) ; } else { engine.cut ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) ) { throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , a1 ) ; } else { engine.cut ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; } return cont ; }
Source:
public void onSuccess ( final com.google.gerrit.client.diff.DiffInfo diff ) { new net.codemirror.lib.ModeInjector ( ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_a ( ) ) ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_b ( ) ) ) . inject ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.lang.Void > ( this ) { @ java.lang.Override protected void preDisplay ( java.lang.Void result ) { display ( diff ) ; } } ) ; }

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 testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void testItsAssociationPolicyOptionalWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "foo" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.OPTIONAL ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.OPTIONAL , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testGetItsAssociationPolicyOptionalWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "foo" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.OPTIONAL ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.OPTIONAL , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
private void bindSkipLine ( int row , final int skipCnt ) { final com.google.gwt.user.client.ui.FlowPanel skipPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; skipPanel.add ( new com.google.gwt.user.client.ui.InlineLabel ( PatchUtil.M.patchSkipRegion ( skipCnt ) ) ) ; table.setWidget ( row , 1 , skipPanel ) ; }

Target:
private int finish ( final java.util.Iterator < com.google.gerrit.client.reviewdb.PatchLineComment > i , int row , final int col ) { while ( i.hasNext ( ) ) { final com.google.gerrit.client.reviewdb.PatchLineComment c = i.next ( ) ; table.insertRow ( row ) ; table.getCellFormatter ( ) . setStyleName ( row , 0 , com.google.gerrit.client.patches.S_ICON_CELL ) ; bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) ) ; row ++ ; } return row ; }
Source:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key ) { if ( computeIntraline ) { try { return intraCache.get ( key ) ; } catch ( java.util.concurrent.ExecutionException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } else { return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; } }

Target:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key , com.google.gerrit.server.patch.IntraLineDiffArgs args ) { if ( computeIntraline ) { try { return intraCache.get ( key , intraLoaderFactory.create ( key , args ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } else { return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; } }
Source:
static com.google.gerrit.server.notedb.NotesMigration allEnabled ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setBoolean ( "notedb" , null , "write" , true ) ; cfg.setBoolean ( "notedb" , "patchSetApprovals" , "read" , true ) ; return new com.google.gerrit.server.notedb.NotesMigration ( cfg ) ; }

Target:
static com.google.gerrit.server.notedb.NotesMigration allEnabled ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setBoolean ( "notedb" , null , "write" , true ) ; cfg.setBoolean ( "notedb" , "patchSetApprovals" , "read" , true ) ; cfg.setBoolean ( "notedb" , "changeMessages" , "read" , true ) ; return new com.google.gerrit.server.notedb.NotesMigration ( cfg ) ; }
Source:
private void initRights ( ) { final com.google.gwt.user.client.ui.Label rightsHdr = new com.google.gwt.user.client.ui.Label ( Util.C.headingAccessRights ( ) ) ; rightsHdr.setStyleName ( "gerrit-SmallHeading" ) ; rights = new com.google.gerrit.client.admin.ProjectAdminScreen.RightsTable ( ) ; delRight = new com.google.gwt.user.client.ui.Button ( Util.C.buttonDeleteGroupMembers ( ) ) ; delRight.addClickListener ( new com.google.gwt.user.client.ui.ClickListener ( ) { public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { rights.deleteChecked ( ) ; } } ) ; add ( rightsHdr ) ; add ( rights ) ; add ( delRight ) ; }

Target:
public void onLostFocus ( com.google.gwt.user.client.ui.Widget sender ) { if ( "" . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( Util.C.defaultAccountGroupName ( ) ) ; nameTxtBox.addStyleName ( "gerrit-InputFieldTypeHint" ) ; } }
Source:
private void assertTagList ( com.google.common.collect.FluentIterable < java.lang.String > expected , java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > actual ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( actual ) . hasSize ( expected.size ( ) ) ; for ( int i = 0 ; i < ( expected.size ( ) ) ; i ++ ) { com.google.common.truth.Truth.assertThat ( actual.get ( i ) . ref ) . isEqualTo ( ( "refs/tags/" + ( expected.get ( i ) ) ) ) ; } }

Target:
private void assertTagList ( com.google.common.collect.FluentIterable < java.lang.String > expected , java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > actual ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( actual ) . hasSize ( expected.size ( ) ) ; for ( int i = 0 ; i < ( expected.size ( ) ) ; i ++ ) { com.google.common.truth.Truth.assertThat ( actual.get ( i ) . ref ) . isEqualTo ( ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + ( expected.get ( i ) ) ) ) ; } }
Source:
public void testErrorWhileSendingUnhealthyResponse ( ) throws java.io.IOException { javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; doThrow ( new java.io.IOException ( "someError" ) ) . when ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE ) ; servlet.doGet ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( currentUserProviderMock.get ( ) ) . thenReturn ( currentUserMock ) ; org.mockito.Mockito.when ( currentUserMock.getCapabilities ( ) ) . thenReturn ( capabilityControlMock ) ; org.mockito.Mockito.when ( capabilityControlMock.canAdministrateServer ( ) ) . thenReturn ( true ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.health.HealthServlet ( currentUserProviderMock , tempFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
public void testUpdateOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; bob.growOlder ( ) ; schema.people ( ) . update ( java.util.Collections.singleton ( bob ) ) ; }

Target:
public void testUpdateOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.Person bob = new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; bob.growOlder ( ) ; schema.people ( ) . update ( java.util.Collections.singleton ( bob ) ) ; }
Source:
private static boolean isSingleQuery ( java.lang.String query ) { if ( query.matches ( "^[1-9][0-9]*$" ) ) { return true ; } if ( query.matches ( "^[iI][0-9a-f]{4,}$" ) ) { return true ; } if ( query.matches ( ( ( "^([0-9a-fA-F]{4," + ( com.google.gerrit.reviewdb.client.RevId.LEN ) ) + "})$" ) ) ) { return true ; } return false ; }

Target:
private static boolean isSingleQuery ( java.lang.String query ) { return ( ( ( com.google.gerrit.client.changes.QueryScreen.NUMERIC_ID.test ( query ) ) || ( com.google.gerrit.client.changes.QueryScreen.CHANGE_ID.test ( query ) ) ) || ( com.google.gerrit.client.changes.QueryScreen.CHANGE_ID_TRIPLET.test ( query ) ) ) || ( com.google.gerrit.client.changes.QueryScreen.COMMIT_SHA1.test ( query ) ) ; }
Source:
private static void initLogSystem ( java.nio.file.Path logdir ) { org.apache.log4j.Logger gcLogger = org.apache.log4j.LogManager.getLogger ( GarbageCollection.LOG_NAME ) ; gcLogger.removeAllAppenders ( ) ; gcLogger.addAppender ( com.google.gerrit.server.util.SystemLog.createAppender ( logdir , GarbageCollection.LOG_NAME , new org.apache.log4j.PatternLayout ( "[%d] %-5p %x: %m%n" ) ) ) ; gcLogger.setAdditivity ( false ) ; }

Target:
private static void initLogSystem ( java.nio.file.Path logdir , boolean rotate ) { org.apache.log4j.Logger gcLogger = org.apache.log4j.LogManager.getLogger ( GarbageCollection.LOG_NAME ) ; gcLogger.removeAllAppenders ( ) ; gcLogger.addAppender ( com.google.gerrit.server.util.SystemLog.createAppender ( logdir , GarbageCollection.LOG_NAME , new org.apache.log4j.PatternLayout ( "[%d] %-5p %x: %m%n" ) , rotate ) ) ; gcLogger.setAdditivity ( false ) ; }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; rescan ( false ) ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }

Target:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( false ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }
Source:
public void changeMessageWithMultipleParagraphs ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing paragraph 1\n" + ( ( ( "\n" + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( ( ( "\n" + "Testing paragraph 1\n" ) + "\n" ) + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }

Target:
public void changeMessageWithMultipleParagraphs ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( "Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3" ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( ( ( "\n" + "Testing paragraph 1\n" ) + "\n" ) + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }
Source:
private java.util.Optional < com.google.gerrit.server.group.InternalGroup > toInternalGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) ; }

Target:
private com.google.gerrit.server.group.InternalGroup toInternalGroup ( com.google.gson.JsonObject json ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) . orElse ( null ) ; }
Source:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.ForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoModule ( ) ) ; }

Target:
protected void configure ( ) { install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.ForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; if ( config.cache ( ) . synchronize ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; } if ( config.event ( ) . synchronize ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; } if ( config.index ( ) . synchronize ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; } install ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoModule ( ) ) ; }
Source:
public void setUp ( ) { org.mockito.Mockito.when ( cfgFactoryMock.getGlobalPluginConfig ( pluginName ) ) . thenReturn ( configMock ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.MAIN_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.SHARED_DIRECTORY ) ; }

Target:
public void setUp ( ) throws java.io.IOException { org.mockito.Mockito.when ( cfgFactoryMock.getGlobalPluginConfig ( pluginName ) ) . thenReturn ( configMock ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.MAIN_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.SHARED_DIRECTORY ) ; site = new com.google.gerrit.server.config.SitePaths ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.SITE_PATH ) ; }
Source:
public com.google.common.collect.ImmutableList < java.lang.String > differencesFrom ( com.google.gerrit.server.notedb.ChangeBundle o ) { java.util.List < java.lang.String > diffs = new java.util.ArrayList < > ( ) ; com.google.gerrit.server.notedb.ChangeBundle.diffChanges ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffChangeMessages ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchSets ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchSetApprovals ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchLineComments ( diffs , this , o ) ; return com.google.common.collect.ImmutableList.copyOf ( diffs ) ; }

Target:
public com.google.common.collect.ImmutableList < java.lang.String > differencesFrom ( com.google.gerrit.server.notedb.ChangeBundle o ) { java.util.List < java.lang.String > diffs = new java.util.ArrayList < > ( ) ; com.google.gerrit.server.notedb.ChangeBundle.diffChanges ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffChangeMessages ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchSets ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchSetApprovals ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffReviewers ( diffs , this , o ) ; com.google.gerrit.server.notedb.ChangeBundle.diffPatchLineComments ( diffs , this , o ) ; return com.google.common.collect.ImmutableList.copyOf ( diffs ) ; }
Source:
private void displayHeader ( ) { int col = 0 ; header ( ( col ++ ) , Util.C.approvalTableReviewer ( ) ) ; header ( ( col ++ ) , "" ) ; for ( final com.google.gerrit.common.data.ApprovalType t : types ) { header ( ( col ++ ) , t.getCategory ( ) . getName ( ) ) ; } applyEdgeStyles ( 0 ) ; }

Target:
private void displayHeader ( ) { int col = 0 ; header ( ( col ++ ) , Util.C.approvalTableReviewer ( ) ) ; header ( ( col ++ ) , "" ) ; for ( final com.google.gerrit.common.data.ApprovalType t : types ) { header ( ( col ++ ) , t.getCategory ( ) . getName ( ) ) ; } header ( ( col ++ ) , Util.C.removeReviewer ( ) ) ; applyEdgeStyles ( 0 ) ; }
Source:
protected com.google.gerrit.acceptance.GerritServer startServer ( org.eclipse.jgit.lib.Config cfg , boolean memory , boolean enableHttpd ) throws java.lang.Exception { return com.google.gerrit.acceptance.GerritServer.start ( cfg , memory , enableHttpd ) ; }

Target:
protected void removeGlobalCapabilities ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.Iterable < java.lang.String > capabilityNames ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( java.lang.String capabilityName : capabilityNames ) { com.google.gerrit.server.project.Util.remove ( cfg , capabilityName , id ) ; } saveProjectConfig ( allProjects , cfg ) ; }
Source:
private void markInvalid ( com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { com.google.gerrit.sshd.SshKeyCacheImpl.log.info ( ( ( "Flagging SSH key " + ( k.getKey ( ) ) ) + " invalid" ) ) ; authorizedKeys.markKeyInvalid ( k.getAccount ( ) , k.getKey ( ) . get ( ) ) ; k.setInvalid ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( ( ( "Failed to mark SSH key" + ( k.getKey ( ) ) ) + " invalid" ) , e ) ; } }

Target:
private void markInvalid ( com.google.gerrit.server.account.AccountSshKey k ) { try { com.google.gerrit.sshd.SshKeyCacheImpl.log.info ( ( ( "Flagging SSH key " + ( k.getKey ( ) ) ) + " invalid" ) ) ; authorizedKeys.markKeyInvalid ( k.getAccount ( ) , k.getKey ( ) . get ( ) ) ; k.setInvalid ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( ( ( "Failed to mark SSH key" + ( k.getKey ( ) ) ) + " invalid" ) , e ) ; } }
Source:
private static java.lang.String newFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { return fh.getOldName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String newFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getNewMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getNewName ( ) ) ) { return null ; } return fh.getNewName ( ) ; } return key.getFileName ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.project.ProjectResource , ? > create ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( com.google.gerrit.server.restapi.project.DashboardsCollection.isDefaultDashboard ( id ) ) { return createDefault.get ( ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.project.ProjectResource , ? > create ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException { parent.getProjectState ( ) . checkStatePermitsWrite ( ) ; if ( com.google.gerrit.server.restapi.project.DashboardsCollection.isDefaultDashboard ( id ) ) { return createDefault.get ( ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( name.get ( ) . toLowerCase ( ) , repo ) ; } return repo ; }

Target:
private static java.lang.String normalize ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { return name.get ( ) . toLowerCase ( ) ; }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: master" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseReviewer ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) + "CC: Other Account <2@gerrit>\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Reviewer: 1@gerrit\n" ) ) ) ; }
Source:
public void newPatchSetOnWipChangeSettingReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , submitType ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }
Source:
public void onPreReceive ( final org.eclipse.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; if ( ( ( newChange ) != null ) && ( ( newChange.getResult ( ) ) == ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) ) { createNewChanges ( ) ; } doReplaces ( ) ; }

Target:
public void sendMessage ( java.lang.String what ) { rp.sendMessage ( what ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to index account" ) ; } accountCache.evict ( rsrc.getUser ( ) . getAccountId ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } accountCache.evict ( rsrc.getUser ( ) . getAccountId ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public java.lang.String getPluginName ( java.io.File srcFile ) { java.lang.String srcFileName = srcFile.getName ( ) ; int dashPos = srcFileName.lastIndexOf ( '-' ) ; int dotPos = srcFileName.lastIndexOf ( '.' ) ; return srcFileName.substring ( 0 , ( dashPos > 0 ? dashPos : dotPos ) ) ; }

Target:
public java.lang.String getPluginName ( java.nio.file.Path srcFile ) { java.lang.String srcFileName = srcFile.getFileName ( ) . toString ( ) ; int dashPos = srcFileName.lastIndexOf ( '-' ) ; int dotPos = srcFileName.lastIndexOf ( '.' ) ; return srcFileName.substring ( 0 , ( dashPos > 0 ? dashPos : dotPos ) ) ; }
Source:
private boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { msgs = ChangeNotes.MESSAGE_BY_TIME.sortedCopy ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : msgs ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }

Target:
private boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { msgs = ChangeNotes.MESSAGE_BY_TIME.sortedCopy ( msgs ) ; java.util.Collections.reverse ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : msgs ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }
Source:
private com.google.gerrit.server.group.GroupJson.GroupInfo initMembersAndIncludes ( com.google.gerrit.server.group.GroupResource rsrc , com.google.gerrit.server.group.GroupJson.GroupInfo info ) throws com.google.gwtorm.server.OrmException { if ( ( rsrc.toAccountGroup ( ) ) == null ) { return info ; } try { if ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.MEMBERS ) ) { info.members = listMembers.get ( ) . apply ( rsrc ) ; } if ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.INCLUDES ) ) { info.includes = listIncludes.get ( ) . apply ( rsrc ) ; } return info ; } catch ( com.google.gerrit.extensions.restapi.MethodNotAllowedException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
private com.google.gerrit.extensions.common.GroupInfo initMembersAndIncludes ( com.google.gerrit.server.group.GroupResource rsrc , com.google.gerrit.extensions.common.GroupInfo info ) throws com.google.gwtorm.server.OrmException { if ( ( rsrc.toAccountGroup ( ) ) == null ) { return info ; } try { if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) { info.members = listMembers.get ( ) . apply ( rsrc ) ; } if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) { info.includes = listIncludes.get ( ) . apply ( rsrc ) ; } return info ; } catch ( com.google.gerrit.extensions.restapi.MethodNotAllowedException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
private void configureMainSection ( ) { ui.header ( "Main section" ) ; java.lang.String sharedDir = promptAndSetString ( "Shared directory" , com.ericsson.gerrit.plugins.highavailability.MAIN_SECTION , com.ericsson.gerrit.plugins.highavailability.SHARED_DIRECTORY_KEY , null ) ; if ( sharedDir != null ) { java.nio.file.Path shared = site.site_path.resolve ( sharedDir ) ; com.google.gerrit.common.FileUtil.mkdirsOrDie ( shared , ( "cannot create " + shared ) ) ; } }

Target:
private void configureMainSection ( ) { ui.header ( "Main section" ) ; java.lang.String sharedDir = promptAndSetString ( "Shared directory" , com.ericsson.gerrit.plugins.highavailability.MAIN_SECTION , com.ericsson.gerrit.plugins.highavailability.SHARED_DIRECTORY_KEY , null ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( sharedDir ) ) ) { java.nio.file.Path shared = site.site_path.resolve ( sharedDir ) ; com.google.gerrit.common.FileUtil.mkdirsOrDie ( shared , ( "cannot create " + shared ) ) ; } }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( ctl.getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
private void addProjectOwnersAsReviewers ( com.google.gerrit.reviewdb.client.Change change ) { final java.lang.String projectOwners = groupBackend.get ( AccountGroup.PROJECT_OWNERS ) . getName ( ) ; try { com.google.gerrit.server.change.ChangeResource rsrc = new com.google.gerrit.server.change.ChangeResource ( changeFactory.controlFor ( change , user ) ) ; com.google.gerrit.server.change.PostReviewers.Input input = new com.google.gerrit.server.change.PostReviewers.Input ( ) ; input.reviewer = projectOwners ; reviewersProvider.get ( ) . apply ( rsrc , input ) ; } catch ( java.lang.Exception e ) { } }

Target:
private void addProjectOwnersAsReviewers ( com.google.gerrit.reviewdb.client.Change change ) { final java.lang.String projectOwners = groupBackend.get ( SystemGroupBackend.PROJECT_OWNERS ) . getName ( ) ; try { com.google.gerrit.server.change.ChangeResource rsrc = new com.google.gerrit.server.change.ChangeResource ( changeFactory.controlFor ( change , user ) ) ; com.google.gerrit.server.change.PostReviewers.Input input = new com.google.gerrit.server.change.PostReviewers.Input ( ) ; input.reviewer = projectOwners ; reviewersProvider.get ( ) . apply ( rsrc , input ) ; } catch ( java.lang.Exception e ) { } }