auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static java.util.SortedSet < java.lang.String > validateLabels ( java.util.Set < java.lang.String > labels ) { if ( labels == null ) { return com.google.common.collect.ImmutableSortedSet.of ( ) ; } java.util.SortedSet < java.lang.String > invalidLabels = new java.util.TreeSet < > ( ) ; for ( java.lang.String label : labels ) { if ( com.google.common.base.CharMatcher.WHITESPACE.matchesAnyOf ( label ) ) { invalidLabels.add ( label ) ; } } return invalidLabels ; }

Target:
private static java.util.SortedSet < java.lang.String > validateLabels ( java.util.Set < java.lang.String > labels ) { if ( labels == null ) { return com.google.common.collect.ImmutableSortedSet.of ( ) ; } java.util.SortedSet < java.lang.String > invalidLabels = new java.util.TreeSet < > ( ) ; for ( java.lang.String label : labels ) { if ( com.google.common.base.CharMatcher.whitespace ( ) . matchesAnyOf ( label ) ) { invalidLabels.add ( label ) ; } } return invalidLabels ; }
Source:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { setKeyExchangeFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.KeyExchange > > asList ( new org.apache.sshd.server.kex.DHG14.Factory ( ) , new org.apache.sshd.server.kex.DHG1.Factory ( ) ) ) ; org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = new org.apache.sshd.common.random.BouncyCastleRandom.Factory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }

Target:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { setKeyExchangeFactories ( NamedFactory.Utils.setUpTransformedFactories ( true , java.util.Collections.unmodifiableList ( java.util.Arrays.asList ( BuiltinDHFactories.dhg14 , BuiltinDHFactories.dhg1 ) ) , ServerBuilder.DH2KEX ) ) ; org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }
Source:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.vmware.gerrit.owners.common.PathOwners ( accounts , repository , patchList ) ; }

Target:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; java.lang.String branch = com.google.gerrit.rules.StoredValues.getChange ( engine ) . getDest ( ) . get ( ) ; return new com.vmware.gerrit.owners.common.PathOwners ( accounts , repository , branch , patchList ) ; }
Source:
void stop ( ) throws java.lang.Exception { com.google.gerrit.lifecycle.LifecycleManager manager = com.google.gerrit.acceptance.GerritServer.get ( daemon , "manager" ) ; java.lang.System.out.println ( "Gerrit Server Shutdown" ) ; manager.stop ( ) ; daemonService.shutdownNow ( ) ; daemonService.awaitTermination ( java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.acceptance.TempFileUtil.recursivelyDelete ( sitePath ) ; }

Target:
void stop ( ) throws java.lang.Exception { com.google.gerrit.lifecycle.LifecycleManager manager = com.google.gerrit.acceptance.GerritServer.get ( daemon , "manager" ) ; java.lang.System.out.println ( "Gerrit Server Shutdown" ) ; manager.stop ( ) ; daemonService.shutdownNow ( ) ; daemonService.awaitTermination ( java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.acceptance.TempFileUtil.recursivelyDelete ( sitePath ) ; org.eclipse.jgit.lib.RepositoryCache.clear ( ) ; }
Source:
private static java.lang.String getUrl ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) { java.lang.String url = cfg.getString ( "accountPatchReviewDb" , null , "url" ) ; if ( url == null ) { return com.google.gerrit.server.schema.H2.createUrl ( sitePaths.db_dir.resolve ( "account_patch_reviews" ) ) ; } return url ; }

Target:
private static java.lang.String getUrl ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) { java.lang.String url = cfg.getString ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.ACCOUNT_PATCH_REVIEW_DB , null , com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.URL ) ; if ( url == null ) { return com.google.gerrit.server.schema.H2.createUrl ( sitePaths.db_dir.resolve ( "account_patch_reviews" ) ) ; } return url ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String labelName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( project , ( ( com.google.gerrit.common.data.Permission.LABEL ) + labelName ) , com.google.gerrit.server.project.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; r.setRange ( ( - 1 ) , 1 ) ; return r ; }

