auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }

Target:
public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseAll ( ) ; } } }
Source:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.client.data.ProjectCache.Entry pe = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; }

Target:
public void setPatchSetInfo ( com.google.gerrit.client.reviewdb.PatchSetInfo patchSetInfo ) { this . patchSetInfo = patchSetInfo ; }
Source:
public void testReplaceLocalName ( ) { final com.google.gerrit.common.data.ParameterizedString p = new com.google.gerrit.common.data.ParameterizedString ( "${a.localPart}" ) ; assertEquals ( 1 , p.getParameterNames ( ) . size ( ) ) ; assertTrue ( p.getParameterNames ( ) . contains ( "a" ) ) ; final java.util.Map < java.lang.String , java.lang.String > a = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; a.put ( "a" , "foo@example.com" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; a.put ( "a" , "foo" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; }

Target:
public void testReplaceLocalName ( ) { final com.google.gerrit.common.data.ParameterizedString p = new com.google.gerrit.common.data.ParameterizedString ( "${a.localPart}" ) ; org.junit.Assert.assertEquals ( 1 , p.getParameterNames ( ) . size ( ) ) ; org.junit.Assert.assertTrue ( p.getParameterNames ( ) . contains ( "a" ) ) ; final java.util.Map < java.lang.String , java.lang.String > a = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; a.put ( "a" , "foo@example.com" ) ; org.junit.Assert.assertNotNull ( p.bind ( a ) ) ; org.junit.Assert.assertEquals ( 1 , p.bind ( a ) . length ) ; org.junit.Assert.assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; org.junit.Assert.assertEquals ( "foo" , p.replace ( a ) ) ; a.put ( "a" , "foo" ) ; org.junit.Assert.assertNotNull ( p.bind ( a ) ) ; org.junit.Assert.assertEquals ( 1 , p.bind ( a ) . length ) ; org.junit.Assert.assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; org.junit.Assert.assertEquals ( "foo" , p.replace ( a ) ) ; }
Source:
public void blockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }

Target:
public void blockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
public boolean isDraftVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewDrafts ( ) ) ) || ( getCurrentUser ( ) . isInternalUser ( ) ) ; }

Target:
public boolean isDraftVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewDrafts ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
public void nonexistentEmail ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "cannot find account doesnotexist@invalid.com" ) ; com.google.gerrit.extensions.api.config.AccessCheckInput in = new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ; in.account = "doesnotexist@invalid.com" ; in.permission = "rebase" ; in.ref = "refs/heads/master" ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( in ) ; }

Target:
public void nonexistentEmail ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.config.AccessCheckInput in = new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ; in.account = "doesnotexist@invalid.com" ; in.permission = "rebase" ; in.ref = "refs/heads/master" ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "cannot find account doesnotexist@invalid.com" ) ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( in ) ; }
Source:
private boolean isIndexPredicate ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.change.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return false ; } com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; return index.getSchema ( ) . hasField ( p.getField ( ) ) ; }

Target:
private boolean isIndexPredicate ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.change.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return false ; } com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; com.google.gerrit.server.index.FieldDef def = p.getField ( ) ; com.google.gerrit.server.index.Schema schema = index.getSchema ( ) ; return schema.hasField ( def ) ; }
Source:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; try { createClassUnderTest ( ) . delete ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.delete ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( delete ) ; }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableMap.of ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return com.google.gerrit.server.account.AccountState.forAccount ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account ) ; }
Source:
public void deleteChecked ( ) { final java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.Key > ids = getCheckedIds ( ) ; if ( ! ( ids.isEmpty ( ) ) ) { Util.ACCOUNT_SVC.deleteProjectWatches ( ids , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { remove ( ids ) ; } } ) ; } }

