auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { if ( ! ( prefs.renderEntireFile ( ) ) ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; } render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void start ( ) { final org.eclipse.jgit.storage.file.WindowCacheConfig c = new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) ; c.fromConfig ( cfg ) ; org.eclipse.jgit.storage.file.WindowCache.reconfigure ( c ) ; }

Target:
public void start ( ) { org.eclipse.jgit.transport.SshSessionFactory.setInstance ( new org.eclipse.jgit.transport.JschConfigSessionFactory ( ) { @ java.lang.Override protected void configure ( org.eclipse.jgit.transport.OpenSshConfig.Host hc , com.jcraft.jsch.Session session ) { } } ) ; final org.eclipse.jgit.storage.file.WindowCacheConfig c = new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) ; c.fromConfig ( cfg ) ; org.eclipse.jgit.storage.file.WindowCache.reconfigure ( c ) ; }
Source:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanUpdate ( "refs/heads/master" , u ) ; }
Source:
public void indexChangeOnNonVisibleBranch ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; blockRead ( project , "refs/heads/master" ) ; com.google.gerrit.acceptance.RestResponse r = userSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NOT_FOUND ) ; }

Target:
public void indexChangeOnNonVisibleBranch ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; blockRead ( project , "refs/heads/master" ) ; userSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) . assertNotFound ( ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager setChangeRepo ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.ObjectInserter ins , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) { com.google.common.base.Preconditions.checkState ( ( ( changeRepo ) == null ) , "change repo already initialized" ) ; changeRepo = new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , rw , ins , cmds , false ) ; return this ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager setChangeRepo ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.ObjectInserter ins , com.google.gerrit.server.update.ChainedReceiveCommands cmds ) { com.google.common.base.Preconditions.checkState ( ( ( changeRepo ) == null ) , "change repo already initialized" ) ; changeRepo = new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , rw , ins , cmds , false ) ; return this ; }
Source:
public com.google.gerrit.extensions.registration.RegistrationHandle replace ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.inject.Provider < org.apache.sshd.server.Command > > m = getMap ( ) ; m.put ( name.value ( ) , cmd ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , cmd ) ; } } ; }

Target:
public com.google.gerrit.extensions.registration.RegistrationHandle replace ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.sshd.CommandProvider > m = getMap ( ) ; m.put ( name.value ( ) , new com.google.gerrit.sshd.CommandProvider ( cmd , null ) ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , cmd ) ; } } ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anonymousUsers = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.Util.grant ( cfg , com.google.gerrit.common.data.Permission.forLabel ( Q.getName ( ) ) , ( - 1 ) , 1 , anonymousUsers , "refs/heads/*" ) ; saveProjectConfig ( cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID anonymousUsers = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( Q.getName ( ) ) , ( - 1 ) , 1 , anonymousUsers , "refs/heads/*" ) ; saveProjectConfig ( cfg ) ; }
Source:
public void select ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme urlType ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( ( d.urlType ) == urlType ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }

Target:
public void select ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme urlType ) { com.google.gerrit.client.download.DownloadUrlLink first = null ; for ( com.google.gwt.user.client.ui.Widget w : this ) { if ( w instanceof com.google.gerrit.client.download.DownloadUrlLink ) { final com.google.gerrit.client.download.DownloadUrlLink d = ( ( com.google.gerrit.client.download.DownloadUrlLink ) ( w ) ) ; if ( first == null ) { first = d ; } if ( ( d.getUrlType ( ) ) == urlType ) { d.select ( ) ; return ; } } } if ( first != null ) { first.select ( ) ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.rpc.CallbackGroup cmGroup = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; net.codemirror.lib.CodeMirror.initLibrary ( cmGroup.add ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ) ; initPath ( ) ; com.google.gerrit.client.changes.ChangeFileApi.getContentOrMessage ( revision , path , cmGroup.addFinal ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.lang.String > ( this ) { @ java.lang.Override protected void preDisplay ( java.lang.String content ) { initEditor ( content ) ; } } ) ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; initPath ( ) ; setHeaderVisible ( false ) ; }
Source:
public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.FileSystemView getNormalizedView ( ) { return this ; } } ; }