Target:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String labelName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( project , ( ( com.google.gerrit.common.data.Permission.LABEL ) + labelName ) , com.google.gerrit.server.project.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; r.setRange ( min , max ) ; return r ; }
Source:
private com.google.gerrit.server.git.validators.CommitValidationMessage commitValidationFailure ( java.lang.String synopsis , java.lang.String details ) throws com.google.gerrit.server.git.validators.CommitValidationException { com.google.gerrit.server.git.validators.CommitValidationMessage ret = new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( ( synopsis + "\n" ) + details ) , false ) ; if ( ( getItsAssociationPolicy ( ) ) == ( ItsAssociationPolicy.MANDATORY ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( synopsis , java.util.Collections.singletonList ( ret ) ) ; } return ret ; }

Target:
private com.google.gerrit.server.git.validators.CommitValidationMessage commitValidationFailure ( java.lang.String synopsis , java.lang.String details ) throws com.google.gerrit.server.git.validators.CommitValidationException { com.google.gerrit.server.git.validators.CommitValidationMessage ret = new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( ( synopsis + "\n" ) + details ) , false ) ; if ( ( itsConfig.getItsAssociationPolicy ( ) ) == ( ItsAssociationPolicy.MANDATORY ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( synopsis , java.util.Collections.singletonList ( ret ) ) ; } return ret ; }
Source:
private void addSshKeys ( com.googlesource.gerrit.plugins.importer.GerritApi api , com.google.gerrit.extensions.common.AccountInfo acc ) throws com.google.gerrit.common.errors.InvalidSshKeyException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > sshKeys = api.getSshKeys ( acc.username ) ; com.google.gerrit.server.account.AccountState a = accountCache.getByUsername ( acc.username ) ; for ( com.google.gerrit.extensions.common.SshKeyInfo sshKeyInfo : sshKeys ) { authorizedKeys.addKey ( a.getAccount ( ) . getId ( ) , sshKeyInfo.sshPublicKey ) ; } }

Target:
private void addSshKeys ( com.googlesource.gerrit.plugins.importer.GerritApi api , com.google.gerrit.extensions.common.AccountInfo acc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > sshKeys = api.getSshKeys ( acc.username ) ; com.google.gerrit.server.account.AccountState a = accountCache.getByUsername ( acc.username ) ; for ( com.google.gerrit.extensions.common.SshKeyInfo sshKeyInfo : sshKeys ) { try { authorizedKeys.addKey ( a.getAccount ( ) . getId ( ) , sshKeyInfo.sshPublicKey ) ; } catch ( com.google.gerrit.common.errors.InvalidSshKeyException e ) { com.googlesource.gerrit.plugins.importer.AccountUtil.log.warn ( java.lang.String.format ( "Invalid SSH key for user %s" , acc.username ) ) ; } } }
Source:
public void onSuccess ( java.lang.Void result ) { view.getEditor ( ) . operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { java.lang.String t = newTheme.name ( ) . toLowerCase ( ) ; view.getEditor ( ) . setOption ( "theme" , t ) ; } } ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { view.setTheme ( newTheme ) ; }
Source:
private void assertProblems ( com.google.gerrit.server.git.gpg.TestKey key , java.lang.String ... expected ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( ( ( expected.length ) > 0 ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( key.getPublicKey ( ) ) . getProblems ( ) ) . containsExactly ( ( ( java.lang.Object [ ] ) ( expected ) ) ) . inOrder ( ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.testutil.TestKey key , java.lang.String ... expected ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( ( ( expected.length ) > 0 ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( key.getPublicKey ( ) ) . getProblems ( ) ) . containsExactly ( ( ( java.lang.Object [ ] ) ( expected ) ) ) . inOrder ( ) ; }
Source:
private com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context newRequestContext ( com.google.gerrit.acceptance.TestAccount account ) { return atrScope.newContext ( reviewDbProvider , new com.google.gerrit.acceptance.SshSession ( server , account ) , identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , account.getId ( ) ) ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }

Target:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }
Source:
private void deleteRef ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.server.notedb.ChangeNoteUtil.changeRefName ( change.getId ( ) ) ; org.eclipse.jgit.lib.ObjectId old = cmds.getObjectId ( repo , refName ) ; if ( old != null ) { cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; } }

Target:
private void deleteRef ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( change.getId ( ) ) ; org.eclipse.jgit.lib.ObjectId old = cmds.getObjectId ( repo , refName ) ; if ( old != null ) { cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; } }
Source:
public java.lang.String getCookieText ( final java.lang.String cookieName ) { final java.lang.String val = com.google.gwtjsonrpc.client.CookieAccess.get ( cookieName ) ; boolean ok ; try { ok = ( checkToken ( val , null ) ) != null ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { ok = false ; } return ok ? com.google.gwtjsonrpc.client.CookieAccess.getTokenText ( cookieName ) : null ; }

Target:
public java.lang.String getCookieText ( final java.lang.String cookieName ) { final java.lang.String val = com.google.gwtjsonrpc.server.ServletCookieAccess.get ( cookieName ) ; boolean ok ; try { ok = ( checkToken ( val , null ) ) != null ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { ok = false ; } return ok ? com.google.gwtjsonrpc.server.ServletCookieAccess.getTokenText ( cookieName ) : null ; }
Source:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) ) ; }

