auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void listOneIncludeMember ( ) throws java.lang.Exception { group ( "gx" , "Administrators" ) ; group ( "gy" , "Administrators" ) ; PUT ( "/groups/Administrators/groups/gx" ) ; PUT ( "/groups/Administrators/groups/gy" ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( "/groups/Administrators/groups/gx" ) . name ) . isEqualTo ( "gx" ) ; }

Target:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; java.lang.String gy = group ( "gy" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) . name ) . isEqualTo ( gy ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.getBatchRefUpdate ( ) . addCommand ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.TrackingId c : object.trackingIds ( db ) ) { if ( getValue ( ) . equals ( c.getTrackingId ( ) ) ) { return true ; } } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( db ) ; if ( c != null ) { try { return trackingFooters.extract ( object.commitFooters ( repositoryManager , db ) ) . values ( ) . contains ( getValue ( ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.query.change.TrackingIdPredicate.log.warn ( ( "Cannot extract footers from " + ( c.getChangeId ( ) ) ) , e ) ; } } return false ; }
Source:
static boolean skip ( org.eclipse.jgit.lib.Ref ref ) { return ( ( ( ref.isSymbolic ( ) ) || ( ( ref.getObjectId ( ) ) == null ) ) || ( com.google.gerrit.reviewdb.client.PatchSet.isChangeRef ( ref.getName ( ) ) ) ) || ( com.google.gerrit.reviewdb.client.RefNames.isNoteDbMetaRef ( ref.getName ( ) ) ) ; }

Target:
static boolean skip ( org.eclipse.jgit.lib.Ref ref ) { return ( ( ( ( ref.isSymbolic ( ) ) || ( ( ref.getObjectId ( ) ) == null ) ) || ( com.google.gerrit.reviewdb.client.PatchSet.isChangeRef ( ref.getName ( ) ) ) ) || ( com.google.gerrit.reviewdb.client.RefNames.isNoteDbMetaRef ( ref.getName ( ) ) ) ) || ( ref.getName ( ) . startsWith ( RefNames.REFS_CACHE_AUTOMERGE ) ) ; }
Source:
public void manualCertificationDoesNotMatchExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) . getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }

Target:
public void manualCertificationDoesNotMatchExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }
Source:
public void addPatchSets ( com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( ca , ps , approvals , false , null , labelTypes ) ; }

Target:
public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute ( org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return asPatchSetAttribute ( db , revWalk , change , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.EventFactory.log.error ( "Cannot open database connection" , e ) ; return new com.google.gerrit.server.data.PatchSetAttribute ( ) ; } }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ApprovalInfo > approvals ( com.google.gerrit.reviewdb.client.Account a , java.util.Map < java.lang.String , java.lang.Short > approvals , java.sql.Timestamp ts ) { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ApprovalInfo > result = new java.util.HashMap < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Short > e : approvals.entrySet ( ) ) { result.put ( e.getKey ( ) , changeJson.approvalInfo ( a.getId ( ) , new java.lang.Integer ( e.getValue ( ) ) , ts ) ) ; } return result ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo revisionInfo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , project , ps.getId ( ) . getParentKey ( ) ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) ; return changeJson.getRevisionInfo ( ctl , ps ) ; }
Source:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; }

Target:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }
Source:
private boolean messageIsForChange ( ) { if ( ( changeMessage ) == null ) { return false ; } com.google.gerrit.reviewdb.client.Change.Id id = change.getId ( ) ; com.google.gerrit.reviewdb.client.Change.Id msgId = changeMessage.getKey ( ) . getParentKey ( ) ; return msgId.equals ( id ) ; }

