auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK , commitExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS , historyExtensionRight , change , rev ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.project.ChangeControl ctl ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , perm , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) . forUser ( perm.user ( ) ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { if ( ( c.getStatus ( ) . isOpen ( ) ) && ( ps.getId ( ) . equals ( c.currentPatchSetId ( ) ) ) ) { c.setMergeable ( mergeable ) ; c.setLastSha1MergeTested ( com.google.gerrit.server.change.Mergeable.toRevId ( ref ) ) ; return c ; } else { return null ; } }

Target:
private static org.eclipse.jgit.lib.ObjectId toId ( com.google.gerrit.reviewdb.client.PatchSet ps ) { try { return org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { com.google.gerrit.server.change.Mergeable.log.error ( ( "Invalid revision on patch set " + ps ) ) ; return null ; } }
Source:
public com.google.template.soy.data.SanitizedContent toSoy ( ) { finishActiveTag ( ) ; return com.google.template.soy.data.UnsafeSanitizedContentOrdainer.ordainAsSafe ( htmlBuf.toString ( ) , ContentKind.HTML ) ; }

Target:
public void entity ( java.lang.String entity ) { com.google.common.base.Preconditions.checkArgument ( com.google.gitiles.doc.html.HtmlBuilder.HTML_ENTITY.matcher ( entity ) . matches ( ) , "invalid entity %s" , entity ) ; finishActiveTag ( ) ; try { htmlBuf.append ( entity ) ; } catch ( java.io.IOException e ) { throw new com.google.gitiles.doc.RuntimeIOException ( e ) ; } }
Source:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.reviewdb.ProjectRight > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.ProjectRight k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , k ) ; } }

Target:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.reviewdb.RefRight > refRights ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.RefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }
Source:
public Response.Accepted apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.extensions.api.projects.ProjectInput input ) { com.google.gerrit.reviewdb.client.Project.NameKey project = resource.getNameKey ( ) ; com.google.gerrit.server.git.MultiProgressMonitor.Task mpt = new com.google.gerrit.server.git.MultiProgressMonitor ( com.google.common.io.ByteStreams.nullOutputStream ( ) , "Reindexing project" ) . beginSubTask ( "" , MultiProgressMonitor.UNKNOWN ) ; com.google.gerrit.server.index.change.AllChangesIndexer allChangesIndexer = allChangesIndexerProvider.get ( ) ; allChangesIndexer.setVerboseOut ( NullOutputStream.INSTANCE ) ; executor.submit ( allChangesIndexer.reindexProject ( indexer , project , mpt , mpt ) ) ; return com.google.gerrit.extensions.restapi.Response.accepted ( ( ( "Project " + project ) + " submitted for reindexing" ) ) ; }

Target:
public Response.Accepted apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.extensions.api.projects.ProjectInput input ) { com.google.gerrit.reviewdb.client.Project.NameKey project = resource.getNameKey ( ) ; com.google.gerrit.server.git.MultiProgressMonitor.Task mpt = new com.google.gerrit.server.git.MultiProgressMonitor ( com.google.common.io.ByteStreams.nullOutputStream ( ) , "Reindexing project" ) . beginSubTask ( "" , MultiProgressMonitor.UNKNOWN ) ; com.google.gerrit.server.index.change.AllChangesIndexer allChangesIndexer = allChangesIndexerProvider.get ( ) ; allChangesIndexer.setVerboseOut ( NullOutputStream.INSTANCE ) ; @ java.lang.SuppressWarnings ( value = "unused" ) java.util.concurrent.Future < java.lang.Void > ignored = executor.submit ( allChangesIndexer.reindexProject ( indexer , project , mpt , mpt ) ) ; return com.google.gerrit.extensions.restapi.Response.accepted ( ( ( "Project " + project ) + " submitted for reindexing" ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myAccount = result.account ; HEAD ( 9.124E12 [ ( ( exp ) - ( nosql ) ) ] ) ; com.google.gerrit.client.build caused ; com.google.gerrit.client.merge error ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.faee65 Start ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } onModuleLoad2 ( ) ; }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken = uaaClient.toAccessToken ( token.getToken ( ) ) ; java.lang.String displayName = uaaClient.getDisplayName ( token.getToken ( ) ) ; return getAsOAuthUserInfo ( accessToken , displayName ) ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthUserInfo getUserInfo ( com.google.gerrit.extensions.auth.oauth.OAuthToken token ) throws java.io.IOException { com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken = uaaClient.toAccessToken ( token.getToken ( ) ) ; com.googlesource.gerrit.plugins.cfoauth.UserInfo userInfo = accessToken.getUserInfo ( ) ; userInfo.setDisplayName ( uaaClient.getDisplayName ( token.getToken ( ) ) ) ; return com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.getAsOAuthUserInfo ( userInfo ) ; }
Source:
private void scan ( ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.util.Map < java.lang.Class < ? extends java.lang.annotation.Annotation > , java.lang.Iterable < com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData > > extensions = scanner.scan ( pluginName , java.util.Arrays.asList ( com.google.gerrit.extensions.annotations.Export.class , com.google.gerrit.extensions.annotations.Listen.class ) ) ; for ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData export : extensions.get ( com.google.gerrit.extensions.annotations.Export.class ) ) { export ( export ) ; } for ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData listener : extensions.get ( com.google.gerrit.extensions.annotations.Listen.class ) ) { listen ( listener ) ; } }

Target:
private void scan ( ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.util.Map < java.lang.Class < ? extends java.lang.annotation.Annotation > , java.lang.Iterable < com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData > > extensions = scanner.scan ( pluginName , java.util.Arrays.asList ( com.google.gerrit.extensions.annotations.Export.class , com.google.gerrit.extensions.annotations.Listen.class ) ) ; for ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData export : extensions.get ( com.google.gerrit.extensions.annotations.Export.class ) ) { export ( export ) ; } for ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData listener : extensions.get ( com.google.gerrit.extensions.annotations.Listen.class ) ) { listen ( listener ) ; } exportInitJs ( ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( false ) ; edit.setVisible ( false ) ; input.setVisible ( true ) ; save.setVisible ( true ) ; if ( ( warning ) != null ) { warning.setVisible ( true ) ; } cancel.setVisible ( true ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( false ) ; edit.setVisible ( false ) ; input.setVisible ( true ) ; input.setFocus ( true ) ; save.setVisible ( true ) ; if ( ( warning ) != null ) { warning.setVisible ( true ) ; } cancel.setVisible ( true ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { if ( gerritAuthFilter.doFilter ( webSession , request , response , chain ) ) { super . doFilter ( request , response , chain ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { if ( gerritAuthFilter.doFilter ( webSession , request , response , chain ) ) { super . doFilter ( new com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationFilter.SyndicationHttpServletRequest ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) , response , chain ) ; } }
Source:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) { com.google.common.base.Preconditions.checkArgument ( ( ( psId ) != null ) , "setPatchSetId must be called before putComment" ) ; com.google.common.base.Preconditions.checkArgument ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( comment ) . equals ( psId ) , "Comment on %s doesn't match previous patch set %s" , com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( comment ) , psId ) ; com.google.common.base.Preconditions.checkArgument ( ( ( comment.getRevId ( ) ) != null ) ) ; if ( ( comment.getSide ( ) ) == 0 ) { commentsForBase.add ( comment ) ; } else { commentsForPs.add ( comment ) ; } }

Target:
private void insertPublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } com.google.common.base.Preconditions.checkArgument ( ( ! ( notes.containsComment ( c ) ) ) , ( "A comment already exists with the same key as the following comment," + " so we cannot insert this comment: %s" ) , c ) ; if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.projects.TagInfo tag ) { showAddedTag ( tag ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.projects.TagInfo tag ) { showAddedTag ( tag ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; annotationTxtBox.setText ( "" ) ; query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { registerNewEmail.setEnabled ( false ) ; final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( newName ) ; me.setPreferredEmail ( newEmail ) ; me.setContactInformation ( info ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( parentScreen ) != null ) { parentScreen.display ( me ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { registerNewEmail.setEnabled ( false ) ; final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( newName ) ; me.setPreferredEmail ( newEmail ) ; displayHasContact ( result ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( parentScreen ) != null ) { parentScreen.display ( me ) ; } }
Source:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectControl ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectControl ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new java.lang.IllegalArgumentException ( "can't check permissions" , e ) ; } }
Source:
public java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > updateGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , java.util.function.Consumer < com.google.gerrit.reviewdb.client.AccountGroup > groupConsumer ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > updatedGroup = updateGroupInDb ( db , groupUuid , groupConsumer ) ; if ( updatedGroup.isPresent ( ) ) { groupCache.evict ( updatedGroup.get ( ) ) ; } return updatedGroup ; }

Target:
public void updateGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , java.util.function.Consumer < com.google.gerrit.reviewdb.client.AccountGroup > groupConsumer ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountGroup updatedGroup = updateGroupInDb ( db , groupUuid , groupConsumer ) ; groupCache.evict ( updatedGroup ) ; }
Source:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.manager.repository.PluginsRepository.class ) . to ( com.googlesource.gerrit.plugins.manager.repository.JenkinsCiPluginsRepository.class ) ; install ( com.googlesource.gerrit.plugins.manager.PluginsCentralCache.module ( ) ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.googlesource.gerrit.plugins.manager.OnStartStop.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.manager.PluginManagerTopMenu.class ) ; bind ( com.googlesource.gerrit.plugins.manager.repository.PluginsRepository.class ) . to ( com.googlesource.gerrit.plugins.manager.repository.JenkinsCiPluginsRepository.class ) ; install ( com.googlesource.gerrit.plugins.manager.PluginsCentralCache.module ( ) ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.googlesource.gerrit.plugins.manager.OnStartStop.class ) ; }
Source:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kh = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyH ( ) ) ; com.google.gerrit.gpg.testutil.TestKey ki = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyI ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; assertNoProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }

Target:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey kh = add ( com.google.gerrit.gpg.testing.TestTrustKeys.keyH ( ) ) ; com.google.gerrit.gpg.testing.TestKey ki = add ( com.google.gerrit.gpg.testing.TestTrustKeys.keyI ( ) ) ; add ( com.google.gerrit.gpg.testing.TestTrustKeys.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testing.TestTrustKeys.keyJ ( ) ) ; assertNoProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( cs.isEmpty ( ) ) { return java.util.Collections.emptyList ( ) ; } else { return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; } }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.common.base.Strings.isNullOrEmpty ( cs ) ) || ( ! ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) . hasField ( com.google.gerrit.server.index.ChangeField.SUBMISSIONID ) ) ) ) { return java.util.Collections.emptyList ( ) ; } else { return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; } }
Source:
public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( this . token , select ( ) ) ; }

Target:
private static void publish ( final com.google.gerrit.reviewdb.client.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }
Source:
private void deleteCommentFromTable ( com.google.common.collect.Table < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > t , com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.reviewdb.client.PatchLineComment old = t.remove ( psId , c.getKey ( ) . get ( ) ) ; com.google.common.base.Preconditions.checkArgument ( ( old != null ) , ( "Cannot delete following draft because one " + "did not previously exist with the same UUID: %s" ) , c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; upsertComments.add ( c ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; if ( ( gwtuiRecompile ) || ( ! ( uaInitialized.contains ( target ) ) ) ) { java.lang.String rule = ( ( "//" + pkg ) + ":" ) + target ; java.lang.String child = java.lang.String.format ( "%s/__gwt_binary_%s__" , pkg , target ) ; java.io.File zip = new java.io.File ( new java.io.File ( gen , child ) , ( target + ".zip" ) ) ; synchronized ( this ) { try { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , rule ) ; } catch ( com.google.gerrit.pgm.http.jetty.JettyServer.BuildFailureException e ) { displayFailure ( rule , e.why , ( ( javax.servlet.http.HttpServletResponse ) ( res ) ) ) ; return ; } if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } uaInitialized.add ( target ) ; } chain.doFilter ( request , res ) ; }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; if ( ( gwtuiRecompile ) || ( ! ( uaInitialized.contains ( target ) ) ) ) { java.lang.String rule = ( ( "//" + pkg ) + ":" ) + target ; java.lang.String child = java.lang.String.format ( "%s/__gwt_binary_%s__" , pkg , target ) ; java.io.File zip = gen.resolve ( child ) . resolve ( ( target + ".zip" ) ) . toFile ( ) ; synchronized ( this ) { try { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , rule ) ; } catch ( com.google.gerrit.pgm.http.jetty.JettyServer.BuildFailureException e ) { displayFailure ( rule , e.why , ( ( javax.servlet.http.HttpServletResponse ) ( res ) ) ) ; return ; } if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } uaInitialized.add ( target ) ; } chain.doFilter ( request , res ) ; }
Source:
private void render ( java.lang.String revision , com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > graph ) { com.google.gerrit.client.change.RelatedChanges.DisplayCommand cmd = new com.google.gerrit.client.change.RelatedChanges.DisplayCommand ( revision , graph ) ; if ( cmd.execute ( ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }

Target:
private void render ( java.lang.String revision , com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > list ) { if ( 0 < ( list.length ( ) ) ) { com.google.gerrit.client.change.RelatedChanges.DisplayCommand cmd = new com.google.gerrit.client.change.RelatedChanges.DisplayCommand ( revision , list ) ; if ( cmd.execute ( ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } } else { progress.setVisible ( false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( header , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( none , true ) ; } }
Source:
private com.google.gwt.http.client.RequestBuilder request ( com.google.gwt.http.client.RequestBuilder.Method method ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( method , url ( ) ) ; if ( ( ifNoneMatch ) != null ) { req.setHeader ( "If-None-Match" , ifNoneMatch ) ; } req.setHeader ( "Accept" , com.google.gerrit.client.rpc.RestApi.JSON_TYPE ) ; if ( ( com.google.gerrit.client.Gerrit.getAuthorization ( ) ) != null ) { req.setHeader ( "Authorization" , com.google.gerrit.client.Gerrit.getAuthorization ( ) ) ; } return req ; }

Target:
private com.google.gwt.http.client.RequestBuilder request ( com.google.gwt.http.client.RequestBuilder.Method method ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( method , url ( ) ) ; if ( ( ifNoneMatch ) != null ) { req.setHeader ( "If-None-Match" , ifNoneMatch ) ; } req.setHeader ( "Accept" , com.google.gerrit.client.rpc.RestApi.JSON_TYPE ) ; if ( ( com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) != null ) { req.setHeader ( "X-Gerrit-Auth" , com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) ; } return req ; }
Source:
public void run ( ) { metric.set ( value ) ; }

Target:
public < V > void newConstantMetric ( java.lang.String name , V value , com.google.gerrit.metrics.Description desc ) { desc.setConstant ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < V > type = ( ( java.lang.Class < V > ) ( value.getClass ( ) ) ) ; com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , type , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( value ) ; } ) ; }
Source:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( ( idActive ) == null ) ? other.idActive : idActive ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }

Target:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( idActive.isBaseOrAutoMerge ( ) ) ? other.idActive.asPatchSetId ( ) : idActive.asPatchSetId ( ) ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }
Source:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public void run ( ) { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; }

Target:
public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.dom.client.NativeEvent clickEvent ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( instance.getLineHandle ( line ) ) ; insertNewDraft ( instance ) . run ( ) ; }
Source:
private static void assertOnlyChild ( java.lang.String o , com.google.gerrit.server.query.Predicate < java.lang.String > c , com.google.gerrit.server.query.Predicate < java.lang.String > p ) { org.junit.Assert.assertEquals ( ( o + " did not affect child" ) , 1 , p.getChildCount ( ) ) ; org.junit.Assert.assertSame ( ( o + " did not affect child" ) , c , p.getChild ( 0 ) ) ; }

