auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.eclipse.jgit.lib.Ref getBranchRef ( com.google.gerrit.reviewdb.Project.NameKey projectName ) { try { final org.eclipse.jgit.lib.Repository r = repoManager.openRepository ( projectName ) ; try { return r.getRef ( showBranch ) ; } finally { r.close ( ) ; } } catch ( java.io.IOException ioe ) { return null ; } }

Target:
private java.util.List < org.eclipse.jgit.lib.Ref > getBranchRefs ( com.google.gerrit.reviewdb.Project.NameKey projectName ) { try { final org.eclipse.jgit.lib.Repository r = repoManager.openRepository ( projectName ) ; try { final java.util.List < org.eclipse.jgit.lib.Ref > result = new java.util.ArrayList < org.eclipse.jgit.lib.Ref > ( showBranch.size ( ) ) ; for ( java.lang.String branch : showBranch ) { result.add ( r.getRef ( branch ) ) ; } return result ; } finally { r.close ( ) ; } } catch ( java.io.IOException ioe ) { return null ; } }
Source:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.people ( ) ) ; }

Target:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; org.junit.Assert.assertNotNull ( schema.people ( ) ) ; org.junit.Assert.assertEquals ( "people" , schema.people ( ) . getRelationName ( ) ) ; org.junit.Assert.assertEquals ( 1 , schema.people ( ) . getRelationID ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ( e.getCause ( ) ) != null ) { com.google.common.base.Throwables.throwIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; } throw e ; } }

Target:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.index.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ( e.getCause ( ) ) != null ) { com.google.common.base.Throwables.throwIfInstanceOf ( e.getCause ( ) , com.google.gerrit.index.query.QueryParseException.class ) ; } throw e ; } }
Source:
private void sendDone ( ) { spinnerState = com.google.gerrit.server.git.MultiProgressMonitor.NO_SPINNER ; java.lang.StringBuilder s = format ( ) ; boolean any = false ; for ( com.google.gerrit.server.git.MultiProgressMonitor.Task t : tasks ) { if ( ( t.count ) != 0 ) { any = true ; break ; } } if ( any ) { s.append ( ", " ) ; } s.append ( "done \n" ) ; send ( s ) ; }

Target:
private void sendDone ( ) { spinnerState = com.google.gerrit.server.git.MultiProgressMonitor.NO_SPINNER ; java.lang.StringBuilder s = format ( ) ; boolean any = false ; for ( com.google.gerrit.server.git.MultiProgressMonitor.Task t : tasks ) { if ( ( t.count ) != 0 ) { any = true ; break ; } } if ( any ) { s.append ( "," ) ; } s.append ( " done \n" ) ; send ( s ) ; }
Source:
public void unblockRangeForChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , true ) ; assertCanVote ( ( - 2 ) , range ) ; assertCanVote ( 2 , range ) ; }

Target:
public void unblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; assertCannotVote ( ( - 2 ) , range ) ; assertCannotVote ( 2 , range ) ; }
Source:
protected void configureServlets ( ) { serve ( "/login/*" ) . with ( com.google.gerrit.httpd.auth.openid.LoginForm.class ) ; serve ( ( "/" + ( OpenIdServiceImpl.RETURN_URL ) ) ) . with ( com.google.gerrit.httpd.auth.openid.OpenIdLoginServlet.class ) ; serve ( ( "/" + ( XrdsServlet.LOCATION ) ) ) . with ( com.google.gerrit.httpd.auth.openid.XrdsServlet.class ) ; filter ( "/" ) . through ( com.google.gerrit.httpd.auth.openid.XrdsFilter.class ) ; bind ( com.google.gerrit.httpd.auth.openid.OpenIdServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { serve ( "/login" , "/login/*" ) . with ( com.google.gerrit.httpd.auth.openid.LoginForm.class ) ; serve ( ( "/" + ( OpenIdServiceImpl.RETURN_URL ) ) ) . with ( com.google.gerrit.httpd.auth.openid.OpenIdLoginServlet.class ) ; serve ( ( "/" + ( XrdsServlet.LOCATION ) ) ) . with ( com.google.gerrit.httpd.auth.openid.XrdsServlet.class ) ; filter ( "/" ) . through ( com.google.gerrit.httpd.auth.openid.XrdsFilter.class ) ; bind ( com.google.gerrit.httpd.auth.openid.OpenIdServiceImpl.class ) ; }
Source:
private void insertDraftComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { createDraftUpdateIfNull ( ) ; draftUpdate.insertComment ( c ) ; }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { createDraftUpdateIfNull ( ) . deleteComment ( c ) ; } else { throw new java.lang.IllegalArgumentException ( ( "Cannot delete published comment " + c ) ) ; } }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; }
Source:
public static void addMember ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , java.lang.String member , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.MemberInfo > cb ) { new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.groups.GroupApi.membersBase ( groupUUID ) ) + "/" ) + member ) ) . put ( cb ) ; }

Target:
public static void addMember ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , java.lang.String member , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.MemberInfo > cb ) { java.lang.String n = com.google.gwt.http.client.URL.encodePathSegment ( member ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.groups.GroupApi.membersBase ( groupUUID ) ) + "/" ) + n ) ) . put ( cb ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }
Source:
private void init ( ) { implClassName = ( ( schemaImpl.getName ( ) ) + "_Factory_" ) + ( com.google.gwtorm.schema.Util.createRandomName ( ) ) ; implTypeName = implClassName.replace ( '.' , '/' ) ; cw = new org.objectweb.asm.ClassWriter ( org.objectweb.asm.ClassWriter.COMPUTE_MAXS ) ; cw.visit ( com.google.gwtorm.server.V1_3 , ( ( ( ACC_PUBLIC ) | ( ACC_FINAL ) ) | ( ACC_SUPER ) ) , implTypeName , null , org.objectweb.asm.Type.getInternalName ( java.lang.Object.class ) , new java.lang.String [ ] { org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.client.SchemaFactory.class ) } ) ; }

Target:
private void init ( ) { implClassName = ( ( schemaImpl.getName ( ) ) + "_Factory_" ) + ( com.google.gwtorm.schema.Util.createRandomName ( ) ) ; implTypeName = implClassName.replace ( '.' , '/' ) ; cw = new org.objectweb.asm.ClassWriter ( org.objectweb.asm.ClassWriter.COMPUTE_MAXS ) ; cw.visit ( com.google.gwtorm.server.V1_3 , ( ( ( ACC_PUBLIC ) | ( ACC_FINAL ) ) | ( ACC_SUPER ) ) , implTypeName , null , org.objectweb.asm.Type.getInternalName ( java.lang.Object.class ) , new java.lang.String [ ] { org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.server.SchemaFactory.class ) } ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.TagResource resource , com.google.gerrit.extensions.common.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String tag = com.google.gerrit.server.project.RefUtil.normalizeTagRef ( resource.getTagInfo ( ) . ref ) ; permissionBackend.user ( user ) . project ( resource.getNameKey ( ) ) . ref ( tag ) . check ( RefPermission.DELETE ) ; deleteRefFactory.create ( resource ) . ref ( tag ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.TagResource resource , com.google.gerrit.extensions.common.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String tag = com.google.gerrit.server.project.RefUtil.normalizeTagRef ( resource.getTagInfo ( ) . ref ) ; permissionBackend.user ( user ) . project ( resource.getNameKey ( ) ) . ref ( tag ) . check ( RefPermission.DELETE ) ; resource.getProjectState ( ) . checkStatePermitsWrite ( ) ; deleteRefFactory.create ( resource ) . ref ( tag ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
boolean matches ( org.eclipse.jgit.lib.Repository git ) throws java.io.IOException { org.eclipse.jgit.lib.Ref head = git.getRef ( Constants.HEAD ) ; return ( ( head != null ) && ( head.isSymbolic ( ) ) ) && ( RefNames.REFS_CONFIG.equals ( head.getLeaf ( ) . getName ( ) ) ) ; }

Target:
boolean matches ( org.eclipse.jgit.lib.Repository git ) throws java.io.IOException { org.eclipse.jgit.lib.Ref head = git.getRefDatabase ( ) . exactRef ( Constants.HEAD ) ; return ( ( head != null ) && ( head.isSymbolic ( ) ) ) && ( RefNames.REFS_CONFIG.equals ( head.getLeaf ( ) . getName ( ) ) ) ; }
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; }
Source:
public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { if ( ( searchBox.getVisibleLength ( ) ) == ( com.google.gerrit.client.SearchPanel.SMALL_SIZE ) ) { sizeAnimation.run ( true ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( searchBox.getVisibleLength ( ) ) == ( com.google.gerrit.client.SearchPanel.SMALL_SIZE ) ) { sizeAnimation.run ( true ) ; } if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( ! ( suggestionDisplay.isSuggestionSelected ) ) { doSearch ( ) ; } } }
Source:
public void listTagsOfNonVisibleProjectWithApi ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tags ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tag ( "tag" ) . get ( ) ; }

Target:
public void getTagOfNonVisibleProjectWithApi ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tag ( "tag" ) . get ( ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { com.google.gwt.user.client.ui.UIObject.setVisible ( error , true ) ; error.setInnerText ( ( err instanceof com.google.gwt.user.client.rpc.StatusCodeException ? ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( err ) ) . getEncodedResponse ( ) : err.getMessage ( ) ) ) ; }

Target:
public void onFailure ( java.lang.Throwable err ) { if ( isSigninFailure ( err ) ) { new com.google.gerrit.client.NotSignedInDialog ( ) . center ( ) ; } else { com.google.gwt.user.client.ui.UIObject.setVisible ( error , true ) ; error.setInnerText ( ( err instanceof com.google.gwt.user.client.rpc.StatusCodeException ? ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( err ) ) . getEncodedResponse ( ) : err.getMessage ( ) ) ) ; } }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { assertAmProjectOwner ( db , projectId ) ; final com.google.gerrit.client.reviewdb.Project proj = db.projects ( ) . get ( projectId ) ; if ( proj == null ) { throw new com.google.gerrit.server.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } proj.setDescription ( description ) ; db.projects ( ) . update ( java.util.Collections.singleton ( proj ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { assertAmProjectOwner ( db , projectId ) ; final com.google.gerrit.client.reviewdb.Project proj = db.projects ( ) . get ( projectId ) ; if ( proj == null ) { throw new com.google.gerrit.server.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } proj.setDescription ( description ) ; db.projects ( ) . update ( java.util.Collections.singleton ( proj ) ) ; com.google.gerrit.client.rpc.Common.getProjectCache ( ) . invalidate ( proj ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private com.google.gwt.dom.client.InputElement getReviewed ( com.google.gerrit.client.diff.FileInfo info ) { com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; com.google.gwt.dom.client.Element e = fmt.getElement ( ( 1 + ( info._row ( ) ) ) , 1 ) ; return com.google.gwt.dom.client.InputElement.as ( e.getFirstChildElement ( ) ) ; }

Target:
private com.google.gwt.dom.client.InputElement getReviewed ( com.google.gerrit.client.info.FileInfo info ) { com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; com.google.gwt.dom.client.Element e = fmt.getElement ( ( 1 + ( info._row ( ) ) ) , 1 ) ; return com.google.gwt.dom.client.InputElement.as ( e.getFirstChildElement ( ) ) ; }
Source:
private void rpc ( java.lang.String name , java.lang.Class < ? extends com.google.gerrit.server.GerritJsonServlet > clazz ) { serve ( ( "/gerrit/rpc/" + name ) ) . with ( clazz ) ; }

Target:
private void rpc ( final java.lang.String name , java.lang.Class < ? extends com.google.gwtjsonrpc.client.RemoteJsonService > clazz ) { final com.google.inject.Key < com.google.gerrit.server.GerritJsonServlet > srv = com.google.inject.Key.get ( com.google.gerrit.server.GerritJsonServlet.class , new com.google.gerrit.server.GerritServletConfig.ServletNameImpl ( name ) ) ; final com.google.gerrit.server.GerritJsonServletProvider provider = new com.google.gerrit.server.GerritJsonServletProvider ( clazz ) ; serve ( ( "/gerrit/rpc/" + name ) ) . with ( srv ) ; bind ( srv ) . toProvider ( provider ) . in ( Scopes.SINGLETON ) ; }
Source:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; }

Target:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db = dbRef.get ( ) ; if ( db == null ) { try { db = com.google.inject.util.Providers.of ( schemaFactory.open ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "error opening ReviewDb" ) ; pe.initCause ( e ) ; throw pe ; } dbRef.set ( db ) ; } return db ; }
Source:
protected void tearDown ( ) { if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }

Target:
protected void tearDown ( ) { if ( ( executor ) != null ) { executor.close ( ) ; } executor = null ; if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }
Source:
public org.apache.lucene.search.IndexSearcher newSearcher ( org.apache.lucene.index.IndexReader reader ) throws java.io.IOException { com.google.common.base.Preconditions.checkState ( ( reader instanceof org.apache.lucene.index.DirectoryReader ) , "expected DirectoryReader, found %s" , reader.getClass ( ) . getName ( ) ) ; return new org.apache.lucene.search.IndexSearcher ( org.apache.lucene.uninverting.UninvertingReader.wrap ( ( ( org.apache.lucene.index.DirectoryReader ) ( reader ) ) , mapping ) ) ; }

Target:
public org.apache.lucene.search.IndexSearcher newSearcher ( org.apache.lucene.index.IndexReader reader , org.apache.lucene.index.IndexReader previousReader ) throws java.io.IOException { com.google.common.base.Preconditions.checkState ( ( reader instanceof org.apache.lucene.index.DirectoryReader ) , "expected DirectoryReader, found %s" , reader.getClass ( ) . getName ( ) ) ; return new org.apache.lucene.search.IndexSearcher ( org.apache.lucene.uninverting.UninvertingReader.wrap ( ( ( org.apache.lucene.index.DirectoryReader ) ( reader ) ) , mapping ) ) ; }
Source:
public void deleteChange ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( "Change is not a draft" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }

Target:
public void publishDraftChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = get ( triplet ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; }
Source:
public void starChange ( 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 ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , 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 star change" , e ) ; } }

Target:
public void starChange ( 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 ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot star change" , e ) ; } }
Source:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accounts.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( db , owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }

Target:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accountCreator.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( db , owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }
Source:
public static boolean isSqlPrimitive ( final java.lang.Class < ? > type ) { if ( ( type == null ) || ( type == ( java.lang.Void.TYPE ) ) ) { return false ; } if ( type.isPrimitive ( ) ) { return true ; } if ( type == ( java.lang.String.class ) ) { return true ; } if ( type == ( java.sql.Timestamp.class ) ) { return true ; } return false ; }

Target:
public static boolean isSqlPrimitive ( final java.lang.Class < ? > type ) { if ( ( type == null ) || ( type == ( java.lang.Void.TYPE ) ) ) { return false ; } if ( type.isPrimitive ( ) ) { return true ; } if ( type == ( java.lang.String.class ) ) { return true ; } if ( type == ( java.sql.Date.class ) ) { return true ; } if ( type == ( java.sql.Timestamp.class ) ) { return true ; } return false ; }
Source:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 1 ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; }

Target:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.RebaseChangeEdit.Rebase.Input in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProject ( ) ; try ( org.eclipse.jgit.lib.Repository repository = repositoryManager.openRepository ( project ) ) { editModifier.rebaseEdit ( repository , rsrc.getControl ( ) ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.RebaseChangeEdit.Rebase.Input in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProject ( ) ; try ( org.eclipse.jgit.lib.Repository repository = repositoryManager.openRepository ( project ) ) { editModifier.rebaseEdit ( repository , rsrc.getNotes ( ) ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void testSubscriptionToEmptyRepo ( ) 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" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "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 testSubscriptionToEmptyRepo ( ) 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" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "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:
private void fireEvent ( com.google.gerrit.reviewdb.Branch.NameKey branchName , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.Account account , com.google.gerrit.reviewdb.ContributorAgreement cla ) { if ( account != null ) { final java.util.List < java.lang.String > args = new java.util.ArrayList < java.lang.String > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-id" , cla.getId ( ) . toString ( ) ) ; runHook ( claSignedHook , args ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChange ( db.get ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( db.get ( ) , rsrc.getNotes ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void reply ( org.eclipse.jetty.server.AbstractHttpConnection conn , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] msg = com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.message ( conn ) ; res.setHeader ( HttpHeaders.CONTENT_TYPE , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( msg.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( msg ) ; } finally { out.close ( ) ; } } }

Target:
private void reply ( org.eclipse.jetty.server.HttpConnection conn , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] msg = com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.message ( conn ) ; res.setHeader ( HttpHeader.CONTENT_TYPE.asString ( ) , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( msg.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( msg ) ; } finally { out.close ( ) ; } } }
Source:
private static byte [ ] readFile ( final java.io.File p ) throws java.io.IOException { final java.io.FileInputStream in = new java.io.FileInputStream ( p ) ; try { final byte [ ] r = new byte [ ( ( int ) ( in.getChannel ( ) . size ( ) ) ) ] ; org.eclipse.jgit.util.IO.readFully ( in , r , 0 , r.length ) ; return r ; } finally { in.close ( ) ; } }

Target:
public int weigh ( java.lang.String name , com.google.gerrit.httpd.raw.StaticServlet.Resource r ) { return ( 2 * ( name.length ( ) ) ) + ( r.raw.length ) ; }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message with invalid Change-Id\n\nChange-Id: X\n" ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; HEAD ( 1.0 ) ; com.google.gerrit.acceptance.git.afa6 Merge ; into ( ( ( stable ) - 2.14 ) ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > files ; try { files = object.currentFilePaths ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return com.google.gerrit.server.util.RegexListSearcher.ofStrings ( getValue ( ) ) . hasMatch ( files ) ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > files ; try { files = object.currentFilePaths ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return com.google.gerrit.server.util.RegexListSearcher.ofStrings ( getValue ( ) ) . search ( files ) . findAny ( ) . isPresent ( ) ; }
Source:
private void appendSkipLine ( final java.lang.StringBuilder body ) { body.append ( "<tr>" ) ; body.append ( ( ( "<td class=\"" + ( S_ICON_CELL ) ) + "\">&nbsp;</td>" ) ) ; body.append ( "<td class=\"SkipLine\" colspan=\"" ) ; body.append ( ( ( fileCnt ) * 2 ) ) ; body.append ( "\">" ) ; body.append ( "</td>" ) ; body.append ( "</tr>" ) ; }

Target:
private void appendSkipLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTr ( ) ; m.openTd ( ) ; m.setStyleName ( com.google.gerrit.client.patches.S_ICON_CELL ) ; m.nbsp ( ) ; m.closeTd ( ) ; m.openTd ( ) ; m.setStyleName ( "SkipLine" ) ; m.setAttribute ( "colspan" , ( ( fileCnt ) * 2 ) ) ; m.closeTd ( ) ; m.closeTr ( ) ; }
Source:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct , final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignIn ( ) ; } if ( ac != null ) { ac.onSuccess ( null ) ; } }

Target:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct , final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignIn ( ) ; } if ( ac != null ) { ac.onSuccess ( null ) ; } }
Source:
public void commentOnReviewableWipChangeByBotNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( 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 ) ; }

Target:
public void commentOnReviewableWipChangeByBotNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( 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 ) . noOneElse ( ) ; }
Source:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < com.google.gerrit.common.data.ChangeDetail > event ) { if ( isAttached ( ) ) { com.google.gerrit.client.changes.ChangeApi.detail ( event.getValue ( ) . getChange ( ) . getId ( ) . get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; display ( event.getValue ( ) ) ; } } ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
public void start ( org.apache.sshd.server.Environment env ) throws java.io.IOException { try { begin ( env ) ; } catch ( com.google.gerrit.sshd.UnloggedFailure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( com.google.gerrit.sshd.ENC ) ) ; err.flush ( ) ; onExit ( e.exitCode ) ; } }

Target:
public void start ( org.apache.sshd.server.Environment env ) throws java.io.IOException { try { begin ( env ) ; } catch ( com.google.gerrit.sshd.Failure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( com.google.gerrit.sshd.ENC ) ) ; err.flush ( ) ; onExit ( e.exitCode ) ; } }
Source:
public java.lang.String toString ( ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; r.append ( getClass ( ) . getName ( ) ) ; r.append ( '[' ) ; if ( ( getParentKey ( ) ) != null ) { r.append ( getParentKey ( ) . toString ( ) ) ; r.append ( ", " ) ; } r.append ( get ( ) ) ; r.append ( ']' ) ; return r.toString ( ) ; }

Target:
public java.lang.String toString ( ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; if ( ( getParentKey ( ) ) != null ) { r.append ( getParentKey ( ) . toString ( ) ) ; r.append ( ',' ) ; } r.append ( get ( ) ) ; return r.toString ( ) ; }
Source:
public void createPrivateChangeWithDisablePrivateChangesFalse ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project.get ( ) , "master" , "empty change" ) ; input.isPrivate = true ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isEqualTo ( true ) ; }

Target:
public void createPrivateChangeWithDisablePrivateChangesFalse ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project.get ( ) , "master" , "empty change" ) ; input.isPrivate = true ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isTrue ( ) ; }
Source:
public static org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { try { org.eclipse.jgit.lib.Ref ref = repo.getRef ( RefNames.REFS_REJECT_COMMITS ) ; if ( ref == null ) { return org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } org.eclipse.jgit.revwalk.RevCommit map = walk.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( walk.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + ( com.google.gerrit.reviewdb.client.RefNames.REFS_REJECT_COMMITS ) ) , badMap ) ; } }

Target:
public static org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { try { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_REJECT_COMMITS ) ; if ( ref == null ) { return org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } org.eclipse.jgit.revwalk.RevCommit map = walk.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( walk.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + ( com.google.gerrit.reviewdb.client.RefNames.REFS_REJECT_COMMITS ) ) , badMap ) ; } }
Source:
public org.eclipse.jgit.revwalk.RevCommit commit ( ) throws java.io.IOException { com.google.gerrit.server.notedb.BatchMetaDataUpdate batch = openUpdate ( ) ; try { writeCommit ( batch ) ; org.eclipse.jgit.revwalk.RevCommit c = batch.commit ( ) ; return c ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } finally { batch.close ( ) ; } }

Target:
com.google.gerrit.server.notedb.ChangeDraftUpdate getDraftUpdate ( ) { return draftUpdate ; }
Source:
public static void incrementPatchSet ( com.google.gerrit.reviewdb.client.Change change ) { com.google.gerrit.reviewdb.client.PatchSet.Id curr = change.currentPatchSetId ( ) ; com.google.gerrit.reviewdb.client.PatchSetInfo ps = new com.google.gerrit.reviewdb.client.PatchSetInfo ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , ( curr != null ? ( curr.get ( ) ) + 1 : 1 ) ) ) ; ps.setSubject ( "Change subject" ) ; change.setCurrentPatchSet ( ps ) ; }

Target:
public static void incrementPatchSet ( com.google.gerrit.reviewdb.client.Change change ) { com.google.gerrit.reviewdb.client.PatchSet.Id curr = change.currentPatchSetId ( ) ; com.google.gerrit.reviewdb.client.PatchSetInfo ps = new com.google.gerrit.reviewdb.client.PatchSetInfo ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , ( curr != null ? ( curr.get ( ) ) + 1 : 1 ) ) ) ; ps.setSubject ( "Change subject" ) ; change.setCurrentPatchSet ( ps ) ; com.google.gerrit.server.ChangeUtil.computeSortKey ( change ) ; }
Source:
private void initFileSystemFactory ( ) { setFileSystemFactory ( new org.apache.sshd.server.FileSystemFactory ( ) { @ java.lang.Override public org.apache.sshd.server.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.server.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.server.SshFile getFile ( org.apache.sshd.server.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.server.SshFile getFile ( java.lang.String file ) { return null ; } } ; } } ) ; }

Target:
private void initFileSystemFactory ( ) { setFileSystemFactory ( new org.apache.sshd.common.file.FileSystemFactory ( ) { @ java.lang.Override public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } } ; } } ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( Hyperlink.impl.handleAsClick ( ( ( com.google.gwt.user.client.Event ) ( event.getNativeEvent ( ) ) ) ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; } }
Source:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( git , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }

Target:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( testRepo , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }
Source:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( java.lang.String.format ( "Cancelling replication event %s" , r ) ) ; } cnt = pool.shutdownNow ( ) . size ( ) ; pool.unregisterWorkQueue ( ) ; pool = null ; } return cnt ; }

Target:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( "Cancelling replication event {}" , r ) ; } cnt = pool.shutdownNow ( ) . size ( ) ; pool.unregisterWorkQueue ( ) ; pool = null ; } return cnt ; }