auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager setAllUsersRepo ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) { com.google.common.base.Preconditions.checkState ( ( ( allUsersRepo ) == null ) , "allUsers repo already initialized" ) ; allUsersRepo = new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , rw , ins , cmds , false ) ; return this ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager setAllUsersRepo ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) { com.google.common.base.Preconditions.checkState ( ( ( allUsersRepo ) == null ) , "All-Users repo already initialized" ) ; allUsersRepo = new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , rw , ins , cmds , false ) ; return this ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index -- ; index > ( - 1 ) ; index -- ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; if ( link != null ) { return link ; } } return null ; }

Target:
private int getNextPatchHelper ( int currentIndex , boolean loopAround , int maxIndex , com.google.gerrit.client.changes.PatchTable.PatchValidator ... validators ) { for ( int i = currentIndex + 1 ; i < maxIndex ; i ++ ) { com.google.gerrit.reviewdb.client.Patch patch = detail.getPatches ( ) . get ( i ) ; if ( ( patch != null ) && ( patchIsValid ( patch , validators ) ) ) { return i ; } } if ( loopAround ) { return getNextPatchHelper ( ( - 1 ) , false , currentIndex , validators ) ; } return - 1 ; }
Source:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String tagRev = tag ( ) . get ( ) . revision ; tag ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , com.google.gerrit.acceptance.rest.project.DeleteTagIT.TAG , null , tagRev , tagRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; tag ( ) . get ( ) ; }

Target:
private void assertDeleteForbidden ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( tag ( ) . get ( ) . canDelete ) . isNull ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "delete not permitted" ) ; tag ( ) . delete ( ) ; }
Source:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.serviceuser.PutConfig.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.serviceuser.ServiceUserResource.SERVICE_USER_KIND ) ; bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; get ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserResource.SERVICE_USER_KIND ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.serviceuser.PutConfig.class ) ; }
Source:
private com.google.gerrit.extensions.common.ChangeMessageInfo getLastMessage ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.ChangeMessageInfo lastMessage = com.google.common.collect.Iterables.getLast ( gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . get ( ) . messages , null ) ; com.google.common.truth.Truth.assertThat ( lastMessage ) . isNotNull ( ) ; return lastMessage ; }

Target:
private com.google.gerrit.extensions.common.ChangeMessageInfo getLastMessage ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.ChangeMessageInfo lastMessage = com.google.common.collect.Iterables.getLast ( gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . get ( ) . messages , null ) ; com.google.common.truth.Truth.assertThat ( lastMessage ) . named ( lastMessage.message ) . isNotNull ( ) ; return lastMessage ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.groups.GroupMap.all ( 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 ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
private void refresh ( ) { final java.lang.String mySubname = subname ; com.google.gerrit.client.groups.GroupMap.match ( subname , 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 ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } } } ) ; }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String fileName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , "HEAD" , fileName ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String path = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , "HEAD" , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.getFileName ( path ) ) ; }
Source:
void display ( final java.util.Map < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.client.reviewdb.ProjectRight > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.ProjectRight k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , k ) ; } }

Target:
private void display ( final com.google.gerrit.client.admin.ProjectDetail result ) { final com.google.gerrit.client.reviewdb.Project project = result.project ; setTitleText ( Util.M.project ( project.getName ( ) ) ) ; }
Source:
private boolean expired ( java.sql.Timestamp created ) { if ( ( expireAfterWrite ) == 0 ) { return false ; } long age = ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) - ( created.getTime ( ) ) ; return ( 1000 * ( expireAfterWrite ) ) < age ; }

Target:
private boolean expired ( java.sql.Timestamp created ) { if ( ( expireAfterWrite ) == 0 ) { return false ; } long age = ( com.google.gerrit.common.TimeUtil.nowMs ( ) ) - ( created.getTime ( ) ) ; return ( 1000 * ( expireAfterWrite ) ) < age ; }
Source:
public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.UnifiedCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }

Target:
java.lang.String getTokenSuffixForActiveLine ( net.codemirror.lib.CodeMirror cm ) { int cmLinePlusOne = ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ; com.google.gerrit.client.diff.UnifiedChunkManager.LineRegionInfo info = ( ( com.google.gerrit.client.diff.Unified ) ( host ) ) . getLineRegionInfoFromCmLine ( ( cmLinePlusOne - 1 ) ) ; return ( ( info.getSide ( ) ) == ( DisplaySide.A ) ? "a" : "" ) + cmLinePlusOne ; }
Source:
public void run ( ) { store.put ( key , h ) ; }

