auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void revokedKeyDueToCompromiseRevokesKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; java.lang.String problem = "Key is revoked (key material has been compromised): test6 compromised" ; assertProblems ( k , problem ) ; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ( "YYYY-MM-dd HH:mm:ss" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( df.parse ( "2010-01-01 12:00:00" ) ) ; assertProblems ( checker , k , problem ) ; }

Target:
public void revokedKeyDueToCompromiseRevokesKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; java.lang.String problem = "Key is revoked (key material has been compromised): test6 compromised" ; assertProblems ( k , problem ) ; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( df.parse ( "2010-01-01 12:00:00" ) ) ; assertProblems ( checker , k , problem ) ; }
Source:
public void validNewChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; insertPatchSet ( c ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c ) ; }

Target:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , ctl.getNotes ( ) ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = ctl.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }
Source:
public void onShowView ( ) { if ( ( windowTitle ) != null ) { com.google.gerrit.client.Gerrit.setWindowTitle ( this , windowTitle ) ; } com.google.gerrit.client.Gerrit.updateMenus ( this ) ; com.google.gerrit.client.Gerrit.setQueryString ( null ) ; registerKeys ( ) ; }

Target:
public void onShowView ( ) { if ( ( windowTitle ) != null ) { com.google.gerrit.client.Gerrit.setWindowTitle ( this , windowTitle ) ; } com.google.gerrit.client.Gerrit.updateMenus ( this ) ; Gerrit.EVENT_BUS.fireEvent ( new com.google.gerrit.client.ui.ScreenLoadEvent ( this ) ) ; com.google.gerrit.client.Gerrit.setQueryString ( null ) ; registerKeys ( ) ; }
Source:
public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; }

Target:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; com.google.gerrit.common.TimeUtil.setCurrentMillisSupplier ( ( ) -> com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ) ; }
Source:
private static long initialDelay ( java.lang.String startTime , java.lang.String interval ) { java.util.Optional < com.google.gerrit.server.config.ScheduleConfig.Schedule > schedule = com.google.gerrit.server.config.ScheduleConfig.builder ( com.google.gerrit.server.config.ScheduleConfigTest.config ( startTime , interval ) , "section" ) . setSubsection ( "subsection" ) . setNow ( com.google.gerrit.server.config.ScheduleConfigTest.NOW ) . build ( ) . schedule ( ) ; com.google.common.truth.Truth.assertThat ( schedule ) . isPresent ( ) ; return schedule.get ( ) . initialDelay ( ) ; }

Target:
private static long initialDelay ( java.lang.String startTime , java.lang.String interval ) { java.util.Optional < com.google.gerrit.server.config.ScheduleConfig.Schedule > schedule = com.google.gerrit.server.config.ScheduleConfig.builder ( com.google.gerrit.server.config.ScheduleConfigTest.config ( startTime , interval ) , "section" ) . setSubsection ( "subsection" ) . setNow ( com.google.gerrit.server.config.ScheduleConfigTest.NOW ) . buildSchedule ( ) ; com.google.common.truth.Truth.assertThat ( schedule ) . isPresent ( ) ; return schedule.get ( ) . initialDelay ( ) ; }
Source:
void display ( java.util.List < com.google.gerrit.client.groups.GroupInfo > list ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.client.groups.GroupInfo i : list ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }

Target:
void display ( java.util.List < com.google.gerrit.client.info.GroupInfo > list ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.client.info.GroupInfo i : list ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }
Source:
public static void setCacheablePrivate ( javax.servlet.http.HttpServletResponse res , long age , java.util.concurrent.TimeUnit unit ) { long now = java.lang.System.currentTimeMillis ( ) ; res.setDateHeader ( "Expires" , now ) ; res.setDateHeader ( "Date" , now ) ; com.google.gwtexpui.server.CacheHeaders.cache ( res , "private" , age , unit ) ; }

