auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } try { return byUUID.get ( uuid.get ( ) ) . orNull ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , uuid.get ( ) ) , e ) ; return null ; } }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } try { return byUUID.get ( uuid.get ( ) ) . orElse ( null ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , uuid.get ( ) ) , e ) ; return null ; } }
Source:
public void parseStatus ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: new\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: OOPS\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) + "Status: NEW\n" ) ) ) ; }

Target:
public void parseStatus ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Status: NEW\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Status: new\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: OOPS\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) + "Status: NEW\n" ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getInjector ( ) . getInstance ( com.google.gerrit.server.patch.PatchSetInfoFactory.class ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }
Source:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.send ( callback ) ; }

Target:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.send ( callback ) ; }
Source:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else { owner = projectControl.isOwner ( ) ; } } return owner ; }
Source:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . projectNameColumn ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , com.google.gerrit.client.ui.ProjectsTable.C_NAME , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , com.google.gerrit.client.ui.ProjectsTable.C_NAME , Gerrit.RESOURCES.css ( ) . projectNameColumn ( ) ) ; fmt.addStyleName ( row , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }
Source:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "enabled" ) ) . toInstance ( new com.googlesource.gerrit.plugins.its.base.its.ItsHookEnabledConfigEntry ( pluginName , pluginCfgFactory ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( isConfigPresent ( pluginName ) ) { com.googlesource.gerrit.plugins.its.rtc.RTCModule.LOG.info ( "RTC is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.rtc.RTCItsFacade.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "enabled" ) ) . toInstance ( new com.googlesource.gerrit.plugins.its.base.its.ItsHookEnabledConfigEntry ( pluginName , pluginCfgFactory ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
public boolean equals ( java.lang.Object other ) { return ( ( other != null ) && ( ( getClass ( ) ) == ( other.getClass ( ) ) ) ) && ( pred.equals ( ( ( com.google.gerrit.server.index.IndexedChangeQuery ) ( other ) ) . pred ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( ( other == null ) || ( ( getClass ( ) ) != ( other.getClass ( ) ) ) ) { return false ; } com.google.gerrit.server.index.IndexedChangeQuery o = ( ( com.google.gerrit.server.index.IndexedChangeQuery ) ( other ) ) ; return ( pred.equals ( o.pred ) ) && ( ( limit ) == ( o.limit ) ) ; }
Source:
protected boolean xsrfValidate ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws com.google.gwtjsonrpc.server.XsrfException { final java.lang.String usertok = com.google.gwtjsonrpc.client.CookieAccess.get ( Gerrit.ACCOUNT_COOKIE ) ; if ( ( usertok == null ) || ( server.getAccountToken ( ) . checkToken ( usertok , null ) ) ) { return super . xsrfValidate ( call ) ; } else { com.google.gerrit.server.LoginServlet.forceLogout ( call.getHttpServletResponse ( ) ) ; return false ; } }

Target:
protected com.google.gwtjsonrpc.server.ActiveCall createActiveCall ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse resp ) { return new com.google.gerrit.server.GerritCall ( server , req , resp ) ; }
Source:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { branch ( ) . delete ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }

Target:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String branchRev = branch ( ) . get ( ) . revision ; branch ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch.get ( ) , null , branchRev , branchRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , sitePath , "--headless" } ) ; if ( rc != 0 ) { serverStarted.reset ( ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , sitePath , "--headless" } ) ; if ( rc != 0 ) { java.lang.System.out.println ( ( ( "Failed to start Gerrit daemon. Check " + sitePath ) + "/logs/error_log" ) ) ; serverStarted.reset ( ) ; } return null ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( com.google.gerrit.server.restapi.config.SetPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } com.google.gerrit.server.account.PreferencesConfig.validateMy ( input.my ) ; try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo updatedPrefs = com.google.gerrit.server.account.PreferencesConfig.updateDefaultPreferences ( md , input ) ; accountCache.evictAllNoReindex ( ) ; return updatedPrefs ; } }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( com.google.gerrit.server.restapi.config.SetPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } com.google.gerrit.server.account.PreferencesConfig.validateMy ( input.my ) ; try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo updatedPrefs = com.google.gerrit.server.account.PreferencesConfig.updateDefaultGeneralPreferences ( md , input ) ; accountCache.evictAllNoReindex ( ) ; return updatedPrefs ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.Change > get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { try { return cache.get ( name ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.git.SearchingChangeCacheImpl.log.warn ( ( "Cannot fetch changes for " + name ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.Change > get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { try { return com.google.common.collect.Lists.transform ( cache.get ( name ) , new com.google.common.base.Function < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange , com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change apply ( com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange in ) { return in.change ( ) ; } } ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.git.SearchingChangeCacheImpl.log.warn ( ( "Cannot fetch changes for " + name ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
public void manualCertificationDoesNotMatchExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }

Target:
public void manualCertificationDoesNotMatchExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }
Source:
public void testIsEnabledEventMultiBranchMixedMatchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" , "refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventMultiBranchMixedMatchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" , "refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
private static Patch.Id patchId ( final java.lang.String token ) { final java.lang.String [ ] p = token.split ( "," ) ; final com.google.gerrit.client.reviewdb.Change.Id cId = Change.Id.fromString ( p [ 2 ] ) ; final com.google.gerrit.client.reviewdb.PatchSet.Id psId = new com.google.gerrit.client.reviewdb.PatchSet.Id ( cId , java.lang.Integer.parseInt ( p [ 3 ] ) ) ; return new com.google.gerrit.client.reviewdb.Patch.Id ( psId , com.google.gwt.http.client.URL.decodeComponent ( p [ 4 ] ) ) ; }

Target:
private static java.lang.String skip ( final java.lang.String prefix , final java.lang.String in ) { return in.substring ( prefix.length ( ) ) ; }
Source:
private void assertStatus ( org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) { org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = result.getRemoteUpdate ( ref ) ; com.google.common.truth.Truth.assertThat ( refUpdate ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . named ( message ( refUpdate ) ) . isEqualTo ( expectedStatus ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getMessage ( ) ) . isEqualTo ( expectedMessage ) ; }

Target:
private void assertStatus ( org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) { org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = result.getRemoteUpdate ( ref ) ; com.google.common.truth.Truth.assertThat ( refUpdate ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . named ( message ( refUpdate ) ) . isEqualTo ( expectedStatus ) ; if ( expectedMessage == null ) { com.google.common.truth.Truth.assertThat ( refUpdate.getMessage ( ) ) . isNull ( ) ; } else { com.google.common.truth.Truth.assertThat ( refUpdate.getMessage ( ) ) . contains ( expectedMessage ) ; } }
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params , com.google.gerrit.acceptance.SshSession session ) throws java.lang.Exception { java.lang.String rawResponse = session.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }

Target:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params , com.google.gerrit.acceptance.SshSession session ) throws java.lang.Exception { java.lang.String rawResponse = session.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assertWithMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }
Source:
private void initPlugins ( ) throws java.lang.Exception { for ( com.google.gerrit.pgm.init.api.InitStep initStep : pluginLoader.getInitSteps ( ) ) { initStep.run ( ) ; } }

Target:
private void initPlugins ( ) throws java.lang.Exception { ui.message ( "Initializing plugins.\n" ) ; java.util.Collection < com.google.gerrit.pgm.init.api.InitStep > initSteps = pluginLoader.getInitSteps ( ) ; if ( initSteps.isEmpty ( ) ) { ui.message ( "No plugins found with init steps.\n" ) ; } else { for ( com.google.gerrit.pgm.init.api.InitStep initStep : initSteps ) { initStep.run ( ) ; } } }
Source:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = createProject ( "parent" , null , true ) . get ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; r.assertForbidden ( ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = createProject ( "parent" , null , true ) . get ( ) ; com.google.gerrit.acceptance.RestResponse r = userRestSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; r.assertForbidden ( ) ; r.consume ( ) ; }
Source:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { com.google.common.collect.ImmutableList.Builder < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = com.google.common.collect.ImmutableList.builder ( ) ; groups.add ( com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( user.getAccountId ( ) ) ) ; if ( ( user.getUserName ( ) ) != null ) { groups.add ( com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( user.getUserName ( ) ) ) ; } return new com.google.gerrit.server.account.ListGroupMembership ( groups.build ( ) ) ; }

Target:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { com.google.common.collect.ImmutableList.Builder < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = com.google.common.collect.ImmutableList.builder ( ) ; groups.add ( com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( user.getAccountId ( ) ) ) ; if ( user.getUserName ( ) . isPresent ( ) ) { groups.add ( com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( user.getUserName ( ) . get ( ) ) ) ; } return new com.google.gerrit.server.account.ListGroupMembership ( groups.build ( ) ) ; }
Source:
public void start ( ) { queue.getDefaultQueue ( ) . execute ( compressor ) ; java.time.ZoneId zone = java.time.ZoneId.systemDefault ( ) ; java.time.LocalDate now = java.time.LocalDate.now ( zone ) ; long milliSecondsUntil11pm = now.atStartOfDay ( zone ) . plusHours ( 23 ) . toInstant ( ) . toEpochMilli ( ) ; @ java.lang.SuppressWarnings ( value = "unused" ) java.util.concurrent.Future < ? > possiblyIgnoredError = queue.getDefaultQueue ( ) . scheduleAtFixedRate ( compressor , milliSecondsUntil11pm , java.util.concurrent.TimeUnit.HOURS.toMillis ( 24 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void start ( ) { queue.getDefaultQueue ( ) . execute ( compressor ) ; java.time.ZoneId zone = java.time.ZoneId.systemDefault ( ) ; java.time.LocalDateTime now = java.time.LocalDateTime.now ( zone ) ; long milliSecondsUntil11pm = now.until ( now.withHour ( 23 ) . withMinute ( 0 ) . withSecond ( 0 ) . withNano ( 0 ) , java.time.temporal.ChronoUnit.MILLIS ) ; @ java.lang.SuppressWarnings ( value = "unused" ) java.util.concurrent.Future < ? > possiblyIgnoredError = queue.getDefaultQueue ( ) . scheduleAtFixedRate ( compressor , milliSecondsUntil11pm , java.util.concurrent.TimeUnit.HOURS.toMillis ( 24 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
private static void dispatchHistoryHooks ( final java.lang.String historyToken ) { final java.lang.String url = ( ( com.google.gwt.user.client.Window.Location.getPath ( ) ) + "#" ) + historyToken ; for ( final com.google.gwt.core.client.JavaScriptObject hook : com.google.gerrit.client.Gerrit.historyHooks ) { com.google.gerrit.client.Gerrit.callHistoryHook ( hook , url ) ; } }

Target:
private static void dispatchHistoryHooks ( final java.lang.String historyToken ) { if ( ( com.google.gerrit.client.Gerrit.signInAnchor ) != null ) { com.google.gerrit.client.Gerrit.signInAnchor.setHref ( com.google.gerrit.client.Gerrit.loginRedirect ( historyToken ) ) ; } if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { final java.lang.String url = ( ( com.google.gwt.user.client.Window.Location.getPath ( ) ) + "#" ) + historyToken ; for ( final com.google.gwt.core.client.JavaScriptObject hook : com.google.gerrit.client.Gerrit.historyHooks ) { com.google.gerrit.client.Gerrit.callHistoryHook ( hook , url ) ; } } }
Source:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void removeGroups ( java.lang.String ... groups ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteGroups.apply ( rsrc , AddIncludedGroups.Input.fromGroups ( java.util.Arrays.asList ( groups ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot remove group members" , e ) ; } }

Target:
public void removeGroups ( java.lang.String ... groups ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteGroups.apply ( rsrc , AddIncludedGroups.Input.fromGroups ( java.util.Arrays.asList ( groups ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot remove group members" , e ) ; } }
Source:
net.sf.ehcache.config.Configuration toConfiguration ( ) { configureDiskStore ( ) ; configureDefaultCache ( ) ; switch ( authConfig.getLoginType ( ) ) { case OPENID : mgr.addCache ( ttl ( named ( "openid" ) , 5 ) ) ; break ; } mgr.addCache ( disk ( named ( "diff" ) ) ) ; mgr.addCache ( named ( "sshkeys" ) ) ; return mgr ; }

Target:
net.sf.ehcache.config.Configuration toConfiguration ( ) { configureDiskStore ( ) ; configureDefaultCache ( ) ; switch ( authConfig.getLoginType ( ) ) { case OPENID : mgr.addCache ( ttl ( named ( "openid" ) , 5 ) ) ; break ; } mgr.addCache ( disk ( named ( "diff" ) ) ) ; mgr.addCache ( named ( "sshkeys" ) ) ; mgr.addCache ( named ( "accounts_byemail" ) ) ; return mgr ; }
Source:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; topNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; bottomNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; } refresh ( true ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; contentTable.setRegisterKeys ( contentTable.isVisible ( ) ) ; if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; modules.add ( com.google.gerrit.server.contact.HttpContactStoreConnection.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
private boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( refControl.canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }

Target:
private boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( refControl.canPerform ( Permission.VIEW_PRIVATE_CHANGES ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
private void initCompression ( boolean enableCompression ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Compression > > compressionFactories = com.google.common.collect.Lists.newArrayList ( ) ; compressionFactories.add ( new org.apache.sshd.common.compression.CompressionNone.Factory ( ) ) ; if ( enableCompression ) { compressionFactories.add ( new org.apache.sshd.common.compression.CompressionZlib.Factory ( ) ) ; } setCompressionFactories ( compressionFactories ) ; }

Target:
private void initCompression ( boolean enableCompression ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.compression.Compression > > compressionFactories = com.google.common.collect.Lists.newArrayList ( ) ; compressionFactories.add ( BuiltinCompressions.none ) ; if ( enableCompression ) { compressionFactories.add ( BuiltinCompressions.zlib ) ; } setCompressionFactories ( compressionFactories ) ; }
Source:
private void loadGroups ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > toGet = groups.keySet ( ) ; groups = new java.util.HashMap < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > ( ) ; for ( com.google.gerrit.reviewdb.AccountGroup.Id groupId : toGet ) { groups.put ( groupId , groupCache.get ( groupId ) ) ; } }

Target:
private java.util.concurrent.Future < com.google.gerrit.reviewdb.AccountGroup > want ( com.google.gerrit.reviewdb.AccountGroup.Id id ) { java.util.concurrent.Future < com.google.gerrit.reviewdb.AccountGroup > f = groups.get ( id ) ; if ( f == null ) { f = groupCache.get ( id ) ; groups.put ( id , f ) ; } return f ; }
Source:
public void merge ( java.lang.String submissionId , java.lang.Iterable < com.google.gerrit.common.data.SubmitRecord > submitRecords ) { this . status = com.google.gerrit.reviewdb.client.PatchLineComment.Status.MERGED ; this . submissionId = submissionId ; this . submitRecords = com.google.common.collect.ImmutableList.copyOf ( submitRecords ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( this . submitRecords.isEmpty ( ) ) ) , "no submit records specified at submit time" ) ; }

Target:
public void merge ( java.lang.String submissionId , java.lang.Iterable < com.google.gerrit.common.data.SubmitRecord > submitRecords ) { this . status = Change.Status.MERGED ; this . submissionId = submissionId ; this . submitRecords = com.google.common.collect.ImmutableList.copyOf ( submitRecords ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( this . submitRecords.isEmpty ( ) ) ) , "no submit records specified at submit time" ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { updateOriginal ( result ) ; setEdit ( false ) ; setMessageText ( message ) ; setDateText ( com.google.gerrit.client.FormatUtil.shortFormatDayTime ( result.updated ( ) ) ) ; resizePaddingWidget ( ) ; if ( isNew ) { removeStyleName ( draftStyle.newDraft ( ) ) ; isNew = false ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { updateOriginal ( result ) ; setMessageText ( message ) ; setDate ( result.updated ( ) ) ; setEdit ( false ) ; if ( isNew ) { removeStyleName ( draftStyle.newDraft ( ) ) ; isNew = false ; } }
Source:
public void setUpMocks ( ) { indexer = createNiceMock ( com.google.gerrit.server.index.ChangeIndexer.class ) ; schemaFactory = createNiceMock ( com.google.gwtorm.server.SchemaFactory.class ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.easymock.EasyMock.expect ( req.getPathInfo ( ) ) . andReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; }

Target:
public void setUpMocks ( ) { indexer = createNiceMock ( com.google.gerrit.server.index.change.ChangeIndexer.class ) ; schemaFactory = createNiceMock ( com.google.gwtorm.server.SchemaFactory.class ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.easymock.EasyMock.expect ( req.getPathInfo ( ) ) . andReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; }
Source:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ; case CREATE_REF : return canAddRefs ( ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }
Source:
public void markKeyInvalid ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = getKey ( seq ) ; if ( key != null ) { key.setInvalid ( ) ; } }

Target:
private boolean markKeyInvalid ( int seq ) { checkLoaded ( ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = getKey ( seq ) ; if ( ( key != null ) && ( key.isValid ( ) ) ) { key.setInvalid ( ) ; return true ; } return false ; }
Source:
public com.google.gerrit.common.data.GroupReference byUUID ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { return byUUID.get ( uuid ) ; }

Target:
public void put ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , com.google.gerrit.common.data.GroupReference reference ) { if ( ( uuid == null ) || ( ( uuid.get ( ) ) == null ) ) { com.google.gerrit.server.git.GroupList.log.warn ( "attempting to put null group in {}: {}" , project , reference ) ; return ; } byUUID.put ( uuid , reference ) ; }
Source:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( contentMerge , InheritedBoolean.FALSE ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }

Target:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.InheritedBoolean inheritedBoolean = new com.google.gerrit.reviewdb.client.InheritedBoolean ( ) ; inheritedBoolean.setValue ( InheritableBoolean.FALSE ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( contentMerge , inheritedBoolean ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }
Source:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; if ( val != null ) { org.joda.time.DateTime expires = new org.joda.time.DateTime ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( new org.joda.time.DateTime ( ) ) ) { deleteFile ( path ) ; } } } }

Target:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; if ( val != null ) { java.time.Instant expires = java.time.Instant.ofEpochMilli ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( java.time.Instant.ofEpochMilli ( com.google.gerrit.common.TimeUtil.nowMs ( ) ) ) ) { deleteFile ( path ) ; } } } }
Source:
public void shouldThrowExceptionIfSharedDirectoryNotConfigured ( ) throws java.lang.Exception { 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 ( null ) ; initializeConfiguration ( ) ; }

Target:
public void testGetJGroupsMyUrlFromListenUrlWhenWildcardConfigured ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "https://*" } ) ; exception.expect ( com.ericsson.gerrit.plugins.highavailability.ProvisionException.class ) ; exception.expectMessage ( "when configured with wildcard" ) ; getMyUrlProvider ( ) ; }
Source:
private java.lang.String getPullUrl ( ) { final java.util.List < com.jcraft.jsch.HostKey > hostKeys = sshInfo.getHostKeys ( ) ; if ( hostKeys.isEmpty ( ) ) { return "" ; } final java.lang.String host = hostKeys.get ( 0 ) . getHost ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "git pull ssh://" ) ; if ( host.startsWith ( "*:" ) ) { r.append ( getGerritHost ( ) ) ; r.append ( host.substring ( 2 ) ) ; } else { r.append ( host ) ; } r.append ( "/" ) ; r.append ( projectName ) ; r.append ( " " ) ; r.append ( patchSet.getRefName ( ) ) ; return r.toString ( ) ; }

Target:
private java.lang.String getPullUrl ( ) { final java.util.List < com.jcraft.jsch.HostKey > hostKeys = sshInfo.getHostKeys ( ) ; if ( hostKeys.isEmpty ( ) ) { return "" ; } final java.lang.String host = hostKeys.get ( 0 ) . getHost ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "git pull ssh://" ) ; if ( host.startsWith ( "*:" ) ) { r.append ( getGerritHost ( ) ) ; r.append ( host.substring ( 1 ) ) ; } else { r.append ( host ) ; } r.append ( "/" ) ; r.append ( projectName ) ; r.append ( " " ) ; r.append ( patchSet.getRefName ( ) ) ; return r.toString ( ) ; }
Source:
private int execute ( org.eclipse.jgit.transport.URIish uri , java.lang.String cmd , java.io.OutputStream errStream ) throws java.io.IOException { try { org.eclipse.jgit.transport.URIish sshUri = toSshUri ( uri ) ; return sshHelper.executeRemoteSsh ( sshUri , cmd , errStream ) ; } catch ( java.net.URISyntaxException e ) { com.googlesource.gerrit.plugins.replication.GerritSshApi.log.error ( java.lang.String.format ( "Cannot convert %s to SSH uri" , uri ) , e ) ; } return com.googlesource.gerrit.plugins.replication.GerritSshApi.SSH_COMMAND_FAILED ; }

Target:
private int execute ( org.eclipse.jgit.transport.URIish uri , java.lang.String cmd , java.io.OutputStream errStream ) throws java.io.IOException { try { org.eclipse.jgit.transport.URIish sshUri = toSshUri ( uri ) ; return sshHelper.executeRemoteSsh ( sshUri , cmd , errStream ) ; } catch ( java.net.URISyntaxException e ) { com.googlesource.gerrit.plugins.replication.GerritSshApi.log.error ( "Cannot convert to SSH uri" , uri , e ) ; } return com.googlesource.gerrit.plugins.replication.GerritSshApi.SSH_COMMAND_FAILED ; }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : this . oldRevision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set old revision on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : this . oldRevision = revision ; break ; default : com.google.common.base.Preconditions.checkState ( ( revision == null ) , "cannot set old revision on %s view" , type ) ; this . oldRevision = revision ; break ; } return this ; }
Source:
static < T > com.google.gerrit.server.query.QueryResult < T > create ( @ com.google.gerrit.common.Nullable java.lang.String query , com.google.gerrit.server.query.Predicate < T > predicate , int limit , java.util.List < T > entites ) { boolean more ; if ( ( entites.size ( ) ) > limit ) { more = true ; entites = entites.subList ( 0 , limit ) ; } else { more = false ; } return new com.google.gerrit.server.query.AutoValue_QueryResult ( query , predicate , entites , more ) ; }

Target:
public static < T > com.google.gerrit.index.query.QueryResult < T > create ( @ com.google.gerrit.common.Nullable java.lang.String query , com.google.gerrit.index.query.Predicate < T > predicate , int limit , java.util.List < T > entites ) { boolean more ; if ( ( entites.size ( ) ) > limit ) { more = true ; entites = entites.subList ( 0 , limit ) ; } else { more = false ; } return new com.google.gerrit.index.query.AutoValue_QueryResult ( query , predicate , entites , more ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( submitRecords ) == null ) { submitRecords = new java.util.HashMap < > ( ) ; } java.util.List < com.google.gerrit.common.data.SubmitRecord > records = submitRecords.get ( cd.getId ( ) ) ; if ( records == null ) { records = new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ; submitRecords.put ( cd.getId ( ) , records ) ; } return records ; }
Source:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; m.append ( " (" ) . append ( u.state ( ) . getUserName ( ) ) . append ( ")" ) ; } return m.toString ( ) ; }

Target:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; if ( u.state ( ) . getUserName ( ) . isPresent ( ) ) { m.append ( " (" ) . append ( u.state ( ) . getUserName ( ) . get ( ) ) . append ( ")" ) ; } } return m.toString ( ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.Change > allChanges ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = database.open ( ) ) { return db.changes ( ) . all ( ) . toList ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { stderr.println ( ( "Cannot read changes from database " + ( e.getMessage ( ) ) ) ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
public boolean apply ( com.google.gerrit.server.notedb.ChangeNotes notes ) { return ( notes.getChange ( ) . getStatus ( ) ) == ( Change.Status.MERGED ) ; }
Source:
public com.google.gerrit.client.reviewdb.ApprovalCategoryValue getValue ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { if ( ( byValue ) == null ) { byValue = new java.util.HashMap < java.lang.Short , com.google.gerrit.client.reviewdb.ApprovalCategoryValue > ( ) ; for ( final com.google.gerrit.client.reviewdb.ApprovalCategoryValue acv : values ) { byValue.put ( acv.getValue ( ) , acv ) ; } } return byValue.get ( ca.getValue ( ) ) ; }

Target:
private void initByValue ( ) { if ( ( byValue ) == null ) { byValue = new java.util.HashMap < java.lang.Short , com.google.gerrit.client.reviewdb.ApprovalCategoryValue > ( ) ; for ( final com.google.gerrit.client.reviewdb.ApprovalCategoryValue acv : values ) { byValue.put ( acv.getValue ( ) , acv ) ; } } }