auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }
Source:
public void newPatchSetByOtherOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , other ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; refMocks = new java.util.ArrayList < com.google.gerrit.server.project.RefControl > ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; refMocks = new java.util.ArrayList < com.google.gerrit.server.project.RefControl > ( ) ; }
Source:
static < T extends com.google.gwtorm.client.Key < ? > > boolean eq ( final T a , final T b ) { if ( a == b ) { return true ; } if ( ( a == null ) || ( b == null ) ) { return false ; } return a.equals ( b ) ; }

Target:
public static < T extends com.google.gwtorm.client.Key < ? > > boolean eq ( final T a , final T b ) { if ( a == b ) { return true ; } if ( ( a == null ) || ( b == null ) ) { return false ; } return a.equals ( b ) ; }
Source:
public void testHashCode ( ) { org.junit.Assert.assertTrue ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) ) ) ; org.junit.Assert.assertFalse ( ( ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "bob" ) . hashCode ( ) ) == ( com.google.gerrit.server.query.FieldPredicateTest.f ( "a" , "alice" ) . hashCode ( ) ) ) ) ; }

Target:
public void testHashCode ( ) { org.junit.Assert.assertTrue ( ( ( f ( "a" , "bob" ) . hashCode ( ) ) == ( f ( "a" , "bob" ) . hashCode ( ) ) ) ) ; org.junit.Assert.assertFalse ( ( ( f ( "a" , "bob" ) . hashCode ( ) ) == ( f ( "a" , "alice" ) . hashCode ( ) ) ) ) ; }
Source:
public void setEnableSmallFileFeatures ( final boolean on ) { enableSmallFileFeatures = on ; if ( enableSmallFileFeatures ) { final com.google.gerrit.prettify.common.PrettySettings p = getValue ( ) . getPrettySettings ( ) ; syntaxHighlighting.setValue ( p.isSyntaxHighlighting ( ) ) ; } else { syntaxHighlighting.setValue ( false ) ; } toggleEnabledStatus ( update.isEnabled ( ) ) ; }

Target:
public void setEnableSmallFileFeatures ( final boolean on ) { enableSmallFileFeatures = on ; if ( enableSmallFileFeatures ) { syntaxHighlighting.setValue ( value.isSyntaxHighlighting ( ) ) ; } else { syntaxHighlighting.setValue ( false ) ; } toggleEnabledStatus ( update.isEnabled ( ) ) ; }
Source:
protected void configure ( ) { persist ( com.google.gerrit.server.change.MergeabilityCacheImpl.CACHE_NAME , com.google.gerrit.server.change.MergeabilityCacheImpl.EntryKey.class , java.lang.Boolean.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( com.google.gerrit.server.change.MergeabilityCacheImpl.MergeabilityWeigher.class ) . loader ( com.google.gerrit.server.change.MergeabilityCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.change.MergeabilityCache.class ) . to ( com.google.gerrit.server.change.MergeabilityCacheImpl.class ) ; }

Target:
protected void configure ( ) { persist ( com.google.gerrit.server.change.MergeabilityCacheImpl.CACHE_NAME , com.google.gerrit.server.change.MergeabilityCacheImpl.EntryKey.class , java.lang.Boolean.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( com.google.gerrit.server.change.MergeabilityCacheImpl.MergeabilityWeigher.class ) ; bind ( com.google.gerrit.server.change.MergeabilityCache.class ) . to ( com.google.gerrit.server.change.MergeabilityCacheImpl.class ) ; }
Source:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "unexpected groups: " + actual ) ) . that ( ( ( java.lang.Iterable < ? > ) ( actual ) ) ) . isEmpty ( ) ; }

Target:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "unexpected groups: " + actual ) ) . that ( actual ) . isEmpty ( ) ; }
Source:
private boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > reversed = ChangeNotes.MESSAGE_BY_TIME.reverse ( ) . sortedCopy ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : reversed ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }

Target:
public static boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > reversed = ChangeNotes.MESSAGE_BY_TIME.reverse ( ) . sortedCopy ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : reversed ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.FixSuggestionInfo > toFixSuggestionInfos ( java.util.List < com.google.gerrit.reviewdb.client.FixSuggestion > fixSuggestions ) { if ( fixSuggestions.isEmpty ( ) ) { return null ; } return fixSuggestions.stream ( ) . map ( this :: toFixSuggestionInfo ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.FixSuggestionInfo > toFixSuggestionInfos ( @ com.google.gerrit.common.Nullable java.util.List < com.google.gerrit.reviewdb.client.FixSuggestion > fixSuggestions ) { if ( ( fixSuggestions == null ) || ( fixSuggestions.isEmpty ( ) ) ) { return null ; } return fixSuggestions.stream ( ) . map ( this :: toFixSuggestionInfo ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public Account.Id lookup ( java.lang.String externalId ) throws com.google.gerrit.server.account.AccountException { try { com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.client.AccountExternalId ext = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( externalId ) ) ; return ext != null ? ext.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.account.AccountException ( ( "Cannot lookup account " + externalId ) , e ) ; } }

Target:
public Account.Id lookup ( java.lang.String externalId ) throws com.google.gerrit.server.account.AccountException { try { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.gerrit.reviewdb.client.AccountExternalId ext = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( externalId ) ) ; return ext != null ? ext.getAccountId ( ) : null ; } } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.account.AccountException ( ( "Cannot lookup account " + externalId ) , e ) ; } }
Source:
public void createChangeWithoutAccessToParentCommitFails ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.acceptance.PushOneCommit.Result > results = changeInTwoBranches ( "invisible-branch" , "a.txt" , "visible-branch" , "b.txt" ) ; block ( com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/invisible-branch" , project ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "visible-branch" ; in.baseChange = results.get ( "invisible-branch" ) . getChangeId ( ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.UnprocessableEntityException.class , ( "Base change not found: " + ( in.baseChange ) ) ) ; }

Target:
public void createChangeWithoutAccessToParentCommitFails ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.acceptance.PushOneCommit.Result > results = changeInTwoBranches ( "invisible-branch" , "a.txt" , "visible-branch" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "visible-branch" ; in.baseChange = results.get ( "invisible-branch" ) . getChangeId ( ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.UnprocessableEntityException.class , ( "Base change not found: " + ( in.baseChange ) ) ) ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null ) ; saveCookie ( ) ; }
Source:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; cfg.getLabelSections ( ) . clear ( ) ; cfg.getLabelSections ( ) . put ( codeReview.getName ( ) , codeReview ) ; saveProjectConfig ( cfg ) ; }

Target:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.getLabelSections ( ) . clear ( ) ; cfg.getLabelSections ( ) . put ( codeReview.getName ( ) , codeReview ) ; saveProjectConfig ( cfg ) ; }
Source:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { gApi.get ( ) . changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) . revision ( patchSet.getRevision ( ) . get ( ) ) . review ( review ) ; }

Target:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { gApi.changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) . revision ( patchSet.getRevision ( ) . get ( ) ) . review ( review ) ; }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > validate ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; try { for ( com.google.gerrit.server.git.validators.CommitValidationListener commitValidator : validators ) { messages.addAll ( commitValidator.onCommitReceived ( receiveEvent ) ) ; } } catch ( com.google.gerrit.server.git.validators.CommitValidationException e ) { messages.addAll ( e.getMessages ( ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( e.getMessage ( ) , messages ) ; } return messages ; }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > validate ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.ArrayList < > ( ) ; try { for ( com.google.gerrit.server.git.validators.CommitValidationListener commitValidator : validators ) { messages.addAll ( commitValidator.onCommitReceived ( receiveEvent ) ) ; } } catch ( com.google.gerrit.server.git.validators.CommitValidationException e ) { messages.addAll ( e.getMessages ( ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( e.getMessage ( ) , messages ) ; } return messages ; }
Source:
public void testToString ( ) { assertEquals ( "author:bob" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "bob" ) . toString ( ) ) ; assertEquals ( "author:\"\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "" ) . toString ( ) ) ; assertEquals ( "owner:\"A U Thor\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "owner" , "A U Thor" ) . toString ( ) ) ; }

Target:
public void testToString ( ) { org.junit.Assert.assertEquals ( "author:bob" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "bob" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "author:\"\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "author" , "" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "owner:\"A U Thor\"" , com.google.gerrit.server.query.FieldPredicateTest.f ( "owner" , "A U Thor" ) . toString ( ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.reviewdb.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.Project.NameKey name = change.getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.Project.NameKey name = change.getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
private boolean search ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids ) { if ( ids.isEmpty ( ) ) { return false ; } com.google.gerrit.server.account.GroupMembership membership = user.getEffectiveGroups ( ) ; if ( ( ids.size ( ) ) == 1 ) { return membership.contains ( com.google.common.collect.Iterables.getOnlyElement ( ids ) ) ; } return membership.containsAnyOf ( ids ) ; }

Target:
private boolean search ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids ) { return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }
Source:
java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes , int indexLimit ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( hashes.size ( ) ) > indexLimit ) { return byCommitsOnBranchNotMergedFromDatabase ( repo , db , branch , hashes ) ; } else { return byCommitsOnBranchNotMergedFromIndex ( branch , hashes ) ; } }

Target:
java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes , int indexLimit ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( hashes.size ( ) ) > indexLimit ) { return byCommitsOnBranchNotMergedFromDatabase ( repo , db , branch , hashes ) ; } return byCommitsOnBranchNotMergedFromIndex ( branch , hashes ) ; }
Source:
public void createTagNotAllowed ( ) throws java.lang.Exception { block ( Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "create not permitted" ) ; tag ( input.ref ) . create ( input ) ; }

Target:
public void createTagNotAllowed ( ) throws java.lang.Exception { block ( ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) , Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "create not permitted" ) ; tag ( input.ref ) . create ( input ) ; }
Source:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; }

Target:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; } }
Source:
public java.lang.String format ( java.lang.String projectName , com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } f.setCss ( getCss ( projectName ) ) ; byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
public java.lang.String format ( java.lang.String projectName , java.lang.String revision , com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } f.setCss ( getCss ( projectName ) ) ; byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.submitType = submitType ; in.createEmptyCommit = createEmptyCommit ; in.submitType = submitType ; return createProject ( in ) ; }

Target:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.submitType = submitType ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.client.Change.Status status ) { if ( status == null ) { return "" ; } switch ( status ) { case DRAFT : return com.google.gerrit.client.changes.Util.C.statusLongDraft ( ) ; case NEW : return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; case SUBMITTED : return com.google.gerrit.client.changes.Util.C.statusLongSubmitted ( ) ; case MERGED : return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; case ABANDONED : return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; default : return status.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.client.Change.Status status ) { if ( status == null ) { return "" ; } switch ( status ) { case DRAFT : return com.google.gerrit.client.changes.Util.C.statusLongDraft ( ) ; case NEW : return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; case MERGED : return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; case ABANDONED : return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; default : return status.name ( ) ; } }
Source:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( com.google.gerrit.server.account.WatchConfig ... watches ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( watches ) ; setApiUser ( sc.reviewer ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; sender.clear ( ) ; return sc ; }

Target:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( sc.reviewer ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; sender.clear ( ) ; return sc ; }
Source:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = newChange ( repo , null , null , userId.get ( ) , null ) . insert ( ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }

Target:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }
Source:
protected com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( com.google.inject.util.Providers.of ( db ) , requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }

Target:
protected com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }
Source:
public static int guessVersion ( java.lang.Class < ? > c ) { java.lang.String n = c.getName ( ) ; n = n.substring ( ( ( n.lastIndexOf ( '_' ) ) + 1 ) ) ; while ( n.startsWith ( "0" ) ) n = n.substring ( 1 ) ; return java.lang.Integer.parseInt ( n ) ; }