Target:
public com.google.gerrit.reviewdb.client.ChangeMessage getChangeMessage ( ) { if ( ( message ) == null ) { return null ; } com.google.common.base.Preconditions.checkState ( ( ( changeMessage ) != null ) , "getChangeMessage() only valid after inserting change" ) ; return changeMessage ; }
Source:
public boolean evict ( java.lang.String cacheName , java.lang.Object key ) { try { java.lang.String json = com.ericsson.gerrit.plugins.highavailability.forwarder.rest.GsonParser.toJson ( cacheName , key ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "cache" , cacheName ) , json ) . isSuccessful ( ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to evict for cache " + cacheName ) , e ) ; return false ; } }

Target:
boolean execute ( ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = send ( ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to {}: {}" , name , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Error trying to {}" , name , e ) ; } return false ; }
Source:
private void lookupGroup ( com.google.gerrit.common.data.PermissionRule rule ) throws com.google.gerrit.common.errors.NoSuchGroupException { com.google.gerrit.common.data.GroupReference ref = rule.getGroup ( ) ; if ( ( ref.getUUID ( ) ) == null ) { com.google.gerrit.reviewdb.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.AccountGroup.NameKey ( ref.getName ( ) ) ; com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( name ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( name ) ; } ref.setUUID ( group.getGroupUUID ( ) ) ; } }

Target:
private void lookupGroup ( com.google.gerrit.common.data.PermissionRule rule ) throws com.google.gerrit.common.errors.NoSuchGroupException { com.google.gerrit.common.data.GroupReference ref = rule.getGroup ( ) ; if ( ( ref.getUUID ( ) ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( ref.getName ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( name ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( name ) ; } ref.setUUID ( group.getGroupUUID ( ) ) ; } }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS , ListChangesOption.WEB_LINKS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
private static java.nio.file.Path getOrCreateDataDir ( com.googlesource.gerrit.plugins.lfs.LfsGlobalConfig config , java.nio.file.Path defaultDataDir ) throws java.io.IOException { java.lang.String dataDir = config.getString ( LfsBackend.FS.name ( ) , null , "directory" ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( dataDir ) ) { return defaultDataDir ; } java.nio.file.Path ensured = java.nio.file.Files.createDirectories ( java.nio.file.Paths.get ( dataDir ) ) ; if ( ! ( java.nio.file.Files.isReadable ( ensured ) ) ) { throw new java.io.IOException ( ( ( "Path '" + ( ensured.toAbsolutePath ( ) ) ) + "' cannot be accessed" ) ) ; } return ensured ; }

Target:
private static java.nio.file.Path getOrCreateDataDir ( com.googlesource.gerrit.plugins.lfs.LfsGlobalConfig config , java.nio.file.Path defaultDataDir ) throws java.io.IOException { java.lang.String dataDir = config.getString ( LfsBackendType.FS.name ( ) , null , "directory" ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( dataDir ) ) { return defaultDataDir ; } java.nio.file.Path ensured = java.nio.file.Files.createDirectories ( java.nio.file.Paths.get ( dataDir ) ) ; if ( ! ( java.nio.file.Files.isReadable ( ensured ) ) ) { throw new java.io.IOException ( ( ( "Path '" + ( ensured.toAbsolutePath ( ) ) ) + "' cannot be accessed" ) ) ; } return ensured ; }
Source:
protected void saveProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey p , com.google.gerrit.server.git.ProjectConfig cfg ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( p ) ) { cfg.commit ( md ) ; } projectCache.evict ( cfg.getProject ( ) ) ; }

Target:
protected void saveProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey p , com.google.gerrit.server.git.ProjectConfig cfg ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( p ) ) { md.setAuthor ( identifiedUserFactory.create ( admin.getId ( ) ) ) ; cfg.commit ( md ) ; } projectCache.evict ( cfg.getProject ( ) ) ; }
Source:
private void onSuccess ( final com.google.gerrit.client.account.SignInResult result ) { com.google.gerrit.client.Gerrit.postSignIn ( result.getAccount ( ) ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { com.google.gerrit.client.Gerrit.postSignIn ( result ) ; hide ( ) ; if ( ac != null ) { ac.onSuccess ( null ) ; } }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ReviewerAdded.log.warn ( "Error in event listener, e" ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ReviewerAdded.log.warn ( "Error in event listener, e" ) ; } } }
Source:
public void setUpMocks ( ) { syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void setUpMocks ( ) { syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.highavailability.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
com.google.gwtexpui.globalkey.client.KeyCommandSet getKeysComment ( ) { return keysComment ; }

Target:
private void countParents ( com.google.gerrit.client.rpc.CallbackGroup cbg ) { com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision.getId ( ) ) . view ( "commit" ) . get ( cbg.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { parents = info.parents ( ) . length ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { parents = 0 ; } } ) ) ; }
Source:
private java.util.List < java.lang.String > scan ( com.google.gerrit.reviewdb.client.Account.Id userId , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > r = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.reviewdb.client.AccountPatchReview w : db.get ( ) . accountPatchReviews ( ) . byReviewer ( userId , psId ) ) { r.add ( w.getKey ( ) . getPatchKey ( ) . getFileName ( ) ) ; } return r ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSet > reversePatchSets ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets = psUtil.byChange ( db.get ( ) , resource.getNotes ( ) ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchSet > list = ( patchSets instanceof java.util.List ) ? ( ( java.util.List < com.google.gerrit.reviewdb.client.PatchSet > ) ( patchSets ) ) : new java.util.ArrayList ( patchSets ) ; return com.google.common.collect.Lists.reverse ( list ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { getTab ( ) . setTitle ( Resources.M.sameTopic ( Resources.C.notAvailable ( ) ) ) ; getTab ( ) . setError ( err.getMessage ( ) ) ; }

Target:
public void onSuccess ( T result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convert ( result ) ; if ( ( changes.length ( ) ) > 0 ) { setTabTitle ( tabInfo , tabInfo.getTitle ( changes.length ( ) ) ) ; getTab ( tabInfo ) . setChanges ( project , revision , changes ) ; } onDone ( ( ( changes.length ( ) ) > 0 ) ) ; }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setHeader ( "Message-ID" , getChangeMessageThreadId ( ) ) ; add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setHeader ( "Message-ID" , getChangeMessageThreadId ( ) ) ; switch ( notify ) { case NONE : case OWNER : break ; case ALL : default : add ( RecipientType.CC , extraCC ) ; case OWNER_REVIEWERS : add ( RecipientType.TO , reviewers ) ; break ; } rcptToAuthors ( RecipientType.CC ) ; }
Source:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }

Target:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( project , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "reviewers" ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reviewers" , null , ProjectConfigEntry.Type.ARRAY , null , false , "Users or groups can be provided as reviewers" ) ) ; }
Source:
public void listChildrenOfNonExistingProject_NotFound ( ) throws java.lang.Exception { try { gApi.projects ( ) . name ( name ( "non-existing" ) ) . child ( "children" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( "non-existing" ) ; } }

Target:
public void listChildrenOfNonExistingProject_NotFound ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; exception.expectMessage ( "non-existing" ) ; gApi.projects ( ) . name ( name ( "non-existing" ) ) . child ( "children" ) ; }
Source:
public void currentPatchSet ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setCurrentPatchSet ( ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Current: true\n" ) ) , update.getResult ( ) ) ; }

Target:
public void currentPatchSet ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setCurrentPatchSet ( ) ; update.commit ( ) ; assertBodyEquals ( "Update patch set 1\n\nPatch-set: 1\nCurrent: true\n" , update.getResult ( ) ) ; }
Source:
public static com.google.gerrit.server.group.db.GroupNameNotes loadForRename ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) throws com.google.gwtorm.server.OrmDuplicateKeyException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = new com.google.gerrit.server.group.db.GroupNameNotes ( groupUuid , oldName , newName ) ; groupNameNotes.load ( repository ) ; groupNameNotes.ensureNewNameIsNotUsed ( ) ; return groupNameNotes ; }

Target:
public static com.google.gerrit.server.group.db.GroupNameNotes loadForRename ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) throws com.google.gwtorm.server.OrmDuplicateKeyException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.common.base.Preconditions.checkNotNull ( oldName ) ; com.google.common.base.Preconditions.checkNotNull ( newName ) ; com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = new com.google.gerrit.server.group.db.GroupNameNotes ( groupUuid , oldName , newName ) ; groupNameNotes.load ( repository ) ; groupNameNotes.ensureNewNameIsNotUsed ( ) ; return groupNameNotes ; }
Source:
public synchronized void onStartPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( pending ) != null ) { pending.add ( plugin ) ; } else { start ( plugin ) ; } }

Target:
public synchronized void onStartPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( pending ) != null ) { pending.add ( plugin ) ; } else { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; if ( filter != null ) { plugins.put ( plugin.getName ( ) , filter ) ; } } }
Source:
private com.google.gerrit.server.ReviewersUtil.VisibilityControl getVisibility ( final com.google.gerrit.server.project.ProjectResource rsrc ) { return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return permissionBackend.user ( identifiedUserFactory.create ( account ) ) . project ( rsrc.getNameKey ( ) ) . testOrFalse ( ProjectPermission.ACCESS ) ; } } ; }

Target:
private com.google.gerrit.server.restapi.change.ReviewersUtil.VisibilityControl getVisibility ( final com.google.gerrit.server.project.ProjectResource rsrc ) { return new com.google.gerrit.server.restapi.change.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return permissionBackend.user ( identifiedUserFactory.create ( account ) ) . project ( rsrc.getNameKey ( ) ) . testOrFalse ( ProjectPermission.ACCESS ) ; } } ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
public void postEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.common.Event event ) { fireEvent ( branchName , event ) ; }
Source:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; return p ; }

Target:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; p.createdOn = ( patchSet.getCreatedOn ( ) . getTime ( ) ) / 1000L ; return p ; }
Source:
void setReviewed ( boolean reviewed ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( patchId ) . view ( "files" ) . id ( fileId ) . view ( "reviewed" ) ; if ( reviewed ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } toggleReviewedBox ( reviewed ) ; }

Target:
void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( patchId ) . view ( "files" ) . id ( fileId ) . view ( "reviewed" ) ; if ( event.getValue ( ) ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
private com.vmware.gerrit.owners.common.OwnersConfig getOwners ( java.lang.String ownersPath ) { try { return com.vmware.gerrit.owners.common.JgitWrapper.getBlobAsBytes ( repository , "master" , ownersPath ) . flatMap ( this :: parseYaml ) . orElse ( null ) ; } catch ( java.lang.Exception e ) { com.vmware.gerrit.owners.common.PathOwners.log.warn ( "Invalid OWNERS file: {}" , ownersPath , e ) ; return null ; } }

Target:
private com.vmware.gerrit.owners.common.OwnersConfig getOwners ( java.lang.String ownersPath ) { try { return com.vmware.gerrit.owners.common.JgitWrapper.getBlobAsBytes ( repository , "master" , ownersPath ) . flatMap ( parser :: getOwnersConfig ) . orElse ( null ) ; } catch ( java.lang.Exception e ) { com.vmware.gerrit.owners.common.PathOwners.log.warn ( "Invalid OWNERS file: {}" , ownersPath , e ) ; return null ; } }
Source:
protected void onLoad ( ) { if ( ! ( loaded ) ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.ALL_COMMITS , ListChangesOption.ALL_REVISIONS , ListChangesOption.DRAFT_COMMENTS ) ) ; call.get ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { render ( result.revisions ( ) ) ; loaded = true ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.EditInfo result ) { edit = result ; }
Source:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( ) throws java.io.IOException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return all ( repo , com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ) ; } }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( com.google.gerrit.metrics.Timer0.Context ctx = readAllLatency.start ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo ) . all ( ) ; } }
Source:
public void testPushNewPatchsetToRefsChanges ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master" ) ; r.assertOkStatus ( ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , PushOneCommit.SUBJECT , "b.txt" , "anotherContent" , r.getChangeId ( ) ) ; r = push.to ( ( "refs/changes/" + ( r.getChange ( ) . change ( ) . getId ( ) . get ( ) ) ) ) ; r.assertOkStatus ( ) ; }

Target:
public void testPushNewPatchsetToRefsChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master" ) ; r.assertOkStatus ( ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , "b.txt" , "anotherContent" , r.getChangeId ( ) ) ; r = push.to ( ( "refs/changes/" + ( r.getChange ( ) . change ( ) . getId ( ) . get ( ) ) ) ) ; r.assertOkStatus ( ) ; }
Source:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; final java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( getUrl ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Healtheck on sysinfo result: {}" , result ) ; return result ; }

Target:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; final java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( getUrl ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Health check on sysinfo result: {}" , result ) ; return result ; }
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 ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.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 ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public void run ( ) throws java.lang.Exception { try { java.util.List < com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult > res = searcher.doQuery ( q ) ; for ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult docResult : res ) { stdout.println ( java.lang.String.format ( "%s:\n%s%s\n" , docResult.title , url , docResult.url ) ) ; } } catch ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocQueryException dqe ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , ( "fatal: " + ( dqe.getMessage ( ) ) ) ) ; } }

Target:
public void run ( ) throws java.lang.Exception { try { java.util.List < com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult > res = searcher.doQuery ( q ) ; for ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocResult docResult : res ) { stdout.println ( java.lang.String.format ( "%s:\n%s%s\n" , docResult.title , url , docResult.url ) ) ; } } catch ( com.google.gerrit.server.documentation.QueryDocumentationExecutor.DocQueryException dqe ) { throw die ( dqe ) ; } }
Source:
public boolean handles ( java.io.File srcFile ) { java.lang.String srcFileName = srcFile.getName ( ) ; java.lang.String scriptExtension = srcFileName.substring ( ( ( srcFileName.lastIndexOf ( '.' ) ) + 1 ) ) . toLowerCase ( ) ; return com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginProvider.GROOVY_EXTENSIONS.contains ( scriptExtension.toLowerCase ( ) ) ; }

Target:
public boolean handles ( java.nio.file.Path srcFile ) { java.lang.String scriptExtension = com.google.common.io.Files.getFileExtension ( srcFile.toString ( ) ) . toLowerCase ( ) ; return com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginProvider.GROOVY_EXTENSIONS.contains ( scriptExtension ) ; }
Source:
private void preMerge ( final com.google.gerrit.server.git.strategy.SubmitStrategy strategy , final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }

Target:
private void preMerge ( final com.google.gerrit.server.git.strategy.SubmitStrategy strategy , final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { logDebug ( "Running submit strategy for commits" , strategy.getClass ( ) . getSimpleName ( ) , toMerge.size ( ) ) ; mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; logDebug ( "Produced new commits" , strategy.getNewCommits ( ) . size ( ) ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }
Source:
public void onSuccess ( java.lang.Void result ) { loadConfigInfo ( info , base ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( base ) == null ) && ( ( rev.commit ( ) . parents ( ) . length ( ) ) > 1 ) ) { base = com.google.gerrit.client.Gerrit.getUserPreferences ( ) . defaultBaseForMerges ( ) . getBase ( ) ; } loadConfigInfo ( info , base ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildNavbar ( com.google.gitiles.doc.MarkdownToHtml.Builder fmt , com.google.gitiles.doc.DocServlet.MarkdownFile navFile ) { com.google.gitiles.doc.Navbar navbar = new com.google.gitiles.doc.Navbar ( ) ; if ( navFile != null ) { navbar.setFormatter ( fmt.setFilePath ( navFile.path ) . build ( ) ) ; navbar.setMarkdown ( navFile.consumeContent ( ) ) ; } return navbar.toSoyData ( ) ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildNavbar ( com.google.gitiles.doc.MarkdownConfig cfg , com.google.gitiles.doc.MarkdownToHtml.Builder fmt , com.google.gitiles.doc.DocServlet.MarkdownFile navFile ) { com.google.gitiles.doc.Navbar navbar = new com.google.gitiles.doc.Navbar ( ) ; if ( navFile != null ) { navbar.setFormatter ( fmt.setFilePath ( navFile.path ) . build ( ) ) ; navbar.setMarkdown ( cfg , navFile.consumeContent ( ) ) ; } return navbar.toSoyData ( ) ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( com.google.gerrit.server.restapi.config.SetPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } com.google.gerrit.server.account.Preferences.validateMy ( input.my ) ; try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultGeneralPreferences ( md , input ) ; accountCache.evictAll ( ) ; return updatedPrefs ; } }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( com.google.gerrit.server.restapi.config.SetPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } com.google.gerrit.server.account.Preferences.validateMy ( input.my ) ; try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultGeneralPreferences ( md , input ) ; accountCache.evictAll ( ) ; return updatedPrefs ; } }
Source:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( idSideA , result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.common.data.PatchScript result ) { if ( ( rpcSequence ) == rpcseq ) { onResult ( result , isFirst ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( db.get ( ) , rsrc.getNotes ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getChangeNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private static java.io.File random ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "_site" ) ; if ( ! ( tmp.delete ( ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } return tmp ; }

Target:
private static java.nio.file.Path random ( ) throws java.io.IOException { java.nio.file.Path tmp = java.nio.file.Files.createTempFile ( "gerrit_test_" , "_site" ) ; java.nio.file.Files.deleteIfExists ( tmp ) ; return tmp ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : db.get ( ) . patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void deleteAllFiles ( java.io.File dir ) { for ( java.io.File f : dir.listFiles ( ) ) { if ( f.isDirectory ( ) ) { deleteAllFiles ( f ) ; } else { f.delete ( ) ; } } dir.delete ( ) ; }

Target:
private static void deleteAllFiles ( java.io.File dir ) throws java.io.IOException { for ( java.io.File f : com.google.gerrit.pgm.rules.PrologCompiler.listFiles ( dir ) ) { if ( f.isDirectory ( ) ) { com.google.gerrit.pgm.rules.PrologCompiler.deleteAllFiles ( f ) ; } else { f.delete ( ) ; } } dir.delete ( ) ; }
Source:
public void specifiedEventTypesPosted ( ) { config.setString ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.URL , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO_URL ) ; config.setString ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.EVENT , "project-created" ) ; eventHandler.onEvent ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.PROJECT_CREATED ) ; org.mockito.Mockito.verify ( postTask , org.mockito.Mockito.times ( 1 ) ) . schedule ( ) ; }

Target:
public void remoteUrlUndefinedTaskNotScheduled ( ) { org.mockito.Mockito.when ( config.getSubsections ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE ) ) ) . thenReturn ( com.google.common.collect.ImmutableSet.of ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO ) ) ; eventHandler.onEvent ( projectCreated ) ; org.mockito.Mockito.verifyZeroInteractions ( taskFactory ) ; org.mockito.Mockito.verifyZeroInteractions ( postTask ) ; }
Source:
public void postRun ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) . getConfig ( ) ; if ( installVerified ) { cfg.setString ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_FUNCTION , "MaxWithBlock" ) ; cfg.setStringList ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_VALUE , java.util.Arrays.asList ( new java.lang.String [ ] { "-1 Fails" , " 0 No score" , "+1 Verified" } ) ) ; allProjectsConfig.save ( "Configure 'Verified' label" ) ; } }

Target:
public void postRun ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) . getConfig ( ) ; if ( installVerified ) { cfg.setString ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_FUNCTION , "MaxWithBlock" ) ; cfg.setStringList ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_VALUE , java.util.Arrays.asList ( new java.lang.String [ ] { "-1 Fails" , " 0 No score" , "+1 Verified" } ) ) ; cfg.setBoolean ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE , true ) ; allProjectsConfig.save ( "Configure 'Verified' label" ) ; } }