Target:
public java.util.Set < java.lang.String > supportedFileAttributeViews ( ) { return null ; }
Source:
public void allRefsVisibleNoRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/02/2/1" , "refs/heads/branch" , "refs/heads/master" ) ; }

Target:
public void allRefsVisibleNoRefsMetaConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.PROJECT_OWNERS , "refs/meta/config" ) ; com.google.gerrit.server.project.Util.doNotInherit ( cfg , Permission.READ , "refs/meta/config" ) ; saveProjectConfig ( project , cfg ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/02/2/1" , "refs/heads/branch" , "refs/heads/master" ) ; }
Source:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gwtorm.server.OrmException { return groups.isIncluded ( dbProvider.get ( ) , parent.getGroupUUID ( ) , member.getGroupUUID ( ) ) ; }

Target:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { return groups.isIncluded ( dbProvider.get ( ) , parent.getGroupUUID ( ) , member.getGroupUUID ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , parent.getGroupUUID ( ) ) ) ; } }
Source:
private boolean isSignedOffBy ( java.util.List < org.eclipse.jgit.revwalk.FooterLine > footers , java.lang.String email ) { for ( final org.eclipse.jgit.revwalk.FooterLine line : footers ) { if ( ( line.matches ( FooterKey.SIGNED_OFF_BY ) ) && ( email.equals ( line.getEmailAddress ( ) ) ) ) { return true ; } } return false ; }

Target:
private static < K , T > java.util.List < T > getList ( final K key , final java.util.Map < K , java.util.List < T > > map ) { java.util.List < T > list = map.get ( key ) ; if ( list == null ) { list = new java.util.ArrayList < T > ( ) ; map.put ( key , list ) ; } return list ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.storyboard.StoryboardModule.log.info ( "Storyboard is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.its.storyboard.StoryboardItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.storyboard.StoryboardModule.log.info ( "Storyboard is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.its.storyboard.StoryboardItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.getRevId ( ) ) != null ) , "RevId required for comment: %s" , c ) ; com.google.common.base.Preconditions.checkArgument ( c.getAuthor ( ) . equals ( getUser ( ) . getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getUser ( ) . getAccountId ( ) , c ) ; }

Target:
com.google.gerrit.server.notedb.ChangeDraftUpdate createDraftUpdateIfNull ( ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( getNotes ( ) , accountId , authorIdent , when ) ; } return draftUpdate ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Account account , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event event = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( account ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { try { l.onAgreementSignup ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( this , l , e ) ; } } }

Target:
public void fire ( com.google.gerrit.server.account.AccountState accountState , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event event = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( accountState ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { try { l.onAgreementSignup ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( this , l , e ) ; } } }
Source:
public void testUpsertNothing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.NO_DATA ) ; }

Target:
public void testUpsertTwoBothExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
private com.google.gerrit.client.diff.ScrollbarAnnotation diff ( net.codemirror.lib.CodeMirror cm , int s , int n ) { com.google.gerrit.client.diff.ScrollbarAnnotation a = new com.google.gerrit.client.diff.ScrollbarAnnotation ( cm ) ; a.at ( net.codemirror.lib.CodeMirror.pos ( s ) , net.codemirror.lib.CodeMirror.pos ( ( s + n ) ) ) ; diff.add ( a ) ; return a ; }

Target:
private com.google.gerrit.client.diff.ScrollbarAnnotation diff ( net.codemirror.lib.CodeMirror cm , int s , int n ) { com.google.gerrit.client.diff.ScrollbarAnnotation a = new com.google.gerrit.client.diff.ScrollbarAnnotation ( cm ) ; a.at ( net.codemirror.lib.Pos.create ( s ) , net.codemirror.lib.Pos.create ( ( s + n ) ) ) ; diff.add ( a ) ; return a ; }
Source:
public static void rebaseEdit ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "edit:rebase" ) . post ( in , cb ) ; }

Target:
public static void submit ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "submit" ) . post ( in , cb ) ; }
Source:
public static java.lang.Iterable < java.lang.Object [ ] > configs ( ) { org.eclipse.jgit.lib.Config defaultConfig = new com.google.gerrit.acceptance.AbstractDaemonTest.NamedConfig ( "default" ) ; return java.util.Arrays.asList ( new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { defaultConfig } } ) ; }

Target:
protected PushOneCommit.Result ammendChange ( java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , "refs/for/master" ) ; }
Source:
public void inheritSubmit_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotSubmit ( "refs/foobar" , u ) ; assertCannotSubmit ( "refs/tags/foobar" , u ) ; assertCanSubmit ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritSubmit_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.deny ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotSubmit ( "refs/foobar" , u ) ; assertCannotSubmit ( "refs/tags/foobar" , u ) ; assertCanSubmit ( "refs/heads/foobar" , u ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.notes ( ) , n.getPatchsetId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.getPatchsetId ( ) ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.getControl ( ) , n.getPatchsetId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.getPatchsetId ( ) ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
static java.lang.String getInnerText ( org.pegdown.ast.Node node ) { if ( ( node == null ) || ( node.getChildren ( ) . isEmpty ( ) ) ) { return null ; } java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; com.google.gitiles.doc.MarkdownUtil.appendTextFromChildren ( b , node ) ; return com.google.common.base.Strings.emptyToNull ( b.toString ( ) . trim ( ) ) ; }

Target:
static java.lang.String getInnerText ( org.commonmark.node.Node node ) { if ( ( node == null ) || ( ( node.getFirstChild ( ) ) == null ) ) { return null ; } java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; com.google.gitiles.doc.MarkdownUtil.appendTextFromChildren ( b , node ) ; return com.google.common.base.Strings.emptyToNull ( b.toString ( ) . trim ( ) ) ; }
Source:
public com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars ( ) throws com.google.gwtorm.server.OrmException { if ( ( stars ) == null ) { stars = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId ) ; } return stars ; }

Target:
public com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars ( ) throws com.google.gwtorm.server.OrmException { if ( ( stars ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.common.collect.ImmutableMultimap.of ( ) ; } stars = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId ) ; } return stars ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.builtin.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }
Source:
public static java.lang.String toGroup ( final com.google.gerrit.reviewdb.client.AccountGroup.Id id ) { return ( com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) + ( id.toString ( ) ) ; }

Target:
private static void unified ( final java.lang.String token , final com.google.gerrit.reviewdb.client.Project.NameKey project , final com.google.gerrit.client.DiffObject base , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.diff.Unified ( project , base , com.google.gerrit.client.DiffObject.patchSet ( id.getParentKey ( ) ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
abstract void expandSideAll ( ) ;

Target:
private void expandSideBefore ( int cnt ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.from ( ) . line ( ) ; int newStart = oldStart + cnt ; int end = range.to ( ) . line ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }
Source:
public void compareEqual ( ) throws java.lang.Exception { com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = newBundle ( ) . source ( Source.REVIEW_DB ) . build ( ) ; com.google.gerrit.server.group.db.GroupBundle noteDbBundle = newBundle ( ) . source ( Source.NOTE_DB ) . build ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.GroupBundle.compare ( reviewDbBundle , noteDbBundle ) ) . isEmpty ( ) ; }

Target:
public void compareEqual ( ) throws java.lang.Exception { com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = newBundle ( ) . source ( Source.REVIEW_DB ) . build ( ) ; com.google.gerrit.server.group.db.GroupBundle noteDbBundle = newBundle ( ) . source ( Source.NOTE_DB ) . build ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.GroupBundle.compareWithAudits ( reviewDbBundle , noteDbBundle ) ) . isEmpty ( ) ; }
Source:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > topicField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2 ; } if ( schema.hasField ( com.google.gerrit.server.index.ChangeField.FUZZY_TOPIC ) ) { return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.FUZZY_TOPIC.getName ( ) ) ; } if ( schema.hasField ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC3 ) ) { return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC3.getName ( ) ) ; } return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2.getName ( ) ) ; }

Target:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > topicField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { return schema.getField ( com.google.gerrit.server.index.ChangeField.FUZZY_TOPIC , com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC3 , com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2 ) . get ( ) ; }
Source:
private void assertNotesMigrationState ( com.google.gerrit.server.notedb.NotesMigrationState expected ) throws java.lang.Exception { gerritConfig.load ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NotesMigrationState.forConfig ( gerritConfig ) ) . hasValue ( expected ) ; }

Target:
public void onlineMigrationViaConfig ( ) throws java.lang.Exception { com.google.gerrit.acceptance.pgm.StandaloneNoteDbMigrationIT.assertNoAutoMigrateConfig ( gerritConfig ) ; com.google.gerrit.acceptance.pgm.StandaloneNoteDbMigrationIT.assertNoAutoMigrateConfig ( noteDbConfig ) ; testOnlineMigration ( ( u ) -> { gerritConfig.setBoolean ( "noteDb" , "changes" , "autoMigrate" , true ) ; gerritConfig.save ( ) ; return startServer ( u.module ( ) ) ; } ) ; com.google.gerrit.acceptance.pgm.StandaloneNoteDbMigrationIT.assertAutoMigrateConfig ( gerritConfig , true ) ; com.google.gerrit.acceptance.pgm.StandaloneNoteDbMigrationIT.assertAutoMigrateConfig ( noteDbConfig , false ) ; }
Source:
public void onSuccess ( final com.google.gerrit.reviewdb.AccountSshKey result ) { addNew.setEnabled ( true ) ; addTxt.setText ( "" ) ; keys.addOneKey ( result ) ; if ( ! ( keys.isVisible ( ) ) ) { showAddKeyBlock ( false ) ; setKeyTableVisible ( true ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.reviewdb.AccountSshKey result ) { addNew.setEnabled ( true ) ; addTxt.setText ( "" ) ; keys.addOneKey ( result ) ; if ( ! ( keys.isVisible ( ) ) ) { showAddKeyBlock ( false ) ; setKeyTableVisible ( true ) ; keys.updateDeleteButton ( ) ; } }
Source:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 1 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 2 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; prefsPanel.display ( account ) ; }

Target:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 1 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 2 , fieldIdx , account.getSshUserName ( ) ) ; info.setText ( 3 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; prefsPanel.display ( account ) ; }
Source:
public com.google.gerrit.index.query.InternalQuery < T > setRequestedFields ( java.util.Set < java.lang.String > fields ) { queryProcessor.setRequestedFields ( fields ) ; return this ; }

Target:
public com.google.gerrit.index.query.InternalQuery < T > setRequestedFields ( com.google.gerrit.index.FieldDef < T , ? > ... fields ) { com.google.common.base.Preconditions.checkArgument ( ( ( fields.length ) > 0 ) , "requested field list is empty" ) ; queryProcessor.setRequestedFields ( java.util.Arrays.stream ( fields ) . map ( FieldDef :: getName ) . collect ( java.util.stream.Collectors.toSet ( ) ) ) ; return this ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo queryOne ( java.lang.Object query ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( query ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( java.lang.String.format ( "expected singleton List<ChangeInfo>, found %s for [%s]" , results , query ) ) . that ( results ) . hasSize ( 1 ) ; return results.get ( 0 ) ; }

Target:
public java.lang.Integer apply ( com.google.gerrit.reviewdb.client.Change in ) { return in.getId ( ) . get ( ) ; }
Source:
public final java.util.List < com.google.gerrit.reviewdb.client.Account.FieldName > editableAccountFields ( ) { java.util.List < com.google.gerrit.reviewdb.client.Account.FieldName > fields = new java.util.ArrayList < > ( ) ; for ( java.lang.String f : com.google.gerrit.client.rpc.Natives.asList ( _editableAccountFields ( ) ) ) { fields.add ( Account.FieldName.valueOf ( f ) ) ; } return fields ; }

Target:
public final java.util.List < com.google.gerrit.extensions.client.AccountFieldName > editableAccountFields ( ) { java.util.List < com.google.gerrit.extensions.client.AccountFieldName > fields = new java.util.ArrayList < > ( ) ; for ( java.lang.String f : com.google.gerrit.client.rpc.Natives.asList ( _editableAccountFields ( ) ) ) { fields.add ( com.google.gerrit.extensions.client.AccountFieldName.valueOf ( f ) ) ; } return fields ; }
Source:
private void expandBefore ( ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.getFrom ( ) . getLine ( ) ; int newStart = oldStart + ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ; int end = range.getTo ( ) . getLine ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }

Target:
void onExpandBefore ( com.google.gwt.event.dom.client.ClickEvent e ) { expandBefore ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ; cm.focus ( ) ; }
Source:
public void changeEditRef ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Account.Id accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 1000042 ) ; com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( 56414 ) ; com.google.gerrit.reviewdb.client.PatchSet.Id psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , 50 ) ; java.lang.String refName = com.google.gerrit.server.edit.ChangeEditUtil.editRefName ( accountId , changeId , psId ) ; org.junit.Assert.assertEquals ( "refs/users/42/1000042/edit-56414/50" , refName ) ; }

Target:
public void changeEditRef ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Account.Id accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 1000042 ) ; com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( 56414 ) ; com.google.gerrit.reviewdb.client.PatchSet.Id psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , 50 ) ; java.lang.String refName = com.google.gerrit.reviewdb.client.RefNames.refsEdit ( accountId , changeId , psId ) ; org.junit.Assert.assertEquals ( "refs/users/42/1000042/edit-56414/50" , refName ) ; }
Source:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; } }

Target:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not update the reference as a fast forward" ) ; } }
Source:
public void destroy ( ) { if ( ( ( task ) != null ) && ( ! ( task.isDone ( ) ) ) ) { task.cancel ( true ) ; } }

Target:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminCommand ( ) ) || ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup toAccountGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) ; }

Target:
private java.util.Optional < com.google.gerrit.server.group.InternalGroup > toInternalGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . getInternalGroup ( uuid ) ; }
Source:
public void oneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }

Target:
public void oneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }
Source:
public void gitLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; java.lang.String url ; url = "git://example.com/repo.git" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git:example.com/repo.git" ) ) . isEqualTo ( "#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://" ) ) . isEqualTo ( "#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://example.com/../root" ) ) . isEqualTo ( "#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://example.com/root/.." ) ) . isEqualTo ( "#zSoyz" ) ; }

Target:
public void gitLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; java.lang.String url ; url = "git://example.com/repo.git" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git:example.com/repo.git" ) ) . isEqualTo ( "about:invalid#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://" ) ) . isEqualTo ( "about:invalid#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://example.com/../root" ) ) . isEqualTo ( "about:invalid#zSoyz" ) ; com.google.common.truth.Truth.assertThat ( md.href ( "git://example.com/root/.." ) ) . isEqualTo ( "about:invalid#zSoyz" ) ; }
Source:
public void emptyGroupName ( ) throws java.lang.Exception { com.google.gerrit.common.data.GroupReference g = newGroup ( "" ) ; updateGroupNames ( com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) , g ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.GroupNameNotes.loadAllGroups ( repo ) ) . containsExactly ( g ) ; com.google.common.truth.Truth.assertThat ( readNameNote ( g ) ) . isEqualTo ( "[group]\n\tuuid = -1\n\tname = \n" ) ; }

Target:
public void emptyGroupName ( ) throws java.lang.Exception { com.google.gerrit.common.data.GroupReference g = newGroup ( "" ) ; updateAllGroups ( com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) , g ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.GroupNameNotes.loadAllGroups ( repo ) ) . containsExactly ( g ) ; com.google.common.truth.Truth.assertThat ( readNameNote ( g ) ) . isEqualTo ( "[group]\n\tuuid = -1\n\tname = \n" ) ; }
Source:
private void req ( java.lang.String key , java.lang.StringBuffer buf , org.apache.log4j.spi.LoggingEvent event ) { java.lang.Object val = event.getMDC ( key ) ; buf.append ( ' ' ) ; if ( val != null ) { buf.append ( val ) ; } else { buf.append ( '-' ) ; } }

Target:
private void req ( java.lang.String key , java.lang.StringBuffer buf , org.apache.log4j.spi.LoggingEvent event ) { java.lang.Object val = event.getMDC ( key ) ; buf.append ( ' ' ) ; if ( val != null ) { java.lang.String s = val.toString ( ) ; if ( 0 <= ( s.indexOf ( ' ' ) ) ) { buf.append ( QuotedString.BOURNE.quote ( s ) ) ; } else { buf.append ( val ) ; } } else { buf.append ( '-' ) ; } }
Source:
public java.lang.String encode ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String emailAddress ) { try { java.lang.String payload = java.lang.String.format ( "%s:%s" , accountId , emailAddress ) ; byte [ ] utf8 = payload.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; java.lang.String base64 = org.eclipse.jgit.util.Base64.encodeBytes ( utf8 ) ; return emailRegistrationToken.newToken ( base64 ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }

Target:
public java.lang.String encode ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String emailAddress ) { checkEmailRegistrationToken ( ) ; try { java.lang.String payload = java.lang.String.format ( "%s:%s" , accountId , emailAddress ) ; byte [ ] utf8 = payload.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; java.lang.String base64 = org.eclipse.jgit.util.Base64.encodeBytes ( utf8 ) ; return emailRegistrationToken.newToken ( base64 ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }
Source:
private static javax.xml.parsers.DocumentBuilder newBuilder ( ) throws javax.xml.parsers.ParserConfigurationException { final javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; factory.setValidating ( false ) ; factory.setExpandEntityReferences ( false ) ; factory.setIgnoringComments ( true ) ; final javax.xml.parsers.DocumentBuilder parser = factory.newDocumentBuilder ( ) ; return parser ; }

Target:
private static javax.xml.parsers.DocumentBuilder newBuilder ( ) throws javax.xml.parsers.ParserConfigurationException { final javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; factory.setValidating ( false ) ; factory.setExpandEntityReferences ( false ) ; factory.setIgnoringComments ( true ) ; factory.setCoalescing ( true ) ; final javax.xml.parsers.DocumentBuilder parser = factory.newDocumentBuilder ( ) ; return parser ; }
Source:
public void testFindInDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( ( - 1 ) , mapper.lineOnOther ( Side.PARENT , 9 ) ) ; }

Target:
public void testFindAfterInsertGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendInsert ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( Side.REVISION , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.PARENT , 0 ) ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }

Target:
private void refresh ( ) { com.google.gerrit.client.groups.GroupMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.groups.GroupMap > ( this , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } } ) ) ; }
Source:
public com.google.gerrit.server.group.GroupResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return parse ( id ) ; }

Target:
public com.google.gerrit.server.group.GroupResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return parse ( id.get ( ) ) ; }
Source:
void delete ( org.apache.lucene.index.Term term ) throws java.io.IOException { writer.deleteDocuments ( term ) ; }

Target:
void close ( ) { reopenThread.close ( ) ; try { nrtManager.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene searcher" , e ) ; } try { writer.getIndexWriter ( ) . close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }
Source:
private java.lang.String getInstanceName ( org.eclipse.jgit.lib.Config config , @ com.google.gerrit.common.Nullable com.google.inject.Provider < java.lang.String > canonicalUrlProvider ) { java.lang.String instanceName = config.getString ( "gerrit" , null , "instanceName" ) ; if ( ( instanceName != null ) || ( canonicalUrlProvider == null ) ) { return instanceName ; } return canonicalUrlProvider.get ( ) ; }

Target:
private static java.lang.String getInstanceName ( org.eclipse.jgit.lib.Config config , @ com.google.gerrit.common.Nullable com.google.inject.Provider < java.lang.String > canonicalUrlProvider ) { java.lang.String instanceName = config.getString ( "gerrit" , null , "instanceName" ) ; if ( ( instanceName != null ) || ( canonicalUrlProvider == null ) ) { return instanceName ; } return com.google.gerrit.server.config.GerritInstanceNameProvider.extractInstanceName ( canonicalUrlProvider.get ( ) ) ; }
Source:
private void createTags ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.CREATE , project , "refs/tags/*" ) ; grant ( Permission.PUSH , project , "refs/tags/*" ) ; for ( java.lang.String tagname : com.google.gerrit.acceptance.rest.project.TagsIT.testTags ) { com.google.gerrit.acceptance.PushOneCommit.Tag tag = new com.google.gerrit.acceptance.PushOneCommit.Tag ( tagname ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push.setTag ( tag ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/for/master%submit" ) ; result.assertOkStatus ( ) ; } }

Target:
private void createTags ( ) throws java.lang.Exception { grantTagPermissions ( ) ; for ( java.lang.String tagname : com.google.gerrit.acceptance.rest.project.TagsIT.testTags ) { com.google.gerrit.acceptance.PushOneCommit.Tag tag = new com.google.gerrit.acceptance.PushOneCommit.Tag ( tagname ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push.setTag ( tag ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/for/master%submit" ) ; result.assertOkStatus ( ) ; } }