Target:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord , com.google.gerrit.client.ui.CommentLinkProcessor commentLinkProcessor ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) , commentLinkProcessor ) ; }
Source:
public void parseSubmissionId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) + "Submission-id: 1-1453387607626-96fabc25" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submission-id: 1-1453387901516-5d1e2450" ) ) ) ; }

Target:
public void parseSubmissionId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) + "Submission-id: 1-1453387607626-96fabc25" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submission-id: 1-1453387901516-5d1e2450" ) ) ) ; }
Source:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; createDraftUpdateIfNull ( ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { draftUpdate.putComment ( c ) ; } else { comments.add ( c ) ; draftUpdate.deleteComment ( c ) ; } }

Target:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment.Status status , com.google.gerrit.reviewdb.client.Comment c ) { verifyComment ( c ) ; createDraftUpdateIfNull ( ) ; if ( status == ( PatchLineComment.Status.DRAFT ) ) { draftUpdate.putComment ( c ) ; } else { comments.add ( c ) ; draftUpdate.deleteComment ( c ) ; } }
Source:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ! ( replyTo.has_line ( ) ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createLine ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; } }

Target:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ! ( replyTo.has_line ( ) ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createRange ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null , null ) ; } }
Source:
public com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.account.AccountResource , com.google.gerrit.server.account.StarredChanges.EmptyInput > create ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { try { return createProvider.get ( ) . setChange ( changes.parse ( TopLevelResource.INSTANCE , id ) ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "change %s not found" , id.get ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.StarredChanges.log.error ( "cannot resolve change" , e ) ; throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( "internal server error" ) ; } }

Target:
public com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.account.AccountResource , com.google.gerrit.server.account.StarredChanges.EmptyInput > create ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { try { return createProvider.get ( ) . setChange ( changes.parse ( TopLevelResource.INSTANCE , id ) ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "change %s not found" , id.get ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.permissions.PermissionBackendException e ) { com.google.gerrit.server.account.StarredChanges.log.error ( "cannot resolve change" , e ) ; throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( "internal server error" ) ; } }
Source:
protected static java.lang.String getShortProjectName ( java.lang.String projectName ) { int lastIndexSlash = projectName.lastIndexOf ( "/" ) ; if ( lastIndexSlash == 0 ) { return projectName.substring ( 1 ) ; } return "..." + ( projectName.substring ( ( lastIndexSlash + 1 ) ) ) ; }

Target:
protected static java.lang.String getShortProjectName ( java.lang.String projectName ) { int lastIndexSlash = projectName.lastIndexOf ( '/' ) ; if ( lastIndexSlash == 0 ) { return projectName.substring ( 1 ) ; } return "..." + ( projectName.substring ( ( lastIndexSlash + 1 ) ) ) ; }
Source:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { if ( ghLogin.login ( httpRequest , httpResponse , oauth ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.getHub ( ) . getMyOrganizations ( ) . keySet ( ) , user , ghLogin.getToken ( ) . accessToken ) ; } }

Target:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { ghLogin.login ( httpRequest , httpResponse , oauth ) ; if ( ghLogin.isLoggedIn ( ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.getHub ( ) . getMyOrganizations ( ) . keySet ( ) , user , ghLogin.getToken ( ) . accessToken ) ; } }
Source:
private void flushCache ( final java.lang.String name ) { try { getGerritServer ( ) . getCache ( name ) . removeAll ( ) ; } catch ( java.lang.Throwable e1 ) { try { err.write ( ( ( ( "warning: cannot flush cache " + name ) + ": " ) + ( err.toString ( ) ) ) . getBytes ( "UTF-8" ) ) ; } catch ( java.io.IOException e2 ) { } } }

Target:
private void flushCache ( final java.lang.String name ) { try { getGerritServer ( ) . getCache ( name ) . removeAll ( ) ; } catch ( java.lang.Throwable e1 ) { p.println ( ( ( ( "warning: cannot flush cache \"" + name ) + "\": " ) + e1 ) ) ; } }
Source:
private void evictCache ( com.google.common.cache.Cache < ? , ? > cache , java.lang.String cacheName , java.lang.Object key ) { if ( Constants.PROJECT_LIST.equals ( cacheName ) ) { cache.invalidateAll ( ) ; } else { cache.invalidate ( key ) ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.debug ( "Invalidated {}" , cacheName ) ; }

Target:
private void evictCache ( com.google.common.cache.Cache < ? , ? > cache , java.lang.String cacheName , java.lang.Object key ) { if ( Constants.PROJECT_LIST.equals ( cacheName ) ) { cache.invalidateAll ( ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.debug ( "Invalidated cache {}" , cacheName ) ; } else { cache.invalidate ( key ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.debug ( "Invalidated cache {}[{}]" , cacheName , key ) ; } }
Source:
protected void resetHtml ( final java.lang.String body ) { for ( final java.util.Iterator < com.google.gwt.user.client.ui.Widget > i = table.iterator ( ) ; i.hasNext ( ) ; ) { i.next ( ) ; i.remove ( ) ; } com.google.gwt.user.client.DOM.setInnerHTML ( table.getBodyElement ( ) , body ) ; }

Target:
protected void resetHtml ( final java.lang.String body ) { for ( final java.util.Iterator < com.google.gwt.user.client.ui.Widget > i = table.iterator ( ) ; i.hasNext ( ) ; ) { i.next ( ) ; i.remove ( ) ; } com.google.gerrit.client.ui.FancyFlexTable.impl.resetHtml ( table , body ) ; }
Source:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key , final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { }

Target:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key , final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { final boolean disk = true ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this , type ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }
Source:
protected abstract java.util.concurrent.Callable < ? > indexTask ( com.google.gerrit.server.query.change.ChangeData cd ) ;

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { new com.google.gerrit.server.index.ChangeIndexer.Task ( cd , true ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }
Source:
public com.google.gerrit.server.git.InsertException apply ( java.lang.Exception input ) { if ( input instanceof com.google.gwtorm.server.OrmException ) { return new com.google.gerrit.server.git.InsertException ( "ORM error" , input ) ; } if ( input instanceof java.io.IOException ) { return new com.google.gerrit.server.git.InsertException ( "IO error" , input ) ; } return new com.google.gerrit.server.git.InsertException ( "Error inserting change/patchset" , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestApiException apply ( java.lang.Exception input ) { if ( input instanceof com.google.gerrit.extensions.restapi.RestApiException ) { return ( ( com.google.gerrit.extensions.restapi.RestApiException ) ( input ) ) ; } else if ( ( input instanceof java.util.concurrent.ExecutionException ) && ( ( input.getCause ( ) ) instanceof com.google.gerrit.extensions.restapi.RestApiException ) ) { return ( ( com.google.gerrit.extensions.restapi.RestApiException ) ( input.getCause ( ) ) ) ; } return new com.google.gerrit.extensions.restapi.RestApiException ( "Error inserting change/patchset" , input ) ; }
Source:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key3 = com.google.gerrit.server.git.gpg.TestKey.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key (" + ( com.google.gerrit.server.git.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + "):\n Key is expired" ) ) ; }

Target:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKey.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key (" + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + "):\n Key is expired" ) ) ; }
Source:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( notes , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }

Target:
public void emptyPermissionRangeKeepsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) ) , norm.normalize ( notes , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }
Source:
private void padLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.closeTd ( ) ; }

Target:
private void padLineNumberForSideA ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; m.closeTd ( ) ; }
Source:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace w ) { switch ( w ) { default : case IGNORE_NONE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.NONE ) ; case IGNORE_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.TRAILING ) ; case IGNORE_LEADING_AND_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.CHANGED ) ; case IGNORE_ALL : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.ALL ) ; } }