Target:
public static void setCacheablePrivate ( javax.servlet.http.HttpServletResponse res , long age , java.util.concurrent.TimeUnit unit , boolean mustRevalidate ) { long now = java.lang.System.currentTimeMillis ( ) ; res.setDateHeader ( "Expires" , now ) ; res.setDateHeader ( "Date" , now ) ; com.google.gwtexpui.server.CacheHeaders.cache ( res , "private" , age , unit , mustRevalidate ) ; }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( getPluginName ( srcFile ) , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner ( getPluginName ( srcFile ) , scriptEngine , srcFile ) , pluginDataDir , scriptEngine.getGroovyClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.scripting.groovyprovider.PluginDescription description ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( getPluginName ( srcFile ) , description.canonicalUrl , description.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner ( getPluginName ( srcFile ) , scriptEngine , srcFile ) , description.dataDir , scriptEngine.getGroovyClassLoader ( ) ) ; }
Source:
private java.lang.String threadName ( ) { final org.apache.sshd.server.session.ServerSession session = com.google.gerrit.sshd.SshScopes.getContext ( ) . session ; final java.lang.String who = session.getUsername ( ) ; final com.google.gerrit.reviewdb.Account.Id id = session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return ( ( ( ( "SSH " + ( getFullCommandLine ( ) ) ) + " / " ) + who ) + " " ) + id ; }

Target:
private final boolean isAdminCommand ( ) { return ( getClass ( ) . getAnnotation ( com.google.gerrit.sshd.AdminCommand.class ) ) != null ; }
Source:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; final java.lang.String name = plugin.getName ( ) ; final com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder holder = new com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder ( plugin , filter ) ; plugin.add ( new com.google.gerrit.server.plugins.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { plugins.remove ( name , holder ) ; } } ) ; plugins.put ( name , holder ) ; }