Target:
public void deleteChecked ( ) { final java.util.Set < com.google.gerrit.client.account.ProjectWatchInfo > infos = getCheckedProjectWatchInfos ( ) ; if ( ! ( infos.isEmpty ( ) ) ) { com.google.gerrit.client.account.AccountApi.deleteWatchedProjects ( "self" , infos , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ProjectWatchInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ProjectWatchInfo > watchedProjects ) { remove ( infos ) ; } } ) ; } }
Source:
private com.google.gerrit.server.account.AuthResult bySshUserName ( final javax.servlet.http.HttpServletResponse rsp , final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byUserName ( final javax.servlet.http.HttpServletResponse rsp , final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
public static void tryRecursiveDelete ( java.nio.file.Path dir ) { try { java.nio.file.Files.walkFileTree ( dir , new java.nio.file.SimpleFileVisitor < java.nio.file.Path > ( ) { @ java.lang.Override public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { com.googlesource.gerrit.plugins.events.fsstore.Fs.tryDelete ( file ) ; return java.nio.file.FileVisitResult.CONTINUE ; } @ java.lang.Override public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException e ) throws java.io.IOException { com.googlesource.gerrit.plugins.events.fsstore.Fs.tryDelete ( dir ) ; return java.nio.file.FileVisitResult.CONTINUE ; } } ) ; } catch ( java.io.IOException e ) { } }

Target:
public static boolean tryRecursiveDelete ( java.nio.file.Path dir ) { try { java.nio.file.Files.walkFileTree ( dir , new java.nio.file.SimpleFileVisitor < java.nio.file.Path > ( ) { @ java.lang.Override public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { com.googlesource.gerrit.plugins.events.fsstore.Fs.tryDelete ( file ) ; return java.nio.file.FileVisitResult.CONTINUE ; } @ java.lang.Override public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException e ) throws java.io.IOException { com.googlesource.gerrit.plugins.events.fsstore.Fs.tryDelete ( dir ) ; return java.nio.file.FileVisitResult.CONTINUE ; } } ) ; } catch ( java.io.IOException e ) { } return ! ( java.nio.file.Files.exists ( dir ) ) ; }
Source:
private static java.lang.String optdef ( final org.spearce.jgit.lib.Config c , final java.lang.String n , final java.lang.String d ) { final java.lang.String v = c.getString ( "ldap" , null , n ) ; if ( v == null ) { return d ; } else if ( "" . equals ( v ) ) { return null ; } else { return v ; } }

Target:
private static java.lang.String optdef ( final org.spearce.jgit.lib.Config c , final java.lang.String n , final java.lang.String d ) { final java.lang.String [ ] v = c.getStringList ( "ldap" , null , n ) ; if ( ( v == null ) || ( ( v.length ) == 0 ) ) { return d ; } else if ( ( ( v [ 0 ] ) == null ) || ( "" . equals ( v [ 0 ] ) ) ) { return null ; } else { return v [ 0 ] ; } }
Source:
public static UnifiedPatchScreen.TopView getPatchScreenTopView ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) == null ) { return null ; } return com.google.gerrit.client.Gerrit.patchScreen.getTopView ( ) ; }

Target:
private void setXsrfToken ( ) { com.google.gerrit.client.Gerrit.xGerritAuth = com.google.gwt.user.client.Cookies.getCookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME ) ; com.google.gwtjsonrpc.client.JsonUtil.setDefaultXsrfManager ( new com.google.gwtjsonrpc.client.XsrfManager ( ) { @ java.lang.Override public java.lang.String getToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy ) { return com.google.gerrit.client.Gerrit.xGerritAuth ; } @ java.lang.Override public void setToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy , java.lang.String token ) { } } ) ; }
Source:
private void showResultSet ( final java.sql.ResultSet rs , boolean alreadyOnRow , long start , com.googlesource.gerrit.plugins.verifystatus.commands.VerifyStatusQueryShell.Function ... show ) throws java.sql.SQLException { switch ( outputFormat ) { case JSON_SINGLE : case JSON : showResultSetJson ( rs , alreadyOnRow , start , show ) ; break ; case PRETTY : default : showResultSetPretty ( rs , alreadyOnRow , start , show ) ; break ; } }

Target:
private void showResultSet ( final java.sql.ResultSet rs , boolean alreadyOnRow , long start , com.googlesource.gerrit.plugins.verifystatus.VerifyStatusQueryShell.Function ... show ) throws java.sql.SQLException { switch ( outputFormat ) { case JSON_SINGLE : case JSON : showResultSetJson ( rs , alreadyOnRow , start , show ) ; break ; case PRETTY : default : showResultSetPretty ( rs , alreadyOnRow , start , show ) ; break ; } }
Source:
public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }

Target:
public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }
Source:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , null , false ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , null , false ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { writeError ( "warning" , e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }
Source:
public void noPlugins ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( gApi.plugins ( ) . list ( ) . get ( ) ) . isEmpty ( ) ; }

