auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setChangeId ( c.getKey ( ) . get ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
private void createFileCommentBorderRow ( ) { if ( ! ( isFileCommentBorderRowExist ) ) { isFileCommentBorderRowExist = true ; table.insertRow ( borderRowOfFileComment ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW , Gerrit.RESOURCES.css ( ) . iconCellOfFileCommentRow ( ) ) ; defaultStyle ( borderRowOfFileComment , fmt ) ; final com.google.gwt.user.client.Element iconCell = fmt.getElement ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . fileCommentBorder ( ) , true ) ; } }

Target:
private void createFileCommentBorderRow ( ) { if ( ! ( isFileCommentBorderRowExist ) ) { isFileCommentBorderRowExist = true ; table.insertRow ( borderRowOfFileComment ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW , Gerrit.RESOURCES.css ( ) . iconCellOfFileCommentRow ( ) ) ; defaultStyle ( borderRowOfFileComment , fmt ) ; final com.google.gwt.dom.client.Element iconCell = fmt.getElement ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . fileCommentBorder ( ) , true ) ; } }
Source:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ; }

Target:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.uuidPrefix , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ) ; }
Source:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_BAD_REQUEST , r.getStatusCode ( ) ) ; r.getEntityContent ( ) . contains ( "commit message must be non-empty" ) ; }

Target:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_BAD_REQUEST , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( r.getEntityContent ( ) . contains ( "commit message must be non-empty" ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { return ( this . id ) == ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLEntry ) ( o ) ) . id ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o == null ) { return false ; } if ( ( this . getClass ( ) ) != ( o.getClass ( ) ) ) { return false ; } return ( this . id ) == ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLEntry ) ( o ) ) . id ) ; }
Source:
private static java.io.File tmpdir ( java.lang.String name ) throws java.io.IOException { java.io.File d = java.io.File.createTempFile ( ( name + "_" ) , "" ) ; if ( ( ! ( d.delete ( ) ) ) || ( ! ( d.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot mkdir " + d ) ) ; } return d ; }

Target:
private static java.io.File tmpdir ( java.lang.String name ) throws java.io.IOException { java.io.File d = java.io.File.createTempFile ( ( name + "_" ) , "" , BuckPrologCompiler.tmpdir ) ; if ( ( ! ( d.delete ( ) ) ) || ( ! ( d.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot mkdir " + d ) ) ; } return d ; }
Source:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public boolean isVisible ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; return ( ( ( ( ( accountGroup != null ) && ( accountGroup.isVisibleToAll ( ) ) ) || ( ( user ) instanceof com.google.gerrit.server.InternalUser ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ; }

Target:
public boolean isVisible ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; return ( ( ( ( ( accountGroup != null ) && ( accountGroup.isVisibleToAll ( ) ) ) || ( ( user ) instanceof com.google.gerrit.server.InternalUser ) ) || ( user.memberOf ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = diffPrefs.getContext ( ) ; if ( ctx == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }

Target:
public boolean isExpandAllComments ( ) { return diffPrefs.expandAllComments ; }
Source:
public void queryChangesStart ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withStart ( 1 ) . get ( ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 1 ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; }
Source:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLockResponse lock = handler.createLock ( project.getProject ( ) . getName ( ) , user , input ) ; context.sendResponse ( lock ) ; }

Target:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLockResponse lock = handler.createLock ( project.getProject ( ) . getNameKey ( ) , user , input ) ; context.sendResponse ( lock ) ; }
Source:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.NamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return disk ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) , type ) . name ( name ) ; }

Target:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { return disk ( com.google.inject.Key.get ( type ) , type ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { if ( ( id.get ( ) ) == ( com.google.gerrit.server.index.change.ChangeField.NO_ASSIGNEE ) ) { return ( object.notes ( ) . load ( ) . getAssignee ( ) ) == null ; } return id.equals ( object.notes ( ) . load ( ) . getAssignee ( ) ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { if ( ( id.get ( ) ) == ( com.google.gerrit.server.index.change.ChangeField.NO_ASSIGNEE ) ) { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > assignee = object.notes ( ) . load ( ) . getAssignee ( ) ; return ( assignee == null ) || ( ! ( assignee.isPresent ( ) ) ) ; } return id.equals ( object.notes ( ) . load ( ) . getAssignee ( ) . get ( ) ) ; }
Source:
public void suggestReviewersNoResult1 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; user1 = user ( "user1" , group1 ) ; user2 = user ( "user2" , group2 ) ; user3 = user ( "user3" , group1 , group2 ) ; }
Source:
private static boolean amAdmin ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup admin = db.accountGroups ( ) . get ( com.google.gerrit.client.admin.ADMIN_GROUP ) ; if ( admin == null ) { return false ; } return ( db.accountGroupMembers ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroupMember.Key ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) , admin.getId ( ) ) ) ) != null ; }

Target:
private static boolean amAdmin ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup admin = db.accountGroups ( ) . get ( com.google.gerrit.client.admin.ADMIN_GROUP ) ; return ( admin != null ) && ( com.google.gerrit.client.admin.GroupAdminServiceImpl.amInGroup ( db , admin.getId ( ) ) ) ; }
Source:
private java.lang.String getJenkinsUrl ( ) { return config.getString ( "jenkinsUrl" , com.googlesource.gerrit.plugins.manager.repository.JenkinsCiPluginsRepository.DEFAULT_GERRIT_CI_URL ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.manager.repository.PluginInfo > list ( java.lang.String gerritVersion ) throws java.io.IOException { java.util.List < com.googlesource.gerrit.plugins.manager.repository.PluginInfo > list = cache.get ( gerritVersion ) ; if ( list == null ) { list = getList ( gerritVersion ) ; cache.put ( gerritVersion , list ) ; } return list ; }
Source:
public com.google.gwtexpui.safehtml.client.SafeHtmlCss css ( ) { return new com.google.gwtexpui.safehtml.client.SafeHtmlCss ( ) { public java.lang.String wikiList ( ) { return "wikiList" ; } public java.lang.String wikiPreFormat ( ) { return "wikiPreFormat" ; } public boolean ensureInjected ( ) { return false ; } public java.lang.String getName ( ) { return null ; } public java.lang.String getText ( ) { return null ; } } ; }

Target:
public java.lang.String wikiQuote ( ) { return "wikiQuote" ; }
Source:
public void singleLineMessagesWithSignedOffBy ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) ) ) ; org.junit.Assert.assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + ( SOB2 ) ) ) ) ; }

Target:
public void singleLineMessagesWithSignedOffBy ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) , call ( ( "a\n\n" + ( SOB1 ) ) ) ) ; org.junit.Assert.assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( "a\n\n" + ( SOB1 ) ) + ( SOB2 ) ) ) ) ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; if ( autoClosed ) { setOpen ( false ) ; } getCm ( ) . focus ( ) ; } }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; if ( autoClosed ) { setOpen ( false ) ; } getCm ( ) . focus ( ) ; } }
Source:
protected void init ( ) throws com.google.gerrit.server.mail.EmailException { super . init ( ) ; try { com.google.gerrit.server.mail.Watchers matching = getWatches ( NotifyType.NEW_CHANGES ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { if ( isOwnerOfProjectOrBranch ( user ) ) { add ( RecipientType.TO , user ) ; } else { add ( RecipientType.BCC , user ) ; } } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.CreateChangeSender.log.warn ( "Cannot BCC watchers for new change" , err ) ; } }

Target:
protected void init ( ) throws com.google.gerrit.server.mail.EmailException { super . init ( ) ; try { com.google.gerrit.server.mail.Watchers matching = getWatches ( NotifyType.NEW_CHANGES ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : com.google.common.collect.Iterables.concat ( matching.to.accounts , matching.cc.accounts , matching.bcc.accounts ) ) { if ( isOwnerOfProjectOrBranch ( user ) ) { add ( RecipientType.TO , user ) ; } } add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.CreateChangeSender.log.warn ( "Cannot notify watchers for new change" , err ) ; } }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo publisher ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.DraftPublished.Event e = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { l.onDraftPublished ( 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 publisher ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.DraftPublished.Event event = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { try { l.onDraftPublished ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.DraftPublished.log.warn ( "Error in event listener" , e ) ; } } }
Source:
private boolean isEmpty ( ) { return ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( reviewers.isEmpty ( ) ) ) && ( commentsForBase.isEmpty ( ) ) ) && ( commentsForPs.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( submitRecords ) == null ) ) && ( ( changeMessage ) == null ) ; }

Target:
private boolean isEmpty ( ) { return ( ( ( ( ( ( ( approvals.isEmpty ( ) ) && ( ( changeMessage ) == null ) ) && ( commentsForBase.isEmpty ( ) ) ) && ( commentsForPs.isEmpty ( ) ) ) && ( reviewers.isEmpty ( ) ) ) && ( ( status ) == null ) ) && ( ( subject ) == null ) ) && ( ( submitRecords ) == null ) ; }
Source:
public void onSuccess ( java.lang.Void result ) { loadConfigInfo ( info , rev ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { if ( ( event.getNativeEvent ( ) . getCharCode ( ) ) == 0 ) { Window.Location.reload ( ) ; return ; } if ( topic.canEdit ( ) ) { topic.onEdit ( ) ; } } else { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; } }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setStatus ( Change.Status.NEW ) ; change.setCurrentPatchSet ( result.info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public void warn ( java.lang.String warning ) { msg.print ( ( ( "warning: " + warning ) + "\n" ) ) ; msg.flush ( ) ; }
Source:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = insertPatchSet ( c ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; incrementPatchSet ( c ) ; insertMissingPatchSet ( c , rev ) ; assertProblems ( c , ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ; }

Target:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = insertPatchSet ( c ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; incrementPatchSet ( c ) ; com.google.gerrit.reviewdb.client.PatchSet ps2 = insertMissingPatchSet ( c , rev ) ; updatePatchSetRef ( ps2 ) ; assertProblems ( c , ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.schema.sql.SqlDialect dialect = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ; try ( java.sql.Statement stmt = newStatement ( db ) ) { for ( java.lang.String name : com.google.common.collect.ImmutableList.of ( "patch_set_approvals_openByUser" , "patch_set_approvals_closedByU" ) ) { if ( dialect instanceof com.google.gwtorm.schema.sql.DialectMySQL ) { stmt.executeUpdate ( ( ( "DROP INDEX " + name ) + " ON patch_set_approvals" ) ) ; } else { stmt.executeUpdate ( ( "DROP INDEX " + name ) ) ; } } } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.schema.sql.SqlDialect dialect = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { dialect.dropIndex ( e , "patch_set_approvals" , "patch_set_approvals_openByUser" ) ; dialect.dropIndex ( e , "patch_set_approvals" , "patch_set_approvals_closedByU" ) ; } }
Source:
public java.lang.String getAlgorithm ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "none" ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 1 ) { return "none" ; } return parts [ 0 ] ; }

Target:
private java.lang.String getPublicKeyPart ( int index , java.lang.String defaultValue ) { java.lang.String s = getSshPublicKey ( ) ; if ( ( s != null ) && ( ( s.length ( ) ) > 0 ) ) { java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) > index ) { return parts [ index ] ; } } return defaultValue ; }
Source:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( testRepo , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }

Target:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit initialHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( testRepo , false ) ; org.eclipse.jgit.revwalk.RevCommit newHead = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( newHead.getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; assertRefUpdatedEvents ( initialHead , newHead ) ; assertChangeMergedEvents ( change.getChangeId ( ) , newHead.name ( ) ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( revision.getParentKey ( ) ) ) ; } } ) ; }

Target:
public void run ( ) { if ( ! ( cm.isClean ( generation ) ) ) { java.lang.String text = cm.getValue ( ) ; final int g = cm.changeGeneration ( false ) ; com.google.gerrit.client.changes.ChangeEditApi.put ( revision.getParentKey ( ) . get ( ) , path , text , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { generation = g ; save.setEnabled ( ( ! ( cm.isClean ( g ) ) ) ) ; } } ) ; } }
Source:
private void fireRefUpdated ( org.eclipse.jgit.lib.RefUpdate branchUpdate ) { logDebug ( "Firing ref updated hooks for {}" , branchUpdate.getName ( ) ) ; gitRefUpdated.fire ( destBranch.getParentKey ( ) , branchUpdate ) ; hooks.doRefUpdatedHook ( destBranch , branchUpdate , getAccount ( mergeTip ) ) ; }

Target:
private void fireRefUpdated ( org.eclipse.jgit.lib.RefUpdate branchUpdate ) { logDebug ( "Firing ref updated hooks for {}" , branchUpdate.getName ( ) ) ; gitRefUpdated.fire ( destBranch.getParentKey ( ) , branchUpdate ) ; hooks.doRefUpdatedHook ( destBranch , branchUpdate , getAccount ( mergeTip.getCurrentTip ( ) ) ) ; }
Source:
private void testGetGroup ( java.lang.String url , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; com.google.gerrit.extensions.common.GroupInfo group = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.GroupInfo.class ) ; com.google.gerrit.acceptance.api.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }

Target:
private void testGetGroup ( java.lang.Object id , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo group = gApi.groups ( ) . id ( id.toString ( ) ) . get ( ) ; com.google.gerrit.acceptance.api.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo info = com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo.create ( ) ; info.ui ( ui.getSelectedValue ( ) ) ; new com.google.gerrit.plugin.client.rpc.RestApi ( "accounts" ) . id ( "self" ) . view ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) , "preferences" ) . put ( info , new com.google.gwt.user.client.rpc.AsyncCallback < com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo > ( ) { @ java.lang.Override public void onSuccess ( com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo result ) { } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { savedLabel.setVisible ( false ) ; com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo info = com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo.create ( ) ; info.ui ( ui.getSelectedValue ( ) ) ; new com.google.gerrit.plugin.client.rpc.RestApi ( "accounts" ) . id ( "self" ) . view ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) , "preferences" ) . put ( info , new com.google.gwt.user.client.rpc.AsyncCallback < com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo > ( ) { @ java.lang.Override public void onSuccess ( com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo result ) { showSavedStatus ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void testEmpty ( ) throws java.lang.Exception { java.util.Map < java.lang.String , ? > data = buildData ( ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( ) , data.get ( "branches" ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( ) , data.get ( "tags" ) ) ; }

Target:
public void empty ( ) throws java.lang.Exception { java.util.Map < java.lang.String , ? > data = buildData ( ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( ) , data.get ( "branches" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( ) , data.get ( "tags" ) ) ; }
Source:
private void assertDeleteByRestSucceeds ( java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ref ) ) ; r.assertNoContent ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }

Target:
private void assertDeleteByRestSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.delete ( ( ( ( "/projects/" + ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( project.get ( ) ) . encoded ( ) ) ) + "/branches/" ) + ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( ref ) . encoded ( ) ) ) ) ; r.assertNoContent ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( branch ) . get ( ) ; }
Source:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c , @ com.google.gerrit.common.Nullable java.lang.Throwable err ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; if ( err != null ) { com.google.gerrit.httpd.RequestUtil.setErrorTraceAttribute ( req , err ) ; } }

Target:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c , @ com.google.gerrit.common.Nullable java.lang.Throwable err ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; if ( err != null ) { com.google.gerrit.util.http.RequestUtil.setErrorTraceAttribute ( req , err ) ; } }
Source:
public void setUpMocks ( ) { indexRestApiServlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/change/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void setUpMocks ( ) { indexRestApiServlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet ( indexer , schemaFactory , indexTs ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/change/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = delegate.rebuild ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = delegate.rebuild ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }
Source:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testutil.FakeEmailSender.Message.create ( from , rcpt , headers , body ) ) ; }

Target:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testutil.FakeEmailSender.Message.create ( from , rcpt , headers , body , htmlBody ) ) ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; rdr.append ( '#' ) ; rdr.append ( getToken ( req ) ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( rsp ) ; rsp.sendRedirect ( rdr.toString ( ) ) ; }

Target:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; rdr.append ( '#' ) ; rdr.append ( com.google.gerrit.httpd.LoginUrlToken.getToken ( req ) ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( rsp ) ; rsp.sendRedirect ( rdr.toString ( ) ) ; }
Source:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.Change > bumpLastUpdatedOn ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; c.setLastUpdatedOn ( ctx.getWhen ( ) ) ; return java.util.Collections.singleton ( c ) ; }

Target:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.Change > changesToUpdate ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( ( ctx.bumpLastUpdatedOn ) && ( c.getLastUpdatedOn ( ) . before ( ctx.getWhen ( ) ) ) ) { c.setLastUpdatedOn ( ctx.getWhen ( ) ) ; } return java.util.Collections.singleton ( c ) ; }
Source:
private org.eclipse.jgit.lib.Config buildConfig ( org.eclipse.jgit.lib.Config baseConfig ) { if ( ( ( configs ( ) ) != null ) && ( ( config ( ) ) != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( ( configs ( ) ) != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( baseConfig , configs ( ) ) ; } else if ( ( config ( ) ) != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( baseConfig , config ( ) ) ; } else { return baseConfig ; } }

Target:
private void checkValidAnnotations ( ) { if ( ( ( configs ( ) ) != null ) && ( ( config ( ) ) != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( ( ( pluginConfigs ( ) ) != null ) && ( ( pluginConfig ( ) ) != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GlobalPluginConfig or @GlobalPluginConfigs not both" ) ; } if ( ( ( ( pluginConfigs ( ) ) != null ) || ( ( pluginConfig ( ) ) != null ) ) && ( memory ( ) ) ) { throw new java.lang.IllegalStateException ( "Must use @UseLocalDisk with @GlobalPluginConfig(s)" ) ; } }
Source:
private static com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > callback ( final java.lang.String target ) { return new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( target ) ; } } ; }

Target:
private com.google.gerrit.client.api.DefaultActions.UiResult asUiResult ( com.google.gwt.core.client.JavaScriptObject in ) { if ( com.google.gerrit.client.rpc.NativeString.is ( in ) ) { java.lang.String str = ( ( com.google.gerrit.client.rpc.NativeString ) ( in ) ) . asString ( ) ; return str.isEmpty ( ) ? com.google.gerrit.client.api.DefaultActions.UiResult.none ( ) : com.google.gerrit.client.api.DefaultActions.UiResult.alert ( str ) ; } return in.cast ( ) ; }
Source:
private com.google.gwtorm.jdbc.JdbcSchema setupSchema ( final com.google.gwtorm.schema.sql.SqlDialect dialect ) { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gwtorm.jdbc.Database db = org.mockito.Mockito.mock ( com.google.gwtorm.jdbc.Database.class ) ; try { org.mockito.Mockito.when ( db.getDialect ( ) ) . thenReturn ( dialect ) ; org.mockito.Mockito.when ( db.newConnection ( ) ) . thenReturn ( conn ) ; com.google.gwtorm.jdbc.JdbcSchema schema = new com.google.gwtorm.jdbc.TestJdbcAccess.Schema ( db ) ; return schema ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private static com.google.gwtorm.jdbc.JdbcSchema setupSchema ( final com.google.gwtorm.schema.sql.SqlDialect dialect , final java.sql.Connection conn ) { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gwtorm.jdbc.Database db = org.mockito.Mockito.mock ( com.google.gwtorm.jdbc.Database.class ) ; try { org.mockito.Mockito.when ( db.getDialect ( ) ) . thenReturn ( dialect ) ; org.mockito.Mockito.when ( db.newConnection ( ) ) . thenReturn ( conn ) ; com.google.gwtorm.jdbc.JdbcSchema schema = new com.google.gwtorm.jdbc.AbstractTestJdbcAccess.Schema ( db ) ; return schema ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public boolean apply ( com.google.gerrit.server.project.ListBranches.BranchInfo in ) { return a.run ( in.ref ) ; }

Target:
public boolean apply ( com.google.gerrit.server.project.ListBranches.BranchInfo in ) { if ( ! ( in.ref.startsWith ( Constants.R_HEADS ) ) ) { return a.run ( in.ref ) ; } else { return a.run ( in.ref.substring ( Constants.R_HEADS.length ( ) ) ) ; } }
Source:
private void fireEventForUnrestrictedListeners ( com.google.gerrit.server.events.ProjectCreatedEvent event ) { for ( com.google.gerrit.common.EventListener listener : unrestrictedListeners ) { listener.onEvent ( event ) ; } }

Target:
private void fireEvent ( 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 ( event , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.init.api.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.init.api.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; org.junit.Assert.assertNotNull ( lib.bouncyCastleProvider ) ; org.junit.Assert.assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }

Target:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( java.nio.file.Paths.get ( "." ) ) ; final com.google.gerrit.pgm.init.api.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.init.api.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; org.junit.Assert.assertNotNull ( lib.bouncyCastleProvider ) ; org.junit.Assert.assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }
Source:
void addReplyBox ( boolean quote ) { com.google.gerrit.client.changes.CommentInfo commentReply = com.google.gerrit.client.changes.CommentInfo.createReply ( comment ) ; if ( quote ) { commentReply.message ( com.google.gerrit.client.change.ReplyBox.quote ( comment.message ( ) ) ) ; } getCommentManager ( ) . addDraftBox ( getCm ( ) . side ( ) , commentReply ) . setEdit ( true ) ; }

Target:
void addReplyBox ( boolean quote ) { com.google.gerrit.client.changes.CommentInfo commentReply = com.google.gerrit.client.changes.CommentInfo.createReply ( comment ) ; if ( quote ) { commentReply.message ( com.google.gerrit.client.change.ReplyBox.quote ( comment.message ( ) ) ) ; } getCommentManager ( ) . addDraftBox ( displaySide , commentReply ) . setEdit ( true ) ; }
Source:
public static synchronized java.nio.file.FileSystem getZipFileSystem ( java.nio.file.Path zip ) throws java.io.IOException { zip = zip.toRealPath ( ) ; java.nio.file.FileSystem zipFs = com.google.gerrit.launcher.GerritLauncher.zipFileSystems.get ( zip ) ; if ( zipFs == null ) { zipFs = java.nio.file.FileSystems.newFileSystem ( java.net.URI.create ( ( "jar:" + ( zip.toUri ( ) ) ) ) , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; com.google.gerrit.launcher.GerritLauncher.zipFileSystems.put ( zip , zipFs ) ; } return zipFs ; }

Target:
private static java.nio.file.FileSystem newZipFileSystem ( java.nio.file.Path zip ) throws java.io.IOException { return java.nio.file.FileSystems.newFileSystem ( java.net.URI.create ( ( "jar:" + ( zip.toUri ( ) ) ) ) , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; }
Source:
public org.objectweb.asm.AnnotationVisitor visitAnnotation ( java.lang.String desc , boolean visible ) { if ( visible && ( com.google.gerrit.server.plugins.AutoRegisterModules.ClassData.EXPORT.equals ( desc ) ) ) { return new com.google.gerrit.server.plugins.AutoRegisterModules.AbstractAnnotationVisitor ( ) { @ java.lang.Override public void visit ( java.lang.String name , java.lang.Object value ) { exportedAsName = ( ( java.lang.String ) ( value ) ) ; } } ; } return null ; }

Target:
public org.objectweb.asm.AnnotationVisitor visitAnnotation ( java.lang.String desc , boolean visible ) { if ( visible && ( com.google.gerrit.server.plugins.AutoRegisterModules.ClassData.EXPORT.equals ( desc ) ) ) { return new com.google.gerrit.server.plugins.AutoRegisterModules.AbstractAnnotationVisitor ( ) { @ java.lang.Override public void visit ( java.lang.String name , java.lang.Object value ) { exportedAsName = ( ( java.lang.String ) ( value ) ) ; } } ; } if ( visible && ( com.google.gerrit.server.plugins.AutoRegisterModules.ClassData.LISTEN.equals ( desc ) ) ) { listen = true ; return null ; } return null ; }
Source:
public void listEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + ( name ( "emptygroup" ) ) ) ) ; com.google.common.truth.Truth.assertThat ( GET ( "/groups/Administrators/groups/" ) ) . isEmpty ( ) ; }

Target:
public void listEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) ) . isEmpty ( ) ; }
Source:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnPath ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }

Target:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnReviewed ( sb , info ) ; columnPath ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }
Source:
private com.google.gerrit.acceptance.TestAccount user ( java.lang.String name , java.lang.String fullName , com.google.gerrit.reviewdb.client.AccountGroup ... groups ) throws java.lang.Exception { name = name ( name ) ; java.lang.String [ ] groupNames = com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( groups ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.AccountGroup , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup in ) { return in.getName ( ) ; } } ) . toArray ( java.lang.String.class ) ; return accounts.create ( name , ( name + "@example.com" ) , fullName , groupNames ) ; }

Target:
private com.google.gerrit.acceptance.TestAccount user ( java.lang.String name , java.lang.String fullName , java.lang.String emailName , com.google.gerrit.reviewdb.client.AccountGroup ... groups ) throws java.lang.Exception { java.lang.String [ ] groupNames = com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( groups ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.AccountGroup , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup in ) { return in.getName ( ) ; } } ) . toArray ( java.lang.String.class ) ; return accounts.create ( name ( name ) , ( ( name ( emailName ) ) + "@example.com" ) , fullName , groupNames ) ; }
Source:
public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.SideBySideCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }

Target:
java.lang.String getTokenSuffixForActiveLine ( net.codemirror.lib.CodeMirror cm ) { return ( ( cm.side ( ) ) == ( DisplaySide.A ) ? "a" : "" ) + ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ; }