Target:
private static void assertOnlyChild ( java.lang.String o , com.google.gerrit.index.query.Predicate < java.lang.String > c , com.google.gerrit.index.query.Predicate < java.lang.String > p ) { org.junit.Assert.assertEquals ( ( o + " did not affect child" ) , 1 , p.getChildCount ( ) ) ; org.junit.Assert.assertSame ( ( o + " did not affect child" ) , c , p.getChild ( 0 ) ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { while ( 2 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.common.data.AccountProjectWatchInfo k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
public void preDisplay ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { watchesTab.display ( result ) ; }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
public com.google.gerrit.reviewdb.Project getProject ( ) { return getProjectState ( ) . getProject ( ) ; }

Target:
public com.google.gerrit.server.project.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < java.lang.String , com.google.gerrit.server.project.RefControl > ( ) ; } com.google.gerrit.server.project.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.project.PermissionCollection relevant = com.google.gerrit.server.project.PermissionCollection.filter ( access ( ) , refName , user.getUserName ( ) ) ; ctl = new com.google.gerrit.server.project.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }
Source:
protected void configure ( ) { persist ( com.google.gerrit.server.patch.PatchListCacheImpl.FILE_NAME , com.google.gerrit.server.patch.PatchListKey.class , com.google.gerrit.server.patch.PatchList.class ) . maximumWeight ( ( 10 << 20 ) ) . loader ( com.google.gerrit.server.patch.PatchListLoader.class ) . weigher ( com.google.gerrit.server.patch.PatchListWeigher.class ) ; persist ( com.google.gerrit.server.patch.PatchListCacheImpl.INTRA_NAME , com.google.gerrit.server.patch.IntraLineDiffKey.class , com.google.gerrit.server.patch.IntraLineDiff.class ) . maximumWeight ( ( 10 << 20 ) ) . loader ( com.google.gerrit.server.patch.IntraLineLoader.class ) . weigher ( com.google.gerrit.server.patch.IntraLineWeigher.class ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }

Target:
protected void configure ( ) { factory ( PatchListLoader.Factory.class ) ; persist ( com.google.gerrit.server.patch.PatchListCacheImpl.FILE_NAME , com.google.gerrit.server.patch.PatchListKey.class , com.google.gerrit.server.patch.PatchList.class ) . maximumWeight ( ( 10 << 20 ) ) . weigher ( com.google.gerrit.server.patch.PatchListWeigher.class ) ; factory ( IntraLineLoader.Factory.class ) ; persist ( com.google.gerrit.server.patch.PatchListCacheImpl.INTRA_NAME , com.google.gerrit.server.patch.IntraLineDiffKey.class , com.google.gerrit.server.patch.IntraLineDiff.class ) . maximumWeight ( ( 10 << 20 ) ) . weigher ( com.google.gerrit.server.patch.IntraLineWeigher.class ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }
Source:
void move ( com.google.gerrit.client.diff.SkipBar bar , int oldLine , int newLine ) { java.util.SortedMap < java.lang.Integer , com.google.gerrit.client.diff.SkipBar > map = map ( bar.getSide ( ) ) ; map.remove ( oldLine ) ; map.put ( newLine , bar ) ; }

Target:
void remove ( com.google.gerrit.client.diff.SkipBar a , com.google.gerrit.client.diff.SkipBar b ) { skipBars.remove ( a ) ; skipBars.remove ( b ) ; if ( ( ( line0 ) == a ) || ( ( line0 ) == b ) ) { line0 = null ; } if ( skipBars.isEmpty ( ) ) { skipBars = null ; } }
Source:
public com.google.gerrit.server.account.GetPreferences.PreferenceInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; return new com.google.gerrit.server.account.GetPreferences.PreferenceInfo ( null , p , git ) ; } }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.GeneralPreferencesInfo a = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; return com.google.gerrit.server.account.GetPreferences.loadFromAllUsers ( a , p , git ) ; } }
Source:
public static void appendOrAddNewComment ( com.google.gerrit.server.mail.receive.MailComment comment , java.util.List < com.google.gerrit.server.mail.receive.MailComment > comments ) { if ( comments.isEmpty ( ) ) { comments.add ( comment ) ; return ; } com.google.gerrit.server.mail.receive.MailComment lastComment = com.google.common.collect.Iterables.getLast ( comments ) ; if ( comment.isSameCommentPath ( lastComment ) ) { lastComment.message += "\n\n" + ( comment.message ) ; return ; } comments.add ( comment ) ; }

Target:
public static void appendOrAddNewComment ( com.google.gerrit.server.mail.receive.MailComment comment , java.util.List < com.google.gerrit.server.mail.receive.MailComment > comments ) { if ( comments.isEmpty ( ) ) { comments.add ( comment ) ; return ; } com.google.gerrit.server.mail.receive.MailComment lastComment = com.google.common.collect.Iterables.getLast ( comments ) ; if ( comment.isSameCommentPath ( lastComment ) ) { lastComment.message += ( comment.isLink ? " " : "\n\n" ) + ( comment.message ) ; return ; } comments.add ( comment ) ; }
Source:
public void testGetAllRelations ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; com.google.gwtorm.client.Access < ? , ? > [ ] all = schema.allRelations ( ) ; assertNotNull ( all ) ; assertEquals ( 2 , all.length ) ; assertSame ( schema.people ( ) , all [ 0 ] ) ; assertSame ( schema.addresses ( ) , all [ 1 ] ) ; }

Target:
public void testGetAllRelations ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; com.google.gwtorm.server.Access < ? , ? > [ ] all = schema.allRelations ( ) ; org.junit.Assert.assertNotNull ( all ) ; org.junit.Assert.assertEquals ( 2 , all.length ) ; org.junit.Assert.assertSame ( schema.people ( ) , all [ 0 ] ) ; org.junit.Assert.assertSame ( schema.addresses ( ) , all [ 1 ] ) ; }
Source:
private java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > old ( ) throws com.google.gwtorm.server.OrmException { final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > r = new java.util.ArrayList < > ( 1 ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId i : db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) { if ( i.isScheme ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME ) ) { r.add ( i ) ; } } return r ; }

