auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.eclipse.jgit.api.Git createProject ( boolean emptyCommit ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; try { com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) , null , emptyCommit ) ; setSubmitType ( getSubmitType ( ) ) ; return com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; } finally { sshSession.close ( ) ; } }

Target:
protected void updateProjectInput ( com.google.gerrit.extensions.api.projects.ProjectInput in ) { in.submitType = getSubmitType ( ) ; if ( ( in.useContentMerge ) == ( com.google.gerrit.extensions.client.InheritableBoolean.INHERIT ) ) { in.useContentMerge = com.google.gerrit.extensions.client.InheritableBoolean.FALSE ; } }
Source:
public com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; cd.limitToPatchSets ( com.google.common.collect.ImmutableList.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; return format ( cd ) ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.common.changes.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }
Source:
private static java.lang.String urlFromView ( com.google.gitiles.GitilesView view , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gitiles.GitilesView.Builder builder ) { com.google.gitiles.Revision rev = view.getRevision ( ) ; return builder.copyFrom ( view ) . setRevision ( ( rev.getId ( ) . equals ( commit ) ? rev.getName ( ) : commit.name ( ) ) , commit ) . setPathPart ( null ) . toUrl ( ) ; }

Target:
private static java.lang.String urlFromView ( com.google.gitiles.GitilesView view , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gitiles.GitilesView.Builder builder ) { com.google.gitiles.Revision rev = view.getRevision ( ) ; return builder.copyFrom ( view ) . setOldRevision ( Revision.NULL ) . setRevision ( ( rev.getId ( ) . equals ( commit ) ? rev.getName ( ) : commit.name ( ) ) , commit ) . setPathPart ( view.getPathPart ( ) ) . toUrl ( ) ; }
Source:
public void inheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.SUBMIT , "refs/heads/master" , u ) ; }

Target:
public void inheritRead_SingleBranchDeniesUpload ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.testing.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.READ , "refs/heads/foobar" ) ; com.google.gerrit.server.project.testing.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.PUSH , "refs/for/refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCannotCreateChange ( "refs/heads/foobar" , u ) ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private com.google.gitiles.doc.MarkdownToHtml file ( java.lang.String path ) { return new com.google.gitiles.doc.MarkdownToHtml ( com.google.gitiles.GitilesView.doc ( ) . copyFrom ( view ) . setPathPart ( path ) . build ( ) , config , path ) ; }

Target:
private com.google.gitiles.doc.MarkdownToHtml file ( java.lang.String path ) { return com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( com.google.gitiles.GitilesView.doc ( ) . copyFrom ( view ) . setPathPart ( path ) . build ( ) ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( path ) . build ( ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Delete" ) . setTitle ( ( "Delete draft change " + ( rsrc.getId ( ) ) ) ) . setVisible ( ( ( ( allowDrafts ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( db.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
private boolean isActionAllowed ( com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.Change.Status status ) { return ( ( status != ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) || ( allowDrafts ) ) || ( changeControl.isAdmin ( ) ) ; }
Source:
public long getHead ( ) throws java.io.IOException { return stores.head.get ( ) ; }

Target:
public synchronized void add ( java.lang.String event ) throws java.io.IOException { long next = ( getHead ( ) ) + 1 ; java.nio.file.Path epath = paths.event ( next ) ; com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( epath.getParent ( ) ) ; java.nio.file.Files.write ( epath , ( event + "\n" ) . getBytes ( ) ) ; stores.head.spinIncrement ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_INCREMENT_SPINS ) ; }
Source:
private static java.lang.String oldName ( final com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case ADDED : return null ; case DELETED : case MODIFIED : return entry.getNewName ( ) ; case COPIED : case RENAMED : default : return entry.getOldName ( ) ; } }

Target:
private static java.lang.String oldName ( final com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case ADDED : return null ; case DELETED : case MODIFIED : case REWRITE : return entry.getNewName ( ) ; case COPIED : case RENAMED : default : return entry.getOldName ( ) ; } }
Source:
public boolean canEditTopicName ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; }