Target:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace w ) { if ( ( w != null ) && ( w != ( com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_ALL ) ) ) { call.addParameter ( "whitespace" , w ) ; } return this ; }
Source:
public void addGroupMember ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > foundGroup = groups.get ( db , groupUuid ) ; if ( ! ( foundGroup.isPresent ( ) ) ) { return ; } com.google.gerrit.reviewdb.client.AccountGroup group = foundGroup.get ( ) ; addGroupMembers ( db , group , com.google.common.collect.ImmutableSet.of ( accountId ) ) ; }

Target:
public void setCurrentUser ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.IdentifiedUser currentUser ) { this . currentUser = currentUser ; setCommitterIdent ( currentUser ) ; }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort , org.eclipse.jgit.revwalk.RevCommit initialTip ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , initialTip , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
private void publishDrafts ( com.google.gerrit.acceptance.TestAccount account , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.ReviewInput rin = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; rin.drafts = ReviewInput.DraftHandling.PUBLISH_ALL_REVISIONS ; com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context old = setApiUser ( account ) ; try { gApi.changes ( ) . id ( id.get ( ) ) . current ( ) . review ( rin ) ; } finally { atrScope.set ( old ) ; } }

Target:
private void publishDrafts ( com.google.gerrit.acceptance.TestAccount account , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.ReviewInput rin = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; rin.drafts = com.google.gerrit.extensions.api.changes.ReviewInput.DraftHandling.PUBLISH_ALL_REVISIONS ; com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context old = setApiUser ( account ) ; try { gApi.changes ( ) . id ( id.get ( ) ) . current ( ) . review ( rin ) ; } finally { atrScope.set ( old ) ; } }
Source:
private org.apache.velocity.VelocityContext getVelocityContext ( java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > properties ) { org.apache.velocity.VelocityContext velocityContext = new org.apache.velocity.VelocityContext ( ) ; for ( com.googlesource.gerrit.plugins.hooks.workflow.Property property : properties ) { java.lang.String key = property.getKey ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( key ) ) ) { java.lang.String value = property.getValue ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( value ) ) ) { velocityContext.put ( key , value ) ; } } } return velocityContext ; }