Target:
private static int guessVersion ( java.lang.Class < ? > c ) { java.lang.String n = c.getName ( ) ; n = n.substring ( ( ( n.lastIndexOf ( '_' ) ) + 1 ) ) ; while ( n.startsWith ( "0" ) ) n = n.substring ( 1 ) ; return java.lang.Integer.parseInt ( n ) ; }
Source:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; try { return new com.vmware.gerrit.owners.common.PathOwners ( resolver , repository , patchList ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }

Target:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; try { return new com.vmware.gerrit.owners.common.PathOwners ( resolver , db , repository , patchList ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }
Source:
private void assertChildNotFound ( com.google.gerrit.reviewdb.client.Project.NameKey parent , java.lang.String child ) throws java.lang.Exception { try { gApi.projects ( ) . name ( parent.get ( ) ) . child ( child ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { e.printStackTrace ( ) ; com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( child ) ; } }

Target:
private void assertChildNotFound ( com.google.gerrit.reviewdb.client.Project.NameKey parent , java.lang.String child ) throws java.lang.Exception { try { gApi.projects ( ) . name ( parent.get ( ) ) . child ( child ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( child ) ; } }
Source:
public boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return false ; }

Target:
private boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return false ; }
Source:
public static com.google.gerrit.client.rpc.RestApi suggestReviewers ( int id , java.lang.String q , int n , boolean e ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "suggest_reviewers" ) . addParameter ( "n" , n ) . addParameter ( "e" , e ) ; if ( q != null ) { api.addParameter ( "q" , q ) ; } return api ; }

Target:
public static com.google.gerrit.client.rpc.RestApi suggestReviewers ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String q , int n , boolean e ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "suggest_reviewers" ) . addParameter ( "n" , n ) . addParameter ( "e" , e ) ; if ( q != null ) { api.addParameter ( "q" , q ) ; } return api ; }
Source:
private org.eclipse.jgit.lib.ObjectId toObjectId ( final com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.PatchSet ps = db.patchSets ( ) . get ( psId ) ; if ( ps == null ) { throw new com.google.gerrit.common.errors.NoSuchEntityException ( ) ; } try { return org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { com.google.gerrit.httpd.rpc.changedetail.PatchSetDetailFactory.log.error ( ( ( "Patch set " + psId ) + " has invalid revision" ) ) ; throw new com.google.gerrit.common.errors.NoSuchEntityException ( ) ; } }

Target:
private org.eclipse.jgit.lib.ObjectId toObjectId ( com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.common.errors.NoSuchEntityException { try { return org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { com.google.gerrit.httpd.rpc.changedetail.PatchSetDetailFactory.log.error ( ( ( "Patch set " + ( ps.getId ( ) ) ) + " has invalid revision" ) ) ; throw new com.google.gerrit.common.errors.NoSuchEntityException ( ) ; } }
Source:
public void testAccountResolve ( ) throws java.lang.Exception { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers = resolver.resolve ( db , com.google.common.collect.ImmutableSet.of ( user.email , admin.email ) , project , change , gApi.accounts ( ) . id ( admin.id.get ( ) ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . containsExactly ( user.id ) ; }

Target:
public void testAccountResolve ( ) throws java.lang.Exception { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers = resolver.resolve ( com.google.common.collect.ImmutableSet.of ( user.email , admin.email ) , project , change , gApi.accounts ( ) . id ( admin.id.get ( ) ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . containsExactly ( user.id ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( project , sshSession ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }
Source:
private static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > noLabelQuery ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ( 2 * ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ) ) ; for ( int i = 1 ; i <= ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ; i ++ ) { r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , i ) ) ; r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , ( - i ) ) ) ; } return not ( or ( r ) ) ; }

Target:
protected static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > noLabelQuery ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ( 2 * ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ) ) ; for ( int i = 1 ; i <= ( com.google.gerrit.server.query.change.LabelPredicate.MAX_LABEL_VALUE ) ; i ++ ) { r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , i ) ) ; r.add ( com.google.gerrit.server.query.change.LabelPredicate.equalsLabelPredicate ( args , label , ( - i ) ) ) ; } return not ( or ( r ) ) ; }
Source:
public java.lang.String format ( ) { if ( ( value ) == ( ( short ) ( 0 ) ) ) { return '-' + ( name ) ; } else if ( ( value ) == ( ( short ) ( 1 ) ) ) { return name ; } else if ( ( value ) < 0 ) { return ( name ) + ( value ) ; } else { return ( ( name ) + '+' ) + ( value ) ; } }

Target:
public java.lang.String format ( ) { if ( ( value ) == ( ( short ) ( 0 ) ) ) { return '-' + ( name ) ; } else if ( ( value ) < 0 ) { return ( name ) + ( value ) ; } else { return ( ( name ) + '+' ) + ( value ) ; } }
Source:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { projects.display ( result ) ; } }

Target:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; }
Source:
private com.google.gerrit.httpd.resources.Resource getMarkdownAsHtmlResource ( java.lang.String md , int lastModified ) throws java.io.IOException { byte [ ] html = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . suppressHtml ( ) . markdownToDocHtml ( replaceMacros ( md ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new com.google.gerrit.httpd.resources.SmallResource ( html ) . setContentType ( "text/html" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) . setLastModified ( lastModified ) ; }

Target:
private com.google.gerrit.httpd.resources.Resource getMarkdownAsHtmlResource ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String md , int lastModified ) throws java.io.IOException { byte [ ] html = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . suppressHtml ( ) . markdownToDocHtml ( replaceMacros ( project , md ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new com.google.gerrit.httpd.resources.SmallResource ( html ) . setContentType ( "text/html" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) . setLastModified ( lastModified ) ; }
Source:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { cmts.append ( ( "Line " + line ) ) ; try { final java.lang.String lineStr = fileData.getLine ( side , line ) ; cmts.append ( ": " ) ; cmts.append ( lineStr ) ; } catch ( java.lang.Throwable e ) { cmts.append ( "" ) ; } cmts.append ( "\n" ) ; }

Target:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { java.lang.String lineStr = getLine ( fileData , side , line ) ; cmts.append ( "Line " ) . append ( line ) . append ( ": " ) . append ( lineStr ) . append ( "\n" ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change updateDraftChange ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change updatedChange = dbProvider.get ( ) . changes ( ) . atomicUpdate ( rsrc.getChange ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; } } ) ; return updatedChange ; }

Target:
private com.google.gerrit.reviewdb.client.Change updateDraftChange ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return dbProvider.get ( ) . changes ( ) . atomicUpdate ( rsrc.getChange ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; } } ) ; }
Source:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.getTop ( ) ) == 0 ) && ( ! ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.getTop ( ) ) > ( 0.5 * ( si.getClientHeight ( ) ) ) ) && ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }

Target:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.getTop ( ) ) == 0 ) && ( ! ( diffTable.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.getTop ( ) ) > ( 0.5 * ( si.getClientHeight ( ) ) ) ) && ( diffTable.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }
Source:
private com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > get ( java.lang.String p , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > m ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > r = m.get ( p ) ; if ( r == null ) { r = com.google.gwt.core.client.JsArray.createArray ( ) . cast ( ) ; } return r ; }

Target:
private com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > get ( java.lang.String p , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > m ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > r = null ; if ( m != null ) { r = m.get ( p ) ; } if ( r == null ) { r = com.google.gwt.core.client.JsArray.createArray ( ) . cast ( ) ; } return r ; }
Source:
public boolean retryRequest ( java.io.IOException exception , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( ( executionCount > ( cfg.getMaxTries ( ) ) ) || ( exception instanceof javax.net.ssl.SSLException ) ) { return false ; } logRetry ( exception.getMessage ( ) ) ; try { java.lang.Thread.sleep ( cfg.getRetryInterval ( ) ) ; } catch ( java.lang.InterruptedException e ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; return false ; } return true ; }

Target:
public boolean retryRequest ( java.io.IOException exception , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( ( executionCount > ( cfg.getMaxTries ( ) ) ) || ( exception instanceof javax.net.ssl.SSLException ) ) { return false ; } logRetry ( exception.getMessage ( ) , context ) ; try { java.lang.Thread.sleep ( cfg.getRetryInterval ( ) ) ; } catch ( java.lang.InterruptedException e ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; return false ; } return true ; }
Source:
public void singlePeeledTagText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/tags/atag" ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/tags/atag" ) ) + " refs/tags/atag\n" ) + ( peeled ( "refs/tags/atag" ) ) ) + " refs/tags/atag^{}\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void singlePeeledTagText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/tags/atag" ) ; com.google.common.truth.Truth.assertThat ( res.getActualBodyString ( ) ) . isEqualTo ( ( ( ( ( id ( "refs/tags/atag" ) ) + " refs/tags/atag\n" ) + ( peeled ( "refs/tags/atag" ) ) ) + " refs/tags/atag^{}\n" ) ) ; }
Source:
public void load ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.PatchSet ps ) throws com.google.gwtorm.client.OrmException { patchSet = ps ; info = db.patchSetInfo ( ) . get ( patchSet.getKey ( ) ) ; patches = db.patches ( ) . byPatchSet ( patchSet.getKey ( ) ) . toList ( ) ; }

Target:
public void load ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.PatchSet ps ) throws com.google.gwtorm.client.OrmException { patchSet = ps ; info = db.patchSetInfo ( ) . get ( patchSet.getId ( ) ) ; patches = db.patches ( ) . byPatchSet ( patchSet.getId ( ) ) . toList ( ) ; }