auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void whoAmI ( ) { final java.lang.String name = com.google.gerrit.client.FormatUtil.nameEmail ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; final com.google.gwt.user.client.ui.InlineLabel l = new com.google.gwt.user.client.ui.InlineLabel ( name ) ; l.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . menuBarUserName ( ) ) ; com.google.gerrit.client.Gerrit.menuRight.add ( l ) ; }

Target:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( userPopup.isShowing ( ) ) { userPopup.hide ( ) ; } else { userPopup.showRelativeTo ( l ) ; } event.preventDefault ( ) ; } }
Source:
private static java.lang.String nameOf ( java.io.File jar ) { java.lang.String name = jar.getName ( ) ; int ext = name.lastIndexOf ( '.' ) ; return 0 < ext ? name.substring ( 0 , ext ) : name ; }

Target:
private static java.lang.String nameOf ( java.io.File jar ) { java.lang.String name = jar.getName ( ) ; if ( name.endsWith ( ".disabled" ) ) { name = name.substring ( 0 , name.lastIndexOf ( '.' ) ) ; } int ext = name.lastIndexOf ( '.' ) ; return 0 < ext ? name.substring ( 0 , ext ) : name ; }
Source:
public void configureServlets ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( p.isDev ( ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( p.buckOut , p.unpackedWar ) ) ; } }

Target:
public void configureServlets ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( p.isDev ( ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( p.builder , p.unpackedWar ) ) ; } }
Source:
private void listen ( com.google.gerrit.server.plugins.AutoRegisterModules.ClassData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.className , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.className ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { PluginLoader.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }

Target:
private void listen ( com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.getClassName ( ) , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.getClassName ( ) ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { PluginLoader.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( runHooks ) ) { hooks.doHashtagsChangedHook ( change , ctx.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) , toAdd , toRemove , updatedHashtags , ctx.getDb ( ) ) ; } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( runHooks ) ) { hashtagsEdited.fire ( change , ctx.getUser ( ) . getAccountId ( ) , updatedHashtags , toAdd , toRemove ) ; hooks.doHashtagsChangedHook ( change , ctx.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) , toAdd , toRemove , updatedHashtags , ctx.getDb ( ) ) ; } }
Source:
java.nio.file.Path getSharedDirectory ( com.google.gerrit.server.config.PluginConfigFactory cfg , @ com.google.gerrit.extensions.annotations.PluginName java.lang.String pluginName ) throws java.io.IOException { java.lang.String sharedDirectory = com.google.common.base.Strings.emptyToNull ( cfg.getFromGerritConfig ( pluginName , true ) . getString ( "sharedDirectory" ) ) ; if ( sharedDirectory == null ) { throw new com.google.inject.ProvisionException ( "sharedDirectory must be configured" ) ; } java.nio.file.Path sharedDirectoryPath = java.nio.file.Paths.get ( sharedDirectory ) ; java.nio.file.Files.createDirectories ( sharedDirectoryPath ) ; return sharedDirectoryPath ; }

Target:
java.nio.file.Path getSharedDirectory ( com.google.gerrit.server.config.PluginConfigFactory cfg , @ com.google.gerrit.extensions.annotations.PluginName java.lang.String pluginName ) throws java.io.IOException { java.lang.String sharedDirectory = com.google.common.base.Strings.emptyToNull ( cfg.getFromGerritConfig ( pluginName , true ) . getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY ) ) ; if ( sharedDirectory == null ) { throw new com.google.inject.ProvisionException ( ( ( com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY ) + " must be configured" ) ) ; } java.nio.file.Path sharedDirectoryPath = java.nio.file.Paths.get ( sharedDirectory ) ; java.nio.file.Files.createDirectories ( sharedDirectoryPath ) ; return sharedDirectoryPath ; }
Source:
public void isDisabledForInvalidRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = anInvalidRef\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anyref" , "blockedFileExtension" ) ) . isFalse ( ) ; }

Target:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch1" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch2" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch3" , "blockedFileExtension" ) ) . isFalse ( ) ; }
Source:
protected com.google.gerrit.client.reviewdb.Project getProject ( ) { final com.google.gerrit.server.project.ProjectState r ; r = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; return r != null ? r.getProject ( ) : null ; }

Target:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.client.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( ps.getProject ( ) . getNameKey ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
private void migrateData ( java.util.List < com.google.gerrit.server.schema.SchemaVersion > pending , com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { for ( com.google.gerrit.server.schema.SchemaVersion v : pending ) { ui.message ( java.lang.String.format ( "Migrating data to schema %d ..." , v.getVersionNbr ( ) ) ) ; v.migrateData ( db , ui ) ; v.finish ( curr , db ) ; } }

Target:
private void migrateData ( java.util.List < com.google.gerrit.server.schema.SchemaVersion > pending , com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { for ( com.google.gerrit.server.schema.SchemaVersion v : pending ) { com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; ui.message ( java.lang.String.format ( "Migrating data to schema %d ..." , v.getVersionNbr ( ) ) ) ; v.migrateData ( db , ui ) ; v.finish ( curr , db ) ; ui.message ( java.lang.String.format ( "\t> Done (%.3f s)" , ( ( sw.elapsed ( java.util.concurrent.TimeUnit.MILLISECONDS ) ) / 1000.0 ) ) ) ; } }
Source:
private static void checkTimerDescription ( com.google.gerrit.metrics.Description desc ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isGauge ( ) ) ) , "timer must not be a gauge" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isRate ( ) ) ) , "timer must not be a rate" ) ; com.google.common.base.Preconditions.checkArgument ( desc.isCumulative ( ) , "timer must be cumulative" ) ; com.google.common.base.Preconditions.checkArgument ( ( ( desc.getTimeUnit ( ) ) != null ) , "timer must have a unit" ) ; }

Target:
private static void checkTimerDescription ( com.google.gerrit.metrics.Description desc ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isConstant ( ) ) ) , "timer must not be constant" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isGauge ( ) ) ) , "timer must not be a gauge" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isRate ( ) ) ) , "timer must not be a rate" ) ; com.google.common.base.Preconditions.checkArgument ( desc.isCumulative ( ) , "timer must be cumulative" ) ; com.google.common.base.Preconditions.checkArgument ( ( ( desc.getTimeUnit ( ) ) != null ) , "timer must have a unit" ) ; }
Source:
private static java.lang.String authorName ( com.google.gerrit.client.changes.CommentInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.getConfig ( ) . getAnonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }

Target:
private static java.lang.String authorName ( com.google.gerrit.client.changes.CommentInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.info ( ) . user ( ) . anonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }
Source:
public void withDuplicateSystemGroupCaseSensitiveName_Conflict ( ) throws java.lang.Exception { java.lang.String newGroupName = "Registered Users" ; adminSshSession.exec ( ( "gerrit create-group " + newGroupName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isTrue ( ) ; }

Target:
public void withDuplicateSystemGroupCaseSensitiveName_Conflict ( ) throws java.lang.Exception { java.lang.String newGroupName = "Registered Users" ; adminSshSession.exec ( ( ( "gerrit create-group '" + newGroupName ) + "'" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( adminSshSession.getError ( ) ) . isEqualTo ( ( ( "fatal: group '" + newGroupName ) + "\' already exists\n" ) ) ; }
Source:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Accounts accounts , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( accountCache , accounts , dbKey , repository , project , branch , changeData.currentFilePaths ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( accountCache , emails , dbKey , repository , project , branch , changeData.currentFilePaths ( ) ) ; }
Source:
public void modifyCommitMessage ( java.lang.String newCommitMessage ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.ChangeEdits.EditMessage.Input input = new com.google.gerrit.server.change.ChangeEdits.EditMessage.Input ( ) ; input.message = newCommitMessage ; try { modifyChangeEditCommitMessage.apply ( changeResource , input ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot modify commit message of change edit" , e ) ; } }

Target:
public void modifyCommitMessage ( java.lang.String newCommitMessage ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.ChangeEdits.EditMessage.Input input = new com.google.gerrit.server.change.ChangeEdits.EditMessage.Input ( ) ; input.message = newCommitMessage ; try { modifyChangeEditCommitMessage.apply ( changeResource , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot modify commit message of change edit" , e ) ; } }
Source:
public void commitWhoseParentIsUninterestingGetsNewGroup ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit branchTip = tr.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit a = tr.commit ( ) . parent ( branchTip ) . create ( ) ; com.google.common.collect.Multimap < org.eclipse.jgit.lib.ObjectId , java.lang.String > groups = com.google.gerrit.server.git.GroupCollectorTest.collectGroups ( newWalk ( a , branchTip ) , com.google.gerrit.server.git.GroupCollectorTest.patchSets ( ) , com.google.gerrit.server.git.GroupCollectorTest.groups ( ) ) ; com.google.common.truth.Truth.assertThat ( groups ) . containsEntry ( a , a.name ( ) ) ; }

Target:
public void commitWhoseParentIsUninterestingGetsNewGroup ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit branchTip = tr.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit a = tr.commit ( ) . parent ( branchTip ) . create ( ) ; com.google.common.collect.SortedSetMultimap < org.eclipse.jgit.lib.ObjectId , java.lang.String > groups = com.google.gerrit.server.git.GroupCollectorTest.collectGroups ( newWalk ( a , branchTip ) , com.google.gerrit.server.git.GroupCollectorTest.patchSets ( ) , com.google.gerrit.server.git.GroupCollectorTest.groups ( ) ) ; com.google.common.truth.Truth.assertThat ( groups ) . containsEntry ( a , a.name ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > loadIncludes ( ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > groups = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById m : db.accountGroupById ( ) . byGroup ( groupId ) ) { if ( control.canSeeGroup ( ) ) { groups.add ( m ) ; } } return groups ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > loadIncludes ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( control.canSeeGroup ( ) ) ) { return com.google.common.collect.ImmutableList.of ( ) ; } java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > groups = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById m : db.accountGroupById ( ) . byGroup ( groupId ) ) { groups.add ( m ) ; } return groups ; }
Source:
public static java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey proj , com.google.gerrit.reviewdb.Change.Status status ) { switch ( status ) { case ABANDONED : return ( "project,abandoned," + ( proj.toString ( ) ) ) + ",n,z" ; case MERGED : return ( "project,merged," + ( proj.toString ( ) ) ) + ",n,z" ; case NEW : case SUBMITTED : default : return ( "project,open," + ( proj.toString ( ) ) ) + ",n,z" ; } }

Target:
public static java.lang.String projectQuery ( com.google.gerrit.reviewdb.Project.NameKey proj , com.google.gerrit.reviewdb.Change.Status status ) { switch ( status ) { case ABANDONED : return "status:abandoned " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case MERGED : return "status:merged " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case NEW : case SUBMITTED : default : return "status:open " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; } }
Source:
private org.eclipse.jgit.lib.Repository getRepo ( final com.google.gerrit.reviewdb.Change change ) { try { return repoManager.openRepository ( change.getProject ( ) . get ( ) ) ; } catch ( java.lang.Exception ex ) { return null ; } }

Target:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Change change ) { com.google.gerrit.reviewdb.Project.NameKey name = change.getProject ( ) ; try { return repoManager.openRepository ( name.get ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }
Source:
private void reindexChanges ( ) throws java.io.IOException { com.google.gerrit.server.index.ChangeIndexer.allAsList ( indexFutures ) . checkedGet ( ) ; }

Target:
private void executeUpdateRepo ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { com.google.gerrit.server.git.BatchUpdate.RepoContext ctx = new com.google.gerrit.server.git.BatchUpdate.RepoContext ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.updateRepo ( ctx ) ; } if ( ( inserter ) != null ) { inserter.flush ( ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e , com.google.gerrit.extensions.restapi.RestApiException.class ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }
Source:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { e.printStackTrace ( ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }

Target:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . project = info.projectNameKey ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . project = info.projectNameKey ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; assigneeSuggestOracle.setChange ( info ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
private java.lang.String configurationToString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( "Supermanifest config (" ) . append ( config.size ( ) ) . append ( ") {\n" ) ; for ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.ConfigEntry c : config ) { b.append ( " " ) . append ( c ) . append ( "\n" ) ; } b.append ( "}\n" ) ; return b.toString ( ) ; }

Target:
private java.lang.String configurationToString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( "Supermanifest config (" ) . append ( config.size ( ) ) . append ( ") {\n" ) ; for ( com.googlesource.gerrit.plugins.supermanifest.ConfigEntry c : config ) { b.append ( " " ) . append ( c ) . append ( "\n" ) ; } b.append ( "}\n" ) ; return b.toString ( ) ; }
Source:
public org.kohsuke.github.GitHub login ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken authToken ) throws java.io.IOException { this . token = authToken ; this . hub = org.kohsuke.github.GitHub.connectUsingOAuth ( authToken.access_token ) ; this . myself = hub.getMyself ( ) ; return this . hub ; }

Target:
public org.kohsuke.github.GitHub login ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken authToken ) throws java.io.IOException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.debug ( "Logging in using access token {}" , authToken.access_token ) ; this . token = authToken ; this . hub = org.kohsuke.github.GitHub.connectUsingOAuth ( authToken.access_token ) ; this . myself = hub.getMyself ( ) ; return this . hub ; }
Source:
org.eclipse.jgit.lib.ObjectId getTestAgainst ( ) throws com.google.gwtorm.server.OrmException { if ( ( testAgainst ) == null ) { testAgainst = org.eclipse.jgit.lib.ObjectId.fromString ( new com.google.gerrit.server.query.change.ChangeData ( change ) . currentPatchSet ( db ) . getRevision ( ) . get ( ) ) ; } return testAgainst ; }

Target:
org.eclipse.jgit.lib.ObjectId getTestAgainst ( ) throws com.google.gwtorm.server.OrmException { if ( ( testAgainst ) == null ) { testAgainst = org.eclipse.jgit.lib.ObjectId.fromString ( changeDataFactory.create ( db.get ( ) , change ) . currentPatchSet ( ) . getRevision ( ) . get ( ) ) ; } return testAgainst ; }
Source:
public static com.google.gerrit.server.notedb.ChangeBundle fromNotes ( com.google.gerrit.server.PatchLineCommentsUtil plcUtil , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeBundle ( notes.getChange ( ) , notes.getChangeMessages ( ) , notes.getPatchSets ( ) . values ( ) , notes.getApprovals ( ) . values ( ) , com.google.common.collect.Iterables.concat ( plcUtil.draftByChange ( null , notes ) , plcUtil.publishedByChange ( null , notes ) ) ) ; }

Target:
public static com.google.gerrit.server.notedb.ChangeBundle fromNotes ( com.google.gerrit.server.PatchLineCommentsUtil plcUtil , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeBundle ( notes.getChange ( ) , notes.getChangeMessages ( ) , notes.getPatchSets ( ) . values ( ) , notes.getApprovals ( ) . values ( ) , com.google.common.collect.Iterables.concat ( plcUtil.draftByChange ( null , notes ) , plcUtil.publishedByChange ( null , notes ) ) , com.google.gerrit.server.notedb.ChangeBundle.Source.NOTE_DB ) ; }
Source:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encodeToByteString ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }

Target:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encodeToByteArray ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) ; }
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }

Target:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }
Source:
public void execute ( ) { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; }

Target:
void resizePaddingWidget ( ) { selfWidget.changed ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( getCommentInfo ( ) . side ( ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } } } ) ; }
Source:
private void display ( com.google.gerrit.reviewdb.client.AccountExternalId id ) { java.lang.String user ; java.lang.String pass ; if ( id != null ) { user = id.getSchemeRest ( ) ; pass = id.getPassword ( ) ; } else { user = null ; pass = null ; } this . id = id ; com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( user ) ; password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) { com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( null ) ; display ( ) ; } else { super . onFailure ( caught ) ; } }
Source:
public static boolean isSqlPrimitive ( final java.lang.Class < ? > type ) { if ( ( type == null ) || ( type == ( java.lang.Void.TYPE ) ) ) { return false ; } if ( type.isPrimitive ( ) ) { return true ; } if ( type == ( java.lang.String.class ) ) { return true ; } return false ; }

Target:
public static boolean isSqlPrimitive ( final java.lang.Class < ? > type ) { if ( ( type == null ) || ( type == ( java.lang.Void.TYPE ) ) ) { return false ; } if ( type.isPrimitive ( ) ) { return true ; } if ( type == ( java.lang.String.class ) ) { return true ; } if ( type == ( java.sql.Timestamp.class ) ) { return true ; } return false ; }
Source:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.restoreContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.deleteContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.base.Suppliers.ofInstance ( com.google.common.collect.ImmutableMap.of ( ) ) , com.google.common.base.Suppliers.ofInstance ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return com.google.gerrit.server.account.AccountState.forAccount ( allUsersName , account ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; if ( ( result.isEmpty ( ) ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }

Target:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.has_actions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }
Source:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( com.google.gerrit.acceptance.server.mail.DeleteReviewerSenderIT.Stager stager ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stager.stage ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = com.google.gerrit.extensions.api.changes.ReviewInput.noScore ( ) . reviewer ( extraReviewer.email ) . reviewer ( extraCcer.email , ReviewerState.CC , false ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( in ) ; return sc ; }

Target:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChangeWithExtraReviewer ( com.google.gerrit.acceptance.server.mail.DeleteReviewerSenderIT.Stager stager ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stager.stage ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = com.google.gerrit.extensions.api.changes.ReviewInput.noScore ( ) . reviewer ( extraReviewer.email ) . reviewer ( extraCcer.email , ReviewerState.CC , false ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( in ) ; return sc ; }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps , dontCopy ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , psId , rw , repoConfig , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }
Source:
protected void assertBadQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query ) throws java.lang.Exception { try { query.get ( ) ; org.junit.Assert.fail ( ( "expected BadRequestException for query: " + query ) ) ; } catch ( com.google.gerrit.extensions.restapi.BadRequestException e ) { } }

Target:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( ids.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
public int getIssuePatternGroupIndex ( ) { java.util.regex.Pattern pattern = getIssuePattern ( ) ; int groupCount = pattern.matcher ( "" ) . groupCount ( ) ; int index = gerritConfig.getInt ( pluginName , "commentlinkGroupIndex" , 1 ) ; if ( ( index < 0 ) || ( index > groupCount ) ) { index = ( groupCount == 0 ) ? 0 : 1 ; } return index ; }

Target:
public int getIssuePatternGroupIndex ( ) { java.util.regex.Pattern pattern = getIssuePattern ( ) ; int groupCount = pattern.matcher ( "" ) . groupCount ( ) ; int index = getPluginConfigInt ( "commentlinkGroupIndex" , 1 ) ; if ( ( index < 0 ) || ( index > groupCount ) ) { index = ( groupCount == 0 ) ? 0 : 1 ; } return index ; }
Source:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getChangeNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }

Target:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }
Source:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }

Target:
protected void deny ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( p ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( p , cfg ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.KEY_CHECK_SYMLINK ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reject Symbolic Links" , "false" , ProjectConfigEntry.Type.BOOLEAN , null , false , ( "Symbolic Links. Pushes of commits that include symbolic " + "links will be rejected." ) ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.KEY_CHECK_SYMLINK ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reject Symbolic Links" , "false" , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.BOOLEAN , null , false , ( "Symbolic Links. Pushes of commits that include symbolic " + "links will be rejected." ) ) ) ; }
Source:
public void changeMessageWithTrailingDoubleNewline ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing trailing double newline\n" + "\n" ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( "\n" + "Testing trailing double newline\n" ) + "\n" ) + "\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }

Target:
public void changeMessageWithTrailingDoubleNewline ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( "Testing trailing double newline\n\n" ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( "\n" + "Testing trailing double newline\n" ) + "\n" ) + "\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }
Source:
public com.google.gerrit.extensions.registration.DynamicSet < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , T newItem ) { if ( ref.compareAndSet ( item , newItem ) ) { return new ReloadableHandle ( ref , newKey , newItem ) ; } return null ; }

Target:
public com.google.gerrit.extensions.registration.DynamicSet < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { if ( ref.compareAndSet ( item , newItem ) ) { return new ReloadableHandle ( ref , newKey , newItem ) ; } return null ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupsOf ( com.google.gerrit.reviewdb.client.Account.Id account ) { return userFactory.create ( account ) . getEffectiveGroups ( ) . getKnownGroups ( ) ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupsOf ( com.google.gerrit.reviewdb.client.Account.Id account ) { return new java.util.HashSet ( com.google.common.collect.Sets.filter ( userFactory.create ( account ) . getEffectiveGroups ( ) . getKnownGroups ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID in ) { return ! ( com.google.gerrit.server.group.SystemGroupBackend.isSystemGroup ( in ) ) ; } } ) ) ; }
Source:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/config/server/tasks/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . isEmpty ( ) ; }

Target:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/config/server/tasks/" ) ; r.assertOK ( ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . isEmpty ( ) ; }
Source:
protected void doUpdate ( final java.lang.Iterable < T > instances , final com.google.gwtorm.jdbc.JdbcTransaction txn ) throws com.google.gwtorm.client.OrmException { try { if ( schema.getDialect ( ) . canDetermineIndividualBatchUpdateCounts ( ) ) { updateAsBatch ( instances ) ; } else { updateIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "update" , e ) ; } }

Target:
public void update ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { updateAsBatch ( instances ) ; } else { updateIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "update" , e ) ; } }
Source:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.UnifiedCommentManager ( this , base , revision , path , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; }

Target:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.UnifiedCommentManager ( this , base , revision , path , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; header.setupPrevNextFiles ( comments ) ; }
Source:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.number , changeMergedEvent.newRev ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.number , changeMergedEvent.newRev ) ; } else if ( event instanceof com.google.gerrit.server.events.RefUpdatedEvent ) { com.google.gerrit.server.events.RefUpdatedEvent e = ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( event ) ) ; com.google.gerrit.server.data.RefUpdateAttribute r = e.refUpdate ; refUpdatedEvents.put ( ( ( ( r.project ) + "-" ) + ( r.refName ) ) , r.newRev ) ; } }