Target:
public boolean canEditTopicName ( ) { if ( change.getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } else { return getRefControl ( ) . canForceEditTopicName ( ) ; } }
Source:
public com.google.gerrit.extensions.api.changes.DraftInput apply ( com.google.gerrit.extensions.common.CommentInfo info ) { com.google.gerrit.extensions.api.changes.DraftInput di = new com.google.gerrit.extensions.api.changes.DraftInput ( ) ; di.path = path ; com.google.gerrit.acceptance.server.change.CommentsIT.copy ( info , di ) ; return di ; }

Target:
private static < I extends com.google.gerrit.extensions.client.Comment > com.google.common.base.Function < com.google.gerrit.extensions.common.CommentInfo , I > infoToInput ( java.lang.String path , java.util.function.Supplier < I > supplier ) { return ( info ) -> { I i = supplier.get ( ) ; i.path = path ; com.google.gerrit.acceptance.server.change.CommentsIT.copy ( info , i ) ; return i ; } ; }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { if ( event.getScreen ( ) . getToken ( ) . equals ( getTargetHistoryToken ( ) ) ) { addStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } else { removeStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { if ( match ( event.getScreen ( ) . getToken ( ) ) ) { com.google.gerrit.client.Gerrit.selectMenu ( bar ) ; addStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } else { removeStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } }
Source:
private void error ( final java.sql.SQLException err ) { switch ( outputFormat ) { case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "error" ) ; obj.addProperty ( "message" , err.getMessage ( ) ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "ERROR: " + ( err.getMessage ( ) ) ) ) ; break ; } }

Target:
private void error ( final java.sql.SQLException err ) { switch ( outputFormat ) { case JSON_SINGLE : case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "error" ) ; obj.addProperty ( "message" , err.getMessage ( ) ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "ERROR: " + ( err.getMessage ( ) ) ) ) ; break ; } }
Source:
protected void setupSoyContext ( ) { soyContext = new java.util.HashMap < > ( ) ; soyContext.put ( "messageClass" , messageClass ) ; soyContextEmailData = new java.util.HashMap < > ( ) ; soyContextEmailData.put ( "settingsUrl" , getSettingsUrl ( ) ) ; soyContextEmailData.put ( "gerritHost" , getGerritHost ( ) ) ; soyContextEmailData.put ( "gerritUrl" , getGerritUrl ( ) ) ; soyContext.put ( "email" , soyContextEmailData ) ; }

Target:
protected void setupSoyContext ( ) { soyContext = new java.util.HashMap < > ( ) ; footers = new java.util.ArrayList < > ( ) ; soyContext.put ( "messageClass" , messageClass ) ; soyContext.put ( "footers" , footers ) ; soyContextEmailData = new java.util.HashMap < > ( ) ; soyContextEmailData.put ( "settingsUrl" , getSettingsUrl ( ) ) ; soyContextEmailData.put ( "gerritHost" , getGerritHost ( ) ) ; soyContextEmailData.put ( "gerritUrl" , getGerritUrl ( ) ) ; soyContext.put ( "email" , soyContextEmailData ) ; }
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 onSelection ( com.google.gwt.event.logical.shared.SelectionEvent < java.lang.Integer > event ) { if ( ( selectedTab ) >= 0 ) { tabs.get ( selectedTab ) . registerKeys ( false ) ; } selectedTab = event.getSelectedItem ( ) ; tabs.get ( selectedTab ) . registerKeys ( true ) ; }
Source:
public static org.eclipse.jgit.lib.ObjectId writeLabels ( org.eclipse.jgit.lib.Repository repo , java.util.SortedSet < java.lang.String > labels ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_BLOB , com.google.common.base.Joiner.on ( "\n" ) . join ( labels ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; oi.flush ( ) ; return id ; } }

Target:
public static org.eclipse.jgit.lib.ObjectId writeLabels ( org.eclipse.jgit.lib.Repository repo , java.util.SortedSet < java.lang.String > labels ) throws java.io.IOException { com.google.gerrit.server.StarredChangesUtil.validateLabels ( labels ) ; try ( org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_BLOB , com.google.common.base.Joiner.on ( "\n" ) . join ( labels ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; oi.flush ( ) ; return id ; } }
Source:
private static org.eclipse.jgit.lib.ObjectId writeNewTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , org.eclipse.jgit.revwalk.RevCommit prevEdit , org.eclipse.jgit.lib.ObjectReader reader , java.lang.String fileName , byte [ ] content , org.eclipse.jgit.revwalk.RevCommit base ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { org.eclipse.jgit.dircache.DirCache newTree = com.google.gerrit.server.edit.ChangeEditModifier.createTree ( reader , prevEdit ) ; com.google.gerrit.server.edit.ChangeEditModifier.editTree ( op , repo , rw , base , newTree.editor ( ) , ins , fileName , content ) ; return newTree.writeTree ( ins ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId toBlob ( org.eclipse.jgit.lib.ObjectInserter ins , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.restapi.RawInput content ) throws java.io.IOException { if ( content == null ) { return null ; } long len = content.getContentLength ( ) ; java.io.InputStream in = content.getInputStream ( ) ; if ( len < 0 ) { return ins.insert ( org.eclipse.jgit.lib.Constants.OBJ_BLOB , com.google.common.io.ByteStreams.toByteArray ( in ) ) ; } return ins.insert ( org.eclipse.jgit.lib.Constants.OBJ_BLOB , len , in ) ; }
Source:
private static java.util.Set < java.security.PublicKey > myHostKeys ( org.apache.sshd.common.keyprovider.KeyPairProvider p ) { final java.util.Set < java.security.PublicKey > keys = new java.util.HashSet < > ( 2 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }

Target:
private static java.util.Set < java.security.PublicKey > myHostKeys ( org.apache.sshd.common.keyprovider.KeyPairProvider p ) { final java.util.Set < java.security.PublicKey > keys = new java.util.HashSet < > ( 6 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_ED25519 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.ECDSA_SHA2_NISTP256 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.ECDSA_SHA2_NISTP384 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.ECDSA_SHA2_NISTP521 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }
Source:
public void setUp ( ) throws java.lang.Exception { admin = accounts.admin ( ) ; session = new com.google.gerrit.acceptance.RestSession ( server , admin ) ; group ( "users1" ) ; group ( "users2" ) ; group ( "users3" ) ; accounts.create ( "user1" , "user1@example.com" , "User1" , "users1" ) ; accounts.create ( "user2" , "user2@example.com" , "User2" , "users2" ) ; accounts.create ( "user3" , "user3@example.com" , "User3" , "users1" , "users2" ) ; com.google.gerrit.acceptance.git.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , project.get ( ) ) ; git = com.google.gerrit.acceptance.git.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; sshSession.close ( ) ; db = reviewDbProvider.open ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { admin = accounts.admin ( ) ; session = new com.google.gerrit.acceptance.RestSession ( server , admin ) ; group ( "users1" ) ; group ( "users2" ) ; group ( "users3" ) ; accounts.create ( "user1" , "user1@example.com" , "User1" , "users1" ) ; accounts.create ( "user2" , "user2@example.com" , "User2" , "users2" ) ; accounts.create ( "user3" , "user3@example.com" , "User3" , "users1" , "users2" ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) ) ; git = com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; sshSession.close ( ) ; db = reviewDbProvider.open ( ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ) { return false ; } return java.util.Objects.equals ( value , ( ( com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ( obj ) ) . value ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ) { return false ; } com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken = ( ( com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ( obj ) ) ; return ( ( value.equals ( accessToken.value ) ) && ( ( expiresAt ) == ( accessToken.expiresAt ) ) ) && ( userInfo.equals ( accessToken.userInfo ) ) ; }
Source:
public org.spearce.jgit.lib.Repository getRepository ( ) { return repo ; }

Target:
private com.google.gerrit.server.patch.Text load ( final org.spearce.jgit.lib.ObjectId tree , final java.lang.String path ) throws java.io.IOException , org.spearce.jgit.errors.CorruptObjectException , org.spearce.jgit.errors.IncorrectObjectTypeException , org.spearce.jgit.errors.MissingObjectException { final org.spearce.jgit.lib.ObjectId id = com.google.gerrit.server.patch.DiffCacheContent.find ( repo , tree , path ) ; if ( id == null ) { return Text.EMPTY ; } final org.spearce.jgit.lib.ObjectLoader ldr = repo.openObject ( id ) ; if ( ldr == null ) { throw new org.spearce.jgit.errors.MissingObjectException ( id , org.spearce.jgit.lib.Constants.TYPE_BLOB ) ; } return new com.google.gerrit.server.patch.Text ( ldr.getCachedBytes ( ) ) ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.getActiveLine ( ) ; int line = cm.getLineNumber ( handle ) ; com.google.gerrit.client.diff.CommentBox box = lineActiveBoxMap.get ( handle ) ; if ( box == null ) { lineActiveBoxMap.put ( handle , addNewDraft ( cm , line ) ) ; } else if ( box instanceof com.google.gerrit.client.diff.DraftBox ) { ( ( com.google.gerrit.client.diff.DraftBox ) ( box ) ) . setEdit ( true ) ; } else { ( ( com.google.gerrit.client.diff.PublishedBox ) ( box ) ) . doReply ( ) ; } }

Target:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { if ( lineActiveBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.get ( handle ) . resizePaddingWidget ( ) ; } if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }
Source:
public static void applyUserPreferences ( ) { final com.google.gerrit.client.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } }

Target:
public static void applyUserPreferences ( ) { final com.google.gerrit.client.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } }
Source:
public static void markPrivate ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "private" ) . post ( com.google.gerrit.client.changes.ChangeApi.PrivateInput.create ( ) , cb ) ; }

Target:
public static void abandon ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , "abandon" ) . post ( input , cb ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } java.util.Optional < com.google.gerrit.server.group.InternalGroup > group = groupCache.get ( groupUUID ) ; if ( group.isPresent ( ) ) { return getGroupMembers ( group.get ( ) , project , seen ) ; } return java.util.Collections.emptySet ( ) ; }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , user.asIdentifiedUser ( ) . getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.project.ProjectControl projectControl , com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , projectControl.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , cm , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , rule , ref ) ; }

Target:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , rule , ref ) ; }
Source:
public void testProcUptime ( ) { com.codahale.metrics.Gauge < java.lang.Long > birth = gauge ( "proc/birth_timestamp" ) ; com.google.common.truth.Truth.assertThat ( birth.getValue ( ) ) . isLessThan ( java.util.concurrent.TimeUnit.MILLISECONDS.toMicros ( java.lang.System.currentTimeMillis ( ) ) ) ; com.codahale.metrics.Gauge < java.lang.Long > uptime = gauge ( "proc/uptime" ) ; com.google.common.truth.Truth.assertThat ( uptime.getValue ( ) ) . isAtLeast ( 1L ) ; }

Target:
public void testProcUptime ( ) { com.codahale.metrics.Gauge < java.lang.Long > birth = gauge ( "proc/birth_timestamp" ) ; com.google.common.truth.Truth.assertThat ( birth.getValue ( ) ) . isAtMost ( java.util.concurrent.TimeUnit.MILLISECONDS.toMicros ( java.lang.System.currentTimeMillis ( ) ) ) ; com.codahale.metrics.Gauge < java.lang.Long > uptime = gauge ( "proc/uptime" ) ; com.google.common.truth.Truth.assertThat ( uptime.getValue ( ) ) . isAtLeast ( 1L ) ; }
Source:
public void isoIncludingTimeZone ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( com.google.common.base.Optional.< java.util.TimeZone > absent ( ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 15:04:05 -0700" ) ; }

Target:
public void isoIncludingTimeZone ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( java.util.Optional.empty ( ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 15:04:05 -0700" ) ; }
Source:
private java.lang.StringBuilder addIdent ( java.lang.StringBuilder sb , com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( accountId ) . getAccount ( ) ; org.eclipse.jgit.lib.PersonIdent ident = newIdent ( account , when ) ; sb.append ( ident.getName ( ) ) . append ( " <" ) . append ( ident.getEmailAddress ( ) ) . append ( '>' ) ; return sb ; }

Target:
private java.lang.StringBuilder addIdent ( java.lang.StringBuilder sb , com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( accountId ) . getAccount ( ) ; org.eclipse.jgit.lib.PersonIdent ident = newIdent ( account , when ) ; org.eclipse.jgit.lib.PersonIdent.appendSanitized ( sb , ident.getName ( ) ) ; sb.append ( " <" ) ; org.eclipse.jgit.lib.PersonIdent.appendSanitized ( sb , ident.getEmailAddress ( ) ) ; sb.append ( '>' ) ; return sb ; }
Source:
public void testEmpty ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertTrue ( b.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( b.hasContent ( ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; b.append ( "a" ) ; org.junit.Assert.assertTrue ( b.hasContent ( ) ) ; org.junit.Assert.assertEquals ( "a" , b.asString ( ) ) ; }

Target:
public void testEmpty ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b.isEmpty ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( b.hasContent ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEmpty ( ) ; b.append ( "a" ) ; com.google.common.truth.Truth.assertThat ( b.hasContent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "a" ) ; }
Source:
private java.lang.String getScopesKey ( javax.servlet.http.HttpServletRequest request ) { java.lang.String scopeRequested = request.getParameter ( "scope" ) ; return com.google.common.base.Objects.firstNonNull ( scopeRequested , "scopes" ) ; }

Target:
private java.lang.String getScopesKey ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) { java.lang.String scopeRequested = request.getParameter ( "scope" ) ; if ( scopeRequested == null ) { scopeRequested = getScopesKeyFromCookie ( request ) ; } if ( scopeRequested != null ) { javax.servlet.http.Cookie scopeCookie = new javax.servlet.http.Cookie ( "scope" , scopeRequested ) ; scopeCookie.setPath ( "/" ) ; scopeCookie.setMaxAge ( ( ( int ) ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.SCOPE_COOKIE_NEVER_EXPIRES ) ) ) ; response.addCookie ( scopeCookie ) ; } return com.google.common.base.Objects.firstNonNull ( scopeRequested , "scopes" ) ; }
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 , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetMessages.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.PutMessages.class ) ; }

Target:
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 ) ; }
Source:
private com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = newRule ( project , group ) ; project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . add ( rule ) ; return rule ; }

Target:
private com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return grant ( project , permissionName , rule , ref ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.reviewdb.Account > ( ) { public void onSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { if ( isAttached ( ) ) { display ( result ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( info ) == null ) { initUI ( ) ; } super . onLoad ( ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.reviewdb.Account > ( ) { public void onSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { if ( isAttached ( ) ) { display ( result ) ; } } } ) ; }
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 ; if ( com.google.gwt.core.client.GWT.isScript ( ) ) { final com.google.gerrit.client.GerritVersion v = com.google.gwt.core.client.GWT.create ( com.google.gerrit.client.GerritVersion.class ) ; vs = v.version ( ) ; } else { vs = "dev" ; } 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:
public static java.lang.String getVersion ( ) { if ( ( com.google.gerrit.client.Gerrit.myVersion ) == null ) { if ( com.google.gwt.core.client.GWT.isScript ( ) ) { final com.google.gerrit.client.GerritVersion v = com.google.gwt.core.client.GWT.create ( com.google.gerrit.client.GerritVersion.class ) ; com.google.gerrit.client.Gerrit.myVersion = v.version ( ) ; } else { com.google.gerrit.client.Gerrit.myVersion = "dev" ; } } return com.google.gerrit.client.Gerrit.myVersion ; }
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getOperator ( ) , p.getValue ( ) ) ) ; } }

Target:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; } }
Source:
public AMQP.BasicProperties getBasicProperties ( ) { return new com.rabbitmq.client.AMQP.BasicProperties.Builder ( ) . appId ( com.googlesource.gerrit.plugins.rabbitmq.config.AMQProperties.EVENT_APPID ) . contentEncoding ( org.apache.commons.codec.CharEncoding.UTF_8 ) . contentType ( com.googlesource.gerrit.plugins.rabbitmq.config.AMQProperties.CONTENT_TYPE_JSON ) . deliveryMode ( message.deliveryMode ) . priority ( message.priority ) . headers ( headers ) . timestamp ( new java.util.Date ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) ) . build ( ) ; }

Target:
public AMQP.BasicProperties getBasicProperties ( ) { return new com.rabbitmq.client.AMQP.BasicProperties.Builder ( ) . appId ( com.googlesource.gerrit.plugins.rabbitmq.config.AMQProperties.EVENT_APPID ) . contentEncoding ( org.apache.commons.codec.CharEncoding.UTF_8 ) . contentType ( com.googlesource.gerrit.plugins.rabbitmq.config.AMQProperties.CONTENT_TYPE_JSON ) . deliveryMode ( message.deliveryMode ) . priority ( message.priority ) . headers ( headers ) . timestamp ( new java.util.Date ( com.google.gerrit.common.TimeUtil.nowMs ( ) ) ) . build ( ) ; }
Source:
public com.google.gerrit.server.query.Predicate < T > copy ( java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.server.query.NotPredicate ( children.iterator ( ) . next ( ) ) ; }

Target:
public com.google.gerrit.index.query.Predicate < T > copy ( java.util.Collection < ? extends com.google.gerrit.index.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.index.query.NotPredicate ( children.iterator ( ) . next ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; contentTable.setCommentLinkProcessor ( commentLinkProcessor ) ; setTheme ( result.getTheme ( ) ) ; }

Target:
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 ) ; }
Source:
public void markReady ( boolean ready ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; com.google.gerrit.lucene.LuceneVersionManager.setReady ( cfg , schema.getVersion ( ) , ready ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void markReady ( boolean ready ) throws java.io.IOException { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( sitePaths , schema.getVersion ( ) , ready ) ; }
Source:
com.google.gerrit.extensions.common.CommentInfo format ( com.google.gerrit.reviewdb.client.PatchLineComment c , boolean fill ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.account.AccountLoader loader = null ; if ( fill ) { loader = accountLoaderFactory.create ( true ) ; } com.google.gerrit.extensions.common.CommentInfo commentInfo = toCommentInfo ( c , loader ) ; if ( fill ) { loader.fill ( ) ; } return commentInfo ; }

Target:
com.google.gerrit.extensions.common.CommentInfo format ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.account.AccountLoader loader = null ; if ( fillAccounts ) { loader = accountLoaderFactory.create ( true ) ; } com.google.gerrit.extensions.common.CommentInfo commentInfo = toCommentInfo ( c , loader ) ; if ( fillAccounts ) { loader.fill ( ) ; } return commentInfo ; }
Source:
private void failAndThrow ( com.google.gerrit.reviewdb.client.Change change , java.lang.Error e ) { fail ( change , e ) ; throw e ; }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { ok.set ( false ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }
Source:
public void testVerifyDecodeAgainstEncodedInput ( ) throws java.lang.Exception { java.lang.String plain = "plain text" ; java.lang.String encrypted = cipher.encrypt ( plain ) ; com.google.common.base.Optional < java.lang.String > decrypted = cipher.decrypt ( encrypted ) ; com.google.common.truth.Truth.assertThat ( decrypted.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( decrypted.get ( ) ) . isEqualTo ( plain ) ; }

Target:
public void testVerifyDecodeAgainstEncodedInput ( ) throws java.lang.Exception { java.lang.String plain = "plain text" ; java.lang.String encrypted = cipher.encrypt ( plain ) ; java.util.Optional < java.lang.String > decrypted = cipher.decrypt ( encrypted ) ; com.google.common.truth.Truth.assertThat ( decrypted.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( decrypted.get ( ) ) . isEqualTo ( plain ) ; }