auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.apache.http.conn.HttpClientConnectionManager customConnectionManager ( ) { org.apache.http.config.Registry < org.apache.http.conn.socket.ConnectionSocketFactory > socketFactoryRegistry = org.apache.http.config.RegistryBuilder.< org.apache.http.conn.socket.ConnectionSocketFactory > create ( ) . register ( "https" , buildSslSocketFactory ( ) ) . register ( "http" , PlainConnectionSocketFactory.INSTANCE ) . build ( ) ; org.apache.http.impl.conn.PoolingHttpClientConnectionManager connManager = new org.apache.http.impl.conn.PoolingHttpClientConnectionManager ( socketFactoryRegistry ) ; connManager.setDefaultMaxPerRoute ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.CONNECTIONS_PER_ROUTE ) ; connManager.setMaxTotal ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTIONS ) ; connManager.setValidateAfterInactivity ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTION_INACTIVITY ) ; return connManager ; }

Target:
private org.apache.http.conn.HttpClientConnectionManager create ( org.apache.http.config.Registry < org.apache.http.conn.socket.ConnectionSocketFactory > socketFactoryRegistry ) { org.apache.http.impl.conn.PoolingHttpClientConnectionManager connManager = new org.apache.http.impl.conn.PoolingHttpClientConnectionManager ( socketFactoryRegistry ) ; connManager.setDefaultMaxPerRoute ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.CONNECTIONS_PER_ROUTE ) ; connManager.setMaxTotal ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTIONS ) ; connManager.setValidateAfterInactivity ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTION_INACTIVITY ) ; return connManager ; }
Source:
public void unstarChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }

Target:
public void unstarChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }
Source:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.server.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.client.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , visibleToAll , null , java.util.Collections.singleton ( me ) , null ) ; }

Target:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.server.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.client.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , visibleToAll , null , java.util.Collections.singleton ( me ) , null ) . getId ( ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.close ( ) ; } }
Source:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private com.google.inject.Key < javax.servlet.http.HttpServlet > gerritUrl ( ) { new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override HEAD ( com.google.gerrit.httpd.da2e26 Merge ) { } protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( req.getRequestURI ( ) . substring ( req.getContextPath ( ) . length ( ) ) , req , rsp ) ; BRANCH ( d57189 ) ; com.google.gerrit.httpd.Redirect polygerrit ; com.google.gerrit.httpd.with context ; com.google.gerrit.httpd.to GWTUI ; } } ; }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > gerritUrl ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( req.getRequestURI ( ) . substring ( req.getContextPath ( ) . length ( ) ) , req , rsp ) ; } } ) ; }
Source:
public com.googlesource.gerrit.plugins.github.oauth.GitHubLogin get ( java.lang.String username ) { try { com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken accessToken = newAccessTokenFromUser ( username ) ; if ( accessToken != null ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin login = new com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ( config ) ; login.login ( accessToken ) ; return login ; } else { return null ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.log.error ( ( ( "Cannot login to GitHub as '" + username ) + "'" ) , e ) ; return null ; } }

Target:
public com.googlesource.gerrit.plugins.github.oauth.GitHubLogin get ( java.lang.String username ) { try { com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken accessToken = newAccessTokenFromUser ( username ) ; if ( accessToken != null ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin login = new com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ( config ) ; login.login ( accessToken ) ; return login ; } return null ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.log.error ( ( ( "Cannot login to GitHub as '" + username ) + "'" ) , e ) ; return null ; } }
Source:
public void start ( ) { if ( ( timer ) == null ) { timer = new java.util.Timer ( ) ; } else { timer.cancel ( ) ; } timer.scheduleAtFixedRate ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { com.google.gerrit.server.mail.receive.MailReceiver.this . handleEmails ( ) ; } } , 0L , ( ( mailSettings.fetchInterval ) * 1000 ) ) ; }

Target:
public void start ( ) { if ( ( timer ) == null ) { timer = new java.util.Timer ( ) ; } else { timer.cancel ( ) ; } timer.scheduleAtFixedRate ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { com.google.gerrit.server.mail.receive.MailReceiver.this . handleEmails ( ) ; } } , 0L , mailSettings.fetchInterval ) ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( req.getRequestURI ( ) . substring ( req.getContextPath ( ) . length ( ) ) , req , rsp ) ; BRANCH ( d57189 ) ; com.google.gerrit.httpd.Redirect polygerrit ; com.google.gerrit.httpd.with context ; com.google.gerrit.httpd.to GWTUI ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( req.getRequestURI ( ) . substring ( req.getContextPath ( ) . length ( ) ) , req , rsp ) ; }
Source:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , anon , java.util.Collections.emptySet ( ) , new java.util.HashMap < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > > ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }
Source:
public void commentOnReview ( java.lang.String project , int number , java.lang.String comment ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.ReviewInput reviewInput = createComment ( comment ) ; applyComment ( project , number , reviewInput ) ; BRANCH ( f1d0f4 ) ; com.criteo.gerrit.plugins.automerge.Format all ; files ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ; }

Target:
public void commentOnReview ( java.lang.String project , int number , java.lang.String comment ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.ReviewInput reviewInput = createComment ( comment ) ; applyComment ( project , number , reviewInput ) ; }
Source:
public com.google.gerrit.server.update.BatchUpdate getUpdate ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory ) { com.google.common.base.Preconditions.checkState ( ( ( db ) != null ) , "call setContext before getUpdate" ) ; if ( ( update ) == null ) { update = batchUpdateFactory.create ( db , getProjectName ( ) , caller , ts ) . setRepository ( repo , rw , ins ) . setRequestId ( submissionId ) . setOnSubmitValidators ( onSubmitValidatorsFactory.create ( ) ) ; } return update ; }

Target:
public com.google.gerrit.server.update.BatchUpdate getUpdate ( ) { com.google.common.base.Preconditions.checkState ( ( ( db ) != null ) , "call setContext before getUpdate" ) ; if ( ( update ) == null ) { update = batchUpdateFactory.create ( db , getProjectName ( ) , caller , ts ) . setRepository ( repo , rw , ins ) . setRequestId ( submissionId ) . setOnSubmitValidators ( onSubmitValidatorsFactory.create ( ) ) ; } return update ; }
Source:
public static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }

Target:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }
Source:
private void resize ( com.google.gwt.user.client.ui.Widget w , java.lang.String id ) { java.lang.StringBuilder autoResizeScript = new java.lang.StringBuilder ( ) ; autoResizeScript.append ( "if (document.getElementById) {" ) ; autoResizeScript.append ( "var e = document.getElementById(\"" ) ; autoResizeScript.append ( id ) ; autoResizeScript.append ( "\"); " ) ; autoResizeScript.append ( "e.width = (e.contentWindow.document .body.scrollWidth) + \"px\"; " ) ; autoResizeScript.append ( "e.height = (e.contentWindow.document .body.scrollHeight) + \"px\"; " ) ; autoResizeScript.append ( "}" ) ; w.getElement ( ) . setAttribute ( "onLoad" , autoResizeScript.toString ( ) ) ; }

Target:
public static void resize ( com.google.gwt.user.client.ui.Widget w , java.lang.String id ) { java.lang.StringBuilder autoResizeScript = new java.lang.StringBuilder ( ) ; autoResizeScript.append ( "if (document.getElementById) {" ) ; autoResizeScript.append ( "var e = document.getElementById(\"" ) ; autoResizeScript.append ( id ) ; autoResizeScript.append ( "\"); " ) ; autoResizeScript.append ( "e.width = (e.contentWindow.document .body.scrollWidth) + \"px\"; " ) ; autoResizeScript.append ( "e.height = (e.contentWindow.document .body.scrollHeight) + \"px\"; " ) ; autoResizeScript.append ( "}" ) ; w.getElement ( ) . setAttribute ( "onLoad" , autoResizeScript.toString ( ) ) ; }
Source:
private long getSeconds ( java.lang.String n , java.lang.String setting , long def ) { final long d = java.util.concurrent.TimeUnit.MINUTES.convert ( def , java.util.concurrent.TimeUnit.SECONDS ) ; final long m ; m = com.google.gerrit.server.config.ConfigUtil.getTimeUnit ( config , "cache" , n , setting , d , java.util.concurrent.TimeUnit.MINUTES ) ; return java.util.concurrent.TimeUnit.SECONDS.convert ( m , java.util.concurrent.TimeUnit.MINUTES ) ; }

Target:
private long getSeconds ( java.lang.String n , java.lang.String s , long d ) { d = java.util.concurrent.TimeUnit.MINUTES.convert ( d , java.util.concurrent.TimeUnit.SECONDS ) ; long m = com.google.gerrit.server.config.ConfigUtil.getTimeUnit ( config , "cache" , n , s , d , java.util.concurrent.TimeUnit.MINUTES ) ; return java.util.concurrent.TimeUnit.SECONDS.convert ( m , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
public static void allOnProject ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }

Target:
public static void allOnProject ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }
Source:
public static void projectDefault ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterTrue ( "default" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }

Target:
public static void projectDefault ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterTrue ( "default" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }
Source:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final java.lang.String defaultValue , final java.lang.String currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( f.getValue ( i ) . equals ( currentValue ) ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }

Target:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final java.lang.String defaultValue , final java.lang.String currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( f.getValue ( i ) . equals ( currentValue ) ) { f.setSelectedIndex ( i ) ; return ; } } if ( ! ( currentValue.equals ( defaultValue ) ) ) { setListBox ( f , defaultValue , defaultValue ) ; } }
Source:
public void testCreateProjectWithBranches ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; in.branches = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; in.branches.add ( "refs/heads/test" ) ; in.branches.add ( "refs/heads/master" ) ; in.branches.add ( "release" ) ; gApi.projects ( ) . create ( in ) ; assertHead ( newProjectName , "refs/heads/test" ) ; assertEmptyCommit ( newProjectName , "refs/heads/test" , "refs/heads/master" , "refs/heads/release" ) ; }

Target:
public void testCreateProjectWithBranches ( ) throws java.lang.Exception { java.lang.String newProjectName = name ( "newProject" ) ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; in.branches = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; in.branches.add ( "refs/heads/test" ) ; in.branches.add ( "refs/heads/master" ) ; in.branches.add ( "release" ) ; gApi.projects ( ) . create ( in ) ; assertHead ( newProjectName , "refs/heads/test" ) ; assertEmptyCommit ( newProjectName , "refs/heads/test" , "refs/heads/master" , "refs/heads/release" ) ; }
Source:
private void assertRedirectsTo ( java.lang.String expectedLocation , javax.servlet.http.HttpServletRequest req ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( expectedLocation , res.getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ) ; }

Target:
private void assertRedirectsTo ( java.lang.String expectedLocation , javax.servlet.http.HttpServletRequest req ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; com.google.common.truth.Truth.assertThat ( res.getStatus ( ) ) . isEqualTo ( javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ) . isEqualTo ( expectedLocation ) ; }
Source:
public void createSyncEventsRestApiServlet ( ) throws java.lang.Exception { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > schema = createNiceMock ( com.google.gwtorm.server.SchemaFactory.class ) ; com.google.gerrit.reviewdb.server.ReviewDb db = createNiceMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; org.easymock.EasyMock.expect ( schema.open ( ) ) . andReturn ( db ) . anyTimes ( ) ; syncEventsRestApiServlet = new com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServlet ( dispatcher , schema ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; org.easymock.EasyMock.expect ( req.getContentType ( ) ) . andReturn ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; }

Target:
public void createSyncEventsRestApiServlet ( ) throws java.lang.Exception { syncEventsRestApiServlet = new com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServlet ( dispatcher ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; org.easymock.EasyMock.expect ( req.getContentType ( ) ) . andReturn ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; }
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 ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; mapper = null ; initialBoxes = null ; publishedMap = 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 void approve ( com.google.gerrit.acceptance.RestSession s , java.lang.String changeId , int expected ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = s.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; org.junit.Assert.assertEquals ( expected , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
private void approve ( com.google.gerrit.acceptance.RestSession s , java.lang.String changeId , int expected ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = s.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( expected ) ; r.consume ( ) ; }
Source:
public boolean isActive ( java.lang.String username ) throws com.google.gerrit.server.account.AccountException , javax.naming.NamingException , javax.security.auth.login.LoginException { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { com.google.gerrit.server.auth.ldap.Helper.LdapSchema schema = helper.getSchema ( ctx ) ; helper.findAccount ( schema , ctx , username , false ) ; return true ; } catch ( com.google.gerrit.server.auth.NoSuchUserException e ) { return false ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }

Target:
public boolean isActive ( java.lang.String username ) throws com.google.gerrit.server.account.AccountException , java.io.IOException , javax.naming.NamingException , javax.security.auth.login.LoginException { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { com.google.gerrit.server.auth.ldap.Helper.LdapSchema schema = helper.getSchema ( ctx ) ; helper.findAccount ( schema , ctx , username , false ) ; return true ; } catch ( com.google.gerrit.server.auth.NoSuchUserException e ) { return false ; } finally { helper.close ( ctx ) ; } }
Source:
private static void sbs ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line , final boolean edit ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , ( edit ? new com.google.gerrit.client.editor.EditScreen ( id , line ) : new com.google.gerrit.client.diff.SideBySide ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ) ; } } ) ; }

Target:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line , final boolean edit ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , ( edit ? new com.google.gerrit.client.editor.EditScreen ( id , line ) : new com.google.gerrit.client.diff.SideBySide ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ) ; } } ) ; }
Source:
void updateReviewerList ( ) { com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.info.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo result ) { display ( result ) ; } } ) ; }

Target:
void updateReviewerList ( ) { com.google.gerrit.client.changes.ChangeApi.detail ( project.get ( ) , changeId.get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.info.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo result ) { display ( result ) ; } } ) ; }
Source:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.compiler.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getProject ( ) . getNameKey ( ) , getConfig ( ) . getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }

Target:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.compiler.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getProject ( ) . getNameKey ( ) , config.getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }
Source:
private java.lang.String buildJsonRaw ( java.lang.String path , java.lang.String additionalQueryString ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , ( "format=json" + additionalQueryString ) , javax.servlet.http.HttpServletResponse.SC_OK ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "application/json" ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; com.google.common.truth.Truth.assertThat ( body ) . startsWith ( magic ) ; java.lang.String result = body.substring ( magic.length ( ) ) ; java.lang.System.out.println ( result ) ; return result ; }

Target:
private java.lang.String buildJsonRaw ( java.lang.String path , java.lang.String additionalQueryString ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , ( "format=json" + additionalQueryString ) , javax.servlet.http.HttpServletResponse.SC_OK ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "application/json" ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; com.google.common.truth.Truth.assertThat ( body ) . startsWith ( magic ) ; return body.substring ( magic.length ( ) ) ; }
Source:
private void addWebLink ( java.lang.String href , java.lang.String name ) { com.google.gwt.dom.client.AnchorElement a = com.google.gwt.user.client.DOM.createAnchor ( ) . cast ( ) ; a.setHref ( href ) ; a.setInnerText ( name ) ; webLinkCell.appendChild ( a ) ; if ( ( revInfo.commit ( ) . parents ( ) . length ( ) ) > 1 ) { mergeCommit.setVisible ( true ) ; setParents ( change.project ( ) , revInfo.commit ( ) . parents ( ) ) ; } }

Target:
private void addWebLink ( java.lang.String href , java.lang.String name ) { com.google.gwt.dom.client.AnchorElement a = com.google.gwt.user.client.DOM.createAnchor ( ) . cast ( ) ; a.setHref ( href ) ; a.setInnerText ( name ) ; webLinkCell.appendChild ( a ) ; }
Source:
void importGit ( ) throws com.google.gwtorm.client.OrmException , java.io.IOException { if ( flags.importProjects ) { java.lang.System.err.println ( ( "Scanning " + ( repositoryManager.getBasePath ( ) ) ) ) ; gitProjectImporter.run ( new com.google.gerrit.server.git.GitProjectImporter.Messages ( ) { @ java.lang.Override public void warning ( java.lang.String msg ) { java.lang.System.err.println ( msg ) ; java.lang.System.err.flush ( ) ; } } ) ; } }

Target:
public void warning ( java.lang.String msg ) { info ( msg ) ; }
Source:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.client.PatchLineComment > i , int row , final int col , boolean expandComment ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.client.PatchLineComment c = i.next ( ) ; if ( ( c.getLine ( ) ) == ( R_HEAD ) ) { insertFileCommentRow ( row ) ; } else { insertRow ( row ) ; } bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) , expandComment ) ; row ++ ; } return row ; }

Target:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.client.PatchLineComment > i , int row , final int col ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.client.PatchLineComment c = i.next ( ) ; if ( ( c.getLine ( ) ) == ( R_HEAD ) ) { insertFileCommentRow ( row ) ; } else { insertRow ( row ) ; } bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) ) ; row ++ ; } return row ; }
Source:
public void login ( final com.google.gerrit.client.reviewdb.Account.Id id , final boolean rememberMe ) { logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id ) ; final int age ; if ( rememberMe ) { manager.updateRefreshCookieAt ( val ) ; age = val.getCookieAge ( ) ; } else { val.refreshCookieAt = java.lang.Long.MAX_VALUE ; age = - 1 ; } saveCookie ( key.token , age ) ; }

Target:
public void login ( final com.google.gerrit.client.reviewdb.Account.Id id , final boolean rememberMe ) { logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe ) ; saveCookie ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.DisabledChangeHooks.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) ; factory ( CommitValidators.Factory.class ) ; install ( new com.google.gerrit.server.git.GitModule ( ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) ; factory ( CommitValidators.Factory.class ) ; install ( new com.google.gerrit.server.git.GitModule ( ) ) ; }
Source:
private static void formatDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path , org.eclipse.jgit.diff.DiffFormatter diff ) throws java.io.IOException { try { if ( ! ( path.isEmpty ( ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; } finally { diff.release ( ) ; } }

Target:
private static void formatDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path , org.eclipse.jgit.diff.DiffFormatter diff ) throws java.io.IOException { if ( ! ( path.isEmpty ( ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; }
Source:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { return b.getChange ( ) . getSortKey ( ) . compareTo ( a.getChange ( ) . getSortKey ( ) ) ; }

Target:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { try { return b.change ( db ) . getSortKey ( ) . compareTo ( a.change ( db ) . getSortKey ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return 0 ; } }
Source:
public void replace ( com.google.gerrit.common.data.AccessSection section ) { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { rule.setGroup ( resolve ( rule.getGroup ( ) ) ) ; } } accessSections.put ( section.getRefPattern ( ) , section ) ; }

Target:
public void replace ( com.google.gerrit.common.data.AccessSection section ) { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { rule.setGroup ( resolve ( rule.getGroup ( ) ) ) ; } } accessSections.put ( section.getName ( ) , section ) ; }
Source:
public static int getHeaderFooterHeight ( ) { int h = ( com.google.gerrit.client.Gerrit.topMenu.getOffsetHeight ( ) ) + ( com.google.gerrit.client.Gerrit.bottomMenu.getOffsetHeight ( ) ) ; if ( com.google.gerrit.client.Gerrit.siteHeader.isVisible ( ) ) { h += com.google.gerrit.client.Gerrit.siteHeader.getOffsetHeight ( ) ; } if ( com.google.gerrit.client.Gerrit.siteFooter.isVisible ( ) ) { h += com.google.gerrit.client.Gerrit.siteFooter.getOffsetHeight ( ) ; } return h ; }

Target:
public static int getHeaderFooterHeight ( ) { int h = com.google.gerrit.client.Gerrit.bottomMenu.getOffsetHeight ( ) ; if ( com.google.gerrit.client.Gerrit.topMenu.isVisible ( ) ) { h += com.google.gerrit.client.Gerrit.topMenu.getOffsetHeight ( ) ; } if ( com.google.gerrit.client.Gerrit.siteHeader.isVisible ( ) ) { h += com.google.gerrit.client.Gerrit.siteHeader.getOffsetHeight ( ) ; } if ( com.google.gerrit.client.Gerrit.siteFooter.isVisible ( ) ) { h += com.google.gerrit.client.Gerrit.siteFooter.getOffsetHeight ( ) ; } return h ; }
Source:
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 ) ; }

Target:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( ( manager ) != null ) { 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:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
void operation ( final java.lang.Runnable apply ) { cmA.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cmB.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { apply.run ( ) ; } } ) ; } } ) ; }

Target:
void operation ( java.lang.Runnable apply ) { cmA.operation ( ( ) -> { cmB.operation ( apply :: run ) ; } ) ; }
Source:
public static com.google.gerrit.reviewdb.client.Change.Id fromEditRefPart ( java.lang.String ref ) { int startChangeId = ( ref.indexOf ( RefNames.EDIT_PREFIX ) ) + ( RefNames.EDIT_PREFIX.length ( ) ) ; int endChangeId = com.google.gerrit.reviewdb.client.Change.Id.nextNonDigit ( ref , startChangeId ) ; java.lang.String id = ref.substring ( startChangeId , endChangeId ) ; return new com.google.gerrit.reviewdb.client.Change.Id ( java.lang.Integer.parseInt ( id ) ) ; }

Target:
public static com.google.gerrit.reviewdb.client.Change.Id fromEditRefPart ( java.lang.String ref ) { int startChangeId = ( ref.indexOf ( RefNames.EDIT_PREFIX ) ) + ( RefNames.EDIT_PREFIX.length ( ) ) ; int endChangeId = com.google.gerrit.reviewdb.client.Change.Id.nextNonDigit ( ref , startChangeId ) ; java.lang.String id = ref.substring ( startChangeId , endChangeId ) ; if ( ( id != null ) && ( ! ( id.isEmpty ( ) ) ) ) { return new com.google.gerrit.reviewdb.client.Change.Id ( java.lang.Integer.parseInt ( id ) ) ; } return null ; }
Source:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; try ( org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ) { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; HEAD ( b771e3 ) ; } finally { or.close ( ) ; BRANCH ( cb445e ) ; to = $missing$ ; } }

Target:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; try ( org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ) { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } }
Source:
public void testAppend_Object ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.Object ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( new java.lang.Object ( ) { @ java.lang.Override public java.lang.String toString ( ) { return "foobar" ; } } ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_Object ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.Object ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.Object ( ) { @ java.lang.Override public java.lang.String toString ( ) { return "foobar" ; } } ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
private PushOneCommit.Result updateChange ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , "test commit" , "a.txt" , content , r.getChangeId ( ) ) ; return push.to ( git , "refs/for/master" ) ; }

Target:
private PushOneCommit.Result updateChange ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , "test commit" , "a.txt" , content , r.getChangeId ( ) ) ; return push.to ( "refs/for/master" ) ; }
Source:
private static boolean isNoteDbTestEnabled ( ) { final java.lang.String [ ] RUN_FLAGS = new java.lang.String [ ] { "yes" , "y" , "true" } ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( java.util.Arrays.asList ( RUN_FLAGS ) . contains ( value.toLowerCase ( ) ) ) ; }

Target:
public static boolean isNoteDbTestEnabled ( ) { final java.lang.String [ ] RUN_FLAGS = new java.lang.String [ ] { "yes" , "y" , "true" } ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( java.util.Arrays.asList ( RUN_FLAGS ) . contains ( value.toLowerCase ( ) ) ) ; }
Source:
public void testCreate_Empty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createDirectory ( root ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; } finally { java.nio.file.Files.delete ( root ) ; } }

Target:
public void testCreate_Empty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createDirectory ( root ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
public org.eclipse.jgit.revwalk.RevCommit commitToNewRef ( com.google.gerrit.server.git.MetaDataUpdate update , java.lang.String refName ) throws java.io.IOException { com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch = openUpdate ( update ) ; try { batch.write ( update.getCommitBuilder ( ) ) ; return batch.createRef ( refName ) ; } finally { batch.close ( ) ; } }

Target:
public org.eclipse.jgit.revwalk.RevCommit commitToNewRef ( com.google.gerrit.server.git.MetaDataUpdate update , java.lang.String refName ) throws java.io.IOException { try ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch = openUpdate ( update ) ) { batch.write ( update.getCommitBuilder ( ) ) ; return batch.createRef ( refName ) ; } }
Source:
public void execute ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( side , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }

Target:
public void run ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( side , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }
Source:
public void assertCanDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { try { pcHandler.assertCanDelete ( rsrc ) ; } catch ( com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } try { dbHandler.assertCanDelete ( rsrc.getControl ( ) . getProject ( ) ) ; } catch ( com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } }

Target:
public void assertCanDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { try { pcHandler.assertCanDelete ( rsrc ) ; dbHandler.assertCanDelete ( rsrc.getControl ( ) . getProject ( ) ) ; } catch ( com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } }