auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; final com.google.gerrit.server.account.AccountState s = new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; return s ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; }
Source:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( smtpRcptTo.isEmpty ( ) ) { return false ; } if ( ( ( rcptTo.size ( ) ) == 1 ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( smtpRcptTo.isEmpty ( ) ) { return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }
Source:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( ( "/projects/" + ( com.google.gwt.http.client.URL.encode ( prefix ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterRaw ( "type" , "ALL" ) . addParameter ( "n" , limit ) . addParameterTrue ( "d" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( ( "/projects/" + ( com.google.gwt.http.client.URL.encode ( prefix ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterRaw ( "type" , "ALL" ) . addParameter ( "n" , limit ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.getPatchSet ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.getPatchSet ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change.getProject ( ) , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( groupCache , user.get ( ) , group ) ; }
Source:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , repo , rw , base , path , ins , content ) ) ; } dce.finish ( ) ; }

Target:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , repo , rw , base , path , ins , content ) ) ; break ; } dce.finish ( ) ; }
Source:
void onLineWrapping ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.lineWrapping ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; BRANCH ( ee24b3 ) ; com.google.gerrit.client.diff.Adds a ; com.google.gerrit.client.diff.pref config ; com.google.gerrit.client.diff.lineWrapping to ; com.google.gerrit.client.diff.and Diff ; }

Target:
void onLineWrapping ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.lineWrapping ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; }
Source:
public void testBulletList3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "* line 1\n* 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testBulletList3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "* line 1\n* 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }
Source:
public void testGetUrl ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetUrl ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . peerInfoStatic ( ) . url ( ) ) . isEmpty ( ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = id ; java.util.List < com.google.gerrit.server.group.MembersCollection.MemberInfo > list = put.get ( ) . apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } else { throw new java.lang.IllegalStateException ( ) ; } }

Target:
public java.lang.Object apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = id ; java.util.List < com.google.gerrit.server.group.MembersCollection.MemberInfo > list = put.get ( ) . apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private static org.apache.lucene.search.Sort getSort ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( com.google.gerrit.server.query.change.SortKeyPredicate.hasSortKeyField ( schema ) ) { boolean reverse = com.google.gerrit.server.query.change.ChangeQueryBuilder.hasNonTrivialSortKeyAfter ( schema , p ) ; return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.SORTKEY.getName ( ) , SortField.Type.LONG , ( ! reverse ) ) ) ; } else { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; } }

Target:
private static org.apache.lucene.search.Sort getSort ( ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change c ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { return createChecked ( db , c.getProject ( ) , c.getId ( ) ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change c ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = create ( db , c.getProject ( ) , c.getId ( ) ) ; if ( ( notes.getChange ( ) ) == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getId ( ) ) ; } return notes ; }
Source:
public void refresh ( final com.google.gerrit.reviewdb.PatchSet.Id diffBaseId ) { if ( ( patchSetPanelsList ) != null ) { for ( final com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel p : patchSetPanelsList ) { p.setDiffBaseId ( diffBaseId ) ; if ( p.isOpen ( ) ) { p.refresh ( ) ; } } } }

Target:
public void refresh ( final com.google.gerrit.reviewdb.client.PatchSet.Id diffBaseId ) { if ( ( patchSetPanelsList ) != null ) { for ( final com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel p : patchSetPanelsList ) { p.setDiffBaseId ( diffBaseId ) ; if ( p.isOpen ( ) ) { p.refresh ( ) ; } } } }
Source:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = com.google.gerrit.server.plugins.PluginGuiceEnvironment.copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
private static com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > sort ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in ) { if ( in != null ) { java.util.Collections.sort ( com.google.gerrit.client.rpc.Natives.asList ( in ) , new java.util.Comparator < com.google.gerrit.client.changes.CommentInfo > ( ) { @ java.lang.Override public int compare ( com.google.gerrit.client.changes.CommentInfo a , com.google.gerrit.client.changes.CommentInfo b ) { return a.updated ( ) . compareTo ( b.updated ( ) ) ; } } ) ; } return in ; }

Target:
private com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > sort ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in ) { if ( in != null ) { for ( com.google.gerrit.client.changes.CommentInfo c : com.google.gerrit.client.rpc.Natives.asList ( in ) ) { c.path ( path ) ; } java.util.Collections.sort ( com.google.gerrit.client.rpc.Natives.asList ( in ) , new java.util.Comparator < com.google.gerrit.client.changes.CommentInfo > ( ) { @ java.lang.Override public int compare ( com.google.gerrit.client.changes.CommentInfo a , com.google.gerrit.client.changes.CommentInfo b ) { return a.updated ( ) . compareTo ( b.updated ( ) ) ; } } ) ; } return in ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; if ( repository == null ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( "There was an error finding the project." ) ; } cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( repository ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; if ( repository == null ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( "There was an error finding the project." ) ; } cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repository ) ; } }
Source:
public void nameEscaperEscapesSpacesWithPercentInsteadOfPlus ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "foo+bar" , com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo+bar" ) ) ; org.junit.Assert.assertEquals ( "foo%20bar" , com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo bar" ) ) ; org.junit.Assert.assertEquals ( "foo%2520bar" , com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo%20bar" ) ) ; }

Target:
public void nameEscaperEscapesSpacesWithPercentInsteadOfPlus ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo+bar" ) ) . isEqualTo ( "foo+bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo bar" ) ) . isEqualTo ( "foo%20bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo%20bar" ) ) . isEqualTo ( "foo%2520bar" ) ; }
Source:
public java.util.List < com.google.gerrit.server.project.CommentLinkInfo > get ( ) { java.util.Set < java.lang.String > subsections = cfg.getSubsections ( ProjectConfig.COMMENTLINK ) ; java.util.List < com.google.gerrit.server.project.CommentLinkInfo > cls = com.google.common.collect.Lists.newArrayListWithCapacity ( subsections.size ( ) ) ; for ( java.lang.String name : subsections ) { cls.add ( com.google.gerrit.server.git.ProjectConfig.buildCommentLink ( cfg , name ) ) ; } return com.google.common.collect.ImmutableList.copyOf ( cls ) ; }

Target:
public java.util.List < com.google.gerrit.server.project.CommentLinkInfo > get ( ) { java.util.Set < java.lang.String > subsections = cfg.getSubsections ( ProjectConfig.COMMENTLINK ) ; java.util.List < com.google.gerrit.server.project.CommentLinkInfo > cls = com.google.common.collect.Lists.newArrayListWithCapacity ( subsections.size ( ) ) ; for ( java.lang.String name : subsections ) { cls.add ( com.google.gerrit.server.git.ProjectConfig.buildCommentLink ( cfg , name , true ) ) ; } return com.google.common.collect.ImmutableList.copyOf ( cls ) ; }
Source:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }

Target:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }
Source:
public void onLoad ( ) { if ( ( sbsTable ) == null ) { initUI ( ) ; } super . onLoad ( ) ; PatchUtil.DETAIL_SVC.sideBySidePatchDetail ( patchId , null , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.SideBySidePatchDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.data.SideBySidePatchDetail r ) { display ( r ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; PatchUtil.DETAIL_SVC.sideBySidePatchDetail ( patchId , null , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.SideBySidePatchDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.data.SideBySidePatchDetail r ) { display ( r ) ; } } ) ; }
Source:
com.google.gerrit.common.data.PatchScript toPatchScript ( final com.google.gerrit.server.patch.PatchListEntry content , final boolean intralineDifference , final com.google.gerrit.common.data.CommentDetail comments , final java.util.List < com.google.gerrit.reviewdb.Patch > history ) throws java.io.IOException { reader = db.newObjectReader ( ) ; try { return build ( content , intralineDifference , comments , history ) ; } finally { reader.release ( ) ; } }

