auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return getRefControl ( ) . isVisible ( ) ; }

Target:
private boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return getRefControl ( ) . isVisible ( ) ; }
Source:
static void delete ( com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision , com.google.gwt.user.client.ui.Button ... draftButtons ) { com.google.gerrit.client.changes.ChangeApi.deleteRevision ( id.get ( ) , revision , com.google.gerrit.client.change.ChangeActions.cs ( id , draftButtons ) ) ; }

Target:
static void delete ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision , com.google.gwt.user.client.ui.Button ... draftButtons ) { com.google.gerrit.client.changes.ChangeApi.deleteRevision ( project.get ( ) , id.get ( ) , revision , com.google.gerrit.client.change.ChangeActions.cs ( project , id , draftButtons ) ) ; }
Source:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { try { final net.sf.ehcache.config.CacheConfiguration c ; c = mgr.getDefaultCacheConfiguration ( ) . clone ( ) ; c.setName ( name ) ; return c ; } catch ( java.lang.CloneNotSupportedException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot configure cache " + name ) , e ) ; } }

Target:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { final net.sf.ehcache.config.CacheConfiguration c ; c = mgr.getDefaultCacheConfiguration ( ) . clone ( ) ; c.setName ( name ) ; return c ; }
Source:
private void applyRightFloor ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.common.data.LabelType lt , com.google.gerrit.reviewdb.client.PatchSetApproval a ) { java.lang.String permission = com.google.gerrit.common.data.Permission.forLabel ( lt.getName ( ) ) ; com.google.gerrit.server.IdentifiedUser user = userFactory.create ( a.getAccountId ( ) ) ; com.google.gerrit.common.data.PermissionRange range = ctl.forUser ( user ) . getRange ( permission ) ; a.setValue ( ( ( short ) ( range.squash ( a.getValue ( ) ) ) ) ) ; }

Target:
private boolean applyRightFloor ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.common.data.LabelType lt , com.google.gerrit.reviewdb.client.PatchSetApproval a ) { com.google.gerrit.common.data.PermissionRange range = getRange ( ctl , lt , a.getAccountId ( ) ) ; if ( range.isEmpty ( ) ) { return false ; } a.setValue ( ( ( short ) ( range.squash ( a.getValue ( ) ) ) ) ) ; return true ; }
Source:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , com.google.gerrit.sshd.CommandModule.description ( meta ) ) ) . to ( clazz ) ; }

Target:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , meta.description ( ) ) ) . to ( clazz ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmB.getWrapperElement ( ) . removeFromParent ( ) ; com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; }
Source:
private PushOneCommit.Result createChangeWithTopic ( java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( git , ( "refs/for/master/" + topic ) ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }
Source:
public void publishComments ( final com.google.gerrit.reviewdb.PatchSet.Id psid , final java.lang.String msg , final java.util.Set < com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > tags , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > cb ) { com.google.gerrit.httpd.rpc.Handler.wrap ( publishCommentsFactory.create ( psid , msg , tags ) ) . to ( cb ) ; }

Target:
public void publishComments ( final com.google.gerrit.reviewdb.PatchSet.Id psid , final java.lang.String msg , final java.util.Set < com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > tags , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > cb ) { com.google.gerrit.httpd.rpc.Handler.wrap ( publishCommentsFactory.create ( psid , msg , tags , false ) ) . to ( cb ) ; }
Source:
private void updateSuperProjects ( java.util.Collection < com.google.gerrit.reviewdb.client.Branch.NameKey > branches ) { logDebug ( "Updating superprojects" ) ; com.google.gerrit.server.git.SubmoduleOp subOp = subOpProvider.get ( ) ; try { subOp.updateSuperProjects ( db , branches , submissionId , orm ) ; logDebug ( "Updating superprojects done" ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The gitlinks were not updated according to the " + "subscriptions" ) , e ) ; } }

Target:
private void updateSuperProjects ( java.util.Collection < com.google.gerrit.reviewdb.client.Branch.NameKey > branches ) { logDebug ( "Updating superprojects" ) ; com.google.gerrit.server.git.SubmoduleOp subOp = subOpProvider.get ( ) ; try { subOp.updateSuperProjects ( branches , submissionId , orm ) ; logDebug ( "Updating superprojects done" ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The gitlinks were not updated according to the " + "subscriptions" ) , e ) ; } }
Source:
public void addComment ( java.lang.String issueKey , java.lang.String comment ) throws java.io.IOException { if ( issueExists ( issueKey ) ) { com.googlesource.gerrit.plugins.its.jira.JiraClient.log.debug ( "Trying to add comment for issue {}" , issueKey ) ; apiBuilder.getIssue ( ) . doPost ( ( ( "/" + issueKey ) + "/comment" ) , gson.toJson ( new com.googlesource.gerrit.plugins.its.jira.restapi.JiraComment ( comment ) ) , java.net.HttpURLConnection.HTTP_CREATED ) ; com.googlesource.gerrit.plugins.its.jira.JiraClient.log.debug ( "Comment added to issue {}" , issueKey ) ; } else { com.googlesource.gerrit.plugins.its.jira.JiraClient.log.error ( "Issue does not exist or no access permission" , issueKey ) ; } }

Target:
public void addComment ( java.lang.String issueKey , java.lang.String comment ) throws java.io.IOException { if ( issueExists ( issueKey ) ) { com.googlesource.gerrit.plugins.its.jira.JiraClient.log.debug ( "Trying to add comment for issue {}" , issueKey ) ; apiBuilder.getIssue ( ) . doPost ( ( issueKey + "/comment" ) , gson.toJson ( new com.googlesource.gerrit.plugins.its.jira.restapi.JiraComment ( comment ) ) , java.net.HttpURLConnection.HTTP_CREATED ) ; com.googlesource.gerrit.plugins.its.jira.JiraClient.log.debug ( "Comment added to issue {}" , issueKey ) ; } else { com.googlesource.gerrit.plugins.its.jira.JiraClient.log.error ( "Issue does not exist or no access permission" , issueKey ) ; } }
Source:
private java.lang.String getScope ( java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { if ( ( scopes.size ( ) ) <= 0 ) { return "" ; } java.lang.StringBuilder out = new java.lang.StringBuilder ( ) ; for ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope scope : scopes ) { if ( ( out.length ( ) ) > 0 ) { out.append ( "," ) ; } out.append ( scope.getValue ( ) ) ; } return ( "&" + "scope=" ) + ( out.toString ( ) ) ; }

Target:
public java.lang.String getScope ( java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { if ( ( scopes.size ( ) ) <= 0 ) { return "" ; } java.lang.StringBuilder out = new java.lang.StringBuilder ( ) ; for ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope scope : scopes ) { if ( ( out.length ( ) ) > 0 ) { out.append ( "," ) ; } out.append ( scope.getValue ( ) ) ; } return out.toString ( ) ; }
Source:
public void listBranchesHeadHidden ( ) throws java.lang.Exception { blockRead ( project , "refs/heads/master" ) ; pushTo ( "refs/heads/master" ) ; java.lang.String dev = pushTo ( "refs/heads/dev" ) . getCommit ( ) . name ( ) ; setApiUser ( user ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( com.google.common.collect.ImmutableList.of ( com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "refs/heads/dev" , dev , false ) ) , list ( ) . get ( ) ) ; }

Target:
public void listBranchesHeadHidden ( ) throws java.lang.Exception { blockRead ( "refs/heads/master" ) ; pushTo ( "refs/heads/master" ) ; java.lang.String dev = pushTo ( "refs/heads/dev" ) . getCommit ( ) . name ( ) ; setApiUser ( user ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( com.google.common.collect.ImmutableList.of ( com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "refs/heads/dev" , dev , false ) ) , list ( ) . get ( ) ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c == null ) { return false ; } com.google.gerrit.reviewdb.client.PatchSet.Id current = c.currentPatchSetId ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) ) { if ( ( p.getPatchSetId ( ) . equals ( current ) ) && ( ( p.getValue ( ) ) != 0 ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c == null ) { return false ; } com.google.gerrit.reviewdb.client.PatchSet.Id current = c.currentPatchSetId ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { if ( ( p.getPatchSetId ( ) . equals ( current ) ) && ( ( p.getValue ( ) ) != 0 ) ) { return true ; } } return false ; }
Source:
private com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > patchSetAttributeSupplier ( final com.google.gerrit.server.notedb.ChangeNotes notes , final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( notes.getProjectName ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , notes , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } } } ) ; }

Target:
private com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > patchSetAttributeSupplier ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.PatchSetAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } } } ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( com.google.gerrit.server.project.RefControl.matches ( getRefName ( ) , right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( matches ( right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }
Source:
public com.google.gerrit.reviewdb.client.ChangeMessage getConflictMessage ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage msg = com.google.common.collect.Iterables.getFirst ( com.google.common.collect.Iterables.filter ( com.google.common.collect.Lists.reverse ( dbProvider.get ( ) . changeMessages ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) . toList ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage input ) { return ( input.getAuthor ( ) ) == null ; } } ) , null ) ; return msg ; }

Target:
public com.google.gerrit.reviewdb.client.ChangeMessage getConflictMessage ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Iterables.getFirst ( com.google.common.collect.Iterables.filter ( com.google.common.collect.Lists.reverse ( dbProvider.get ( ) . changeMessages ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) . toList ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage input ) { return ( input.getAuthor ( ) ) == null ; } } ) , null ) ; }
Source:
private org.asciidoctor.Options createOptions ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String revision , java.io.File out ) { return org.asciidoctor.OptionsBuilder.options ( ) . backend ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.BACKEND ) . docType ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.DOCTYPE ) . eruby ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.ERUBY ) . safe ( SafeMode.SECURE ) . attributes ( getAttributes ( cfg , revision ) ) . mkDirs ( true ) . toFile ( out ) . get ( ) ; }