Target:
private java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > old ( ) { final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > r = new java.util.ArrayList < > ( 1 ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId i : externalIdCache.byAccount ( user.getAccountId ( ) ) ) { if ( i.isScheme ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME ) ) { r.add ( i ) ; } } return r ; }
Source:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanRead ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }
Source:
public void testUrlTrailingSlashIsDropped ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( configMock.getString ( "url" ) ) . andReturn ( ( ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) + "/" ) ) ; replayAll ( ) ; configuration = new com.ericsson.gerrit.plugins.syncindex.Configuration ( cfgFactoryMock , pluginName ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.getUrl ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) ; }

Target:
public void testUrlTrailingSlashIsDropped ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( "url" ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) + "/" ) ) ; configuration = new com.ericsson.gerrit.plugins.syncindex.Configuration ( cfgFactoryMock , pluginName ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.getUrl ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) ; }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.common.data.GroupReference group = com.google.gerrit.server.account.GroupBackends.findBestSuggestion ( groupBackend , n ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getUUID ( ) ) ; return 1 ; }

Target:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; com.google.gerrit.common.data.GroupReference group = com.google.gerrit.server.account.GroupBackends.findExactSuggestion ( groupBackend , n ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getUUID ( ) ) ; return 1 ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
java.lang.Runnable diffChunkNav ( final net.codemirror.lib.CodeMirror cm , final com.google.gerrit.client.diff.Direction dir ) { return ( ) -> { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; } ; }
Source:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; final java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( getUrl ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Healtheck on sysinfo result: {}" , result ) ; return result ; }

Target:
private java.lang.String healthCheckAccess ( ) throws java.io.IOException { client ( ) . sysInfo ( ) ; final java.lang.String result = ( "{\"status\"=\"ok\",\"username\"=\"" + ( getUsername ( ) ) ) + "\"}" ; log.debug ( "Health check on access result: {}" , result ) ; return result ; }
Source:
public void testGetNoHashtags ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; assertResult ( GET ( changeId ) , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; }

Target:
public void testAddSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" ) . inOrder ( ) ; }
Source:
public void testIsEnabledRefNoParentMatchingBranchMiddleDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchMiddleEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.SideBySideCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }

Target:
com.google.gerrit.client.diff.CommentGroup getCommentGroupOnActiveLine ( net.codemirror.lib.CodeMirror cm ) { com.google.gerrit.client.diff.CommentGroup group = null ; if ( cm.extras ( ) . hasActiveLine ( ) ) { group = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; } return group ; }