Target:
com.google.gerrit.common.data.PatchScript toPatchScript ( final com.google.gerrit.server.patch.PatchListEntry content , final com.google.gerrit.common.data.CommentDetail comments , final java.util.List < com.google.gerrit.reviewdb.Patch > history ) throws java.io.IOException { reader = db.newObjectReader ( ) ; try { return build ( content , comments , history ) ; } finally { reader.release ( ) ; } }
Source:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public com.google.gerrit.extensions.common.MergeableInfo mergeableOtherBranches ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.Mergeable m = mergeable.get ( ) ; m.setOtherBranches ( true ) ; return m.apply ( revision ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot check mergeability" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.MergeableInfo mergeableOtherBranches ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { mergeable.setOtherBranches ( true ) ; return mergeable.apply ( revision ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot check mergeability" , e ) ; } }
Source:
public void testGetGroup ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup adminGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "Administrators" ) ) ; testGetGroup ( ( "/groups/" + ( adminGroup.getGroupUUID ( ) . get ( ) ) ) , adminGroup ) ; testGetGroup ( ( "/groups/" + ( adminGroup.getName ( ) ) ) , adminGroup ) ; testGetGroup ( ( "/groups/" + ( adminGroup.getId ( ) . get ( ) ) ) , adminGroup ) ; }

Target:
public void testGetGroup ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup adminGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "Administrators" ) ) ; testGetGroup ( adminGroup.getGroupUUID ( ) . get ( ) , adminGroup ) ; testGetGroup ( adminGroup.getName ( ) , adminGroup ) ; testGetGroup ( adminGroup.getId ( ) . get ( ) , adminGroup ) ; }
Source:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; return cache.get ( p , newLoader ( name , p ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }

Target:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; return cache.get ( p , newLoader ( p ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }
Source:
private boolean growFrom ( org.eclipse.jgit.blame.BlameResult blame , int i ) { if ( ( com.google.common.base.Objects.equal ( blame.getSourcePath ( i ) , sourcePath ) ) && ( com.google.common.base.Objects.equal ( blame.getSourceCommit ( i ) , sourceCommit ) ) ) { ( count ) ++ ; return true ; } else { return false ; } }

Target:
public boolean growFrom ( org.eclipse.jgit.blame.BlameResult blame , int i ) { if ( ( com.google.common.base.Objects.equal ( blame.getSourcePath ( i ) , sourcePath ) ) && ( com.google.common.base.Objects.equal ( blame.getSourceCommit ( i ) , sourceCommit ) ) ) { ( count ) ++ ; return true ; } else { return false ; } }
Source:
private com.google.gerrit.httpd.raw.HostPageServlet.Page get ( ) { com.google.gerrit.httpd.raw.HostPageServlet.Page p = page ; if ( ( refreshHeaderFooter ) && ( p.isStale ( ) ) ) { final com.google.gerrit.httpd.raw.HostPageServlet.Page newPage ; try { newPage = new com.google.gerrit.httpd.raw.HostPageServlet.Page ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.httpd.raw.HostPageServlet.log.error ( "Cannot refresh site header/footer" , e ) ; return p ; } p = newPage ; page = p ; } return p ; }

Target:
private com.google.gerrit.httpd.raw.HostPageServlet.Page get ( ) { com.google.gerrit.httpd.raw.HostPageServlet.Page p = page ; try { if ( ( refreshHeaderFooter ) && ( p.isStale ( ) ) ) { p = new com.google.gerrit.httpd.raw.HostPageServlet.Page ( ) ; page = p ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.raw.HostPageServlet.log.error ( "Cannot refresh site header/footer" , e ) ; } return p ; }
Source:
public org.apache.http.impl.client.CloseableHttpClient get ( ) { return org.apache.http.impl.client.HttpClients.custom ( ) . setSSLSocketFactory ( sslSocketFactory ) . setConnectionManager ( customConnectionManager ( ) ) . setDefaultRequestConfig ( customRequestConfig ( ) ) . setRetryHandler ( customRetryHandler ( ) ) . setServiceUnavailableRetryStrategy ( customServiceUnavailRetryStrategy ( ) ) . build ( ) ; }

Target:
public org.apache.http.impl.client.CloseableHttpClient get ( ) { return org.apache.http.impl.client.HttpClients.custom ( ) . setSSLSocketFactory ( sslSocketFactory ) . setConnectionManager ( customConnectionManager ( ) ) . setDefaultRequestConfig ( customRequestConfig ( ) ) . setServiceUnavailableRetryStrategy ( customServiceUnavailRetryStrategy ( ) ) . build ( ) ; }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.String name = column.getColumnName ( ) ; final java.lang.String t = getTrueLiteralValue ( ) ; final java.lang.String f = getFalseLiteralValue ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CHAR(1)" ) ; if ( column.isNotNull ( ) ) { r.append ( ( " DEFAULT " + f ) ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.String f = getFalseLiteralValue ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CHAR(1)" ) ; if ( column.isNotNull ( ) ) { r.append ( ( " DEFAULT " + f ) ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }
Source:
public void stop ( ) { scanner.end ( ) ; synchronized ( this ) { boolean clean = ! ( running.isEmpty ( ) ) ; for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( clean ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }

Target:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } synchronized ( this ) { boolean clean = ! ( running.isEmpty ( ) ) ; for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( clean ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
protected com.google.gerrit.server.GerritServer getGerritServer ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { try { return com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" , e ) ; } }

Target:
protected com.google.gerrit.server.GerritServer getGerritServer ( ) { return server ; }
Source:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( db , change.change ( ) , user ( admin ) ) ; com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) . isEmpty ( ) ) . isEqualTo ( expected ) ; }

Target:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.get ( ) . completeChangeSet ( db , change.change ( ) , user ( admin ) ) ; com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) . isEmpty ( ) ) . isEqualTo ( expected ) ; }
Source:
public com.google.gerrit.extensions.registration.DynamicItem < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > n = new com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > ( newItem , item.pluginName ) ; if ( ref.compareAndSet ( item , n ) ) { return new ReloadableHandle ( newKey , n , defaultItem ) ; } return null ; }

Target:
public com.google.gerrit.extensions.registration.DynamicItem < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > n = new com.google.gerrit.extensions.registration.DynamicItem.NamedProvider ( newItem , item.pluginName ) ; if ( ref.compareAndSet ( item , n ) ) { return new ReloadableHandle ( newKey , n , defaultItem ) ; } return null ; }
Source:
public void queryChangesOwnerWithDifferentUsers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( query ( "owner:self" ) ) . changeId ) . isEqualTo ( r.getChangeId ( ) ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( query ( "owner:self" ) . isEmpty ( ) ) . isTrue ( ) ; }

Target:
public void queryChangesOwnerWithDifferentUsers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( query ( "owner:self" ) ) . changeId ) . isEqualTo ( r.getChangeId ( ) ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( query ( "owner:self" ) ) . isEmpty ( ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( cell == null ) { return ; } if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( cell.getRowIndex ( ) ) ; } else if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) { } else if ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( cell == null ) { return ; } if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { } else if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) { } else if ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }
Source:
private void doAssertApproval ( int expected , com.google.gerrit.extensions.common.ChangeInfo c ) { com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( ( ( int ) ( cr.defaultValue ) ) ) . isEqualTo ( ( - 1 ) ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . name ) . isEqualTo ( "Administrator" ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value.intValue ( ) ) . isEqualTo ( expected ) ; }

Target:
private void doAssertApproval ( int expected , com.google.gerrit.extensions.common.ChangeInfo c ) { com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( ( ( int ) ( cr.defaultValue ) ) ) . isEqualTo ( ( - 1 ) ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . name ) . isEqualTo ( "Administrator" ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( expected ) ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { newChange ( repo , null , null , user2 , null ) . insert ( ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChange ( repo , null , null , user2 , null ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }
Source:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( java.io.IOException | com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } }
Source:
void onChangeRevision ( com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = revisionList.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = revisionList.getValue ( idx ) ; revisionList.setEnabled ( false ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( changeId , n ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , n ) ) ; } }

Target:
void onChangeRevision ( com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = revisionList.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = revisionList.getValue ( idx ) ; revisionList.setEnabled ( false ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( changeId , n ) ) ; } }
Source:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't force update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }
Source:
public void listChildrenOfNonExistingProject_NotFound ( ) throws java.lang.Exception { try { gApi.projects ( ) . name ( "non-existing" ) . child ( "children" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( "non-existing" ) ; } }

Target:
public void listChildrenOfNonExistingProject_NotFound ( ) throws java.lang.Exception { try { gApi.projects ( ) . name ( name ( "non-existing" ) ) . child ( "children" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( "non-existing" ) ; } }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult asBinaryResult ( final org.eclipse.jgit.lib.ObjectLoader obj ) { @ java.lang.SuppressWarnings ( value = "resource" ) com.google.gerrit.extensions.restapi.BinaryResult result = new com.google.gerrit.extensions.restapi.BinaryResult ( ) { @ java.lang.Override public void writeTo ( java.io.OutputStream os ) throws java.io.IOException { obj.copyTo ( os ) ; } } . setContentLength ( obj.getSize ( ) ) ; return result ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult asBinaryResult ( final org.eclipse.jgit.lib.ObjectLoader obj ) { com.google.gerrit.extensions.restapi.BinaryResult result = new com.google.gerrit.extensions.restapi.BinaryResult ( ) { @ java.lang.Override public void writeTo ( java.io.OutputStream os ) throws java.io.IOException { obj.copyTo ( os ) ; } } ; result.setContentLength ( obj.getSize ( ) ) ; return result ; }
Source:
public void onOpen ( final com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.PatchSetDetail result ) { ensureLoaded ( result ) ; patchTable.setRegisterKeys ( true ) ; } } ) ; } }

