auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { return buckOut.resolveSibling ( "gerrit-war" ) . resolve ( "src" ) . resolve ( "main" ) . resolve ( "webapp" ) . resolve ( name ) ; }

Target:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { if ( ( unpackedWar ) != null ) { return unpackedWar.resolve ( name ) ; } return buckOut.resolveSibling ( "gerrit-war" ) . resolve ( "src" ) . resolve ( "main" ) . resolve ( "webapp" ) . resolve ( name ) ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm intDivide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.lang.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.lang.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( int ) ( ( this . val ) / ( t.intValue ( ) ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm intDivide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( int ) ( ( this . val ) / ( t.intValue ( ) ) ) ) ) ; }
Source:
static final void post ( com.google.gerrit.client.rpc.RestApi api , com.google.gwt.core.client.JavaScriptObject in , com.google.gwt.core.client.JavaScriptObject cb ) { api.post ( in , com.google.gerrit.client.api.ActionContext.wrap ( cb ) ) ; }

Target:
static final void post ( com.google.gerrit.client.rpc.RestApi api , com.google.gwt.core.client.JavaScriptObject in , com.google.gwt.core.client.JavaScriptObject cb ) { if ( com.google.gerrit.client.rpc.NativeString.is ( in ) ) { com.google.gerrit.client.api.ActionContext.post ( api , ( ( com.google.gerrit.client.rpc.NativeString ) ( in ) ) . asString ( ) , cb ) ; } else { api.post ( in , com.google.gerrit.client.api.ActionContext.wrap ( cb ) ) ; } }
Source:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) ) ; } } }

Target:
private void logWarn ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isWarnEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.warn ( ( ( submissionId ) + msg ) , t ) ; } }
Source:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( change ) != null ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.areDraftsUpToDate ( repo , author ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }

Target:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( ( change ) != null ) && ( autoRebuild ) ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.areDraftsUpToDate ( repo , author ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }
Source:
private boolean finite ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . isFinite ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return false ; } else { return true ; } }

Target:
private boolean finite ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefPattern.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefPattern.toRegExp ( pattern ) . toAutomaton ( ) . isFinite ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return false ; } else { return true ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.account.Preferences > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.client.account.Preferences prefs ) { display ( prefs ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.api.ExtensionPanel extensionPanel = createExtensionPoint ( GerritUiExtensionPoint.PREFERENCES_SCREEN_BOTTOM ) ; extensionPanel.addStyleName ( Gerrit.RESOURCES.css ( ) . extensionPanel ( ) ) ; add ( extensionPanel ) ; com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.info.AccountPreferencesInfo > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { display ( prefs ) ; } } ) ; }
Source:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot insert a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( changeNotes.containsComment ( c ) ) ) , ( "A comment already exists with the same key," + " so the following comment cannot be inserted: %s" ) , c ) ; } upsertComments.add ( c ) ; }

Target:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot insert a published comment into a ChangeDraftUpdate" ) ; if ( migration.readChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( changeNotes.containsComment ( c ) ) ) , ( "A comment already exists with the same key," + " so the following comment cannot be inserted: %s" ) , c ) ; } upsertComments.add ( c ) ; }
Source:
public boolean canAdministrateServer ( ) { if ( ( canAdministrateServer ) == null ) { canAdministrateServer = ( ( user ) instanceof com.google.gerrit.server.PeerDaemonUser ) || ( matchAny ( capabilities.administrateServer , com.google.gerrit.server.account.CapabilityControl.ALLOWED_RULE ) ) ; } return canAdministrateServer ; }

Target:
public boolean canAdministrateServer ( ) { if ( ( canAdministrateServer ) == null ) { if ( ( user.getRealUser ( ) ) != ( user ) ) { canAdministrateServer = false ; } else { canAdministrateServer = ( ( user ) instanceof com.google.gerrit.server.PeerDaemonUser ) || ( matchAny ( capabilities.administrateServer , com.google.gerrit.server.account.CapabilityControl.ALLOWED_RULE ) ) ; } } return canAdministrateServer ; }
Source:
public void replaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) ) ; }

Target:
public void replaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( "A\n<a href=\"?42\">issue 42</a>\n<a href=\"?9918\">issue 9918</a>\nB" ) ; }
Source:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { if ( ( prefsHandler ) != null ) { prefsHandler.removeHandler ( ) ; prefsHandler = null ; } if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }
Source:
public void login ( final com.google.gerrit.reviewdb.Account.Id id , final boolean rememberMe ) { logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }
Source:
public void diff ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.DiffInfo diff = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . diff ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaA ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaB.lines ) . isEqualTo ( 1 ) ; }

Target:
private void assertContent ( com.google.gerrit.acceptance.PushOneCommit.Result pushResult , java.lang.String path , java.lang.String expectedContent ) throws java.lang.Exception { com.google.gerrit.extensions.restapi.BinaryResult bin = gApi.changes ( ) . id ( pushResult.getChangeId ( ) ) . revision ( pushResult.getCommit ( ) . name ( ) ) . file ( path ) . content ( ) ; java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; bin.writeTo ( os ) ; java.lang.String res = new java.lang.String ( os.toByteArray ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.common.truth.Truth.assertThat ( res ) . isEqualTo ( expectedContent ) ; }
Source:
private Change.Id insertPatchSet ( org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , org.eclipse.jgit.revwalk.RevCommit cherryPickCommit , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { patchSetInserterFactory.create ( git , revWalk , refControl , currentUser , change , cherryPickCommit ) . setMessage ( buildChangeMessage ( patchSetId , change ) ) . insert ( ) ; return change.getId ( ) ; }

Target:
private Change.Id insertPatchSet ( org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , org.eclipse.jgit.revwalk.RevCommit cherryPickCommit , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.server.change.PatchSetInserter inserter = patchSetInserterFactory.create ( git , revWalk , refControl , currentUser , change , cherryPickCommit ) ; final com.google.gerrit.reviewdb.client.PatchSet.Id newPatchSetId = inserter.getPatchSetId ( ) ; inserter.setMessage ( ( ( "Uploaded patch set " + ( newPatchSetId.get ( ) ) ) + "." ) ) . insert ( ) ; return change.getId ( ) ; }
Source:
public void visit ( org.pegdown.ast.WikiLinkNode node ) { java.lang.String text = node.getText ( ) ; java.lang.String path = ( text.replace ( ' ' , '-' ) ) + ".md" ; html.open ( "a" ) . attribute ( "href" , href ( path ) ) . appendAndEscape ( text ) . close ( "a" ) ; }

Target:
public void visit ( org.commonmark.node.Link node ) { html.open ( "a" ) . attribute ( "href" , href ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; }
Source:
public void display ( final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { final java.lang.StringBuilder nc = new java.lang.StringBuilder ( ) ; appendHeader ( nc ) ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { appendRow ( nc , p ) ; } appendRow ( nc , null ) ; resetHtml ( nc.toString ( ) ) ; int row = 1 ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { setRowItem ( ( row ++ ) , p ) ; } }

Target:
private boolean longRunning ( ) { return ( ( java.lang.System.currentTimeMillis ( ) ) - ( start ) ) > 200 ; }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort , org.eclipse.jgit.revwalk.RevCommit initialTip ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , initialTip , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
public void testIsEnabledChangeAbandonedEvent ( ) { testIsEnabledEvent ( com.google.gerrit.server.events.ChangeAbandonedEvent.class ) ; }

Target:
public void testIsEnabledChangeRestoredEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeRestoredEvent event = new com.google.gerrit.server.events.ChangeRestoredEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseSubmissionId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submission-id: 1-1453387901516-5d1e2450" ) ) ) ; }
Source:
public void setAuthorNameText ( final com.google.gerrit.client.account.AccountInfo author , final java.lang.String nameText ) { header.setWidget ( 0 , 0 , new com.google.gerrit.client.AvatarImage ( author ) ) ; header.setText ( 0 , 1 , nameText ) ; body.getElement ( ) . setAttribute ( "email" , author.email ( ) ) ; body.getElement ( ) . setAttribute ( "name" , author.name ( ) ) ; }

Target:
public void setAuthorNameText ( final com.google.gerrit.client.info.AccountInfo author , final java.lang.String nameText ) { header.setWidget ( 0 , 0 , new com.google.gerrit.client.AvatarImage ( author ) ) ; header.setText ( 0 , 1 , nameText ) ; body.getElement ( ) . setAttribute ( "email" , author.email ( ) ) ; body.getElement ( ) . setAttribute ( "name" , author.name ( ) ) ; }
Source:
public boolean isValid ( final com.google.gerrit.client.reviewdb.Account.Id accountId , final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( com.google.gerrit.server.workflow.SubmitFunction.valid ( at , state ) ) { for ( final com.google.gerrit.client.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( state.isMember ( accountId , pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) > 0 ) ) { return true ; } } } return false ; }

Target:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( com.google.gerrit.server.workflow.SubmitFunction.valid ( at , state ) ) { for ( final com.google.gerrit.client.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) > 0 ) ) { return true ; } } } return false ; }
Source:
private void initReplyButton ( ) { reply.setTitle ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyTitle ( ) ) ; reply.setHTML ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openDiv ( ) . append ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyLabel ( ) ) . closeDiv ( ) ) ; if ( changeInfo.revision ( revision ) . is_edit ( ) ) { reply.setVisible ( false ) ; quickApprove.setVisible ( false ) ; } }

Target:
void onPublish ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.change.DraftActions.publish ( changeId , revision ) ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }
Source:
protected int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
protected boolean getBoolean ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , boolean defaultValue ) { try { return cfg.getBoolean ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { logError ( name , "boolean" , defaultValue , e ) ; return defaultValue ; } }
Source:
private org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( ) { org.eclipse.jgit.merge.ThreeWayMerger m ; if ( destProject.isUseContentMerge ( ) ) { m = MergeStrategy.RESOLVE.newMerger ( repo , true ) ; } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger ( repo ) ; } m.setObjectInserter ( new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; } @ java.lang.Override public void flush ( ) { } @ java.lang.Override public void release ( ) { } } ) ; return m ; }

Target:
private com.google.gerrit.server.git.SubmitStrategy createStrategy ( ) throws com.google.gerrit.server.git.MergeException { return submitStrategyFactory.create ( destProject.getSubmitType ( ) , db , repo , rw , inserter , CAN_MERGE , alreadyAccepted , destBranch , destProject.isUseContentMerge ( ) ) ; }
Source:
private java.sql.PreparedStatement setupPreparedStatementForBatch ( final int [ ] updateCounts ) throws java.sql.SQLException { java.sql.PreparedStatement ps = org.mockito.Mockito.mock ( java.sql.PreparedStatement.class ) ; org.mockito.Mockito.doNothing ( ) . when ( ps ) . addBatch ( ) ; org.mockito.Mockito.stub ( ps.executeBatch ( ) ) . toReturn ( updateCounts ) ; org.mockito.Mockito.stub ( ps.executeUpdate ( ) ) . toThrow ( new java.lang.AssertionError ( "unexpected method call" ) ) ; return ps ; }

Target:
private java.sql.PreparedStatement stubStatementThrowExceptionOnExecute ( java.lang.String command , java.sql.SQLException exception ) throws java.sql.SQLException { java.sql.PreparedStatement ps = org.mockito.Mockito.mock ( java.sql.PreparedStatement.class ) ; org.mockito.Mockito.doNothing ( ) . when ( ps ) . addBatch ( ) ; org.mockito.Mockito.when ( ps.executeBatch ( ) ) . thenThrow ( exception ) ; org.mockito.Mockito.when ( ps.executeUpdate ( ) ) . thenThrow ( exception ) ; org.mockito.Mockito.when ( conn.prepareStatement ( command ) ) . thenReturn ( ps ) ; return ps ; }
Source:
public void evict ( final com.google.gerrit.reviewdb.AccountGroup group ) { byId.remove ( group.getId ( ) ) ; byName.remove ( group.getNameKey ( ) ) ; byExternalName.remove ( group.getExternalNameKey ( ) ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > evictAsync ( com.google.gerrit.reviewdb.AccountGroup group ) { return com.google.gerrit.server.util.CompoundFuture.wrap ( byId.removeAsync ( group.getId ( ) ) , byName.removeAsync ( group.getNameKey ( ) ) , byExternalName.removeAsync ( group.getExternalNameKey ( ) ) ) ; }
Source:
private static java.lang.String encodeDashboardId ( java.lang.String dashboardId ) { int c = dashboardId.indexOf ( ":" ) ; if ( 0 <= c ) { final java.lang.String ref = com.google.gwt.http.client.URL.encode ( dashboardId.substring ( 0 , c ) ) ; final java.lang.String path = com.google.gwt.http.client.URL.encode ( dashboardId.substring ( ( c + 1 ) ) ) ; return ( ref + ":" ) + path ; } else { return com.google.gwt.http.client.URL.encode ( dashboardId ) ; } }

Target:
private static java.lang.String encodeDashboardId ( java.lang.String dashboardId ) { int c = dashboardId.indexOf ( ":" ) ; if ( 0 <= c ) { final java.lang.String ref = com.google.gwt.http.client.URL.encodeQueryString ( dashboardId.substring ( 0 , c ) ) ; final java.lang.String path = com.google.gwt.http.client.URL.encodeQueryString ( dashboardId.substring ( ( c + 1 ) ) ) ; return ( ref + ":" ) + path ; } else { return com.google.gwt.http.client.URL.encodeQueryString ( dashboardId ) ; } }
Source:
public void setList ( java.lang.String section , java.lang.String subsection , java.lang.String name , java.util.List < java.lang.String > values ) { if ( values != null ) { sec.setStringList ( section , subsection , name , values ) ; } else { sec.unset ( section , subsection , name ) ; } save ( ) ; }

Target:
public void setList ( java.lang.String section , java.lang.String subsection , java.lang.String name , java.util.List < java.lang.String > values ) { if ( values != null ) { sec.setStringList ( section , subsection , name , values.stream ( ) . map ( codec :: encode ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; } else { sec.unset ( section , subsection , name ) ; } save ( ) ; }
Source:
private com.google.gerrit.extensions.common.GroupInfo initMembersAndIncludes ( com.google.gerrit.server.group.GroupResource rsrc , com.google.gerrit.extensions.common.GroupInfo info ) throws com.google.gwtorm.server.OrmException { if ( ( rsrc.toAccountGroup ( ) ) == null ) { return info ; } try { if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) { info.members = listMembers.get ( ) . apply ( rsrc ) ; } if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) { info.includes = listIncludes.get ( ) . apply ( rsrc ) ; } return info ; } catch ( com.google.gerrit.extensions.restapi.MethodNotAllowedException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
private com.google.gerrit.extensions.common.GroupInfo initMembersAndIncludes ( com.google.gerrit.server.group.GroupResource rsrc , com.google.gerrit.extensions.common.GroupInfo info ) throws com.google.gwtorm.server.OrmException { if ( ! ( rsrc.isInternalGroup ( ) ) ) { return info ; } try { if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) { info.members = listMembers.get ( ) . apply ( rsrc ) ; } if ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) { info.includes = listIncludes.get ( ) . apply ( rsrc ) ; } return info ; } catch ( com.google.gerrit.extensions.restapi.MethodNotAllowedException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
private void setLabelValues ( com.google.gerrit.common.data.ApprovalType type , com.google.gerrit.server.change.ChangeJson.LabelInfo label ) { label.values = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.ApprovalCategoryValue acv : type.getValues ( ) ) { label.values.put ( acv.formatValue ( ) , acv.getName ( ) ) ; } if ( com.google.gerrit.server.change.ChangeJson.isOnlyZero ( label.values.keySet ( ) ) ) { label.values = null ; } }

Target:
private void setLabelValues ( com.google.gerrit.common.data.LabelType type , com.google.gerrit.server.change.ChangeJson.LabelInfo label ) { label.values = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( com.google.gerrit.common.data.LabelValue v : type.getValues ( ) ) { label.values.put ( v.formatValue ( ) , v.getText ( ) ) ; } if ( com.google.gerrit.server.change.ChangeJson.isOnlyZero ( label.values.keySet ( ) ) ) { label.values = null ; } }
Source:
public void deleteProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > projectWatchKeys ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( com.google.gerrit.server.account.WatchConfig watchConfig = open ( accountId ) ) { java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; boolean commit = false ; for ( com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key : projectWatchKeys ) { if ( ( projectWatches.remove ( key ) ) != null ) { commit = true ; } } if ( commit ) { commit ( watchConfig ) ; } } }

Target:
public void deleteProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > projectWatchKeys ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.WatchConfig watchConfig = read ( accountId ) ; java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; boolean commit = false ; for ( com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key : projectWatchKeys ) { if ( ( projectWatches.remove ( key ) ) != null ) { commit = true ; } } if ( commit ) { commit ( watchConfig ) ; } }
Source:
public void subsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/01/1/meta" , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void subsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
public void flushWebSessions_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userRestSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "projects" ) ) ) ; r.assertOK ( ) ; r.consume ( ) ; userRestSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "web_sessions" ) ) ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; } }

Target:
public void flushWebSessions_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userRestSession.postOK ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "projects" ) ) ) ; r.consume ( ) ; userRestSession.post ( "/config/server/caches/" , new com.google.gerrit.server.config.PostCaches.Input ( com.google.gerrit.server.config.PostCaches.Operation.FLUSH , java.util.Arrays.asList ( "web_sessions" ) ) ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.FLUSH_CACHES , GlobalCapability.VIEW_CACHES ) ; } }
Source:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.create ( c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }

Target:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.createChecked ( db , c ) ) . all ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Abandon" ) . setTitle ( "Abandon the change" ) . setVisible ( ( ( ( change.getStatus ( ) . isOpen ( ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.DRAFT ) ) ) && ( rsrc.permissions ( ) . database ( dbProvider ) . testOrFalse ( ChangePermission.ABANDON ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Abandon" ) . setTitle ( "Abandon the change" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( change.getStatus ( ) . isOpen ( ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.DRAFT ) ) ) , rsrc.permissions ( ) . database ( dbProvider ) . testCond ( ChangePermission.ABANDON ) ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.common.data.ReviewerResult result ) { if ( result.getErrors ( ) . isEmpty ( ) ) { final com.google.gerrit.common.data.ChangeDetail r = result.getChange ( ) ; display ( r.getChange ( ) , r.getMissingApprovals ( ) , r.getApprovals ( ) ) ; } else { new com.google.gerrit.client.ErrorDialog ( result.getErrors ( ) . get ( 0 ) . toString ( ) ) . center ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doRemove ( ad , remove ) ; }
Source:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.get ( callback ) ; }

Target:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.get ( callback ) ; }
Source:
private synchronized void runHook ( org.eclipse.jgit.lib.Repository repo , java.io.File hook , java.util.List < java.lang.String > args ) { if ( repo != null ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( repo , hook , args ) ) ; } else { repo.close ( ) ; } } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( project , hook , args ) ) ; } }
Source:
public void testIsEnabledRefNoParentMatchingBranchMiddleEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentNonMatchingBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
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.isVariable ( ) ) throw new com.googlecode.prolog_cafe.builtin.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.builtin.TermException ( a1 ) ; }

Target:
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.isVariable ( ) ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.exceptions.TermException ( a1 ) ; }
Source:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }

Target:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.MoreObjects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }
Source:
public com.google.gerrit.testutil.TestNotesMigration setFromEnv ( ) { switch ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) { case READ_WRITE : setWriteChanges ( true ) ; setReadChanges ( true ) ; break ; case CHECK : case OFF : default : break ; } return this ; }

Target:
public com.google.gerrit.testutil.TestNotesMigration setFromEnv ( ) { switch ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) { case READ_WRITE : setWriteChanges ( true ) ; setReadChanges ( true ) ; break ; case WRITE : setWriteChanges ( true ) ; setReadChanges ( false ) ; break ; case CHECK : case OFF : default : break ; } return this ; }
Source:
public void testStripDotGit ( ) throws java.lang.Exception { servlet = com.google.gitiles.TestGitilesServlet.create ( repo , new com.google.gitiles.GitwebRedirectFilter ( true ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test.git" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }

Target:
public void stripDotGit ( ) throws java.lang.Exception { servlet = com.google.gitiles.TestGitilesServlet.create ( repo , new com.google.gitiles.GitwebRedirectFilter ( true ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test.git" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignIn ( ) ; } } } ) ; }

Target:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct , final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignIn ( ) ; } if ( ac != null ) { ac.onSuccess ( null ) ; } }
Source:
private com.google.gerrit.server.git.GroupList readGroupList ( ) throws java.io.IOException { com.google.gerrit.server.git.ValidationError.Sink errors = new com.google.gerrit.server.git.ValidationError.Sink ( ) { @ java.lang.Override public void error ( com.google.gerrit.server.git.ValidationError error ) { com.google.gerrit.pgm.init.api.AllProjectsConfig.log.error ( ( ( ( "Error parsing file " + ( com.google.gerrit.server.git.GroupList.FILE_NAME ) ) + ": " ) + ( error.getMessage ( ) ) ) ) ; } } ; java.lang.String text = readUTF8 ( GroupList.FILE_NAME ) ; return com.google.gerrit.server.git.GroupList.parse ( text , errors ) ; }

Target:
private com.google.gerrit.server.git.GroupList readGroupList ( ) throws java.io.IOException { return com.google.gerrit.server.git.GroupList.parse ( readUTF8 ( GroupList.FILE_NAME ) , com.google.gerrit.server.git.GroupList.createLoggerSink ( GroupList.FILE_NAME , com.google.gerrit.pgm.init.api.AllProjectsConfig.log ) ) ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }
Source:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { final com.google.gerrit.httpd.rpc.changedetail.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canRestore ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.restore ( patchSetId , currentUser , message , db , senderFactory , hooks ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canRestore ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.restore ( patchSetId , currentUser , message , db , senderFactory , hooks ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }
Source:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.googlesource.gerrit.plugins.hooks.its.ItsName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; commitMessageFetcher = createMock ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) . toInstance ( commitMessageFetcher ) ; db = createMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; bind ( com.google.gerrit.reviewdb.server.ReviewDb.class ) . toInstance ( db ) ; }

Target:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; commitMessageFetcher = createMock ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) . toInstance ( commitMessageFetcher ) ; db = createMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; bind ( com.google.gerrit.reviewdb.server.ReviewDb.class ) . toInstance ( db ) ; }