Target:
private org.apache.velocity.VelocityContext getVelocityContext ( java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > properties ) { org.apache.velocity.VelocityContext velocityContext = new org.apache.velocity.VelocityContext ( ) ; for ( com.googlesource.gerrit.plugins.hooks.workflow.Property property : properties ) { java.lang.String key = property.getKey ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( key ) ) ) { java.lang.String value = property.getValue ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( value ) ) ) { velocityContext.put ( key , value ) ; } } } velocityContext.put ( "its" , new com.googlesource.gerrit.plugins.hooks.workflow.action.AddVelocityComment.VelocityAdapterItsFacade ( its ) ) ; return velocityContext ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gerrit.client.ui.PatchLink.SideBySide link = new com.google.gerrit.client.ui.PatchLink.SideBySide ( p.getFileName ( ) , p.getKey ( ) , 0 , null , null ) ; com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( link.getTargetHistoryToken ( ) ) ) , "_blank" , null ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( com.google.gerrit.client.Dispatcher.toPatchSideBySide ( p.getKey ( ) ) ) ) , "_blank" , null ) ; } }
Source:
public void visit ( org.pegdown.ast.WikiLinkNode node ) { java.lang.String text = node.getText ( ) ; java.lang.String path = ( text.replace ( ' ' , '-' ) ) + ".md" ; html.open ( "a" ) . attribute ( "href" , path ) . appendAndEscape ( text ) . close ( "a" ) ; }

Target:
public void visit ( org.pegdown.ast.WikiLinkNode node ) { java.lang.String text = node.getText ( ) ; java.lang.String path = ( text.replace ( ' ' , '-' ) ) + ".md" ; html.open ( "a" ) . attribute ( "href" , href ( path ) ) . appendAndEscape ( text ) . close ( "a" ) ; }
Source:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , whitespace ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , BaseParser.ANY , body.append ( matchedChar ( ) ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( ( ( com.google.gitiles.doc.DivNode.Style ) ( pop ( ) ) ) , parse ( body ) . getChildren ( ) ) ) ) ; }

Target:
public org.parboiled.Rule cols ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( colsTag ( ) , Newline ( ) , oneOrMore ( testNot ( colsTag ( ) , Newline ( ) ) , Line ( body ) ) , colsTag ( ) , Newline ( ) , push ( new com.google.gitiles.doc.ColsNode ( parse ( body ) ) ) ) ; }
Source:
PatchSet.Id getPatchSetIdFromSide ( com.google.gerrit.client.diff.DisplaySide side ) { if ( ( ( side == ( DisplaySide.A ) ) && ( ( base ) != null ) ) && ( ( base.get ( ) ) >= 0 ) ) { return base ; } return revision ; }

Target:
com.google.gerrit.client.diff.DisplaySide displaySide ( com.google.gerrit.client.changes.CommentInfo info , com.google.gerrit.client.diff.DisplaySide forSide ) { if ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ) { return ( base.isBaseOrAutoMerge ( ) ) || ( base.isParent ( ) ) ? DisplaySide.A : null ; } return forSide ; }
Source:
public java.lang.String toRefName ( ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.PatchSet.REFS_CHANGES ) ; int change = changeId.get ( ) ; int m = change % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( change ) ; r.append ( '/' ) ; r.append ( patchSetId ) ; return r.toString ( ) ; }

Target:
public java.lang.String toRefName ( ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; int change = changeId.get ( ) ; int m = change % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( change ) ; r.append ( '/' ) ; r.append ( patchSetId ) ; return r.toString ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; user1 = user ( "user1" , "First1 Last1" , group1 ) ; user2 = user ( "user2" , "First2 Last2" , group2 ) ; user3 = user ( "user3" , "First3 Last3" , group1 , group2 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; user1 = user ( "user1" , "First1 Last1" , group1 ) ; user2 = user ( "user2" , "First2 Last2" , group2 ) ; user3 = user ( "user3" , "First3 Last3" , group1 , group2 ) ; user4 = user ( "jdoe" , "John Doe" , "JDOE" ) ; }
Source:
private static boolean hasNoHttpd ( java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) != null ) ; } }

Target:
private static boolean has ( java.lang.Class < ? extends java.lang.annotation.Annotation > annotation , java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( annotation ) ) != null ) { return true ; } } return false ; }
Source:
public static java.lang.String name ( com.google.gerrit.client.changes.AccountInfo ai ) { if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } java.lang.String email = ai.email ( ) ; if ( email != null ) { int at = email.indexOf ( '@' ) ; return 0 < at ? email.substring ( 0 , at ) : email ; } return com.google.gerrit.client.FormatUtil.nameEmail ( ai ) ; }

Target:
public static java.lang.String name ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } java.lang.String email = ai.email ( ) ; if ( email != null ) { int at = email.indexOf ( '@' ) ; return 0 < at ? email.substring ( 0 , at ) : email ; } return com.google.gerrit.client.FormatUtil.nameEmail ( ai ) ; }
Source:
private void setSubmitType ( final com.google.gerrit.extensions.common.SubmitType newSubmitType ) { int index = - 1 ; if ( ( submitType ) != null ) { for ( int i = 0 ; i < ( submitType.getItemCount ( ) ) ; i ++ ) { if ( newSubmitType.name ( ) . equals ( submitType.getValue ( i ) ) ) { index = i ; break ; } } submitType.setSelectedIndex ( index ) ; setEnabledForUseContentMerge ( ) ; } }

Target:
private void setSubmitType ( final com.google.gerrit.extensions.client.SubmitType newSubmitType ) { int index = - 1 ; if ( ( submitType ) != null ) { for ( int i = 0 ; i < ( submitType.getItemCount ( ) ) ; i ++ ) { if ( newSubmitType.name ( ) . equals ( submitType.getValue ( i ) ) ) { index = i ; break ; } } submitType.setSelectedIndex ( index ) ; setEnabledForUseContentMerge ( ) ; } }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
public void run ( ) { if ( prefs.renderEntireFile ( ) ) { return ; } net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.eventslog.EventQueue.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.eventslog.EventHandler.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.ericsson.gerrit.plugins.eventslog.EventQueue.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.eventslog.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.eventslog.EventQueue.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.eventslog.EventHandler.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.ericsson.gerrit.plugins.eventslog.EventQueue.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.events.EventListener.class ) . to ( com.ericsson.gerrit.plugins.eventslog.EventHandler.class ) ; }
Source:
public com.google.gerrit.server.events.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.PatchLineComment c ) { com.google.gerrit.server.events.PatchSetCommentAttribute a = new com.google.gerrit.server.events.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; p.createdOn = ( patchSet.getCreatedOn ( ) . getTime ( ) ) / 1000L ; return p ; }
Source:
private void doDeleteRefRights ( final java.util.HashSet < com.google.gerrit.reviewdb.RefRight.Key > refRightIds ) { if ( ! ( refRightIds.isEmpty ( ) ) ) { Util.PROJECT_SVC.deleteRight ( getProjectKey ( ) , refRightIds , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ProjectDetail > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { display ( result ) ; } } ) ; } }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectAcceess ( getProjectKey ( ) ) ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { validate ( ctx ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , patchSet.getId ( ) ) ; change.setCurrentPatchSet ( patchSetInfo ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } if ( ( updateRefCommand ) == null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , psId.toRefName ( ) ) ) ; } else { ctx.addRefUpdate ( updateRefCommand ) ; } }
Source:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } return "jdbc:h2:" + ( site.resolve ( database ) . toUri ( ) . toString ( ) ) ; }

Target:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } return com.google.gerrit.server.schema.H2.createUrl ( site.resolve ( database ) ) ; }
Source:
public void nonExistingVersion ( ) { int nonExistingVersion = ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) + 1 ; assertIllegalArgument ( java.lang.Integer.toString ( nonExistingVersion ) , ( ( ( "Index version " + nonExistingVersion ) + " that was specified by test not found. Possible versions are: " ) + ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getSchemas ( ) . keySet ( ) ) ) ) ; }

Target:
public void nonExistingVersion ( ) { int nonExistingVersion = ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) + 1 ; assertIllegalArgument ( java.lang.Integer.toString ( nonExistingVersion ) , ( ( ( "Index version " + nonExistingVersion ) + " that was specified by test not found. Possible versions are: " ) + ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getSchemas ( ) . keySet ( ) ) ) ) ; }
Source:
public static java.lang.String shard ( int id ) { if ( id < 0 ) { return null ; } java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; return r.toString ( ) ; }

Target:
private static java.lang.StringBuilder shard ( int id , java.lang.StringBuilder sb ) { int n = id % 100 ; if ( n < 10 ) { sb.append ( '0' ) ; } sb.append ( n ) ; sb.append ( '/' ) ; sb.append ( id ) ; return sb ; }