Target:
public void onOpen ( final com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , null , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.PatchSetDetail result ) { ensureLoaded ( result ) ; patchTable.setRegisterKeys ( true ) ; } } ) ; } }
Source:
private static com.google.gerrit.common.data.GroupReference accountToGroup ( com.google.gerrit.server.account.AccountState s ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( ( s.getUserName ( ) . isPresent ( ) ? s.getUserName ( ) . get ( ) : com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( s.getAccount ( ) . getId ( ) ) ) ) ; return new com.google.gerrit.common.data.GroupReference ( uuid , com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.nameOf ( uuid , s ) ) ; }

Target:
private static com.google.gerrit.common.data.GroupReference accountToGroup ( com.google.gerrit.server.account.AccountState s ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = ( s.getUserName ( ) . isPresent ( ) ) ? com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( s.getUserName ( ) . get ( ) ) : com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( s.getAccount ( ) . getId ( ) ) ; return new com.google.gerrit.common.data.GroupReference ( uuid , com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.nameOf ( uuid , s ) ) ; }
Source:
protected void execResource ( final java.lang.String p ) { java.io.InputStream in = com.google.gerrit.pgm.shell.JythonShell.class . getClassLoader ( ) . getResourceAsStream ( p ) ; if ( in != null ) { execStream ( in , ( "resource " + p ) ) ; } else { com.google.gerrit.pgm.shell.JythonShell.log.error ( ( "Cannot load resource " + p ) ) ; } }

Target:
protected void execResource ( final java.lang.String p ) { try ( java.io.InputStream in = com.google.gerrit.pgm.shell.JythonShell.class . getClassLoader ( ) . getResourceAsStream ( p ) ) { if ( in != null ) { execStream ( in , ( "resource " + p ) ) ; } else { com.google.gerrit.pgm.shell.JythonShell.log.error ( ( "Cannot load resource " + p ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.pgm.shell.JythonShell.log.error ( e.getMessage ( ) , e ) ; } }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName = ( commandName + "." ) + ( args [ i ] ) ; } return commandName ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }