auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; com.google.gerrit.server.IdentifiedUser caller = control.getUser ( ) . asIdentifiedUser ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , control.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public static com.google.gerrit.server.patch.DiffCacheContent createEmpty ( final org.spearce.jgit.lib.Repository db , final org.spearce.jgit.lib.ObjectId treeIsh , final java.lang.String path ) throws java.io.IOException , org.spearce.jgit.errors.IncorrectObjectTypeException , org.spearce.jgit.errors.MissingObjectException { final org.spearce.jgit.lib.ObjectId blob = com.google.gerrit.server.patch.DiffCacheContent.find ( db , treeIsh , path ) ; if ( blob == null ) { throw new java.io.IOException ( ( ( ( "path \"" + path ) + "\" not in " ) + ( treeIsh.name ( ) ) ) ) ; } return new com.google.gerrit.server.patch.DiffCacheContent ( blob ) ; }

Target:
public static com.google.gerrit.server.patch.DiffCacheContent createEmpty ( ) { return new com.google.gerrit.server.patch.DiffCacheContent ( ) ; }
Source:
public void skipWhenUserBelongsToGroupUUID ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" , "yetAnotherGroup" ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( projectName , "anyRef" , "testOp" ) ) . isFalse ( ) ; }

Target:
public void skipWhenUserBelongsToGroupUUID ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" , "yetAnotherGroup" ) . get ( ) , projectName , "anyRef" , "testOp" ) ) . isFalse ( ) ; }
Source:
public void addValue ( final java.lang.Object value ) throws org.kohsuke.args4j.CmdLineException { java.lang.Short val = ( ( java.lang.Short ) ( value ) ) ; if ( ( val < ( approvalMin ) ) || ( val > ( approvalMax ) ) ) { throw new org.kohsuke.args4j.CmdLineException ( ( ( ( ( ( name ( ) ) + " valid values are " ) + ( approvalMin.toString ( ) ) ) + ".." ) + ( approvalMax.toString ( ) ) ) ) ; } this . value = ( ( java.lang.Short ) ( value ) ) ; }

Target:
public void addValue ( final java.lang.Short val ) { this . value = val ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( groupCache , user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }
Source:
private boolean shouldGet ( ) { if ( console.isBatch ( ) ) { return required ; } else { final java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "\n" ) ; msg.append ( "Gerrit Code Review is not shipped with %s\n" ) ; if ( required ) { msg.append ( "** This library is required for your configuration. **\n" ) ; } else { msg.append ( " If available, Gerrit can take advantage of features\n" ) ; msg.append ( " in the library, but will also function without it.\n" ) ; } msg.append ( "Download and install it now" ) ; return console.yesno ( msg.toString ( ) , name ) ; } }

Target:
private boolean shouldGet ( ) { if ( console.isBatch ( ) ) { return required ; } else { final java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "\n" ) ; msg.append ( "Gerrit Code Review is not shipped with %s\n" ) ; if ( required ) { msg.append ( "** This library is required for your configuration. **\n" ) ; } else { msg.append ( " If available, Gerrit can take advantage of features\n" ) ; msg.append ( " in the library, but will also function without it.\n" ) ; } msg.append ( "Download and install it now" ) ; return console.yesno ( true , msg.toString ( ) , name ) ; } }
Source:
void appendInsert ( int numLines ) { int origLineB = lineB ; lineB += numLines ; int bAheadOfA = ( lineB ) - ( lineA ) ; lineMapAtoB.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( lineA , lineA , bAheadOfA ) ) ; lineMapBtoA.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( origLineB , ( ( lineB ) - 1 ) , ( - bAheadOfA ) ) ) ; }

Target:
void appendInsert ( int numLines ) { int origLineB = lineB ; lineB += numLines ; int bAheadOfA = ( lineB ) - ( lineA ) ; lineMapAtoB.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( lineA , ( - 1 ) , bAheadOfA ) ) ; lineMapBtoA.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( origLineB , ( ( lineB ) - 1 ) , ( - bAheadOfA ) ) ) ; }
Source:
static java.lang.String makeKey ( int change , int patch , java.lang.String branch ) { if ( ( branch.indexOf ( com.googlesource.gerrit.plugins.findowners.Cache.REFS_HEADS ) ) == 0 ) { branch = branch.substring ( com.googlesource.gerrit.plugins.findowners.Cache.REFS_HEADS.length ( ) ) ; } return ( ( ( change + ":" ) + patch ) + ":" ) + branch ; }

Target:
public static java.lang.String makeKey ( int change , int patch , java.lang.String branch ) { if ( ( branch.indexOf ( com.googlesource.gerrit.plugins.findowners.Cache.REFS_HEADS ) ) == 0 ) { branch = branch.substring ( com.googlesource.gerrit.plugins.findowners.Cache.REFS_HEADS.length ( ) ) ; } return ( ( ( change + ":" ) + patch ) + ":" ) + branch ; }
Source:
public boolean canDelete ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return ( ( isOwner ( ) ) && ( getRefControl ( ) . canDeleteOwnChanges ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; case MERGED : default : return false ; } }

Target:
private boolean canDelete ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return ( ( isOwner ( ) ) && ( getRefControl ( ) . canDeleteOwnChanges ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; case MERGED : default : return false ; } }
Source:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin , val.sessionId ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin , val.sessionId , val.auth ) ; }
Source:
public void testBlockedExtensionsCaseInsensitive ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_UC ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.performValidation ( repo , c , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < java.lang.String > expected = new java.util.ArrayList < > ( ) ; for ( java.lang.String extension : com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_UC ) { expected.add ( ( "ERROR: blocked file: foo." + extension ) ) ; } com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testBlockedExtensionsCaseInsensitive ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( rw , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_UC ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.performValidation ( repo , c , rw , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < java.lang.String > expected = new java.util.ArrayList < > ( ) ; for ( java.lang.String extension : com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_UC ) { expected.add ( ( "ERROR: blocked file: foo." + extension ) ) ; } com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( expected ) ; } }
Source:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; finishLogin ( rsp , false ) ; } }

Target:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; finishLogin ( rsp , null , null ) ; } }
Source:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( user.memberOf ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ) || ( user.memberOf ( group.getGroupUUID ( ) ) ) ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsSummaryPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsSummaryPanel.Factory ( ) ) ; } if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsSummaryPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsSummaryPanel.Factory ( ) ) ; } if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( info ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( info ) ) ; } }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup missing ( final com.google.gerrit.reviewdb.client.AccountGroup.Id key ) { final com.google.gerrit.reviewdb.client.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( ( "Deleted Group" + ( key.toString ( ) ) ) ) ; final com.google.gerrit.reviewdb.client.AccountGroup g = new com.google.gerrit.reviewdb.client.AccountGroup ( name , key , null ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; return g ; }

Target:
private static com.google.gerrit.reviewdb.client.AccountGroup missing ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( ( "Deleted Group" + key ) ) ; com.google.gerrit.reviewdb.client.AccountGroup g = new com.google.gerrit.reviewdb.client.AccountGroup ( name , key , null ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; return g ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) && ( com.google.gerrit.client.Gerrit.currentScreen.isRequiresSignIn ( ) ) ) { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } }

Target:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignOut ( ) ; } }
Source:
public void conflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }

Target:
public void conflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( true ) ; createChange ( false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }
Source:
public void commentOnReviewableChangeByReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( sc.reviewer ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.reviewer ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.reviewer ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }

Target:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }
Source:
private static java.lang.Class < ? > scanObjectOrClass ( java.lang.Object element ) { if ( java.lang.Class.class . isAssignableFrom ( element.getClass ( ) ) ) { return ( ( java.lang.Class < ? > ) ( element ) ) ; } else { return element.getClass ( ) ; } }

Target:
private static java.lang.Class < ? > scanObjectOrClass ( java.lang.Object element ) { if ( java.lang.Class.class . isAssignableFrom ( element.getClass ( ) ) ) { return ( ( java.lang.Class < ? > ) ( element ) ) ; } return element.getClass ( ) ; }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }

Target:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; HEAD ( 14422 ) ; com.google.gerrit.server.patch.a Update ; com.google.gerrit.server.patch.plugin to ; com.google.gerrit.server.patch.latest revision ; }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } }
Source:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind changeKind ) throws java.lang.Exception { switch ( changeKind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : updateFirstParent ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.NO_CHANGE : noChange ( changeId ) ; return ; default : org.junit.Assert.fail ( ( "unexpected change kind: " + changeKind ) ) ; } }

Target:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind changeKind ) throws java.lang.Exception { switch ( changeKind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : updateFirstParent ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.NO_CHANGE : noChange ( changeId ) ; return ; default : fail ( ( "unexpected change kind: " + changeKind ) ) ; } }
Source:
public void run ( ) { if ( prefs.renderEntireFile ( ) ) { return ; } net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException | org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { rw.markStart ( rw.parseCommit ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { rw.markStart ( rw.parseCommit ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } finally { rw.close ( ) ; } } finally { repo.close ( ) ; } }
Source:
public com.google.gerrit.pgm.init.api.AllProjectsConfig load ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File path = getPath ( ) ; if ( path != null ) { org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( path ) ; try { load ( repo ) ; } finally { repo.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.pgm.init.api.AllProjectsConfig load ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File path = getPath ( ) ; if ( path != null ) { try ( org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( path ) ) { load ( repo ) ; } } return this ; }
Source:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.server.account.externalids.ExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.asAccountExternalId ( ) . getKey ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }

Target:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.server.account.externalids.ExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.key ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }
Source:
public boolean equals ( final java.lang.Object other ) { if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.VariablePredicate < ? > v = ( ( com.google.gerrit.server.query.VariablePredicate < ? > ) ( other ) ) ; return ( getName ( ) . equals ( v.getName ( ) ) ) && ( getChildren ( ) . equals ( v.getChildren ( ) ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object other ) { if ( other == null ) return false ; if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.VariablePredicate < ? > v = ( ( com.google.gerrit.server.query.VariablePredicate < ? > ) ( other ) ) ; return ( getName ( ) . equals ( v.getName ( ) ) ) && ( getChildren ( ) . equals ( v.getChildren ( ) ) ) ; } return false ; }