Target:
public void list ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( gApi.plugins ( ) . list ( ) . get ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( gApi.plugins ( ) . list ( ) . all ( ) . get ( ) ) . isEmpty ( ) ; }
Source:
public boolean canUpdate ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( getProjectControl ( ) . isOwner ( ) ) ) ) { return false ; } return canPerform ( Permission.PUSH ) ; }

Target:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( com.google.gerrit.server.patch.PatchListKey.eq ( oldId , k.oldId ) ) && ( com.google.gerrit.server.patch.PatchListKey.eq ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( oldIdName ) != null ? oldIdName.equals ( k.oldIdName ) : ( ( ( k.oldIdName ) == null ) && ( newIdName.equals ( k.newIdName ) ) ) && ( ( getWhitespace ( ) ) == ( k.getWhitespace ( ) ) ) ; } return false ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.project.ProjectState > i : getWriteIndexes ( ) ) { i.replace ( projectCache.get ( nameKey ) ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { for ( com.google.gerrit.index.Index < ? , com.google.gerrit.server.project.ProjectData > i : getWriteIndexes ( ) ) { i.replace ( projectCache.get ( nameKey ) . toProjectData ( ) ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; }
Source:
protected < V > java.util.concurrent.RunnableScheduledFuture < V > decorateTask ( final java.lang.Runnable runnable , final java.util.concurrent.RunnableScheduledFuture < V > task ) { return new com.google.gerrit.server.git.WorkQueue.Task < V > ( runnable , super . decorateTask ( runnable , task ) ) ; }

Target:
protected < V > java.util.concurrent.RunnableScheduledFuture < V > decorateTask ( final java.lang.Runnable runnable , java.util.concurrent.RunnableScheduledFuture < V > r ) { r = super . decorateTask ( runnable , r ) ; for ( ; ; ) { final int id = idGenerator.next ( ) ; final com.google.gerrit.server.git.WorkQueue.Task < V > task = new com.google.gerrit.server.git.WorkQueue.Task < V > ( runnable , r , this , id ) ; if ( ( all.putIfAbsent ( task.getTaskId ( ) , task ) ) == null ) { return task ; } } }
Source:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setWidget ( row , 1 , new com.google.gwt.user.client.ui.InlineHTML ( com.google.gerrit.client.ui.Util.highlight ( k.name ( ) , toHighlight ) ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { populateState ( row , k ) ; table.setWidget ( row , ProjectsTable.C_NAME , new com.google.gwt.user.client.ui.InlineHTML ( com.google.gerrit.client.ui.Util.highlight ( k.name ( ) , toHighlight ) ) ) ; table.setText ( row , ProjectsTable.C_DESCRIPTION , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
public void run ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { commentManager.getSideBySide2 ( ) . resizePaddingOnOtherSide ( commentManager.getSideBySide2 ( ) . getSideFromCm ( cm ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }

Target:
public void run ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { commentManager.getSideBySide2 ( ) . getChunkManager ( ) . resizePaddingOnOtherSide ( cm.side ( ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }
Source:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen ( changeId , b , rev , openReplyBox , FileTable.Mode.REVIEW ) ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , base.asString ( ) , rev ) , new com.google.gerrit.client.change.ChangeScreen ( changeId , base , rev , openReplyBox , FileTable.Mode.REVIEW ) ) ; }
Source:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; org.junit.Assert.assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; org.junit.Assert.assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
public void setMinusOne ( java.lang.String project , int number , java.lang.String commentTemplate ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.ReviewInput message = createComment ( commentTemplate ) . label ( "Code-Review" , ( - 1 ) ) ; applyComment ( project , number , message ) ; }

Target:
public void setMinusOne ( java.lang.String project , int number , java.lang.String comment ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.ReviewInput message = createComment ( comment ) . label ( "Code-Review" , ( - 1 ) ) ; applyComment ( project , number , message ) ; }
Source:
public static java.io.File defaultFile ( javax.servlet.FilterConfig filterConfig ) { java.lang.String configPath = java.lang.System.getProperty ( com.google.gitiles.GitilesConfig.PROPERTY_NAME , com.google.gitiles.GitilesConfig.DEFAULT_PATH ) ; if ( ( configPath == null ) && ( filterConfig != null ) ) { configPath = filterConfig.getInitParameter ( com.google.gitiles.GitilesConfig.FILTER_CONFIG_PARAM ) ; } return new java.io.File ( configPath ) ; }

Target:
public static java.io.File defaultFile ( javax.servlet.FilterConfig filterConfig ) { java.lang.String configPath = java.lang.System.getProperty ( com.google.gitiles.GitilesConfig.PROPERTY_NAME , com.google.gitiles.GitilesConfig.DEFAULT_PATH ) ; if ( ( configPath == null ) && ( filterConfig != null ) ) { configPath = filterConfig.getInitParameter ( com.google.gitiles.GitilesConfig.FILTER_CONFIG_PARAM ) ; } com.google.common.base.Preconditions.checkNotNull ( configPath ) ; return new java.io.File ( configPath ) ; }
Source:
public void deleteFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeEditResource changeEditResource = getOrCreateChangeEditResource ( filePath ) ; changeEditDeleteContent.apply ( changeEditResource , null ) ; } catch ( java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete file of change edit" , e ) ; } }

Target:
public void deleteFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { changeEditDeleteContent.apply ( changeResource.getControl ( ) , filePath ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete file of change edit" , e ) ; } }
Source:
public void unblockMoreSpecificRefInLocalWithExclusiveFlag_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockMoreSpecificRefInLocalWithExclusiveFlag_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
public void setDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.SetDashboardInput input = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; input.id = id ; try { set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( project.getControl ( ) ) , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set default dashboard" , e ) ; } }

Target:
public void setDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.SetDashboardInput input = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; input.id = id ; try { set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( project.getControl ( ) ) , input ) ; } catch ( java.lang.Exception e ) { java.lang.String msg = java.lang.String.format ( "Cannot %s default dashboard" , ( ( id ) != null ? "set" : "remove" ) ) ; throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( msg , e ) ; } }
Source:
public void onFailure ( java.lang.Throwable err ) { getTab ( ) . setTitle ( Resources.M.conflictingChanges ( "na" ) ) ; getTab ( ) . setError ( err.getMessage ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( ( result.length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.cherryPicks ( result.length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , convertChangeList ( result ) ) ; } }
Source:
private org.eclipse.jgit.lib.RefUpdate createRefUpdate ( org.eclipse.jgit.lib.ObjectId newObjectId , org.eclipse.jgit.lib.ObjectId expectedOldObjectId ) throws java.io.IOException { org.eclipse.jgit.lib.RefUpdate refUpdate = db.updateRef ( com.google.gerrit.server.git.GitRepositoryManager.REFS_NOTES_REVIEW ) ; refUpdate.setNewObjectId ( newObjectId ) ; if ( expectedOldObjectId == null ) { refUpdate.setExpectedOldObjectId ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } else { refUpdate.setExpectedOldObjectId ( expectedOldObjectId ) ; } return refUpdate ; }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.ObjectId commit ) throws com.google.gerrit.server.git.CodeReviewNoteCreationException , java.io.IOException { if ( ! ( commit instanceof org.eclipse.jgit.revwalk.RevCommit ) ) { commit = revWalk.parseCommit ( commit ) ; } return createNoteContent ( change , ( ( org.eclipse.jgit.revwalk.RevCommit ) ( commit ) ) ) ; }
Source:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testutil.FakeEmailSender.Message.create ( from , rcpt , headers , body , htmlBody ) ) ; }

Target:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testing.FakeEmailSender.Message.create ( from , rcpt , headers , body , htmlBody ) ) ; }
Source:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.server.project.SetHead.Input input = new com.google.gerrit.server.project.SetHead.Input ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project , user ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.HeadInput input = new com.google.gerrit.extensions.common.HeadInput ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project , user ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }
Source:
protected org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > createProject ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.project.CreateProject create = projectFactory.create ( name ) ; create.apply ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.TLR , new com.google.gerrit.server.project.CreateProject.Input ( ) ) ; return new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > ( repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > createProject ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.project.CreateProject create = projectFactory.create ( name ) ; create.apply ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.TLR , new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ) ; return new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > ( repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ) ; }
Source:
private void assertListBlock ( java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > list , int index , int itemIndex , java.lang.String text ) { com.google.gerrit.server.mail.send.CommentFormatter.Block block = list.get ( index ) ; com.google.common.truth.Truth.assertThat ( block.type ) . isEqualTo ( BlockType.LIST ) ; com.google.common.truth.Truth.assertThat ( block.items.get ( itemIndex ) ) . isEqualTo ( text ) ; com.google.common.truth.Truth.assertThat ( block.text ) . isNull ( ) ; }

Target:
private void assertListBlock ( java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > list , int index , int itemIndex , java.lang.String text ) { com.google.gerrit.server.mail.send.CommentFormatter.Block block = list.get ( index ) ; com.google.common.truth.Truth.assertThat ( block.type ) . isEqualTo ( BlockType.LIST ) ; com.google.common.truth.Truth.assertThat ( block.items.get ( itemIndex ) ) . isEqualTo ( text ) ; com.google.common.truth.Truth.assertThat ( block.text ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( block.quotedBlocks ) . isNull ( ) ; }
Source:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { return ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.content_type ( ) ) != null ) ? net.codemirror.lib.ModeInjector.getContentType ( meta.content_type ( ) ) : null ; }

Target:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.content_type ( ) ) != null ) ) { net.codemirror.mode.ModeInfo m = net.codemirror.mode.ModeInfo.findMode ( meta.content_type ( ) , path ) ; return m != null ? m.mime ( ) : null ; } return null ; }
Source:
public void absolutePath ( ) { com.google.gitiles.doc.MarkdownToHtml md = new com.google.gitiles.doc.MarkdownToHtml ( view , config , "index.md" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/" ) ) . isEqualTo ( "/g/repo/+/HEAD/" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/index.md" ) ) . isEqualTo ( "/g/repo/+/HEAD/index.md" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/doc/index.md" ) ) . isEqualTo ( "/g/repo/+/HEAD/doc/index.md" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/doc/" ) ) . isEqualTo ( "/g/repo/+/HEAD/doc" ) ; }

Target:
public void absolutePath ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/" ) ) . isEqualTo ( "/g/repo/+/HEAD/" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/index.md" ) ) . isEqualTo ( "/g/repo/+/HEAD/index.md" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/doc/index.md" ) ) . isEqualTo ( "/g/repo/+/HEAD/doc/index.md" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "/doc/" ) ) . isEqualTo ( "/g/repo/+/HEAD/doc" ) ; }
Source:
private boolean requestRegistration ( final org.openid4java.message.AuthRequest aReq ) { if ( AuthRequest.SELECT_ID.equals ( aReq.getIdentity ( ) ) ) { return true ; } try { return ! ( accountManager.exists ( aReq.getIdentity ( ) ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { com.google.gerrit.server.openid.OpenIdServiceImpl.log.warn ( "Cannot determine if user account exists" , e ) ; return true ; } }

Target:
private boolean requestRegistration ( final org.openid4java.message.AuthRequest aReq ) { if ( AuthRequest.SELECT_ID.equals ( aReq.getIdentity ( ) ) ) { return true ; } try { return ( accountManager.lookup ( aReq.getIdentity ( ) ) ) == null ; } catch ( com.google.gerrit.server.account.AccountException e ) { com.google.gerrit.server.openid.OpenIdServiceImpl.log.warn ( "Cannot determine if user account exists" , e ) ; return true ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( com.google.gerrit.server.edit.ChangeEdit edit , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit parentCommit = commit.getParent ( 0 ) ; com.google.gerrit.reviewdb.client.RevId parentRev = new com.google.gerrit.reviewdb.client.RevId ( org.eclipse.jgit.lib.ObjectId.toString ( parentCommit.getId ( ) ) ) ; try { return com.google.common.collect.Iterables.getOnlyElement ( db.get ( ) . patchSets ( ) . byRevision ( parentRev ) . toList ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( com.google.gerrit.server.edit.ChangeEdit edit ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { return getBasePatchSet ( edit , rw.parseCommit ( edit.getRef ( ) . getObjectId ( ) ) ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }
Source:
private void pushTagDeletion ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType , java.lang.String tagRef , org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus ) throws java.lang.Exception { org.eclipse.jgit.transport.PushResult r = com.google.gerrit.acceptance.GitUtil.deleteRef ( testRepo , tagRef ) ; org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = r.getRemoteUpdate ( tagRef ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . named ( tagType.name ( ) ) . isEqualTo ( expectedStatus ) ; }

Target:
private void fastForwardTagToExistingCommit ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType , java.lang.String tagName , org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus ) throws java.lang.Exception { pushTag ( tagType , tagName , false , expectedStatus ) ; }
Source:
public final java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project ) { if ( ! ( commandAllowed ) ) { return null ; } if ( ( ( ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.SshScheme ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.HttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousHttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousGitScheme ) ) { return getCommand ( scheme.getUrl ( project ) ) ; } else { return null ; } }

Target:
public final java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ! ( commandAllowed ) ) { return null ; } if ( ( ( ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.SshScheme ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.HttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.AnonymousHttpScheme ) ) || ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.GitScheme ) ) { java.lang.String url = scheme.getUrl ( project ) ; if ( url != null ) { return getCommand ( url , ref ) ; } else return null ; } else { return null ; } }
Source:
private static java.util.Set < java.lang.String > query ( javax.servlet.http.HttpServletRequest req ) { java.util.Set < java.lang.String > params = com.google.common.collect.Sets.newHashSet ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( req.getQueryString ( ) ) ) ) { for ( java.lang.String kvPair : com.google.common.base.Splitter.on ( '&' ) . split ( req.getQueryString ( ) ) ) { params.add ( com.google.common.collect.Iterables.getFirst ( com.google.common.base.Splitter.on ( '=' ) . limit ( 2 ) . split ( kvPair ) , null ) ) ; } } return params ; }

Target:
private static java.util.Set < java.lang.String > query ( javax.servlet.http.HttpServletRequest req ) { java.util.Set < java.lang.String > params = new java.util.HashSet < > ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( req.getQueryString ( ) ) ) ) { for ( java.lang.String kvPair : com.google.common.base.Splitter.on ( '&' ) . split ( req.getQueryString ( ) ) ) { params.add ( com.google.common.collect.Iterables.getFirst ( com.google.common.base.Splitter.on ( '=' ) . limit ( 2 ) . split ( kvPair ) , null ) ) ; } } return params ; }
Source:
protected void setApiHeaders ( javax.servlet.http.HttpServletResponse res , java.lang.String contentType ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( contentType ) ) ) { res.setContentType ( contentType ) ; } res.setCharacterEncoding ( com.google.common.base.Charsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; res.setHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN , "*" ) ; setCacheHeaders ( res ) ; }

Target:
protected void setApiHeaders ( javax.servlet.http.HttpServletResponse res , java.lang.String contentType ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( contentType ) ) ) { res.setContentType ( contentType ) ; } res.setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; res.setHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN , "*" ) ; setCacheHeaders ( res ) ; }
Source:
public void testGetJGroupsMyUrlFromListenUrlWhenNoListenUrlSpecified ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { } ) ; exception.expect ( com.ericsson.gerrit.plugins.highavailability.ProvisionException.class ) ; exception.expectMessage ( "exactly 1 value configured; found 0" ) ; getMyUrlProvider ( ) ; }

Target:
public void testGetJGroupsMyUrlFromListenUrlWhenNoListenUrlSpecified ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { } ) ; exception.expect ( com.google.inject.ProvisionException.class ) ; exception.expectMessage ( "exactly 1 value configured; found 0" ) ; getMyUrlProvider ( ) ; }
Source:
static com.google.template.soy.data.SoyMapData getTemplateData ( java.lang.String canonicalURL , java.lang.String cdnPath ) throws java.net.URISyntaxException { java.lang.String canonicalPath = com.google.gerrit.httpd.raw.IndexServlet.computeCanonicalPath ( canonicalURL ) ; java.lang.String staticPath = "" ; if ( cdnPath != null ) { staticPath = cdnPath ; } else if ( canonicalPath != null ) { staticPath = canonicalPath ; } com.google.template.soy.data.SanitizedContent sanitizedStaticPath = com.google.template.soy.data.UnsafeSanitizedContentOrdainer.ordainAsSafe ( staticPath , SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI ) ; return new com.google.template.soy.data.SoyMapData ( "canonicalPath" , canonicalPath , "staticResourcePath" , sanitizedStaticPath ) ; }

Target:
static com.google.template.soy.data.SoyMapData getTemplateData ( java.lang.String canonicalURL , java.lang.String cdnPath , java.lang.String faviconPath ) throws java.net.URISyntaxException { java.lang.String canonicalPath = com.google.gerrit.httpd.raw.IndexServlet.computeCanonicalPath ( canonicalURL ) ; java.lang.String staticPath = "" ; if ( cdnPath != null ) { staticPath = cdnPath ; } else if ( canonicalPath != null ) { staticPath = canonicalPath ; } com.google.template.soy.data.SanitizedContent sanitizedStaticPath = com.google.template.soy.data.UnsafeSanitizedContentOrdainer.ordainAsSafe ( staticPath , SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI ) ; return new com.google.template.soy.data.SoyMapData ( "canonicalPath" , canonicalPath , "staticResourcePath" , sanitizedStaticPath , "faviconPath" , faviconPath ) ; }