auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String tagRev = tag ( ) . get ( ) . revision ; tag ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , com.google.gerrit.acceptance.rest.project.DeleteTagIT.TAG , null , tagRev , tagRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; tag ( ) . get ( ) ; }

Target:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.TagInfo tagInfo = tag ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( tagInfo.canDelete ) . isTrue ( ) ; java.lang.String tagRev = tagInfo.revision ; tag ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , com.google.gerrit.acceptance.rest.project.DeleteTagIT.TAG , null , tagRev , tagRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; tag ( ) . get ( ) ; }
Source:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { return true ; } } return false ; }

Target:
public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; }
Source:
public static void recent ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "all" ) . addParameterTrue ( "recent" ) . addParameterTrue ( "d" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
protected boolean onKeyPress ( final char keyCode , final int modifiers ) { if ( super . onKeyPress ( keyCode , modifiers ) ) { return true ; } if ( modifiers == 0 ) { switch ( keyCode ) { case 's' : case 'c' : toggleCurrentRow ( ) ; return true ; } } return false ; }

Target:
public boolean onBeforeTabSelected ( com.google.gwt.user.client.ui.SourcesTabEvents sender , int tabIndex ) { return true ; }
Source:
public void execute ( ) { doBrowse ( ) ; }

Target:
public void run ( ) { if ( com.google.gerrit.client.account.SshPanel.isAppletRunning ( com.google.gerrit.client.account.SshPanel.applet ) ) { appletLoadTimer = null ; cancel ( ) ; doBrowse ( ) ; } else if ( ( 30000 / 200 ) < ( ( attempts ) ++ ) ) { appletLoadTimer = null ; cancel ( ) ; noBrowse ( ) ; } }
Source:
public int compare ( final com.google.gerrit.reviewdb.client.PatchSetApproval a , final com.google.gerrit.reviewdb.client.PatchSetApproval b ) { return a.getGranted ( ) . compareTo ( b.getGranted ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.patchsetId ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.patchsetId ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getEffectiveUserGroups ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = user.getEffectiveGroups ( ) ; if ( isOwner ( ) ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroupsOnProject = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.UUID > ( ( ( userGroups.size ( ) ) + 1 ) ) ; userGroupsOnProject.addAll ( userGroups ) ; userGroupsOnProject.add ( AccountGroup.PROJECT_OWNERS ) ; return java.util.Collections.unmodifiableSet ( userGroupsOnProject ) ; } else { return userGroups ; } }

Target:
public boolean canRunUploadPack ( ) { for ( com.google.gerrit.reviewdb.AccountGroup.UUID group : uploadGroups ) { if ( match ( group ) ) { return true ; } } return false ; }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) throws java.io.IOException { response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , getScope ( scopes ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }

Target:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) throws java.io.IOException { java.lang.String scopeRequested = request.getParameter ( "scope" ) ; java.lang.String baseScopeKey = com.google.common.base.Objects.firstNonNull ( scopeRequested , "scopes" ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , getScope ( baseScopeKey , scopes ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }
Source:
protected static java.lang.String getGroupName ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { return java.lang.String.format ( "Group <%s>" , uuid ) ; }

Target:
private static java.util.Optional < com.google.gerrit.common.data.GroupDescription.Basic > getGroup ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { com.google.gerrit.common.data.GroupDescription.Basic group = new com.google.gerrit.common.data.GroupDescription.Basic ( ) { @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return uuid ; } @ java.lang.Override public java.lang.String getName ( ) { return "Group" ; } @ com.google.gerrit.common.Nullable @ java.lang.Override public java.lang.String getEmailAddress ( ) { return null ; } @ com.google.gerrit.common.Nullable @ java.lang.Override public java.lang.String getUrl ( ) { return null ; } } ; return java.util.Optional.of ( group ) ; }
Source:
com.google.gerrit.client.diff.DraftBox addReplyBox ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , initMessage ) ; com.google.gerrit.client.diff.DraftBox box = new com.google.gerrit.client.diff.DraftBox ( this , revision , info , commentLinkProcessor , true , ( ! doSave ) ) ; addCommentBox ( info , box ) ; return box ; }

Target:
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 ) ; }
Source:
public < T > java.util.Enumeration < T > resources ( java.lang.Class < ? extends T > resourceClass ) { return java.util.Collections.emptyEnumeration ( ) ; }

Target:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resource = resourceOf ( relativePathOf ( path ) ) ; if ( resource.isPresent ( ) ) { resourcesList.add ( resource.get ( ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
private PushOneCommit.Result updateChange ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , "test commit" , "a.txt" , content , r.getChangeId ( ) ) ; return push.to ( "refs/for/master" ) ; }

Target:
private PushOneCommit.Result updateChange ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , "test commit" , "a.txt" , content , r.getChangeId ( ) ) ; return push.to ( "refs/for/master" ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; user1 = user ( "user1" , "First1 Last1" , group1 ) ; user2 = user ( "user2" , "First2 Last2" , group2 ) ; user3 = user ( "user3" , "First3 Last3" , group1 , group2 ) ; }
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 ; com.googlecode.prolog_cafe.builtin.Term a2 ; a1 = arg1 ; a2 = arg2 ; a1 = a1.dereference ( ) ; if ( ! ( a2.unify ( new com.googlecode.prolog_cafe.builtin.IntegerTerm ( a1.hashCode ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; com.googlecode.prolog_cafe.lang.Term a2 ; a1 = arg1 ; a2 = arg2 ; a1 = a1.dereference ( ) ; if ( ! ( a2.unify ( new com.googlecode.prolog_cafe.lang.IntegerTerm ( a1.hashCode ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }
Source:
public void testIsEnabledRefNoParentNonMatchingBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentNonMatchingBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void myStarredChangeIds ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > > callback ) { run ( callback , new com.google.gerrit.server.rpc.Action < java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > > ( ) { public java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { return com.google.gerrit.server.rpc.ChangeListServiceImpl.starredBy ( db , com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; } } ) ; }

Target:
public void myStarredChangeIds ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > > callback ) { callback.onSuccess ( currentUser.get ( ) . getStarredChanges ( ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectAccess ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectAccess > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.common.data.ProjectAccess access ) { displayReadOnly ( access ) ; } } ) ; savedPanel = ACCESS ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.lang.Exception { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.gerrit.server.change.ChangeInserter setDraft ( boolean draft ) { change.setStatus ( ( draft ? Change.Status.DRAFT : Change.Status.NEW ) ) ; patchSet.setDraft ( draft ) ; return this ; }

Target:
public com.google.gerrit.reviewdb.client.Change createChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { change = new com.google.gerrit.reviewdb.client.Change ( com.google.gerrit.server.change.ChangeInserter.getChangeKey ( commit ) , changeId , ctx.getUser ( ) . getAccountId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( ctx.getProject ( ) , refName ) , ctx.getWhen ( ) ) ; change.setStatus ( com.google.common.base.MoreObjects.firstNonNull ( status , Change.Status.NEW ) ) ; change.setTopic ( topic ) ; return change ; }
Source:
private java.lang.String messageForDestinationChange ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch ) { return new java.lang.StringBuilder ( "Patch Set " ) . append ( patchSetId.get ( ) ) . append ( ": Cherry Picked from branch " ) . append ( sourceBranch.getShortName ( ) ) . append ( "." ) . toString ( ) ; }

Target:
private java.lang.String messageForDestinationChange ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch , org.eclipse.jgit.lib.ObjectId sourceCommit ) { java.lang.StringBuilder stringBuilder = new java.lang.StringBuilder ( "Patch Set " ) . append ( patchSetId.get ( ) ) ; if ( sourceBranch != null ) { stringBuilder.append ( ": Cherry Picked from branch " ) . append ( sourceBranch.getShortName ( ) ) ; } else { stringBuilder.append ( ": Cherry Picked from commit " ) . append ( sourceCommit.getName ( ) ) ; } return stringBuilder.append ( "." ) . toString ( ) ; }
Source:
core ( ) { }

Target:
protected < K , V > com.google.gerrit.server.cache.NamedCacheBinding < K , V > core ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return core ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) , type ) . name ( name ) ; }
Source:
public boolean dryRun ( final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( com.google.gerrit.server.git.MergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( com.google.gerrit.server.git.MergeUtil.canMerge ( args.mergeSorter , args.repo , args.useContentMerge , mergeTip , toMerge ) ) ; }

Target:
public boolean dryRun ( final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( args.mergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }
Source:
public void tearDown ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( com.google.gerrit.server.account.GpgKeys.getGpgExtIds ( db , admin.getId ( ) ) ) ; db.accountExternalIds ( ) . delete ( com.google.gerrit.server.account.GpgKeys.getGpgExtIds ( db , user.getId ( ) ) ) ; }

Target:
public void restoreExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( getExternalIds ( admin ) ) ; db.accountExternalIds ( ) . delete ( getExternalIds ( user ) ) ; db.accountExternalIds ( ) . insert ( savedExternalIds ) ; }
Source:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } if ( ( entryCreator ) != null ) { return new com.google.gerrit.server.cache.PopulatingCache < K , V > ( cache , entryCreator.get ( ) ) ; } return new com.google.gerrit.server.cache.SimpleCache < K , V > ( cache ) ; }

Target:
public com.google.gerrit.server.cache.EntryCreator < K , V > getEntryCreator ( ) { return ( entryCreator ) != null ? entryCreator.get ( ) : null ; }
Source:
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 ) ; }

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 = java.util.Arrays.stream ( groups ) . map ( AccountGroup :: getName ) . toArray ( java.lang.String [ ] :: new ) ; return accounts.create ( name ( name ) , ( ( name ( emailName ) ) + "@example.com" ) , fullName , groupNames ) ; }
Source:
private static org.apache.lucene.search.Query notTimestampQuery ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.QueryBuilder.toIndexTime ( r.getMaxTimestamp ( ) ) , null , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }

Target:
private static org.apache.lucene.search.Query notTimestamp ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.QueryBuilder.toIndexTime ( r.getMaxTimestamp ( ) ) , null , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }
Source:
private java.lang.String newChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String newChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD , java.nio.charset.StandardCharsets.UTF_8 ) ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.client.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final com.google.gerrit.server.account.AuthMethod meth , final boolean rememberMe ) { final com.google.gerrit.reviewdb.client.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null ) ; saveCookie ( ) ; authMethod = meth ; }
Source:
void initMeter ( ) { if ( ( ( stage ) == 0 ) && ( ( meter ) == null ) ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.openTr ( ) ; b.openTd ( ) ; b.closeTd ( ) ; b.closeTr ( ) ; resetHtml ( b ) ; meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }

Target:
void updateMeter ( ) { if ( ( meter ) != null ) { final int n = list.size ( ) ; meter.setValue ( ( ( 100 * ( ( ( stage ) * n ) + ( row ) ) ) / ( 2 * n ) ) ) ; } }
Source:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4L ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2L ) ) ; org.junit.Assert.assertEquals ( "42" , b.asString ( ) ) ; }

Target:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 4L ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 2L ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "42" ) ; }
Source:
protected void assertCurrentRevision ( java.lang.String changeId , int expectedNum , org.eclipse.jgit.lib.ObjectId expectedId ) throws java.io.IOException { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( expectedId.name ( ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( expectedNum , c.revisions.get ( expectedId.name ( ) ) . _number ) ; }

Target:
protected void assertCurrentRevision ( java.lang.String changeId , int expectedNum , org.eclipse.jgit.lib.ObjectId expectedId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( expectedId.name ( ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( expectedId.name ( ) ) . _number ) . isEqualTo ( expectedNum ) ; }
Source:
public void testUpsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testUpsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) { public void onSuccess ( final com.google.gerrit.common.data.ChangeDetail result ) { if ( result != null ) { detailCache.set ( result ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.Change.Id id = patchSet.getId ( ) . getParentKey ( ) ; com.google.gerrit.client.changes.ChangeApi.deleteRevision ( id.get ( ) , patchSet.getRevision ( ) . get ( ) , com.google.gerrit.client.change.DraftActions.cs ( id ) ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } com.google.gerrit.extensions.common.AccountInfo accountInfo = new com.google.gerrit.extensions.common.AccountInfo ( a.getId ( ) . get ( ) ) ; accountInfo.email = a.getPreferredEmail ( ) ; accountInfo.name = a.getFullName ( ) ; accountInfo.username = a.getUserName ( ) ; return accountInfo ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.server.account.AccountState accountState ) { if ( ( accountState == null ) || ( ( accountState.getAccount ( ) . getId ( ) ) == null ) ) { return null ; } com.google.gerrit.reviewdb.client.Account account = accountState.getAccount ( ) ; com.google.gerrit.extensions.common.AccountInfo accountInfo = new com.google.gerrit.extensions.common.AccountInfo ( account.getId ( ) . get ( ) ) ; accountInfo.email = account.getPreferredEmail ( ) ; accountInfo.name = account.getFullName ( ) ; accountInfo.username = accountState.getUserName ( ) ; return accountInfo ; }
Source:
private java.util.List < com.google.gerrit.client.api.ExtensionPanel.Context > create ( ) { java.util.List < com.google.gerrit.client.api.ExtensionPanel.Context > contexts = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.client.api.ExtensionPanel.Definition def : com.google.gerrit.client.rpc.Natives.asList ( com.google.gerrit.client.api.ExtensionPanel.Definition.get ( extensionPoint.name ( ) ) ) ) { com.google.gwt.user.client.ui.SimplePanel p = new com.google.gwt.user.client.ui.SimplePanel ( ) ; add ( p ) ; contexts.add ( com.google.gerrit.client.api.ExtensionPanel.Context.create ( def , p ) ) ; } return contexts ; }

Target:
private java.util.List < com.google.gerrit.client.api.ExtensionPanel.Context > create ( java.util.List < java.lang.String > panelNames ) { java.util.List < com.google.gerrit.client.api.ExtensionPanel.Context > contexts = new java.util.ArrayList < com.google.gerrit.client.api.ExtensionPanel.Context > ( ) ; for ( com.google.gerrit.client.api.ExtensionPanel.Definition def : getOrderedDefs ( panelNames ) ) { com.google.gwt.user.client.ui.SimplePanel p = new com.google.gwt.user.client.ui.SimplePanel ( ) ; add ( p ) ; contexts.add ( com.google.gerrit.client.api.ExtensionPanel.Context.create ( def , p ) ) ; } return contexts ; }
Source:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.send.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }

Target:
private void sendCreateChange ( com.google.gerrit.server.update.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.send.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }
Source:
public java.util.Collection < com.google.gerrit.pgm.init.InitStep > getInitSteps ( ) { java.util.List < java.io.File > jars = scanJarsInPluginsDirectory ( ) ; java.util.ArrayList < com.google.gerrit.pgm.init.InitStep > pluginsInitSteps = new java.util.ArrayList < > ( ) ; for ( java.io.File jar : jars ) { com.google.gerrit.pgm.init.InitStep init = loadInitStep ( jar ) ; if ( init != null ) { pluginsInitSteps.add ( init ) ; } } return pluginsInitSteps ; }

Target:
public java.util.Collection < com.google.gerrit.pgm.init.api.InitStep > getInitSteps ( ) { java.util.List < java.io.File > jars = scanJarsInPluginsDirectory ( ) ; java.util.ArrayList < com.google.gerrit.pgm.init.api.InitStep > pluginsInitSteps = new java.util.ArrayList < > ( ) ; for ( java.io.File jar : jars ) { com.google.gerrit.pgm.init.api.InitStep init = loadInitStep ( jar ) ; if ( init != null ) { pluginsInitSteps.add ( init ) ; } } return pluginsInitSteps ; }
Source:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
public void parseReviewer ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) + "CC: Other Account <2@gerrit>\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Reviewer: 1@gerrit\n" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
public void addReviewerToReviewableChangeByOtherInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accounts.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; } ) ; }

Target:
private void addReviewerToReviewableChangeByOtherInNoteDb ( com.google.gerrit.acceptance.server.mail.AddReviewerSenderIT.Adder adder ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accountCreator.create ( "other" , "other@example.com" , "other" ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accountCreator.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void testCreateProjectWithEmptyCommit ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.createEmptyCommit = true ; adminSession.put ( ( "/projects/" + newProjectName ) , in ) ; assertEmptyCommit ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectWithEmptyCommit ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; gApi.projects ( ) . create ( in ) ; assertEmptyCommit ( newProjectName , "refs/heads/master" ) ; }
Source:
private boolean recursiveDelete ( java.io.File file ) { if ( file.isDirectory ( ) ) { for ( java.io.File f : file.listFiles ( ) ) { if ( ! ( recursiveDelete ( f ) ) ) { return false ; } } } return file.delete ( ) ; }

Target:
private boolean recursiveDelete ( java.io.File file ) { if ( file.isDirectory ( ) ) { java.io.File [ ] contents = file.listFiles ( ) ; if ( contents == null ) { return false ; } for ( java.io.File f : contents ) { if ( ! ( recursiveDelete ( f ) ) ) { return false ; } } } return file.delete ( ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.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.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.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 ) ) ; com.google.gerrit.server.util.FutureUtil.waitFor ( accountCache.evictAsync ( a.getId ( ) ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public java.util.List < com.google.reviewit.app.Change > next ( ) throws com.google.gerrit.extensions.restapi.RestApiException { query ( ) ; return result.subList ( ( ( page ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) , ( ( ( page ) + 1 ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) ) ; }

Target:
public java.util.List < com.google.reviewit.app.Change > next ( ) throws com.google.gerrit.extensions.restapi.RestApiException { query ( ) ; java.util.List < com.google.reviewit.app.Change > nextChanges = result.subList ( ( ( page ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) , ( ( ( page ) + 1 ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) ) ; ( page ) ++ ; return nextChanges ; }
Source:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { return new com.google.gerrit.server.plugins.InstallPlugin ( loader , id.get ( ) , true ) ; }

Target:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote installation is disabled" ) ; } return new com.google.gerrit.server.plugins.InstallPlugin ( loader , id.get ( ) , true ) ; }
Source:
public void process ( java.lang.String pluginName , java.io.InputStream in ) throws java.io.IOException { java.io.File tmpPlugin = com.google.gerrit.server.plugins.PluginLoader.storeInTemp ( pluginName , in , site ) ; java.lang.String pluginVersion = com.google.gerrit.pgm.init.InitPlugins.getVersion ( tmpPlugin ) ; if ( deleteTempPluginFile ) { tmpPlugin.delete ( ) ; } result.add ( new com.google.gerrit.pgm.init.InitPlugins.PluginData ( pluginName , pluginVersion , tmpPlugin ) ) ; }

Target:
public void process ( java.lang.String pluginName , java.io.InputStream in ) throws java.io.IOException { java.io.File tmpPlugin = com.google.gerrit.server.plugins.PluginLoader.storeInTemp ( pluginName , in , site ) ; java.lang.String pluginVersion = com.google.gerrit.pgm.init.InitPlugins.getVersion ( tmpPlugin ) ; if ( deleteTempPluginFile ) { tmpPlugin.delete ( ) ; } result.add ( new com.google.gerrit.common.PluginData ( pluginName , pluginVersion , tmpPlugin ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Rebase" ) . setTitle ( "Rebase onto tip of branch or parent change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( rebaseChange.get ( ) . canRebase ( resource ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Rebase" ) . setTitle ( "Rebase onto tip of branch or parent change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( hasOneParent ( resource.getPatchSet ( ) . getId ( ) ) ) ) ) ; }
Source:
public void abandonWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
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.PrintWriter out = res.getWriter ( ) ; out.write ( message ) ; out.close ( ) ; }

Target:
protected java.io.PrintWriter startRenderText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; return res.getWriter ( ) ; }
Source:
void onRefReplicatedToAllNodes ( java.lang.String project , java.lang.String ref , int nodesCount ) { com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( project , ref , nodesCount ) ; postEvent ( project , event ) ; }

Target:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , ref , event ) ; }
Source:
public com.gitblit.models.UserModel authenticate ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String gerritUsername = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-username" ) ) ) ; java.lang.String gerritToken = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-token" ) ) ) ; httpRequest.getSession ( ) . setAttribute ( Constants.AUTHENTICATION_TYPE , AuthenticationType.CONTAINER ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( gerritUsername ) ) || ( com.google.common.base.Strings.isNullOrEmpty ( gerritToken ) ) ) { return com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserModel.getAnonymous ( projectControl ) ; } else { return authenticateSSO ( gerritUsername , gerritToken ) ; } }

Target:
public com.gitblit.models.UserModel authenticate ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String gerritUsername = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-username" ) ) ) ; java.lang.String gerritToken = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-token" ) ) ) ; httpRequest.getSession ( ) . setAttribute ( Constants.ATTRIB_AUTHTYPE , AuthenticationType.CONTAINER ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( gerritUsername ) ) || ( com.google.common.base.Strings.isNullOrEmpty ( gerritToken ) ) ) { return com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserModel.getAnonymous ( projectControl ) ; } else { return authenticateSSO ( gerritUsername , gerritToken ) ; } }
Source:
static void closeDataSource ( ) { if ( ( com.google.gerrit.server.GerritServer.datasource ) != null ) { try { try { java.lang.Class.forName ( "com.mchange.v2.c3p0.DataSources" ) . getMethod ( "destroy" , javax.sql.DataSource.class ) . invoke ( null , com.google.gerrit.server.GerritServer.datasource ) ; } catch ( java.lang.Throwable bad ) { } } finally { com.google.gerrit.server.GerritServer.datasource = null ; } } }

Target:
static void closeDataSource ( ) { if ( ( com.google.gerrit.server.GerritServer.datasource ) != null ) { try { try { java.lang.Class.forName ( "com.mchange.v2.c3p0.DataSources" ) . getMethod ( "destroy" , javax.sql.DataSource.class ) . invoke ( null , com.google.gerrit.server.GerritServer.datasource ) ; } catch ( java.lang.Throwable bad ) { } } finally { com.google.gerrit.server.GerritServer.datasource = null ; } } if ( ( com.google.gerrit.server.GerritServer.cacheMgr ) != null ) { try { com.google.gerrit.server.GerritServer.cacheMgr.shutdown ( ) ; } catch ( java.lang.Throwable bad ) { } finally { com.google.gerrit.server.GerritServer.cacheMgr = null ; } } }