Target:
private org.asciidoctor.OptionsBuilder createOptions ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String revision ) { return org.asciidoctor.OptionsBuilder.options ( ) . backend ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.BACKEND ) . docType ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.DOCTYPE ) . eruby ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.ERUBY ) . safe ( SafeMode.SECURE ) . attributes ( getAttributes ( cfg , revision ) ) . mkDirs ( true ) ; }
Source:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( psId.getParentKey ( ) ) ; if ( c == null ) { return null ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( db , c ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }

Target:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( db , project , psId.getParentKey ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }
Source:
public boolean isAssignee ( ) { com.google.gerrit.reviewdb.client.Account.Id currentAssignee = notes.getChange ( ) . getAssignee ( ) ; if ( ( currentAssignee != null ) && ( getUser ( ) . isIdentifiedUser ( ) ) ) { com.google.gerrit.reviewdb.client.Account.Id id = getUser ( ) . getAccountId ( ) ; return id.equals ( currentAssignee.get ( ) ) ; } return false ; }

Target:
public boolean isAssignee ( ) { com.google.gerrit.reviewdb.client.Account.Id currentAssignee = notes.getChange ( ) . getAssignee ( ) ; if ( ( currentAssignee != null ) && ( getUser ( ) . isIdentifiedUser ( ) ) ) { com.google.gerrit.reviewdb.client.Account.Id id = getUser ( ) . getAccountId ( ) ; return id.equals ( currentAssignee ) ; } return false ; }
Source:
static final com.googlesource.gerrit.plugins.quota.Module.Holder createWithBurstyRateLimiter ( com.google.common.base.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) , ( ( int ) ( ( limit.get ( ) . getMaxBurstSeconds ( ) ) * ( limit.get ( ) . getRatePerSecond ( ) ) ) ) ) ; }

Target:
private static final com.googlesource.gerrit.plugins.quota.Module.Holder createWithBurstyRateLimiter ( com.google.common.base.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) , ( ( int ) ( ( limit.get ( ) . getMaxBurstSeconds ( ) ) * ( limit.get ( ) . getRatePerSecond ( ) ) ) ) ) ; }
Source:
void add ( ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( ) ; for ( com.google.gwtexpui.globalkey.client.NpTextBox input : inputs ) { java.lang.String v = input.getValue ( ) . trim ( ) ; if ( ! ( v.isEmpty ( ) ) ) { input.setValue ( "" ) ; values.add ( v ) ; } } insert ( values ) ; }

Target:
void add ( ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( ) ; for ( com.google.gwtexpui.globalkey.client.NpTextBox input : inputs ) { values.add ( input.getValue ( ) . trim ( ) ) ; input.setValue ( "" ) ; } insert ( values ) ; }
Source:
public void testInheritSubmit_OverridesAndDeniesOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) . setDeny ( true ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/foobar" ) . canSubmit ( ) ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/tags/foobar" ) . canSubmit ( ) ) ; assertTrue ( "can submit" , u.controlForRef ( "refs/heads/foobar" ) . canSubmit ( ) ) ; }

Target:
public void testInheritSubmit_OverridesAndDeniesOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/*" ) . setDeny ( ) ; grant ( local , com.google.gerrit.common.data.Permission.SUBMIT , registered , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/foobar" ) . canSubmit ( ) ) ; assertFalse ( "can't submit" , u.controlForRef ( "refs/tags/foobar" ) . canSubmit ( ) ) ; assertTrue ( "can submit" , u.controlForRef ( "refs/heads/foobar" ) . canSubmit ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } else { return userExtId.getAccountId ( ) ; } }

Target:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } return userExtId.getAccountId ( ) ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } }
Source:
public java.util.List < com.google.gerrit.extensions.common.GroupInfo > get ( ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( suggest ) ) ) { return suggestGroups ( ) ; } if ( owned ) { return getGroupsOwnedBy ( ( ( user ) != null ? userFactory.create ( user ) : identifiedUser.get ( ) ) ) ; } if ( ( user ) != null ) { return accountGetGroups.get ( ) . apply ( new com.google.gerrit.server.account.AccountResource ( userFactory.create ( user ) ) ) ; } return getAllGroups ( ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.GroupInfo > get ( ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( suggest ) ) ) { return suggestGroups ( ) ; } if ( owned ) { return getGroupsOwnedBy ( ( ( user ) != null ? userFactory.create ( user ) : identifiedUser.get ( ) ) ) ; } if ( ( user ) != null ) { return accountGetGroups.apply ( new com.google.gerrit.server.account.AccountResource ( userFactory.create ( user ) ) ) ; } return getAllGroups ( ) ; }
Source:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( name ) ; if ( ! ( projectState.getProject ( ) . getState ( ) . permitsRead ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( projectState , userProvider.get ( ) , repoManager.openRepository ( name ) , visibleRefFilterFactory , permissionBackend ) ; }

Target:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( name ) ; if ( ( projectState == null ) || ( ! ( projectState.getProject ( ) . getState ( ) . permitsRead ( ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( projectState , userProvider.get ( ) , repoManager.openRepository ( name ) , visibleRefFilterFactory , permissionBackend ) ; }
Source:
void onSaveSuccess ( final com.google.gerrit.reviewdb.client.Account result ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }

Target:
void onSaveSuccess ( final com.google.gerrit.reviewdb.client.Account result ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; display ( me ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; table.setSavePointerId ( com.google.gwt.user.client.History.getToken ( ) ) ; Util.LIST_SVC.myStarredChanges ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.data.ChangeInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.data.ChangeInfo > result ) { starred.display ( result ) ; table.finishDisplay ( ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.LIST_SVC.myStarredChanges ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.data.ChangeInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.data.ChangeInfo > result ) { starred.display ( result ) ; table.finishDisplay ( ) ; } } ) ; }
Source:
private boolean canPushWithForce ( ) { if ( ( ! ( isProjectStatePermittingWrite ( ) ) ) || ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }

Target:
private boolean canPushWithForce ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }
Source:
boolean wouldPushProject ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { if ( ! ( isVisible ( project ) ) ) { return false ; } java.lang.String [ ] projects = config.getProjects ( ) ; if ( ( projects.length ) < 1 ) { return true ; } return new com.googlesource.gerrit.plugins.replication.ReplicationFilter ( java.util.Arrays.asList ( projects ) ) . matches ( project ) ; }

Target:
boolean wouldPushProject ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { if ( ! ( isVisible ( project ) ) ) { return false ; } java.util.List < java.lang.String > projects = config.getProjects ( ) ; if ( projects.isEmpty ( ) ) { return true ; } return new com.googlesource.gerrit.plugins.replication.ReplicationFilter ( projects ) . matches ( project ) ; }
Source:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } throw e ; } }

Target:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { try { return accounts.parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } throw e ; } }
Source:
public void deleteGpgKeys ( ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { java.lang.String ref = com.google.gerrit.reviewdb.client.RefNames.REFS_GPG_KEYS ; if ( ( repo.getRefDatabase ( ) . exactRef ( ref ) ) != null ) { org.eclipse.jgit.lib.RefUpdate ru = repo.updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "Failed to delete " + ref ) ) . that ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; } } }

Target:
public void deleteGpgKeys ( ) throws java.lang.Exception { java.lang.String ref = com.google.gerrit.reviewdb.client.RefNames.REFS_GPG_KEYS ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { if ( ( repo.getRefDatabase ( ) . exactRef ( ref ) ) != null ) { org.eclipse.jgit.lib.RefUpdate ru = repo.updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "Failed to delete " + ref ) ) . that ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; } } }
Source:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }

Target:
void addLabel ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.git.PushReplication.ReplicationConfig.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; bind ( PushOp.Factory.class ) . toProvider ( com.google.inject.assistedinject.FactoryProvider.newFactory ( PushOp.Factory.class , com.google.gerrit.server.git.PushOp.class ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.git.PushReplication.ReplicationConfig.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; factory ( PushOp.Factory.class ) ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; if ( ( args.length ) > 1 ) { return ( commandName + "." ) + ( args [ 1 ] ) ; } else { return commandName ; } }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; if ( ( args.length ) > 1 ) { return ( commandName + "." ) + ( args [ 1 ] ) ; } return commandName ; }
Source:
public void _onRequestSuggestions ( final com.google.gerrit.client.ui.Request req , final com.google.gerrit.client.ui.Callback callback ) { com.google.gerrit.client.RpcStatus.hide ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { com.google.gerrit.client.projects.ProjectMap.suggest ( req.getQuery ( ) , req.getLimit ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ProjectMap map ) { callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( com.google.gerrit.client.rpc.Natives.asList ( map.values ( ) ) ) ) ; } } ) ; } } ) ; }

Target:
public void _onRequestSuggestions ( final com.google.gerrit.client.ui.Request req , final com.google.gerrit.client.ui.Callback callback ) { com.google.gerrit.client.projects.ProjectMap.suggest ( req.getQuery ( ) , req.getLimit ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ProjectMap map ) { callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( com.google.gerrit.client.rpc.Natives.asList ( map.values ( ) ) ) ) ; } } ) ; }
Source:
public void branchDelegation1 ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/heads/x/*" ) ; com.google.gerrit.server.project.ProjectControl uDev = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertNotOwner ( uDev ) ; assertOwnerAnyRef ( uDev ) ; assertOwner ( "refs/heads/x/*" , uDev ) ; assertOwner ( "refs/heads/x/y" , uDev ) ; assertOwner ( "refs/heads/x/y/*" , uDev ) ; assertNotOwner ( "refs/*" , uDev ) ; assertNotOwner ( "refs/heads/master" , uDev ) ; }

Target:
public void branchDelegation1 ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/heads/x/*" ) ; com.google.gerrit.server.project.ProjectControl uDev = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertNotOwner ( uDev ) ; assertOwner ( "refs/heads/x/*" , uDev ) ; assertOwner ( "refs/heads/x/y" , uDev ) ; assertOwner ( "refs/heads/x/y/*" , uDev ) ; assertNotOwner ( "refs/*" , uDev ) ; assertNotOwner ( "refs/heads/master" , uDev ) ; }
Source:
protected PushOneCommit.Result createChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/for/master" ) ; result.assertOkStatus ( ) ; return result ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( ref ) ; result.assertOkStatus ( ) ; return result ; }
Source:
private static boolean isUnreasonableName ( java.lang.String name ) { if ( ( name.length ( ) ) < 1 ) return true ; if ( name.contains ( "\\" ) ) return true ; if ( name.startsWith ( "../" ) ) return true ; if ( name.contains ( "/../" ) ) return true ; if ( name.contains ( "/./" ) ) return true ; if ( name.contains ( "//" ) ) return true ; return false ; }

Target:
private static boolean isUnreasonableName ( java.lang.String name ) { return ( ( ( ( ( ( name.length ( ) ) < 1 ) || ( name.contains ( "\\" ) ) ) || ( name.startsWith ( "../" ) ) ) || ( name.contains ( "/../" ) ) ) || ( name.contains ( "/./" ) ) ) || ( name.contains ( "//" ) ) ; }
Source:
public void testCreate_Empty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { assertTrue ( root.mkdir ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; } finally { root.delete ( ) ; } }

Target:
public void testCreate_Empty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { org.junit.Assert.assertTrue ( root.mkdir ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { root.delete ( ) ; } }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , null ) ) ) ) { return false ; } return isRefVisible ( ) ; }

Target:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return isRefVisible ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } return userExtId.getAccountId ( ) ; }

Target:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } else { return userExtId.getAccountId ( ) ; } }
Source:
public void testBulletList4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug, you have to:\n" + ( "* Be on IMAP or EAS (not on POP)\n" + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug, you have to:\n" + ( "* Be on IMAP or EAS (not on POP)\n" + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }
Source:
public void testChildString ( ) { final java.lang.String pv = "foo,bar/ at %here" ; final java.lang.String cv = "x" ; final com.google.gwtorm.client.StringKeyTestCase.Child c1 = new com.google.gwtorm.client.StringKeyTestCase.Child ( new com.google.gwtorm.client.StringKeyTestCase.Parent ( pv ) , cv ) ; assertEquals ( "foo%2Cbar/+at+%25here,x" , c1.toString ( ) ) ; final com.google.gwtorm.client.StringKeyTestCase.Child c2 = new com.google.gwtorm.client.StringKeyTestCase.Child ( new com.google.gwtorm.client.StringKeyTestCase.Parent ( "" ) , "" ) ; c2.fromString ( c1.toString ( ) ) ; assertEquals ( c1 , c2 ) ; }

Target:
public void testChildString ( ) { final java.lang.String pv = "foo,bar/ at %here" ; final java.lang.String cv = "x" ; final com.google.gwtorm.client.StringKeyTestCase.Child c1 = new com.google.gwtorm.client.StringKeyTestCase.Child ( new com.google.gwtorm.client.StringKeyTestCase.Parent ( pv ) , cv ) ; org.junit.Assert.assertEquals ( "foo%2Cbar/+at+%25here,x" , c1.toString ( ) ) ; final com.google.gwtorm.client.StringKeyTestCase.Child c2 = new com.google.gwtorm.client.StringKeyTestCase.Child ( new com.google.gwtorm.client.StringKeyTestCase.Parent ( "" ) , "" ) ; c2.fromString ( c1.toString ( ) ) ; org.junit.Assert.assertEquals ( c1 , c2 ) ; }
Source:
public com.google.common.util.concurrent.CheckedFuture < java.lang.Boolean , java.io.IOException > reindexIfStale ( com.google.gerrit.reviewdb.client.Account.Id id ) { java.util.concurrent.Callable < java.lang.Boolean > task = ( ) -> { if ( stalenessChecker.isStale ( id ) ) { index ( id ) ; return true ; } return false ; } ; return com.google.common.util.concurrent.Futures.makeChecked ( com.google.common.util.concurrent.Futures.nonCancellationPropagating ( batchExecutor.submit ( task ) ) , IndexUtils.MAPPER ) ; }

Target:
public boolean reindexIfStale ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { if ( stalenessChecker.isStale ( id ) ) { index ( id ) ; return true ; } return false ; }
Source:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content , changeId ) ; return push.to ( git , ref ) ; }

Target:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content , changeId ) ; return push.to ( ref ) ; }