Target:
public com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > call ( ) throws java.lang.Exception { if ( store.mightContain ( key ) ) { com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = store.getIfPresent ( key ) ; if ( h != null ) { return h ; } } final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( loader.call ( ) ) ; h.created = com.google.gerrit.common.TimeUtil.nowMs ( ) ; executor.execute ( ( ) -> store.put ( key , h ) ) ; return h ; }
Source:
public static com.google.gerrit.reviewdb.client.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setShowLineEndings ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT ) ; p.setManualReview ( false ) ; return p ; }

Target:
public static com.google.gerrit.reviewdb.client.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTheme ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Theme.DEFAULT ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setShowLineEndings ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT ) ; p.setManualReview ( false ) ; return p ; }
Source:
public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup.Id id ) { return id.toString ( ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.extensions.api.accounts.AccountInput input = new com.google.gerrit.extensions.api.accounts.AccountInput ( ) ; input.username = username ; input.email = email ; input.name = fullName ; input.sshKey = readSshKey ( ) ; input.httpPassword = httpPassword ; input.groups = com.google.common.collect.Lists.transform ( groups , com.google.gerrit.reviewdb.client.AccountGroup.Id :: toString ) ; try { createAccountFactory.create ( username ) . apply ( TopLevelResource.INSTANCE , input ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e.getMessage ( ) ) ; } }
Source:
protected com.google.gerrit.reviewdb.client.Change insert ( com.google.gerrit.server.change.ChangeInserter ins ) throws java.lang.Exception { try ( com.google.gerrit.server.git.BatchUpdate bu = updateFactory.create ( db , ins.getChange ( ) . getProject ( ) , ins.getUser ( ) , ins.getChange ( ) . getCreatedOn ( ) ) ) { bu.insertChange ( ins ) ; bu.execute ( ) ; return ins.getChange ( ) ; } }

Target:
protected com.google.gerrit.reviewdb.client.Change insert ( com.google.gerrit.server.change.ChangeInserter ins ) throws java.lang.Exception { try ( com.google.gerrit.server.git.BatchUpdate bu = updateFactory.create ( db , ins.getProject ( ) , ins.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { bu.insertChange ( ins ) ; bu.execute ( ) ; return ins.getChange ( ) ; } }
Source:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( repoManager , migration , allUsers , getChangeId ( ) , author ) ; draftCommentNotes.load ( ) ; } }

Target:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( repoManager , migration , allUsers , commentsUtil , getChangeId ( ) , author ) ; draftCommentNotes.load ( ) ; } }
Source:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; }

Target:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; final com.google.gwt.user.client.ui.Label keyHelp = new com.google.gwt.user.client.ui.Label ( com.google.gerrit.client.Gerrit.C.keyHelp ( ) ) ; keyHelp.setStyleName ( "gerrit-keyhelp" ) ; btmmenu.add ( keyHelp ) ; }
Source:
private com.google.gerrit.server.edit.ChangeEdit createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.PatchSet basePatchSet , org.eclipse.jgit.lib.ObjectId newEditCommitId , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = changeControl.getChange ( ) ; java.lang.String editRefName = getEditRefName ( change , basePatchSet ) ; updateReference ( repository , editRefName , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , newEditCommitId , timestamp ) ; reindex ( change ) ; org.eclipse.jgit.revwalk.RevCommit newEditCommit = com.google.gerrit.server.edit.ChangeEditModifier.lookupCommit ( repository , newEditCommitId ) ; return new com.google.gerrit.server.edit.ChangeEdit ( change , editRefName , newEditCommit , basePatchSet ) ; }

Target:
private com.google.gerrit.server.edit.ChangeEdit createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet basePatchSet , org.eclipse.jgit.lib.ObjectId newEditCommitId , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = notes.getChange ( ) ; java.lang.String editRefName = getEditRefName ( change , basePatchSet ) ; updateReference ( repository , editRefName , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , newEditCommitId , timestamp ) ; reindex ( change ) ; org.eclipse.jgit.revwalk.RevCommit newEditCommit = com.google.gerrit.server.edit.ChangeEditModifier.lookupCommit ( repository , newEditCommitId ) ; return new com.google.gerrit.server.edit.ChangeEdit ( change , editRefName , newEditCommit , basePatchSet ) ; }
Source:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( c ) ) . containsExactly ( "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }
Source:
public void testTagDiv ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.openDiv ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "d<a>ta" ) ) ; org.junit.Assert.assertSame ( b , b.closeDiv ( ) ) ; org.junit.Assert.assertEquals ( "<div>d&lt;a&gt;ta</div>" , b.asString ( ) ) ; }

Target:
public void testTagDiv ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.openDiv ( ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( "d<a>ta" ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.closeDiv ( ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "<div>d&lt;a&gt;ta</div>" ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.dom.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.dom.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; event.stopPropagation ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.dom.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.dom.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; event.stopPropagation ( ) ; } saveSelectedTab ( ) ; }
Source:
public boolean canSubmit ( ) { return canPerform ( ApprovalCategory.SUBMIT , ( ( short ) ( 1 ) ) ) ; }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . isAdministrator ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }
Source:
public java.util.List < java.lang.String > getMoreStable ( java.lang.String branch ) { int i = order.indexOf ( com.google.gerrit.server.git.BranchOrderSection.fullName ( branch ) ) ; if ( 0 <= i ) { return order.subList ( ( i + 1 ) , order.size ( ) ) ; } else { return com.google.common.collect.ImmutableList.of ( ) ; } }

Target:
public java.util.List < java.lang.String > getMoreStable ( java.lang.String branch ) { int i = order.indexOf ( com.google.gerrit.reviewdb.client.RefNames.fullName ( branch ) ) ; if ( 0 <= i ) { return order.subList ( ( i + 1 ) , order.size ( ) ) ; } else { return com.google.common.collect.ImmutableList.of ( ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { com.google.gerrit.client.change.RelatedChangesTab tab = tabs.get ( com.google.gerrit.client.change.RelatedChanges.RELATED_CHANGES ) ; tab.setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; tab.setChanges ( info.project ( ) , revision , result.changes ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { relatedChangesTab.setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; relatedChangesTab.setChanges ( info.project ( ) , revision , result.changes ( ) ) ; }
Source:
private void columnReviewed ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . reviewed ( ) ) ; if ( hasUser ) { sb.openElement ( "input" ) . setAttribute ( "title" , Resources.C.reviewedFileTitle ( ) ) . setAttribute ( "type" , "checkbox" ) . setAttribute ( "onclick" , ( ( ( ( com.google.gerrit.client.change.FileTable.REVIEWED ) + "(event," ) + ( info._row ( ) ) ) + ")" ) ) . closeSelf ( ) ; } sb.closeTd ( ) ; }

Target:
private void columnReviewed ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.info.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . reviewed ( ) ) ; if ( hasUser ) { sb.openElement ( "input" ) . setAttribute ( "title" , Resources.C.reviewedFileTitle ( ) ) . setAttribute ( "type" , "checkbox" ) . setAttribute ( "onclick" , ( ( ( ( com.google.gerrit.client.change.FileTable.REVIEWED ) + "(event," ) + ( info._row ( ) ) ) + ")" ) ) . closeSelf ( ) ; } sb.closeTd ( ) ; }
Source:
public org.eclipse.jgit.lib.Config load ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File path = getPath ( ) ; if ( path == null ) { return null ; } org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( path ) ; try { load ( repo ) ; } finally { repo.close ( ) ; } return cfg ; }

Target:
public com.google.gerrit.pgm.init.api.AllProjectsConfig load ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File path = getPath ( ) ; if ( path != null ) { org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( path ) ; try { load ( repo ) ; } finally { repo.close ( ) ; } } return this ; }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { return byId.get ( groupId ) ; }

Target:
public void evict ( final com.google.gerrit.reviewdb.client.AccountGroup group ) { if ( ( group.getId ( ) ) != null ) { byId.invalidate ( group.getId ( ) ) ; } if ( ( group.getNameKey ( ) ) != null ) { byName.invalidate ( group.getNameKey ( ) . get ( ) ) ; } if ( ( group.getGroupUUID ( ) ) != null ) { byUUID.invalidate ( group.getGroupUUID ( ) . get ( ) ) ; } }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { if ( ( user ) == null ) { if ( isSignedIn ( ) ) { user = identified.create ( val.getAccountId ( ) ) ; } else { user = anonymousProvider.get ( ) ; } } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getUser ( ) { if ( ( user ) == null ) { if ( isSignedIn ( ) ) { user = identified.create ( val.getAccountId ( ) ) ; } else { user = anonymousProvider.get ( ) ; } } return user ; }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.toAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }

Target:
public synchronized void start ( ) { removeStalePluginFiles ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.toAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }
Source:
private void putSchemaVersion ( java.util.Map < java.lang.String , java.lang.Integer > singleVersions , com.google.gerrit.server.index.SchemaDefinitions < ? > schemaDef ) { java.lang.String schemaName = schemaDef.getName ( ) ; int version = cfg.getInt ( "index" , "lucene" , ( schemaName + "TestVersion" ) , ( - 1 ) ) ; if ( version > 0 ) { com.google.common.base.Preconditions.checkState ( ( ! ( singleVersions.containsKey ( schemaName ) ) ) , "version for schema %s was alreay set" , schemaName ) ; singleVersions.put ( schemaName , version ) ; } }

Target:
private void putSchemaVersion ( java.util.Map < java.lang.String , java.lang.Integer > singleVersions , com.google.gerrit.index.SchemaDefinitions < ? > schemaDef ) { java.lang.String schemaName = schemaDef.getName ( ) ; int version = cfg.getInt ( "index" , "lucene" , ( schemaName + "TestVersion" ) , ( - 1 ) ) ; if ( version > 0 ) { com.google.common.base.Preconditions.checkState ( ( ! ( singleVersions.containsKey ( schemaName ) ) ) , "version for schema %s was alreay set" , schemaName ) ; singleVersions.put ( schemaName , version ) ; } }
Source:
private java.lang.String getPluginCanonicalWebUrl ( java.lang.String name ) { java.lang.String url = java.lang.String.format ( "%s/plugins/%s/" , com.google.common.base.CharMatcher.is ( '/' ) . trimTrailingFrom ( urlProvider.get ( ) ) , name ) ; return url ; }

Target:
private java.lang.String getPluginCanonicalWebUrl ( java.lang.String name ) { java.lang.String canonicalWebUrl = urlProvider.get ( ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( canonicalWebUrl ) ) { return "/plugins/" + name ; } java.lang.String url = java.lang.String.format ( "%s/plugins/%s/" , com.google.common.base.CharMatcher.is ( '/' ) . trimTrailingFrom ( canonicalWebUrl ) , name ) ; return url ; }
Source:
public void run ( ) { java.lang.String t = prefs.theme ( ) . name ( ) . toLowerCase ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "theme" , t ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "theme" , t ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( java.util.Objects.equals ( mode , getSelectedMode ( ) ) ) ) && ( view.isAttached ( ) ) ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; } } ) ; } }
Source:
public static < T > com.google.gerrit.server.query.Predicate < T > and ( java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > that ) { if ( ( that.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( that ) ; } return new com.google.gerrit.server.query.AndPredicate ( that ) ; }

Target:
public static < T > com.google.gerrit.index.query.Predicate < T > and ( java.util.Collection < ? extends com.google.gerrit.index.query.Predicate < T > > that ) { if ( ( that.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( that ) ; } return new com.google.gerrit.index.query.AndPredicate ( that ) ; }
Source:
protected void configureServlets ( ) { serve ( ( "/" + ( OpenIdServiceImpl.RETURN_URL ) ) ) . with ( com.google.gerrit.server.openid.OpenIdLoginServlet.class ) ; install ( new com.google.gerrit.server.http.RpcServletModule ( com.google.gerrit.server.rpc.UiRpcModule.PREFIX ) { @ java.lang.Override protected void configureServlets ( ) { rpc ( com.google.gerrit.server.openid.OpenIdServiceImpl.class ) ; } } ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > ( ) { } ; core ( type , "openid" ) . timeToIdle ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . timeToLive ( 5 , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.IdentifiedUser caller = ( ( com.google.gerrit.server.IdentifiedUser ) ( control.getCurrentUser ( ) ) ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.IdentifiedUser caller = ( ( com.google.gerrit.server.IdentifiedUser ) ( control.getUser ( ) ) ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } view.setContext ( prefs.context ( ) ) ; }

Target:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canEnableRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; } else { if ( prefs.renderEntireFile ( ) ) { prefs.renderEntireFile ( false ) ; renderEntireFile.setValue ( false ) ; view.updateRenderEntireFile ( ) ; } renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }
Source:
boolean isSubmit ( ) { return submit ; }

Target:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , commit , "submit" ) . data ( in ) . post ( cb ) ; }

Target:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . post ( in , cb ) ; }
Source:
private void cleanInBackground ( ) { int cnt = java.lang.Math.max ( 0 , ( ( cleanupHandles.size ( ) ) - ( running.size ( ) ) ) ) ; if ( 0 < cnt ) { cleaner.get ( ) . clean ( cnt ) ; } }

Target:
synchronized int processPendingCleanups ( ) { java.util.Iterator < com.google.gerrit.server.plugins.Plugin > iterator = toCleanup.iterator ( ) ; while ( iterator.hasNext ( ) ) { com.google.gerrit.server.plugins.Plugin plugin = iterator.next ( ) ; iterator.remove ( ) ; com.google.gerrit.server.plugins.CleanupHandle cleanupHandle = cleanupHandles.remove ( plugin ) ; cleanupHandle.cleanup ( ) ; } return toCleanup.size ( ) ; }
Source:
private com.google.gerrit.server.account.AccountState toAccountState ( 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.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( ) . get ( id ) ; }

Target:
protected com.google.gerrit.server.account.AccountState fromDocument ( com.google.gson.JsonObject json , java.util.Set < java.lang.String > fields ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( ) . get ( id ) ; }
Source:
public void display ( com.google.gerrit.common.data.ChangeDetail changeDetail , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord , com.google.gerrit.client.ui.CommentLinkProcessor commentLinkProcessor ) { infoBlock.display ( changeDetail , acc , submitTypeRecord ) ; messageBlock.display ( changeDetail.getChange ( ) . currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) , commentLinkProcessor ) ; }

Target:
public void display ( com.google.gerrit.common.data.ChangeDetail changeDetail , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord , com.google.gerrit.client.ui.CommentLinkProcessor commentLinkProcessor ) { infoBlock.display ( changeDetail , acc , submitTypeRecord ) ; messageBlock.display ( changeDetail.getChange ( ) . currentPatchSetId ( ) , info.getRevId ( ) , starred , canEditCommitMessage , info.getMessage ( ) , commentLinkProcessor ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public void testPushForMasterAsDraft ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/drafts/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.DRAFT , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; ref = "refs/for/master%draft" ; r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.DRAFT , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }

Target:
public void testPushForMasterAsDraft ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/drafts/master" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; r = pushTo ( "refs/for/master%draft" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; }
Source:
public com.google.gwt.user.client.ui.CheckBox getSyntaxHighlightingCheckBox ( ) { return syntaxHighlighting ; }

Target:
public void setEnableSmallFileFeatures ( final boolean on ) { enableSmallFileFeatures = on ; if ( enableSmallFileFeatures ) { final com.google.gerrit.prettify.common.PrettySettings p = getValue ( ) . getPrettySettings ( ) ; syntaxHighlighting.setValue ( p.isSyntaxHighlighting ( ) ) ; showFullFile.setValue ( ( ( getValue ( ) . getContext ( ) ) == ( com.google.gerrit.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ) ) ) ; } else { syntaxHighlighting.setValue ( false ) ; showFullFile.setValue ( false ) ; } toggleEnabledStatus ( update.isEnabled ( ) ) ; }
Source:
public void onSuccess ( T value ) { if ( failed ) { return ; } this . result = value ; remaining.remove ( this ) ; this . applyAllSuccess ( ) ; }

Target:
private void applyAllFailed ( ) { if ( ( ( failed ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applyFailed ( ) ; } callbacks.clear ( ) ; } }
Source:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , repo , rw , base , path , ins , content ) ) ; break ; } dce.finish ( ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit prevEdit , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.lib.ObjectId tree ) throws java.io.IOException { return createCommit ( me , inserter , prevEdit , base , tree , prevEdit.getFullMessage ( ) ) ; }
Source:
void onLineWrapping ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.lineWrapping ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; BRANCH ( ee24b3 ) ; com.google.gerrit.client.diff.Adds a ; com.google.gerrit.client.diff.pref config ; com.google.gerrit.client.diff.lineWrapping to ; com.google.gerrit.client.diff.and Diff ; }

Target:
private java.lang.String getSelectedMode ( ) { java.lang.String m = mode.getValue ( mode.getSelectedIndex ( ) ) ; return ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ? m : null ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( config.getUrl ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.syncindex.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getUser ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.syncindex.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getPassword ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.syncindex.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.syncindex.HttpClientProviderTest.TIME_INTERVAL ) ; org.mockito.Mockito.when ( config.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.syncindex.HttpClientProviderTest.TIME_INTERVAL ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( config.getUrl ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.multimaster.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getUser ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.multimaster.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getPassword ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.multimaster.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.multimaster.HttpClientProviderTest.TIME_INTERVAL ) ; org.mockito.Mockito.when ( config.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.multimaster.HttpClientProviderTest.TIME_INTERVAL ) ; }
Source:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; repo.getRevWalk ( ) . parseBody ( commit ) ; com.google.gitiles.CommitJsonData.Log log = buildJson ( "/repo/+log" , com.google.gitiles.LogServletTest.LOG.getType ( ) , "" ) ; com.google.common.truth.Truth.assertThat ( log.log ) . hasSize ( 1 ) ; verifyJsonCommit ( log.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( log.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }

Target:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; com.google.gitiles.CommitJsonData.Log response = buildJson ( "/repo/+log" , com.google.gitiles.LogServletTest.LOG , "" ) ; com.google.common.truth.Truth.assertThat ( response.log ) . hasSize ( 1 ) ; verifyJsonCommit ( response.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( response.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }
Source:
private static com.google.common.base.Optional < com.google.gerrit.common.data.SubmitRecord > findOkRecord ( java.util.Collection < com.google.gerrit.common.data.SubmitRecord > in ) { return com.google.common.collect.Iterables.tryFind ( in , new com.google.common.base.Predicate < com.google.gerrit.common.data.SubmitRecord > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.common.data.SubmitRecord input ) { return ( input.status ) == ( com.google.gerrit.common.data.SubmitRecord.Status.OK ) ; } } ) ; }

Target:
public boolean submittable ( com.google.gerrit.server.query.change.ChangeData cd ) { try { com.google.gerrit.server.git.MergeOp.checkSubmitRule ( cd ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException | com.google.gwtorm.server.OrmException e ) { return false ; } }
Source:
private void saveSubscribeSections ( org.eclipse.jgit.lib.Config rc ) { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : subscribeSections.keySet ( ) ) { com.google.gerrit.common.data.SubscribeSection s = subscribeSections.get ( p ) ; for ( org.eclipse.jgit.transport.RefSpec r : s.getRefSpecs ( ) ) { rc.setString ( com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_SECTION , p.get ( ) , com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_REFS , r.toString ( ) ) ; } } }

Target:
private void saveSubscribeSections ( org.eclipse.jgit.lib.Config rc ) { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : subscribeSections.keySet ( ) ) { com.google.gerrit.common.data.SubscribeSection s = subscribeSections.get ( p ) ; for ( org.eclipse.jgit.transport.RefSpec r : s.getMatchingRefSpecs ( ) ) { rc.setString ( com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_SECTION , p.get ( ) , com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_MATCH_REFS , r.toString ( ) ) ; } for ( org.eclipse.jgit.transport.RefSpec r : s.getMultiMatchRefSpecs ( ) ) { rc.setString ( com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_SECTION , p.get ( ) , com.google.gerrit.server.git.ProjectConfig.SUBSCRIBE_MULTI_MATCH_REFS , r.toString ( ) ) ; } } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( accessToken ) == null ? 0 : accessToken.hashCode ( ) ) ; result = ( prime * result ) + ( ( tokenType ) == null ? 0 : tokenType.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( accessToken , tokenType , error , errorDescription , errorUri ) ; }
Source:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return execute ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }

Target:
private < T > T executeWithAttemptAndTimeoutCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return executeWithTimeoutCount ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }