auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.rebase ( id.get ( ) , revision , getBase ( ) , 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 ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.rebase ( project.get ( ) , id.get ( ) , revision , getBase ( ) , 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 ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( project , id ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private void parseAll ( ) throws java.io.IOException , java.text.ParseException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( walk.parseCommit ( tip ) ) ; pruneReviewers ( ) ; }

Target:
private void parseAll ( ) throws java.io.IOException , java.text.ParseException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; pruneReviewers ( ) ; }
Source:
static java.util.SortedMap < java.lang.String , java.lang.String > makeSortedMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { java.util.SortedMap < java.lang.String , java.lang.String > result = new java.util.TreeMap < > ( ) ; for ( java.lang.String key : com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.keySet ( ) ) ) { result.put ( key , java.lang.String.join ( " " , com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.get ( key ) ) ) ) ; } return result ; }

Target:
static java.util.SortedMap < java.lang.String , java.util.List < java.lang.String > > makeSortedMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { java.util.SortedMap < java.lang.String , java.util.List < java.lang.String > > result = new java.util.TreeMap < > ( ) ; for ( java.lang.String key : com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.keySet ( ) ) ) { result.put ( key , com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.get ( key ) ) ) ; } return result ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > index ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.util.RequestScopePropagator prop ) { java.util.concurrent.Callable < ? > task = new com.google.gerrit.server.index.ChangeIndexerImpl.Task ( change ) ; if ( prop != null ) { task = prop.wrap ( task ) ; } return executor.submit ( task ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > index ( com.google.gerrit.reviewdb.client.Change change ) { return executor.submit ( new com.google.gerrit.server.index.ChangeIndexerImpl.Task ( change ) ) ; }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) , new com.google.gerrit.server.config.GerritGlobalModule ( ) , new com.google.gerrit.server.ssh.SshModule ( ) , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } } ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) , new com.google.gerrit.server.config.GerritGlobalModule ( ) , new com.google.gerrit.server.ssh.SshModule ( ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public final com.google.common.util.concurrent.ListenableFuture < com.google.gerrit.server.notedb.NoteDbUpdateManager.Result > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < com.google.gerrit.server.notedb.NoteDbUpdateManager.Result > ( ) { @ java.lang.Override public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result call ( ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return rebuild ( db , id ) ; } } } ) ; }

Target:
public final com.google.common.util.concurrent.ListenableFuture < com.google.gerrit.server.notedb.NoteDbUpdateManager.Result > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( ( ) -> { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return rebuild ( db , id ) ; } } ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listBranches.request ( this ) . apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listBranches.get ( ) . request ( this ) . apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }
Source:
private java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } return org.spearce.jgit.util.SystemReader.getInstance ( ) . getHostname ( ) ; }

Target:
protected java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } return org.spearce.jgit.util.SystemReader.getInstance ( ) . getHostname ( ) ; }
Source:
public static java.lang.String toPatch ( final java.lang.String type , final com.google.gerrit.client.reviewdb.Patch.Id id ) { final com.google.gerrit.client.reviewdb.PatchSet.Id psId = id.getParentKey ( ) ; final com.google.gerrit.client.reviewdb.Change.Id chId = psId.getParentKey ( ) ; final java.lang.String encp = com.google.gerrit.client.Link.encodePath ( id.get ( ) ) ; return ( ( ( ( ( ( "patch," + type ) + "," ) + ( chId.get ( ) ) ) + "," ) + ( psId.get ( ) ) ) + "," ) + encp ; }

Target:
public static java.lang.String toPatch ( final java.lang.String type , final com.google.gerrit.client.reviewdb.Patch.Id id ) { return ( ( "patch," + type ) + "," ) + ( id.toString ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , java.lang.String msgTxt , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( control , msgTxt , notifyHandling ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getProject ( ) . getNameKey ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control.getId ( ) , op ) . execute ( ) ; } return op.change ; }

Target:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , java.lang.String msgTxt , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( control.getUser ( ) , msgTxt , notifyHandling ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getProject ( ) . getNameKey ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control.getId ( ) , op ) . execute ( ) ; } return op.change ; }
Source:
private void hide ( ) { for ( com.google.gwt.user.client.ui.Widget w = getParent ( ) ; w != null ; w = w.getParent ( ) ) { if ( w instanceof com.google.gwt.user.client.ui.PopupPanel ) { ( ( com.google.gwt.user.client.ui.PopupPanel ) ( w ) ) . hide ( ) ; break ; } } }

Target:
protected void hide ( ) { for ( com.google.gwt.user.client.ui.Widget w = getParent ( ) ; w != null ; w = w.getParent ( ) ) { if ( w instanceof com.google.gwt.user.client.ui.PopupPanel ) { ( ( com.google.gwt.user.client.ui.PopupPanel ) ( w ) ) . hide ( ) ; break ; } } }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.executeUpdate ( "UPDATE accounts set mute_common_path_prefixes = 'Y'" ) ; } finally { stmt.close ( ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { try ( java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ) { stmt.executeUpdate ( "UPDATE accounts set mute_common_path_prefixes = 'Y'" ) ; } }
Source:
public void testBlocked ( ) throws java.lang.Exception { java.lang.String [ ] patterns = new java.lang.String [ ] { "application/pdf" , "application/xml" , "text/html" } ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , makeCommit ( ) , patterns , false ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: found blocked content type (application/pdf) in file: foo.pdf" , "ERROR: found blocked content type (application/xml) in file: foo.xml" , "ERROR: found blocked content type (text/html) in file: foo.html" ) ; }

Target:
public void testBlocked ( ) throws java.lang.Exception { java.lang.String [ ] patterns = new java.lang.String [ ] { "application/pdf" , "application/xml" , "text/html" } ; try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , makeCommit ( rw ) , rw , patterns , false ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: found blocked content type (application/pdf) in file: foo.pdf" , "ERROR: found blocked content type (application/xml) in file: foo.xml" , "ERROR: found blocked content type (text/html) in file: foo.html" ) ; } }
Source:
public void onSuggestionsReady ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Response response ) { if ( ( exclude.size ( ) ) > 0 ) { java.util.Set < com.google.gerrit.client.ui.Suggestion > filteredSuggestions = new java.util.HashSet < com.google.gerrit.client.ui.Suggestion > ( response.getSuggestions ( ) ) ; for ( com.google.gerrit.client.ui.Suggestion s : response.getSuggestions ( ) ) { if ( exclude.contains ( s.getReplacementString ( ) ) ) { filteredSuggestions.remove ( s ) ; } } response.setSuggestions ( filteredSuggestions ) ; } callback.onSuggestionsReady ( request , response ) ; }

Target:
public void onSuggestionsReady ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Response response ) { if ( ( exclude.size ( ) ) > 0 ) { java.util.Set < com.google.gerrit.client.ui.Suggestion > filteredSuggestions = new java.util.HashSet ( response.getSuggestions ( ) ) ; for ( com.google.gerrit.client.ui.Suggestion s : response.getSuggestions ( ) ) { if ( exclude.contains ( s.getReplacementString ( ) ) ) { filteredSuggestions.remove ( s ) ; } } response.setSuggestions ( filteredSuggestions ) ; } callback.onSuggestionsReady ( request , response ) ; }
Source:
public static < T > com.google.gerrit.server.query.Predicate < T > and ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > that ) { if ( ( that.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( that ) ; } return new com.google.gerrit.server.query.AndPredicate < T > ( that ) ; }

Target:
public static < T > com.google.gerrit.server.query.Predicate < T > and ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > that ) { if ( ( that.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( that ) ; } return new com.google.gerrit.server.query.AndPredicate ( that ) ; }
Source:
public void submitTwoChangesWithFastForward_missingDependency ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change2 = createChange ( ) ; submitWithConflict ( change2.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( oldHead.getId ( ) ) ; }

Target:
public void submitTwoChangesWithFastForward_missingDependency ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change2 = createChange ( ) ; submitWithConflict ( change2.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( oldHead.getId ( ) ) ; }
Source:
public boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ; }

Target:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeEditResource rsrc , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { try { editModifier.modifyFile ( rsrc.getChangeEdit ( ) , rsrc.getPath ( ) , com.google.common.io.ByteStreams.toByteArray ( input.content.getInputStream ( ) ) ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException | java.io.IOException 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.ChangeEditResource rsrc , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { try { editModifier.modifyFile ( rsrc.getChangeEdit ( ) , rsrc.getPath ( ) , input.content ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.reviewdb.Account.Id accountId = getAccountId ( ) ; if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private void initAgreements ( ) { grid.addHeader ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingAgreements ( ) ) ) ; contributorAgreements = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; if ( com.google.gerrit.client.Gerrit.getConfig ( ) . isUseContributorAgreements ( ) ) { saveEnabler.listenTo ( contributorAgreements ) ; grid.add ( Util.C.useContributorAgreements ( ) , contributorAgreements ) ; } signedOffBy = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; saveEnabler.listenTo ( signedOffBy ) ; grid.addHtml ( Util.C.useSignedOffBy ( ) , signedOffBy ) ; }

Target:
private void initAgreements ( ) { grid.addHeader ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingAgreements ( ) ) ) ; contributorAgreements = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . useContributorAgreements ( ) ) { saveEnabler.listenTo ( contributorAgreements ) ; grid.add ( Util.C.useContributorAgreements ( ) , contributorAgreements ) ; } signedOffBy = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; saveEnabler.listenTo ( signedOffBy ) ; grid.addHtml ( Util.C.useSignedOffBy ( ) , signedOffBy ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriter ( indexes , com.google.gerrit.server.index.IndexConfig.create ( 0 , 0 , 3 , 100 ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriter ( indexes , com.google.gerrit.server.index.IndexConfig.create ( 0 , 0 , 3 ) ) ; }
Source:
private void testPushForMasterWithTopic ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { selectProtocol ( p ) ; java.lang.String topic = "my/topic" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/master/" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; r = pushTo ( ( "refs/for/master%topic=" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; }

Target:
public void testPushForMasterWithTopic ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String topic = "my/topic" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/master/" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; r = pushTo ( ( "refs/for/master%topic=" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; }
Source:
private static void setXGerritAuthCookie ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp , com.google.gerrit.httpd.WebSession session ) { java.lang.String v = ( session != null ) ? session.getXGerritAuth ( ) : "" ; javax.servlet.http.Cookie c = new javax.servlet.http.Cookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME , v ) ; c.setPath ( "/" ) ; c.setHttpOnly ( false ) ; c.setSecure ( com.google.gerrit.httpd.raw.HostPageServlet.isSecure ( req ) ) ; c.setMaxAge ( ( session != null ? - 1 : 0 ) ) ; rsp.addCookie ( c ) ; }

Target:
private static void setXGerritAuthCookie ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp , com.google.gerrit.httpd.WebSession session ) { java.lang.String v = ( session != null ) ? session.getXGerritAuth ( ) : "" ; javax.servlet.http.Cookie c = new javax.servlet.http.Cookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME , v ) ; c.setPath ( "/" ) ; c.setSecure ( com.google.gerrit.httpd.raw.HostPageServlet.isSecure ( req ) ) ; c.setMaxAge ( ( session != null ? - 1 : 0 ) ) ; rsp.addCookie ( c ) ; }
Source:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( req , res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; try ( java.io.Writer out = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { out.write ( message ) ; } }

Target:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( req , res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( req , res ) ; try ( java.io.Writer out = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { out.write ( message ) ; } }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException ( ) ; } org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException ( ) ; } org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) , true ) ) ; } return up ; }
Source:
public void storeEvent ( java.lang.String projectName , java.sql.Timestamp timestamp , java.lang.String event ) throws java.sql.SQLException { java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ; try { stat.execute ( ( ( java.lang.String.format ( "INSERT INTO %s(%s, %s, %s) " , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.PROJECT_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.EVENT_ENTRY ) ) + ( java.lang.String.format ( "VALUES('%s', '%s', '%s')" , projectName , timestamp , event ) ) ) ) ; } finally { closeStatement ( stat ) ; closeConnection ( conn ) ; } }

Target:
public void storeEvent ( java.lang.String projectName , java.sql.Timestamp timestamp , java.lang.String event ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { stat.execute ( ( ( java.lang.String.format ( "INSERT INTO %s(%s, %s, %s) " , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.PROJECT_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.EVENT_ENTRY ) ) + ( java.lang.String.format ( "VALUES('%s', '%s', '%s')" , projectName , timestamp , event ) ) ) ) ; } }
Source:
private < A extends com.google.gwtorm.client.Access < ? , ? > > java.lang.Class < A > loadClass ( ) throws com.google.gwtorm.client.OrmException { try { final java.lang.Class < ? > c = java.lang.Class.forName ( implClassName , false , classLoader ) ; return ( ( java.lang.Class < A > ) ( c ) ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gwtorm.client.OrmException ( "Cannot load generated class" , err ) ; } }

Target:
private java.lang.Class < ? > loadClass ( ) throws com.google.gwtorm.client.OrmException { try { return java.lang.Class.forName ( implClassName , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gwtorm.client.OrmException ( "Cannot load generated class" , err ) ; } }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > predicate = new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } } ; return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( predicate ) . toList ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > predicate = ( ps ) -> { try { return changeControl ( ) . isPatchVisible ( ps , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } ; return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( predicate ) . toList ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; for ( com.google.gerrit.server.git.validators.CommitValidationListener validator : commitValidationListeners ) { try { messages.addAll ( validator.onCommitReceived ( receiveEvent ) ) ; } catch ( com.google.gerrit.server.git.validators.CommitValidationException e ) { messages.addAll ( e.getMessages ( ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( e.getMessage ( ) , messages ) ; } } return messages ; }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.git.validators.CommitValidationListener validator : commitValidationListeners ) { try { messages.addAll ( validator.onCommitReceived ( receiveEvent ) ) ; } catch ( com.google.gerrit.server.git.validators.CommitValidationException e ) { messages.addAll ( e.getMessages ( ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( e.getMessage ( ) , messages ) ; } } return messages ; }
Source:
private java.lang.Iterable < T > buffer ( com.google.gwtorm.server.ResultSet < T > scanner ) { return com.google.common.collect.FluentIterable.from ( com.google.common.collect.Iterables.partition ( scanner , 50 ) ) . transformAndConcat ( new com.google.common.base.Function < java.util.List < T > , java.util.List < T > > ( ) { @ java.lang.Override public java.util.List < T > apply ( java.util.List < T > buffer ) { return transformBuffer ( buffer ) ; } } ) ; }

Target:
private java.lang.Iterable < T > buffer ( com.google.gwtorm.server.ResultSet < T > scanner ) { return com.google.common.collect.FluentIterable.from ( com.google.common.collect.Iterables.partition ( scanner , 50 ) ) . transformAndConcat ( this :: transformBuffer ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = dbProvider.get ( ) . changes ( ) . get ( id ) ; if ( c == null ) { return null ; } return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( c ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.reviewdb.client.Change c = dbProvider.get ( ) . changes ( ) . get ( id ) ; if ( c == null ) { return null ; } return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( c ) ; }
Source:
public void testCarriageReturnIgnoringBinaries ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithPseudoBinaries ( ) ; java.util.Set < java.lang.String > ignoreFiles = com.google.common.collect.Sets.newHashSet ( new java.lang.String [ ] { "iso" , "jpeg" } ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.performValidation ( repo , c , ignoreFiles ) ; org.junit.Assert.assertEquals ( 0 , m.size ( ) ) ; }

Target:
public void testCarriageReturnIgnoringBinaries ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithPseudoBinaries ( ) ; java.util.Set < java.lang.String > ignoreFiles = com.google.common.collect.Sets.newHashSet ( new java.lang.String [ ] { "iso" , "jpeg" } ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.performValidation ( repo , c , ignoreFiles ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; }
Source:
private static java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets = cd.patchSets ( ) ; java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > result = com.google.common.collect.Maps.newTreeMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { result.put ( ps.getId ( ) . get ( ) , ps ) ; } return result ; }

Target:
private static java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets = cd.patchSets ( ) ; java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > result = new java.util.TreeMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { result.put ( ps.getId ( ) . get ( ) , ps ) ; } return result ; }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { HEAD ( ( dfc7e6 = ( metrics ) - ( ( com.google.gerrit.acceptance.rest.change.version ) ( setSignedOffByFooter ( ) ) ) ) ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }

Target:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( true ) ; try { com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; } finally { setSignedOffByFooter ( false ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { updateOriginal ( result ) ; setMessageText ( message ) ; setDate ( result.updated ( ) ) ; setEdit ( false ) ; if ( isNew ) { removeStyleName ( draftStyle.newDraft ( ) ) ; isNew = false ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { updateOriginal ( result ) ; setMessageText ( message ) ; setDate ( result.updated ( ) ) ; if ( isNew ) { removeStyleName ( draftStyle.newDraft ( ) ) ; isNew = false ; } }
Source:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; final com.google.gwtorm.client.SchemaFactory < com.google.gerrit.client.reviewdb.ReviewDb > rdf = gs.getDatabase ( ) ; final com.google.gerrit.client.data.GroupCache groups = gs.getGroupCache ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( rdf , groups ) ; }

Target:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; final com.google.gwtorm.client.SchemaFactory < com.google.gerrit.client.reviewdb.ReviewDb > rdf = gs.getDatabase ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( rdf ) ; }
Source:
private com.google.gerrit.reviewdb.ChangeMessage message ( final com.google.gerrit.reviewdb.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( schema ) ; } catch ( com.google.gwtorm.client.OrmException e ) { return null ; } final com.google.gerrit.reviewdb.ChangeMessage m = new com.google.gerrit.reviewdb.ChangeMessage ( new com.google.gerrit.reviewdb.ChangeMessage.Key ( c.getId ( ) , uuid ) , null ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.ChangeMessage message ( final com.google.gerrit.reviewdb.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( schema ) ; } catch ( com.google.gwtorm.client.OrmException e ) { return null ; } final com.google.gerrit.reviewdb.ChangeMessage m = new com.google.gerrit.reviewdb.ChangeMessage ( new com.google.gerrit.reviewdb.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }
Source:
public void onOpen ( final com.google.gwt.user.client.ui.DisclosureEvent event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }

Target:
public void onOpen ( final com.google.gwt.user.client.ui.DisclosureEvent event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }
Source:
private static synchronized com.google.gerrit.git.WorkQueue.Executor getPool ( final boolean autoStart ) { if ( autoStart && ( ( com.google.gerrit.git.WorkQueue.pool ) == null ) ) { com.google.gerrit.git.WorkQueue.pool = new com.google.gerrit.git.WorkQueue.Executor ( 1 ) ; com.google.gerrit.git.WorkQueue.pool.setKeepAliveTime ( 60 , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.WorkQueue.pool.setMaximumPoolSize ( 5 ) ; } return com.google.gerrit.git.WorkQueue.pool ; }

Target:
private static synchronized com.google.gerrit.git.WorkQueue.Executor getPool ( final boolean autoStart ) { if ( autoStart && ( ( com.google.gerrit.git.WorkQueue.pool ) == null ) ) { com.google.gerrit.git.WorkQueue.pool = new com.google.gerrit.git.WorkQueue.Executor ( 1 ) ; } return com.google.gerrit.git.WorkQueue.pool ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ( ! ( change.isPrivate ( ) ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.MERGED ) ) ) && ( canSetPrivate ( rsrc ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ! ( change.isPrivate ( ) ) ) && ( canSetPrivate ( rsrc ) ) ) ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }
Source:
private java.io.File getSiteFromReviewDb ( java.sql.Connection conn ) { try { java.sql.Statement stmt = conn.createStatement ( ) ; try { java.sql.ResultSet rs = stmt.executeQuery ( "SELECT site_path FROM system_config" ) ; if ( rs.next ( ) ) { return new java.io.File ( rs.getString ( 1 ) ) ; } } finally { stmt.close ( ) ; } return null ; } catch ( java.sql.SQLException e ) { return null ; } }

Target:
private java.io.File getSiteFromReviewDb ( java.sql.Connection conn ) { try ( java.sql.Statement stmt = conn.createStatement ( ) ; java.sql.ResultSet rs = stmt.executeQuery ( "SELECT site_path FROM system_config" ) ) { if ( rs.next ( ) ) { return new java.io.File ( rs.getString ( 1 ) ) ; } } catch ( java.sql.SQLException e ) { return null ; } return null ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , null , new com.google.gerrit.server.index.IndexRewriteImpl.BasicRewritesImpl ( null , indexes ) , new com.google.gerrit.server.query.change.SqlRewriterImpl ( null ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , null , new com.google.gerrit.server.index.IndexRewriteImpl.BasicRewritesImpl ( null , indexes ) , new com.google.gerrit.server.query.change.SqlRewriterImpl ( null ) ) ; }
Source:
public void atomicDelete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.query.change.ChangeData > changes = queryProvider.get ( ) . byProject ( project.getNameKey ( ) ) ; deleteChanges ( changes ) ; db.accountProjectWatches ( ) . delete ( db.accountProjectWatches ( ) . byProject ( project.getNameKey ( ) ) ) ; db.submoduleSubscriptions ( ) . delete ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) ) ; }

Target:
public void atomicDelete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.query.change.ChangeData > changes = queryProvider.get ( ) . byProject ( project.getNameKey ( ) ) ; deleteChanges ( changes ) ; db.accountProjectWatches ( ) . delete ( db.accountProjectWatches ( ) . byProject ( project.getNameKey ( ) ) ) ; }
Source:
public void commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( sc.reviewer ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( 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 commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( 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 ) ; }
Source:
public void testEndOfString ( ) throws com.google.gwtorm.server.OrmException { assertTrue ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a" ) ) ) ; assertFalse ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a$" ) ) ) ; assertFalse ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a\\$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a" ) ) ) ; assertTrue ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a\\$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a$" ) ) ) ; }

Target:
public void testEndOfString ( ) throws com.google.gwtorm.server.OrmException { org.junit.Assert.assertTrue ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a" ) ) ) ; org.junit.Assert.assertFalse ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a$" ) ) ) ; org.junit.Assert.assertFalse ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a\\$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a" ) ) ) ; org.junit.Assert.assertTrue ( com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a\\$" ) . match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a$" ) ) ) ; }
Source:
public void receivePackRespectsVisibilityOfOpenChanges ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( getReceivePackRefs ( ) . additionalHaves ( ) ) . containsExactly ( com.google.gerrit.acceptance.git.RefAdvertisementIT.obj ( c3 , 1 ) ) ; }

Target:
public void receivePackRespectsVisibilityOfOpenChanges ( ) throws java.lang.Exception { allow ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( getReceivePackRefs ( ) . additionalHaves ( ) ) . containsExactly ( com.google.gerrit.acceptance.git.RefAdvertisementIT.obj ( c3 , 1 ) ) ; }