Target:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; final java.lang.String name = plugin.getName ( ) ; final com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder holder = new com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder ( plugin , filter ) ; plugin.add ( new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { plugins.remove ( name , holder ) ; } } ) ; plugins.put ( name , holder ) ; }
Source:
com.googlesource.gerrit.plugins.webhooks.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( endpoint ) ; post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; return httpClient.execute ( post , new com.googlesource.gerrit.plugins.webhooks.HttpResponseHandler ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.webhooks.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , com.googlesource.gerrit.plugins.webhooks.EventProcessor.Request request ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( endpoint ) ; post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > header : request.headers.entrySet ( ) ) { post.addHeader ( header.getKey ( ) , header.getValue ( ) ) ; } post.setEntity ( new org.apache.http.entity.StringEntity ( request.body , java.nio.charset.StandardCharsets.UTF_8 ) ) ; return httpClient.execute ( post , new com.googlesource.gerrit.plugins.webhooks.HttpResponseHandler ( ) ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { throw new java.io.IOException ( e ) ; } catch ( java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; org.junit.Assert.assertTrue ( "push is blocked for anonymous to refs/drafts/master" , util.user ( local ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; org.junit.Assert.assertFalse ( "push is blocked for admin refs/drafts/master" , util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; assertCannotRead ( util.user ( local ) ) ; }
Source:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.getApprovalType ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }

Target:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; com.google.gerrit.common.data.ApprovalType at = approvalTypes.byId ( approval.getKey ( ) ) ; if ( at != null ) { a.description = at.getCategory ( ) . getName ( ) ; } a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }
Source:
private static void assertRef ( int changeId , int psId , java.lang.String refName ) { org.junit.Assert.assertTrue ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( refName ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( new com.google.gerrit.reviewdb.client.Change.Id ( changeId ) , psId ) , PatchSet.Id.fromRef ( refName ) ) ; }

Target:
private static void assertRef ( int changeId , int psId , java.lang.String refName ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( refName ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( PatchSet.Id.fromRef ( refName ) ) . isEqualTo ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( new com.google.gerrit.reviewdb.client.Change.Id ( changeId ) , psId ) ) ; }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return isRefVisible ( ) ; }

Target:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return isRefVisible ( ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.AccountSshKey > getKeys ( ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; java.util.List < com.google.gerrit.reviewdb.client.AccountSshKey > result = new java.util.ArrayList < > ( ) ; for ( com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > key : keys.values ( ) ) { if ( key.isPresent ( ) ) { result.add ( key.get ( ) ) ; } } return result ; }

Target:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException { if ( com.google.common.base.Strings.isNullOrEmpty ( commit.getMessage ( ) ) ) { commit.setMessage ( "Updated SSH keys\n" ) ; } saveUTF8 ( AuthorizedKeys.FILE_NAME , com.google.gerrit.server.account.AuthorizedKeys.serialize ( keys ) ) ; return true ; }
Source:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { try { branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; } }

Target:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { exception.expect ( errType ) ; branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; }
Source:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 3 ) ; possibleLimits.add ( getPermittedLimit ( ) ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }

Target:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 4 ) ; possibleLimits.add ( getBackendSupportedLimit ( ) ) ; possibleLimits.add ( getPermittedLimit ( ) ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.lib.ModeInjector ( ) . add ( getContentType ( info.meta_a ( ) ) ) . add ( getContentType ( info.meta_b ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }
Source:
private void addIssuesOccurrence ( java.lang.String text , java.lang.String occurrence , java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { for ( java.lang.String issue : getIssueIds ( text ) ) { java.util.Set < java.lang.String > occurrences = map.get ( issue ) ; if ( occurrences == null ) { occurrences = com.google.common.collect.Sets.newLinkedHashSet ( ) ; map.put ( issue , occurrences ) ; } occurrences.add ( occurrence ) ; } }

Target:
private void addIssuesOccurrence ( java.lang.String text , java.lang.String occurrence , java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { for ( java.lang.String issue : getIssueIds ( text ) ) { java.util.Set < java.lang.String > occurrences = map.computeIfAbsent ( issue , ( k ) -> com.google.common.collect.Sets.newLinkedHashSet ( ) ) ; occurrences.add ( occurrence ) ; } }
Source:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.reviewdb.Account.Id to ) { if ( ( ! ( rcptTo.contains ( to ) ) ) && ( isVisibleTo ( to ) ) ) { rcptTo.add ( to ) ; add ( rt , toAddress ( to ) ) ; } }

Target:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.reviewdb.Account.Id to ) { try { if ( ( ! ( rcptTo.contains ( to ) ) ) && ( isVisibleTo ( to ) ) ) { rcptTo.add ( to ) ; add ( rt , toAddress ( to ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.mail.OutgoingEmail.log.error ( ( "Error reading database for account: " + to ) , e ) ; } }
Source:
private PushOneCommit.Result createChangeWithTopic ( java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }
Source:
private static com.google.gerrit.server.git.CodeReviewCommit failed ( final org.eclipse.jgit.revwalk.RevWalk rw , final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit n , final com.google.gerrit.server.git.CommitMergeStatus failure ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.reset ( ) ; rw.markStart ( n ) ; rw.markUninteresting ( mergeTip ) ; com.google.gerrit.server.git.CodeReviewCommit failed ; while ( ( failed = ( ( com.google.gerrit.server.git.CodeReviewCommit ) ( rw.next ( ) ) ) ) != null ) { failed.statusCode = failure ; } return failed ; }

Target:
private static com.google.gerrit.server.git.CodeReviewCommit failed ( final org.eclipse.jgit.revwalk.RevWalk rw , final org.eclipse.jgit.revwalk.RevFlag canMergeFlag , final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit n , final com.google.gerrit.server.git.CommitMergeStatus failure ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.resetRetain ( canMergeFlag ) ; rw.markStart ( n ) ; rw.markUninteresting ( mergeTip ) ; com.google.gerrit.server.git.CodeReviewCommit failed ; while ( ( failed = ( ( com.google.gerrit.server.git.CodeReviewCommit ) ( rw.next ( ) ) ) ) != null ) { failed.statusCode = failure ; } return failed ; }
Source:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private static com.google.gerrit.server.project.ChangeControl validate ( final com.google.gerrit.server.project.ChangeControl c ) throws com.google.gerrit.server.project.NoSuchChangeException { if ( ! ( c.isVisible ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }

Target:
private static com.google.gerrit.server.project.ChangeControl validate ( final com.google.gerrit.server.project.ChangeControl c , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { if ( ! ( c.isVisible ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }
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 ( ) , true ) ) ; } 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.transport.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.transport.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:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( "Error deleting local repository %s:\n" , uri.getPath ( ) ) , e ) ; } }

Target:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot delete project on remote site {}. " + ( "Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ; } }
Source:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertPatchSet ( c ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; repo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; deleteRef ( refName ) ; assertProblems ( c , ( "Ref missing: " + refName ) ) ; }

Target:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertPatchSet ( c ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; deleteRef ( refName ) ; assertProblems ( c , ( "Ref missing: " + refName ) ) ; }
Source:
public void testUpdateOne ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; createClassUnderTest ( ) . update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; }

Target:
public void testUpsertTwoFirstExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 2 ) ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) ) ; md.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) , batch ) ; md.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }
Source:
boolean isStale ( java.nio.file.Path p ) { java.nio.file.attribute.FileTime t = getLastModifiedTime ( p ) ; return ( ( ( t.toMillis ( ) ) == 0 ) || ( ( lastModified.toMillis ( ) ) == 0 ) ) || ( ! ( lastModified.equals ( t ) ) ) ; }

Target:
boolean isStale ( java.nio.file.Path p , com.google.gerrit.httpd.raw.ResourceServlet rs ) throws java.io.IOException { java.nio.file.attribute.FileTime t = rs.getLastModifiedTime ( p ) ; return ( ( ( t.toMillis ( ) ) == 0 ) || ( ( lastModified.toMillis ( ) ) == 0 ) ) || ( ! ( lastModified.equals ( t ) ) ) ; }
Source:
public void dryRunMerge ( ) throws java.lang.Exception { changeInTwoBranches ( "a.txt" , "b.txt" ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/master/mergeable?source=branchA" ) ) ; com.google.gerrit.extensions.common.MergeableInfo m = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.MergeableInfo.class ) ; com.google.common.truth.Truth.assertThat ( m.mergeable ) . isTrue ( ) ; }

Target:
public void invalidSource ( ) throws java.lang.Exception { changeInTwoBranches ( "branchA" , "a.txt" , "branchB" , "b.txt" ) ; com.google.gerrit.extensions.common.ChangeInput in = newMergeChangeInput ( "branchA" , "invalid" , "" ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.BadRequestException.class , "Cannot resolve 'invalid' to a commit" ) ; }
Source:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } else { switch ( status ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } } }

Target:
public void cancel ( ) { if ( ( status.getStatus ( ) ) != ( com.googlesrouce.gerrit.plugins.github.git.GitJobStatus.Code.SYNC ) ) { return ; } cancelled = true ; status.update ( GitJobStatus.Code.CANCELLED , "Cancelled" , "Cancelled" ) ; rollback ( ) ; }
Source:
public static java.security.PublicKey parse ( com.google.gerrit.server.account.AccountSshKey key ) throws java.security.NoSuchAlgorithmException , java.security.NoSuchProviderException , java.security.spec.InvalidKeySpecException { try { final java.lang.String s = key.getEncodedKey ( ) ; if ( s == null ) { throw new java.security.spec.InvalidKeySpecException ( "No key string" ) ; } final byte [ ] bin = org.apache.commons.codec.binary.Base64.decodeBase64 ( org.eclipse.jgit.lib.Constants.encodeASCII ( s ) ) ; return new org.apache.sshd.common.util.buffer.ByteArrayBuffer ( bin ) . getRawPublicKey ( ) ; } catch ( java.lang.RuntimeException | org.apache.sshd.common.SshException e ) { throw new java.security.spec.InvalidKeySpecException ( "Cannot parse key" , e ) ; } }

Target:
public static java.security.PublicKey parse ( com.google.gerrit.server.account.AccountSshKey key ) throws java.security.NoSuchAlgorithmException , java.security.NoSuchProviderException , java.security.spec.InvalidKeySpecException { try { final java.lang.String s = key.encodedKey ( ) ; if ( s == null ) { throw new java.security.spec.InvalidKeySpecException ( "No key string" ) ; } final byte [ ] bin = org.apache.commons.codec.binary.Base64.decodeBase64 ( org.eclipse.jgit.lib.Constants.encodeASCII ( s ) ) ; return new org.apache.sshd.common.util.buffer.ByteArrayBuffer ( bin ) . getRawPublicKey ( ) ; } catch ( java.lang.RuntimeException | org.apache.sshd.common.SshException e ) { throw new java.security.spec.InvalidKeySpecException ( "Cannot parse key" , e ) ; } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.gerrit.server.git.LabelNormalizer.Result normalize ( com.google.gerrit.reviewdb.client.Change change , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { return normalize ( changeFactory.controlFor ( change , userFactory.create ( change.getOwner ( ) ) ) , approvals ) ; }

Target:
public com.google.gerrit.server.git.LabelNormalizer.Result normalize ( com.google.gerrit.reviewdb.client.Change change , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = userFactory.create ( change.getOwner ( ) ) ; return normalize ( changeFactory.controlFor ( db.get ( ) , change , user ) , approvals ) ; }
Source:
public void testToString ( ) { final com.google.gerrit.server.query.TestPredicate a = f ( "q" , "alice" ) ; final com.google.gerrit.server.query.TestPredicate b = f ( "q" , "bob" ) ; final com.google.gerrit.server.query.TestPredicate c = f ( "q" , "charlie" ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.server.query.Predicate.or ( a , b ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.server.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }

Target:
public void testToString ( ) { final com.google.gerrit.index.query.TestPredicate a = f ( "q" , "alice" ) ; final com.google.gerrit.index.query.TestPredicate b = f ( "q" , "bob" ) ; final com.google.gerrit.index.query.TestPredicate c = f ( "q" , "charlie" ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.index.query.Predicate.or ( a , b ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.index.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; }

Target:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoModule ( ) ) ; }
Source:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { if ( id == null ) { return false ; } java.lang.Boolean b = memberOf.get ( id ) ; if ( b != null ) { return b ; } memberOf.put ( id , false ) ; if ( search ( includeCache.membersOf ( id ) ) ) { memberOf.put ( id , true ) ; return true ; } return false ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > r = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id : groupIds ) { if ( contains ( id ) ) { r.add ( id ) ; } } return r ; }
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 ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; }
Source:
public void testInheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "not blocked from submitting" , u.controlForRef ( "refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.SUBMIT ) ) ; }

Target:
public void testInheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.SUBMIT , "refs/heads/master" , u ) ; }
Source:
private static org.eclipse.jgit.diff.Edit copy ( org.eclipse.jgit.diff.Edit edit ) { if ( edit instanceof org.eclipse.jgit.diff.ReplaceEdit ) { return com.google.gerrit.server.patch.IntraLineDiff.copy ( ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( edit ) ) ) ; } return new org.eclipse.jgit.diff.Edit ( edit.getBeginA ( ) , edit.getEndA ( ) , edit.getBeginB ( ) , edit.getEndB ( ) ) ; }

Target:
private static org.eclipse.jgit.diff.Edit copy ( org.eclipse.jgit.diff.Edit edit ) { if ( edit instanceof org.eclipse.jgit.diff.ReplaceEdit ) { return com.google.gerrit.server.diff.IntraLineDiff.copy ( ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( edit ) ) ) ; } return new org.eclipse.jgit.diff.Edit ( edit.getBeginA ( ) , edit.getEndA ( ) , edit.getBeginB ( ) , edit.getEndB ( ) ) ; }
Source:
public static com.google.gitiles.Revision normalizeParentExpressions ( com.google.gitiles.Revision rev ) { if ( ( rev == null ) || ( ( ( rev.name.indexOf ( "~" ) ) < 0 ) && ( ( rev.name.indexOf ( "^" ) ) < 0 ) ) ) { return rev ; } return new com.google.gitiles.Revision ( rev.id.name ( ) , rev.id , rev.type , rev.peeledId , rev.peeledType ) ; }

Target:
public static com.google.gitiles.Revision normalizeParentExpressions ( com.google.gitiles.Revision rev ) { if ( ( rev == null ) || ( ( ( rev.name.indexOf ( '~' ) ) < 0 ) && ( ( rev.name.indexOf ( '^' ) ) < 0 ) ) ) { return rev ; } return new com.google.gitiles.Revision ( rev.id.name ( ) , rev.id , rev.type , rev.peeledId , rev.peeledType ) ; }
Source:
public com.google.gerrit.extensions.client.AccountGeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.AccountGeneralPreferencesInfo a = new com.google.gerrit.extensions.client.AccountGeneralPreferencesInfo ( ) ; return com.google.gerrit.server.account.GetPreferences.loadFromAllUsers ( a , p , git ) ; } }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.GeneralPreferencesInfo a = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; return loader.loadFromAllUsers ( a , p , git ) ; } }
Source:
public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.rpc.Common.setGerritConfig ( result.config ) ; if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.rpc.Common.setGerritConfig ( result.config ) ; if ( ( result.xsrfToken ) != null ) { com.google.gwtjsonrpc.client.JsonUtil.getDefaultXsrfManager ( ) . setToken ( null , result.xsrfToken ) ; } if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }
Source:
public boolean hasNext ( ) { return itr.hasNext ( ) ; }

Target:
public boolean hasNext ( ) { if ( ( next ) != null ) { return true ; } while ( itr.hasNext ( ) ) { com.google.gerrit.server.query.change.ChangeData d = convert ( itr.next ( ) ) ; if ( seen.add ( d.getId ( ) ) ) { next = d ; return true ; } } return false ; }
Source:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }

Target:
private void setSubmitType ( com.google.gerrit.extensions.client.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.client.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }