auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void initEvents ( ) { if ( ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == null ) { com.google.gwtexpui.globalkey.client.DocWidget.get ( ) . addKeyPressHandler ( new com.google.gwt.event.dom.client.KeyPressHandler ( ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { com.google.gwtexpui.globalkey.client.GlobalKey.active.all.onKeyPress ( event ) ; } } ) ; com.google.gwtexpui.globalkey.client.GlobalKey.global = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( null ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = com.google.gwtexpui.globalkey.client.GlobalKey.global ; } }

Target:
public void run ( ) { com.google.gwtexpui.globalkey.client.GlobalKey.active.live = com.google.gwtexpui.globalkey.client.GlobalKey.active.all ; }
Source:
private static java.lang.String initSite ( ) throws java.lang.Exception { java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyyMMddHHmmss" ) ; java.lang.String path = "target/test_site_" + ( df.format ( new java.util.Date ( ) ) ) ; com.google.gerrit.pgm.Init init = new com.google.gerrit.pgm.Init ( ) ; int rc = init.main ( new java.lang.String [ ] { "-d" , path , "--batch" , "--no-auto-start" } ) ; if ( rc != 0 ) { throw new java.lang.RuntimeException ( "Couldn't initialize site" ) ; } return path ; }

Target:
private static java.io.File initSite ( ) throws java.lang.Exception { java.io.File tmp = com.google.gerrit.acceptance.TempFileUtil.createTempDirectory ( ) ; com.google.gerrit.pgm.Init init = new com.google.gerrit.pgm.Init ( ) ; int rc = init.main ( new java.lang.String [ ] { "-d" , tmp.getPath ( ) , "--batch" , "--no-auto-start" } ) ; if ( rc != 0 ) { throw new java.lang.RuntimeException ( "Couldn't initialize site" ) ; } return tmp ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; return ctx ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; return ctx ; }
Source:
public java.lang.String getBranchUrl ( java.lang.String projectName , java.lang.String branchName ) { com.google.gerrit.server.project.ProjectState state = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; if ( state == null ) { return null ; } return getPatchUrl ( projectName , branchName , cfgFactory.create ( state ) . getIndexFile ( ) ) ; }

Target:
private java.lang.String getBranchUrl ( java.lang.String projectName , java.lang.String branchName ) { com.google.gerrit.server.project.ProjectState state = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; if ( state == null ) { return null ; } return getFileUrl ( projectName , branchName , cfgFactory.create ( state ) . getIndexFile ( ) ) ; }
Source:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/testBranch" } ; setupIsEnabled ( "false" , 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 ( ) ; assertFalse ( 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:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; get ( com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) . to ( GetCapabilities.CheckOne.class ) ; }
Source:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { next = itr.next ( ) . get ( ) ; } return ( next ) != null ; }

Target:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { com.google.inject.Provider < T > p = itr.next ( ) . get ( ) ; if ( p != null ) { try { next = p.get ( ) ; } catch ( java.lang.RuntimeException e ) { } } } return ( next ) != null ; }
Source:
private static java.lang.Object toImgSrc ( com.google.gitiles.doc.ImageLoader img , java.lang.String url ) { if ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( url ) ) { return url ; } if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( url ) ) { return com.google.template.soy.shared.restricted.Sanitizers.filterImageDataUri ( url ) ; } if ( img != null ) { return com.google.template.soy.shared.restricted.Sanitizers.filterImageDataUri ( img.loadImage ( url ) ) ; } return FilterImageDataUri.INSTANCE.getInnocuousOutput ( ) ; }

Target:
private void extractRefLinks ( java.lang.String markdown ) { java.util.regex.Matcher m = com.google.gitiles.doc.Navbar.REF_LINK.matcher ( markdown ) ; while ( m.find ( ) ) { java.lang.String key = m.group ( 1 ) . toLowerCase ( ) ; java.lang.String url = m.group ( 2 ) . trim ( ) ; switch ( key ) { case "logo" : logoUrl = url ; break ; case "home" : homeUrl = url ; break ; } } }
Source:
void start ( ) throws java.io.IOException { if ( flags.autoStart ) { if ( com.google.gerrit.pgm.util.IoUtil.isWin32 ( ) ) { java.lang.System.err.println ( "Automatic startup not supported on Win32." ) ; } else { startDaemon ( ) ; if ( ! ( ui.isBatch ( ) ) ) { browser.open ( PageLinks.ADMIN_PROJECTS ) ; } } } }

Target:
void start ( ) throws java.io.IOException { if ( flags.autoStart ) { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { java.lang.System.err.println ( "Automatic startup not supported on Win32." ) ; } else { startDaemon ( ) ; if ( ! ( ui.isBatch ( ) ) ) { browser.open ( PageLinks.ADMIN_PROJECTS ) ; } } } }
Source:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName , boolean refresh ) { if ( refresh && ( cfgSnapshot.isModified ( site.gerrit_config ) ) ) { cfgSnapshot = org.eclipse.jgit.internal.storage.file.FileSnapshot.save ( site.gerrit_config ) ; cfg = cfgProvider.get ( ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName , boolean refresh ) { java.io.File configFile = site.gerrit_config.toFile ( ) ; if ( refresh && ( cfgSnapshot.isModified ( configFile ) ) ) { cfgSnapshot = org.eclipse.jgit.internal.storage.file.FileSnapshot.save ( configFile ) ; cfg = cfgProvider.get ( ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }
Source:
private void initKeyMapType ( ) { keyMap.addItem ( KeyMapType.DEFAULT.name ( ) . toLowerCase ( ) , KeyMapType.DEFAULT.name ( ) ) ; keyMap.addItem ( KeyMapType.EMACS.name ( ) . toLowerCase ( ) , KeyMapType.EMACS.name ( ) ) ; keyMap.addItem ( KeyMapType.VIM.name ( ) . toLowerCase ( ) , KeyMapType.VIM.name ( ) ) ; }

Target:
private void initKeyMapType ( ) { for ( com.google.gerrit.extensions.client.KeyMapType t : com.google.gerrit.extensions.client.KeyMapType.values ( ) ) { keyMap.addItem ( t.name ( ) . toLowerCase ( ) , t.name ( ) ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; int rest = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 30 ; cm.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ) ) ; cm.refresh ( ) ; cm.focus ( ) ; }

Target:
public void onWindowClosing ( com.google.gwt.user.client.Window.ClosingEvent event ) { if ( ! ( cm.isClean ( generation ) ) ) { event.setMessage ( EditConstants.I.closeUnsavedChanges ( ) ) ; } }
Source:
public static boolean same ( final com.google.gwtexpui.globalkey.client.KeyCommand a , final com.google.gwtexpui.globalkey.client.KeyCommand b ) { return ( ( a.getClass ( ) ) == ( b.getClass ( ) ) ) && ( a.helpText.equals ( b.helpText ) ) ; }

Target:
public static boolean same ( final com.google.gwtexpui.globalkey.client.KeyCommand a , final com.google.gwtexpui.globalkey.client.KeyCommand b ) { return ( ( ( a.getClass ( ) ) == ( b.getClass ( ) ) ) && ( a.helpText.equals ( b.helpText ) ) ) && ( ( a.sibling ) == ( b.sibling ) ) ; }
Source:
private com.google.gerrit.server.account.AccountState missingAccount ( final com.google.gerrit.client.reviewdb.Account.Id accountId ) { final com.google.gerrit.client.reviewdb.Account account = new com.google.gerrit.client.reviewdb.Account ( accountId ) ; final java.util.Set < java.lang.String > emails = java.util.Collections.emptySet ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anonymous , anonymous , emails ) ; }

Target:
private com.google.gerrit.server.account.AccountState missingAccount ( final com.google.gerrit.client.reviewdb.Account.Id accountId ) { final com.google.gerrit.client.reviewdb.Account account = new com.google.gerrit.client.reviewdb.Account ( accountId ) ; final java.util.Collection < com.google.gerrit.client.reviewdb.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anonymous , ids ) ; }
Source:
com.ericsson.gerrit.plugins.eventslog.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { return new com.ericsson.gerrit.plugins.eventslog.SQLClient ( cfg.getLocalStoreDriver ( ) , cfg.getLocalStoreUrl ( ) , cfg.getUrlOptions ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.eventslog.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; return new com.ericsson.gerrit.plugins.eventslog.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.Module.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; }
Source:
public void setActive ( boolean active ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( active ) { putActive.apply ( account , new com.google.gerrit.server.account.PutActive.Input ( ) ) ; } else { deleteActive.apply ( account , new com.google.gerrit.server.account.DeleteActive.Input ( ) ) ; } } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set active" , e ) ; } }

Target:
public void setActive ( boolean active ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( active ) { putActive.apply ( account , new com.google.gerrit.extensions.common.Input ( ) ) ; } else { deleteActive.apply ( account , new com.google.gerrit.extensions.common.Input ( ) ) ; } } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set active" , e ) ; } }
Source:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSessionManager.class ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . to ( com.google.gerrit.httpd.CacheBasedWebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }

Target:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . memoryLimit ( 1024 ) . maxAge ( com.google.gerrit.httpd.CacheBasedWebSession.MAX_AGE_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSessionManager.class ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . to ( com.google.gerrit.httpd.CacheBasedWebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }
Source:
public static GroupDescription.Internal forAccountGroup ( final com.google.gerrit.reviewdb.client.AccountGroup group ) { return new com.google.gerrit.common.data.GroupDescription.Internal ( ) { @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return group.getGroupUUID ( ) ; } @ java.lang.Override public java.lang.String getName ( ) { return group.getName ( ) ; } @ java.lang.Override public boolean isVisibleToAll ( ) { return group.isVisibleToAll ( ) ; } @ java.lang.Override public com.google.gerrit.reviewdb.client.AccountGroup getAccountGroup ( ) { return group ; } } ; }

Target:
public java.lang.String getUrl ( ) { return "#" + ( com.google.gerrit.common.PageLinks.toGroup ( getGroupUUID ( ) ) ) ; }
Source:
public static < T > com.google.gerrit.server.query.Predicate < T > and ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > that ) { return new com.google.gerrit.server.query.AndPredicate < T > ( that ) ; }

Target:
public static < T > com.google.gerrit.server.query.Predicate < T > and ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > that ) { if ( ( that.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( that ) ; } return new com.google.gerrit.server.query.AndPredicate < T > ( that ) ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getSessionId ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = java.lang.System.currentTimeMillis ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }

Target:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getSessionId ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = com.google.gerrit.server.util.TimeUtil.nowMs ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }
Source:
public void parsePatchSetId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + "\n" ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Patch-set: 1\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( "\n" + "Patch-set: x\n" ) ) ) ; }

Target:
public void parsePatchSetId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( "Update change\n\n" ) ; assertParseFails ( "Update change\n\nPatch-set: 1\nPatch-set: 1\n" ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( "Update change\n\nPatch-set: x\n" ) ; }
Source:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > admins = getAdmins ( ) ; com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID admin : admins ) { allow ( pc , Permission.READ , admin , "refs/*" ) ; } }

Target:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > admins = getAdmins ( ) ; com.google.gerrit.server.project.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID admin : admins ) { allow ( pc , Permission.READ , admin , "refs/*" ) ; } }
Source:
public void testEvictProjectListOK ( ) throws java.lang.Exception { java.lang.String key = "all" ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.PROJECT_LIST ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.PROJECT_LIST , key ) ) . isTrue ( ) ; }

Target:
public void testRemoveFromProjectListOK ( ) throws java.lang.Exception { java.lang.String projectName = "projectToDelete" ; org.mockito.Mockito.when ( httpSessionMock.delete ( buildProjectListCacheEndpoint ( projectName ) ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.removeFromProjectList ( projectName ) ) . isTrue ( ) ; }
Source:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.server.git.validators.MergeValidationException { for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : mergeValidationListeners ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId ) ; } }

Target:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : mergeValidationListeners ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }
Source:
private static void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.error ( ( "Failed to send error messsage: " + ( e.getMessage ( ) ) ) , e ) ; } }

Target:
private static void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.error ( "Failed to send error messsage: {}" , e.getMessage ( ) , e ) ; } }
Source:
public void testSubscriptionToExistingRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isTrue ( ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionToExistingRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isTrue ( ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }
Source:
private void assertChanges ( java.util.Set < java.lang.String > actualChanges , com.google.gerrit.acceptance.PushOneCommit ... expectedChanges ) { org.junit.Assert.assertEquals ( expectedChanges.length , actualChanges.size ( ) ) ; for ( com.google.gerrit.acceptance.PushOneCommit.Result c : expectedChanges ) { org.junit.Assert.assertTrue ( actualChanges.contains ( id ( c ) ) ) ; } }

Target:
private void assertChanges ( java.util.Set < java.lang.String > actualChanges , com.google.gerrit.acceptance.PushOneCommit ... expectedChanges ) { com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( actualChanges ) ) ) . hasSize ( expectedChanges.length ) ; for ( com.google.gerrit.acceptance.PushOneCommit.Result c : expectedChanges ) { com.google.common.truth.Truth.assertThat ( actualChanges.contains ( id ( c ) ) ) . isTrue ( ) ; } }
Source:
public void add ( final com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } add ( new com.google.gerrit.lifecycle.LifecycleListener ( ) { @ java.lang.Override public void start ( ) { } @ java.lang.Override public void stop ( ) { handle.remove ( ) ; } } ) ; }

Target:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } manager.add ( handle ) ; }
Source:
public void keyRevokedByExpiredKeyBeforeExpirationIsRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyBeforeExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k , "Key is revoked (retired and no longer valid): test9 not used" ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2005-08-01 13:00:00 -0400" ) ) ; assertProblems ( checker , k ) ; }

Target:
public void keyRevokedByExpiredKeyBeforeExpirationIsRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyBeforeExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k , "Key is revoked (retired and no longer valid): test9 not used" ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2005-08-01 13:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }
Source:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }

Target:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ; HEAD ( ( 0 ? AbstractSubmit : Format ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ) ) ; stmt.executeUpdate ( ( "CREATE TABLE IF NOT EXISTS ACCOUNT_PATCH_REVIEWS (" + ( ( ( ( ( ( "ACCOUNT_ID INTEGER DEFAULT 0 NOT NULL, " + "CHANGE_ID INTEGER DEFAULT 0 NOT NULL, " ) + "PATCH_SET_ID INTEGER DEFAULT 0 NOT NULL, " ) + "FILE_NAME VARCHAR(255) DEFAULT '' NOT NULL, " ) + "CONSTRAINT PRIMARY_KEY_ACCOUNT_PATCH_REVIEWS " ) + "PRIMARY KEY (ACCOUNT_ID, CHANGE_ID, PATCH_SET_ID, FILE_NAME)" ) + ")" ) ) ) ; }

Target:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { com.google.gerrit.server.schema.H2AccountPatchReviewStore.doCreateTable ( stmt ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }
Source:
private static java.util.List < java.lang.String > toHashtagList ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { java.util.List < java.lang.String > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < java.lang.String > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private void removeHashtags ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String ... toRemove ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.HashtagsInput input = new com.google.gerrit.extensions.api.changes.HashtagsInput ( ) ; input.remove = com.google.common.collect.Sets.newHashSet ( toRemove ) ; gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . setHashtags ( input ) ; }
Source:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String n = entry.getFileName ( ) . toString ( ) ; return ( ! ( n.startsWith ( ".last_" ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ; }

Target:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String n = entry.getFileName ( ) . toString ( ) ; boolean accept = ( ( ! ( n.startsWith ( ".last_" ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( suffix ) ) ) { accept &= n.endsWith ( suffix ) ; } return accept ; }
Source:
public void onReviewerAdded ( com.google.gerrit.extensions.events.ReviewerAddedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet patch = db.get ( ) . patchSets ( ) . get ( change.currentPatchSetId ( ) ) ; hooks.doReviewerAddedHook ( change , getAccount ( ev.getReviewer ( ) ) , patch , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ReviewerAdded hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
private com.google.gerrit.reviewdb.client.PatchSet getPatchSet ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.extensions.common.RevisionInfo info ) throws com.google.gwtorm.server.OrmException { return psUtil.get ( db.get ( ) , notes , PatchSet.Id.fromRef ( info.ref ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException { try { final com.google.gerrit.reviewdb.client.PatchSet patchSet = db.patchSets ( ) . get ( patchSetId ) ; final com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( patchSet.getId ( ) . getParentKey ( ) ) ; return get ( change , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.patch.PatchSetInfoNotAvailableException ( e ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException { try { com.google.gerrit.reviewdb.client.PatchSet patchSet = psUtil.get ( db , notes , psId ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( psId.getParentKey ( ) ) ; return get ( change , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.patch.PatchSetInfoNotAvailableException ( e ) ; } }
Source:
private com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > createClassUnderTest ( ) { final com.google.gwtorm.schema.sql.SqlDialect dialect = org.mockito.Mockito.mock ( com.google.gwtorm.schema.sql.SqlDialect.class , org.mockito.Mockito.CALLS_REAL_METHODS ) ; com.google.gwtorm.jdbc.JdbcSchema schema = setupSchema ( dialect ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = new com.google.gwtorm.jdbc.TestJdbcAccess.DataJdbcAccess ( schema ) ; return classUnderTest ; }

Target:
private com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > createJdbcAccess ( final com.google.gwtorm.schema.sql.SqlDialect dialect ) { com.google.gwtorm.jdbc.JdbcSchema schema = setupSchema ( dialect ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = new com.google.gwtorm.jdbc.TestJdbcAccess.DataJdbcAccess ( schema ) ; return classUnderTest ; }
Source:
protected int columnOf ( final com.google.gwt.user.client.Element target ) { final com.google.gwt.user.client.Element td = getParentCell ( target ) ; if ( td == null ) { return - 1 ; } final com.google.gwt.user.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; return com.google.gwt.user.client.DOM.getChildIndex ( tr , td ) ; }

Target:
protected int columnOf ( final com.google.gwt.dom.client.Element target ) { final com.google.gwt.dom.client.Element td = getParentCell ( target ) ; if ( td == null ) { return - 1 ; } final com.google.gwt.dom.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; return com.google.gwt.user.client.DOM.getChildIndex ( tr , td ) ; }
Source:
private static java.util.Set < com.google.gerrit.reviewdb.Account.Id > pack ( final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c ) { switch ( c.size ( ) ) { case 0 : return java.util.Collections.emptySet ( ) ; case 1 : return com.google.gerrit.server.account.AccountByEmailCacheImpl.Loader.one ( c ) ; default : return java.util.Collections.unmodifiableSet ( new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( c ) ) ; } }

Target:
private static com.google.gerrit.server.account.AccountIdSet pack ( final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c ) { switch ( c.size ( ) ) { case 0 : return AccountIdSet.EMPTY_SET ; case 1 : return new com.google.gerrit.server.account.AccountIdSet ( c.iterator ( ) . next ( ) ) ; default : return new com.google.gerrit.server.account.AccountIdSet ( new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( c ) ) ; } }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , null ) ; return null ; } } ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor , final org.eclipse.jgit.lib.BatchRefUpdate bru ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , bru ) ; return null ; } } ) ; }
Source:
public void testIsEnabledEventSingleBranchNonMatchingRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( testChange ( "testProject" , "testBranch" ) ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void BROKEN_testIsEnabledEventSingleBranchNonMatchingRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( testChange ( "testProject" , "testBranch" ) ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
public static void topic ( int id , java.lang.String topic , java.lang.String msg , com.google.gwtjsonrpc.common.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.setTopic ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ) ; input.setMessage ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + id ) + "/topic" ) ) . data ( input ) . put ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; }

Target:
public static void topic ( int id , java.lang.String topic , java.lang.String msg , com.google.gwtjsonrpc.common.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.topic ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "topic" ) . data ( input ) . put ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; }
Source:
public int hashCode ( ) { return ( ( ( ( fp [ 4 ] ) << 24 ) & ( ( fp [ 5 ] ) << 16 ) ) & ( ( fp [ 6 ] ) << 8 ) ) & ( fp [ 7 ] ) ; }

Target:
public int hashCode ( ) { return org.eclipse.jgit.util.NB.decodeInt32 ( fp , 4 ) ; }
Source:
private com.google.gerrit.reviewdb.Account findByEmail ( final java.lang.String email ) { final java.util.Set < com.google.gerrit.reviewdb.Account.Id > candidates = byEmail.get ( email ) ; if ( 1 == ( candidates.size ( ) ) ) { return byId.get ( candidates.iterator ( ) . next ( ) ) . getAccount ( ) ; } return null ; }

Target:
private com.google.gerrit.reviewdb.Account findByEmail ( final java.lang.String email ) { final java.util.Set < com.google.gerrit.reviewdb.Account.Id > candidates = byEmail.get ( email ) . getIds ( ) ; if ( 1 == ( candidates.size ( ) ) ) { return byId.get ( candidates.iterator ( ) . next ( ) ) . getAccount ( ) ; } return null ; }
Source:
public void byAuthor ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "author:jauthor@example.com" , change1 ) ; assertQuery ( "author:jauthor" , change1 ) ; assertQuery ( "author:example" , change1 ) ; assertQuery ( "author:example.com" , change1 ) ; assertQuery ( "author:Author" , change1 ) ; assertQuery ( "author:jAuThOr" , change1 ) ; assertQuery ( "author:ExAmPlE" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }

Target:
public void byAuthor ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChangeForUser ( repo , userId ) ) ; assertQuery ( "author:jauthor@example.com" , change1 ) ; assertQuery ( "author:jauthor" , change1 ) ; assertQuery ( "author:example" , change1 ) ; assertQuery ( "author:example.com" , change1 ) ; assertQuery ( "author:Author" , change1 ) ; assertQuery ( "author:jAuThOr" , change1 ) ; assertQuery ( "author:ExAmPlE" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.grant ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) . setBlock ( ) ; saveProjectConfig ( cfg ) ; projectCache.evict ( cfg.getProject ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; saveProjectConfig ( cfg ) ; projectCache.evict ( cfg.getProject ( ) ) ; }
Source:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , repo , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }

Target:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; com.google.gerrit.server.project.ProjectState state = projectControl.getProjectState ( ) ; if ( ! ( commits.canRead ( state , repo , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }