auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void doPerformAction ( final java.lang.String issueKey , final java.lang.String actionName ) throws com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException , java.io.IOException { log.debug ( ( ( ( "Trying to perform action: " + actionName ) + " on issue " ) + issueKey ) ) ; boolean ret = client ( ) . doTransition ( issueKey , actionName ) ; if ( ret ) { log.debug ( ( ( ( "Action " + actionName ) + " successful on Issue " ) + issueKey ) ) ; } else { log.debug ( "Action on Issue not possible" , actionName , issueKey ) ; } }

Target:
private void doPerformAction ( final java.lang.String issueKey , final java.lang.String actionName ) throws com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException , java.io.IOException { log.debug ( "Trying to perform action: on issue {}" , actionName , issueKey ) ; boolean ret = client ( ) . doTransition ( issueKey , actionName ) ; if ( ret ) { log.debug ( "Action successful on Issue {}" , actionName , issueKey ) ; } else { log.debug ( "Action on Issue not possible" , actionName , issueKey ) ; } }
Source:
public void onBackPressed ( ) { android.app.Fragment fragment = getFragmentManager ( ) . findFragmentById ( R.id.mainFrame ) ; if ( fragment instanceof com.google.reviewit.OnBackPressedAware ) { if ( ( ( com.google.reviewit.OnBackPressedAware ) ( fragment ) ) . onBackPressed ( ) ) { return ; } } getFragmentManager ( ) . executePendingTransactions ( ) ; int count = getFragmentManager ( ) . getBackStackEntryCount ( ) ; if ( count == 0 ) { super . onBackPressed ( ) ; } else { getFragmentManager ( ) . popBackStack ( ) ; } }

Target:
public void onBackPressed ( ) { android.support.v4.app.Fragment fragment = getSupportFragmentManager ( ) . findFragmentById ( R.id.mainFrame ) ; if ( fragment instanceof com.google.reviewit.OnBackPressedAware ) { if ( ( ( com.google.reviewit.OnBackPressedAware ) ( fragment ) ) . onBackPressed ( ) ) { return ; } } getFragmentManager ( ) . executePendingTransactions ( ) ; int count = getFragmentManager ( ) . getBackStackEntryCount ( ) ; if ( count == 0 ) { super . onBackPressed ( ) ; } else { getFragmentManager ( ) . popBackStack ( ) ; } }
Source:
void onClick ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio b ) { switch ( b.file ) { case 0 : screen.idSideA = b.patchSetId ; break ; case 1 : screen.idSideB = b.patchSetId ; break ; default : return ; } enableAll ( false ) ; screen.refresh ( false ) ; }

Target:
void onClick ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio b ) { switch ( b.file ) { case 0 : screen.setSideA ( b.patchSetId ) ; break ; case 1 : screen.setSideB ( b.patchSetId ) ; break ; default : return ; } enableAll ( false ) ; screen.refresh ( false ) ; }
Source:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.nio.file.Path trashRepo = gitDir.resolve ( ( ( ( ( nameKey.get ( ) ) + "." ) + ( java.lang.System.currentTimeMillis ( ) ) ) + ".deleted" ) ) ; return java.nio.file.Files.move ( directory , trashRepo , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }

Target:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.nio.file.Path trashRepo = gitDir.resolve ( ( ( ( ( nameKey.get ( ) ) + "." ) + ( java.lang.System.currentTimeMillis ( ) ) ) + ".%deleted%.git" ) ) ; return java.nio.file.Files.move ( directory , trashRepo , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.SubmitInput submitInput , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { if ( ( filter.get ( ) ) == null ) { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; res.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED ) ; return ; } filter.get ( ) . doFilter ( req , res , chain ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { if ( ( filter.get ( ) ) == null ) { responseLfsNotConfigured ( res ) ; return ; } filter.get ( ) . doFilter ( req , res , chain ) ; }
Source:
static void initialize ( org.eclipse.jgit.lib.Config cfg ) { cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , AsciidoctorFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , "adoc" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , MarkdownFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/x-markdown" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , PlainTextFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/plain" ) ; }

Target:
static void initialize ( org.eclipse.jgit.lib.Config cfg ) { cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , AsciidoctorFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , "adoc" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , MarkdownFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/x-markdown" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , PlainTextFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/plain" ) ; cfg.setStringList ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , ZipFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , java.util.Arrays.asList ( "jar" , "war" , "zip" ) ) ; }
Source:
public boolean isChangeUpToDate ( org.eclipse.jgit.lib.Repository changeRepo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = changeRepo.exactRef ( com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( changeId ) ) ; if ( ref == null ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return ref.getObjectId ( ) . equals ( changeMetaId ) ; }

Target:
public boolean isChangeUpToDate ( com.google.gerrit.server.git.RefCache changeRepoRefs ) throws java.io.IOException { com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > id = changeRepoRefs.get ( com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( changeId ) ) ; if ( ! ( id.isPresent ( ) ) ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return id.get ( ) . equals ( changeMetaId ) ; }
Source:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent e , int idx ) { if ( com.google.gerrit.client.change.RevisionsBox.link.handleAsClick ( e.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.change.RevisionsBox t = com.google.gerrit.client.change.RevisionsBox.getRevisionBox ( e ) ; if ( t != null ) { t.onOpenRow ( idx ) ; e.preventDefault ( ) ; return false ; } } return true ; }

Target:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent e , int idx ) { if ( com.google.gerrit.client.change.PatchSetsBox.link.handleAsClick ( e.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.change.PatchSetsBox t = com.google.gerrit.client.change.PatchSetsBox.getRevisionBox ( e ) ; if ( t != null ) { t.onOpenRow ( idx ) ; e.preventDefault ( ) ; return false ; } } return true ; }
Source:
public com.google.gwtjsonrpc.common.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account a = db.accounts ( ) . get ( getAccountId ( ) ) ; if ( a == null ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; } a.setGeneralPreferences ( pref ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; accountCache.evict ( a.getId ( ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.publish ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { detailCache.set ( result ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.publish ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) ) ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > extIds = externalIdCache.byAccount ( user.getAccountId ( ) ) ; db.accountExternalIds ( ) . delete ( extIds ) ; externalIdCache.onRemove ( extIds ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; com.google.gerrit.reviewdb.client.AccountExternalId extId = new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( extId ) ) ; externalIdCache.onCreate ( extId ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
public com.google.gerrit.server.project.ProjectState projectState ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db , com.google.gerrit.server.project.ProjectCache projectCache ) throws com.google.gwtorm.client.OrmException { if ( ( projectState ) == null ) { com.google.gerrit.reviewdb.Change c = change ( db ) ; projectState = projectCache.get ( c.getProject ( ) ) ; } return projectState ; }

Target:
public com.google.gerrit.server.project.ProjectState projectState ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db , com.google.gerrit.server.project.ProjectCache projectCache ) throws com.google.gwtorm.client.OrmException { initProjectState ( db , projectCache ) ; return com.google.gerrit.server.util.FutureUtil.get ( projectState ) ; }
Source:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.block ( local , 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.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , 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 ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can't edit topic name" ) . isFalse ( ) ; }
Source:
public void testVerifyAgainstToken ( ) throws java.lang.Exception { java.lang.String token = auth.generateToken ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( token , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isTrue ( ) ; }

Target:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }
Source:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.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.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }

Target:
public void blockPushDrafts ( ) { 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.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }
Source:
protected void insert ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . cPROJECT ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . cPROJECT ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }
Source:
public void testAppend_StringBuffer ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.StringBuffer ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( new java.lang.StringBuffer ( "foo" ) ) ) ; assertSame ( b , b.append ( new java.lang.StringBuffer ( "bar" ) ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_Object ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.Object ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.Object ( ) { @ java.lang.Override public java.lang.String toString ( ) { return "foobar" ; } } ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.set ( list , diff ) ; header.setChangeInfo ( info ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.set ( prefs , list , diff ) ; header.setChangeInfo ( info ) ; }
Source:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; java.io.Writer out = newWriter ( res ) ; out.write ( message ) ; out.close ( ) ; }

Target:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; try ( java.io.Writer out = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { out.write ( message ) ; } }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return fileContentUtil.getContentType ( rsrc.getRevision ( ) . getControl ( ) . getProject ( ) . getNameKey ( ) , rsrc.getRevision ( ) . getPatchSet ( ) . getRevision ( ) . get ( ) , rsrc.getPatchKey ( ) . get ( ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.lang.String path = rsrc.getPatchKey ( ) . get ( ) ; if ( Patch.COMMIT_MSG.equals ( path ) ) { return "text/plain" ; } return fileContentUtil.getContentType ( rsrc.getRevision ( ) . getControl ( ) . getProject ( ) . getNameKey ( ) , rsrc.getRevision ( ) . getPatchSet ( ) . getRevision ( ) . get ( ) , path ) ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }
Source:
protected void run ( ) { stdout.println ( "Branching manifest:" ) ; stdout.println ( manifestRepo ) ; stdout.println ( manifestCommitish ) ; stdout.println ( manifestPath ) ; com.amd.gerrit.plugins.manifestsubscription.Utilities.branchManifest ( gitRepoManager , manifestRepo , manifestCommitish , manifestPath , newBranch , stdout , stderr , ( ( outputType ) == ( Utilities.OutputType.JSON ) ) ) ; }

Target:
protected void run ( ) { stdout.println ( "Branching manifest:" ) ; stdout.println ( manifestRepo ) ; stdout.println ( manifestCommitish ) ; stdout.println ( manifestPath ) ; stdout.println ( newManifestRepo ) ; stdout.println ( newManifestBranch ) ; stdout.println ( newManifestPath ) ; com.amd.gerrit.plugins.manifestsubscription.Utilities.branchManifest ( gitRepoManager , metaDataUpdateFactory , manifestRepo , manifestCommitish , manifestPath , newBranch , newManifestRepo , newManifestBranch , newManifestPath , stdout , stderr , ( ( outputType ) == ( Utilities.OutputType.JSON ) ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.account.Preferences > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.client.account.Preferences prefs ) { display ( prefs ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.api.ExtensionPanel extensionPanel = createExtensionPoint ( GerritUiExtensionPoint.PREFERENCES_SCREEN_BOTTOM ) ; extensionPanel.addStyleName ( Gerrit.RESOURCES.css ( ) . extensionPanel ( ) ) ; add ( extensionPanel ) ; com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.account.Preferences > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.client.account.Preferences prefs ) { display ( prefs ) ; } } ) ; }
Source:
public void storeLocalOfflineAfterNoRetry ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.when ( cfgMock.getMaxTries ( ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; store.queryChangeEvents ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.GENERIC_QUERY ) ; }
Source:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }

Target:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( accounts.create ( ) . id.get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }
Source:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( peerInfo.get ( ) . getDirectUrl ( ) ) + endpoint ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( content ) ) ) { post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; } return httpClient.execute ( post , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( getPeerInfo ( ) . getDirectUrl ( ) ) + endpoint ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( content ) ) ) { post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; } return httpClient.execute ( post , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }
Source:
com.google.gerrit.client.diff.DraftBox addReply ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.common.changes.Side side = replyTo.side ( ) ; int line = replyTo.line ( ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , line , replyTo.id ( ) , initMessage ) ; return addDraftBox ( info , doSave ) ; }

Target:
void removeFileCommentBox ( com.google.gerrit.client.diff.DraftBox box , com.google.gerrit.common.changes.Side side ) { diffTable.onRemoveDraftBox ( box , side ) ; }
Source:
public void testUsernamePatternNonRegex ( ) { grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "u" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "d" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state ) ; } } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.PushAll.stateLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }

Target:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { if ( filter.matches ( nameKey ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state ) ; } } } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.PushAll.stateLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }
Source:
private static int split ( java.lang.String line ) { int sp = line.indexOf ( ' ' ) ; int tab = line.indexOf ( '\t' ) ; if ( ( sp < 0 ) && ( tab < 0 ) ) { return - 1 ; } if ( ( sp < 0 ) && ( 0 <= tab ) ) { return tab ; } if ( ( 0 <= sp ) && ( tab < 0 ) ) { return sp ; } return java.lang.Math.min ( sp , tab ) ; }

Target:
public static com.google.gerrit.server.git.ProjectConfig read ( com.google.gerrit.server.git.MetaDataUpdate update ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.ProjectConfig r = new com.google.gerrit.server.git.ProjectConfig ( update.getProjectName ( ) ) ; r.load ( update ) ; return r ; }
Source:
public boolean canRebase ( ) { return ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ; }

Target:
public boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void sideBySidePatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.SideBySidePatchDetail > callback ) { final com.google.gerrit.git.RepositoryCache rc = server.getRepositoryCache ( ) ; if ( rc == null ) { callback.onFailure ( new java.lang.Exception ( "No Repository Cache configured" ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.SideBySidePatchDetailAction ( rc , key ) ) ; }

Target:
public void sideBySidePatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final java.util.List < com.google.gerrit.client.reviewdb.PatchSet.Id > versions , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.SideBySidePatchDetail > callback ) { final com.google.gerrit.git.RepositoryCache rc = server.getRepositoryCache ( ) ; if ( rc == null ) { callback.onFailure ( new java.lang.Exception ( "No Repository Cache configured" ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.SideBySidePatchDetailAction ( rc , key , versions ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { java.lang.String action = result.asString ( ) ; try { com.google.gerrit.reviewdb.client.Project.SubmitType type = Project.SubmitType.valueOf ( action ) ; submitActionText.setInnerText ( com.google.gerrit.client.admin.Util.toLongString ( type ) ) ; } catch ( java.lang.IllegalArgumentException e ) { submitActionText.setInnerText ( action ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { renderSubmitType ( result.asString ( ) ) ; }
Source:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.highavailability.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.highavailability.EventForwarder.class ) . to ( com.ericsson.gerrit.plugins.highavailability.RestEventForwarder.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.IndexEventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestEventForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; }
Source:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.changes.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacy_id ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }

Target:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.changes.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacyId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }
Source:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , change ) ; return d ; }

Target:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } assertCanRead ( change ) ; final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , change ) ; return d ; }
Source:
private void loadCommit ( final com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.isEdit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
private void loadConfigInfo ( final com.google.gerrit.client.info.ChangeInfo info , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { if ( loaded ) { return ; } com.google.gerrit.client.changes.RevisionInfoCache.add ( changeId , rev ) ; com.google.gerrit.client.projects.ConfigInfoCache.add ( info ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( info.projectNameKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { loaded = true ; commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; renderChangeInfo ( info ) ; loadRevisionInfo ( ) ; } } ) ; }
Source:
private Project.NameKey getProjectName ( java.nio.file.Path p ) { java.lang.String projectName = startFolder.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }

Target:
private void addProject ( java.nio.file.Path p ) { com.google.gerrit.reviewdb.client.Project.NameKey nameKey = com.google.gerrit.server.git.LocalDiskRepositoryManager.getProjectName ( startFolder , p ) ; if ( getBasePath ( nameKey ) . equals ( startFolder ) ) { if ( isUnreasonableName ( nameKey ) ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.warn ( ( "Ignoring unreasonably named repository " + ( p.toAbsolutePath ( ) ) ) ) ; } else { found.add ( nameKey ) ; } } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isClosed ( ) ) { return null ; } if ( ! ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { return null ; } if ( ( change.getStatus ( ) ) != ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; } change.setLastSha1MergeTested ( null ) ; change.setCurrentPatchSet ( info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isClosed ( ) ) { return null ; } if ( ! ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { return null ; } if ( ( change.getStatus ( ) ) != ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; } change.setLastSha1MergeTested ( null ) ; change.setCurrentPatchSet ( info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { setReviewedByCurrentUser ( event.getValue ( ) ) ; }

Target:
private void update ( com.google.gerrit.common.data.PatchScriptSettings s ) { if ( ( ( lastScript ) != null ) && ( canReuse ( s , lastScript ) ) ) { lastScript.setSettings ( s ) ; RpcStatus.INSTANCE.onRpcStart ( null ) ; settingsPanel.setEnabled ( false ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; } else { refresh ( false ) ; } }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Object > apply ( java.lang.Boolean indexUpdated ) throws java.lang.Exception { if ( ! indexUpdated ) { return ( ( com.google.common.util.concurrent.ListenableFuture < java.lang.Object > ) ( indexer.indexAsync ( c.getId ( ) ) ) ) ; } return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.lang.Void o ) { return ( ( com.google.common.util.concurrent.ListenableFuture < java.lang.Void > ) ( indexer.indexAsync ( c.getId ( ) ) ) ) ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws java.lang.Exception { emailReviewers ( rsrc.getChange ( ) , added ) ; if ( ! ( added.isEmpty ( ) ) ) { for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : added ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( psa.getAccountId ( ) ) . getAccount ( ) ; reviewerAdded.fire ( rsrc.getChange ( ) , patchSet , account ) ; } } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws java.lang.Exception { emailReviewers ( rsrc.getChange ( ) , added ) ; if ( ! ( added.isEmpty ( ) ) ) { for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : added ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( psa.getAccountId ( ) ) . getAccount ( ) ; reviewerAdded.fire ( rsrc.getChange ( ) , patchSet , account , ctx.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) , ctx.getWhen ( ) ) ; } } }
Source:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( ( "A " + name ) + " B" ) , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ( ( "A " + name ) + " B" ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1.isVariable ( ) ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.exceptions.TermException ( a1 ) ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.builtin.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; throw new com.googlecode.prolog_cafe.exceptions.TermException ( a1 ) ; }
Source:
public void destroy ( ) { org.apache.sshd.server.Command cmd = atomicCmd.getAndSet ( null ) ; if ( cmd != null ) { try { cmd.destroy ( ) ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagate ( e ) ; } } }

Target:
public void destroy ( ) { org.apache.sshd.server.Command cmd = atomicCmd.getAndSet ( null ) ; if ( cmd != null ) { try { cmd.destroy ( ) ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new java.lang.RuntimeException ( e ) ; } } }
Source:
protected void doDelete ( final java.lang.Iterable < T > instances , final com.google.gwtorm.jdbc.JdbcTransaction txn ) throws com.google.gwtorm.client.OrmException { try { if ( schema.getDialect ( ) . canDetermineIndividualBatchUpdateCounts ( ) ) { deleteAsBatch ( instances ) ; } else { deleteIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "delete" , e ) ; } }

Target:
public void delete ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { deleteAsBatch ( instances ) ; } else { deleteIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "delete" , e ) ; } }