auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void tearDown ( ) { if ( ( repo ) != null ) { repo.getRepository ( ) . close ( ) ; } if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }

Target:
public void tearDown ( ) { if ( ( repo ) != null ) { repo.getRepository ( ) . close ( ) ; } if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( inMemoryDatabase ) ; }
Source:
public com.google.gerrit.server.plugins.ListPlugins.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote plugin administration is disabled" ) ; } java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return new com.google.gerrit.server.plugins.ListPlugins.PluginInfo ( loader.get ( name ) ) ; }

Target:
public com.google.gerrit.extensions.common.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote plugin administration is disabled" ) ; } java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return com.google.gerrit.server.plugins.ListPlugins.toPluginInfo ( loader.get ( name ) ) ; }
Source:
public void parseMultipleValue ( ) throws java.lang.Exception { java.lang.String in = "a.b=c,d,e" ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue > > r = cmd.parsePluginConfigValues ( java.util.Collections.singletonList ( in ) ) ; com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue configValue = r.get ( "a" ) . get ( "b" ) ; org.junit.Assert.assertArrayEquals ( new java.lang.String [ ] { "c" , "d" , "e" } , configValue.values.toArray ( ) ) ; org.junit.Assert.assertNull ( configValue.value ) ; }

Target:
public void parseMultipleValue ( ) throws java.lang.Exception { java.lang.String in = "a.b=c,d,e" ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue > > r = cmd.parsePluginConfigValues ( java.util.Collections.singletonList ( in ) ) ; com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue configValue = r.get ( "a" ) . get ( "b" ) ; com.google.common.truth.Truth.assertThat ( configValue.values ) . containsExactly ( "c" , "d" , "e" ) . inOrder ( ) ; com.google.common.truth.Truth.assertThat ( configValue.value ) . isNull ( ) ; }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gerrit.server.git.UpdateException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }

Target:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gerrit.server.update.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }
Source:
private org.eclipse.jgit.transport.PushResult pushVia ( final org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; final java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }

Target:
private org.eclipse.jgit.transport.PushResult pushVia ( final org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; final java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }
Source:
boolean inCharacter ( com.googlecode.prolog_cafe.builtin.Term t ) { if ( ! ( t instanceof com.googlecode.prolog_cafe.builtin.SymbolTerm ) ) return false ; if ( t.equals ( com.googlecode.prolog_cafe.builtin.PRED_get_char_2.SYM_EOF ) ) return true ; return ( ( ( com.googlecode.prolog_cafe.builtin.SymbolTerm ) ( t ) ) . name ( ) . length ( ) ) == 1 ; }

Target:
boolean inCharacter ( com.googlecode.prolog_cafe.lang.Term t ) { if ( ! ( t instanceof com.googlecode.prolog_cafe.lang.SymbolTerm ) ) return false ; if ( t.equals ( com.googlecode.prolog_cafe.builtin.PRED_get_char_2.SYM_EOF ) ) return true ; return ( ( ( com.googlecode.prolog_cafe.lang.SymbolTerm ) ( t ) ) . name ( ) . length ( ) ) == 1 ; }
Source:
public static < T > java.util.LinkedHashSet < T > topoSort ( com.google.common.collect.Multimap < T , T > graph ) throws com.google.gerrit.server.git.SubmoduleException { java.util.LinkedHashSet < T > sorted = new java.util.LinkedHashSet < > ( ) ; for ( T p : graph.keySet ( ) ) { if ( ! ( sorted.contains ( p ) ) ) { com.google.gerrit.server.git.SubmoduleOp.topoSortHelper ( p , new java.util.HashSet < T > ( ) , sorted , graph ) ; } } return sorted ; }

Target:
private < T > java.lang.String printCircularPath ( java.util.LinkedHashSet < T > p , T target ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( target ) ; java.util.ArrayList < T > reverseP = new java.util.ArrayList < > ( p ) ; java.util.Collections.reverse ( reverseP ) ; for ( T t : reverseP ) { sb.append ( "->" ) ; sb.append ( t ) ; if ( t.equals ( target ) ) { break ; } } return sb.toString ( ) ; }
Source:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , 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 force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.client.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
boolean isOwner ( final com.google.gerrit.server.account.GroupMembership groups ) { return com.google.common.collect.Iterables.any ( tree ( ) , new com.google.common.base.Predicate < com.google.gerrit.server.project.ProjectState > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.server.project.ProjectState in ) { return groups.containsAnyOf ( in.localOwners ) ; } } ) ; }
Source:
public void content ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.restapi.BinaryResult bin = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . content ( ) ; java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; bin.writeTo ( os ) ; java.lang.String res = new java.lang.String ( os.toByteArray ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.common.truth.Truth.assertThat ( res ) . isEqualTo ( com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT ) ; }

Target:
private void assertContent ( com.google.gerrit.acceptance.PushOneCommit.Result pushResult , java.lang.String path , java.lang.String expectedContent ) throws java.lang.Exception { com.google.gerrit.extensions.restapi.BinaryResult bin = gApi.changes ( ) . id ( pushResult.getChangeId ( ) ) . revision ( pushResult.getCommit ( ) . name ( ) ) . file ( path ) . content ( ) ; java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; bin.writeTo ( os ) ; java.lang.String res = new java.lang.String ( os.toByteArray ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.common.truth.Truth.assertThat ( res ) . isEqualTo ( expectedContent ) ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.author = mockAccount ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester commented\\n>>>" + ( ( "testproject (master): This is the first line\n" + "And the second line. (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester commented\\n>>>" + ( ( "testproject (master): This is the first line\n" + "And the second line. (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( "gerrit.run" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }
Source:
public void testIsEnabledCommentAddedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.CommentAddedEvent event = new com.google.gerrit.server.events.CommentAddedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventMultiBranchMixedMatchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/foo" , "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = commit.getCommitterIdent ( ) . getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } throw parseException ( "invalid committer, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }

Target:
private Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = ident.getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } throw parseException ( "invalid identity, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private com.google.gerrit.reviewdb.client.PatchLineComment publishComment ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchLineComment c , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { c.setStatus ( PatchLineComment.Status.PUBLISHED ) ; c.setWrittenOn ( ctx.getWhen ( ) ) ; c.setTag ( in.tag ) ; com.google.gerrit.server.PatchLineCommentsUtil.setCommentRevId ( c , patchListCache , ctx.getChange ( ) , com.google.common.base.Preconditions.checkNotNull ( ps ) ) ; return c ; }
Source:
public com.google.gerrit.server.git.InsertException apply ( java.lang.Exception input ) { if ( input instanceof com.google.gwtorm.server.OrmException ) { return new com.google.gerrit.server.git.InsertException ( "ORM error" , input ) ; } if ( input instanceof java.io.IOException ) { return new com.google.gerrit.server.git.InsertException ( "IO error" , input ) ; } return new com.google.gerrit.server.git.InsertException ( "Error inserting change/patchset" , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestApiException apply ( java.lang.Exception input ) { if ( input instanceof com.google.gerrit.extensions.restapi.RestApiException ) { return ( ( com.google.gerrit.extensions.restapi.RestApiException ) ( input ) ) ; } return new com.google.gerrit.extensions.restapi.RestApiException ( "Error inserting change/patchset" , input ) ; }
Source:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Repository repo , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return cache.get ( key , new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , repo , rw ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return cache.get ( key , new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , rw , repoConfig ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }
Source:
public void createProject ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( gApi.projects ( ) . create ( name ) . get ( ) . name ) . isEqualTo ( name ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( name , RefNames.REFS_CONFIG ) ; eventRecorder.assertRefUpdatedEvents ( name , RefNames.REFS_CONFIG , null , head ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/heads/master" , new java.lang.String [ ] { } ) ; }

Target:
public void createProject ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( gApi.projects ( ) . create ( name ) . get ( ) . name ) . isEqualTo ( name ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( name , RefNames.REFS_CONFIG ) ; eventRecorder.assertRefUpdatedEvents ( name , RefNames.REFS_CONFIG , null , head ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/heads/master" , new java.lang.String [ ] { } ) ; projectIndexedCounter.assertReindexOf ( name ) ; }
Source:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { 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 ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , java.lang.String commandName , java.lang.String [ ] args ) { final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; final java.lang.String what = extractWhat ( commandName , args ) ; auditService.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , extractCurrentUser ( ctx ) , ( "ssh:" + what ) , created , java.util.Arrays.asList ( args ) , result ) ) ; }

Target:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , java.lang.String cmd ) { final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; auditService.dispatch ( new com.google.gerrit.audit.SshAuditEvent ( sid , extractCurrentUser ( ctx ) , cmd , created , null , result ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( ChangeIndex.Manager.class ) . to ( com.google.gerrit.lucene.LuceneChangeIndexManager.class ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneChangeIndexManager.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.lucene.IndexVersionCheck.class ) ; } }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.lucene.IndexVersionCheck.class ) ; } }
Source:
private boolean isMuteable ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return ( ! ( isMuted ( rsrc ) ) ) && ( ! ( stars.isIgnored ( rsrc ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Mute.log.error ( "failed to check ignored star" , e ) ; } return false ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Mute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( rsrc.isUserOwner ( ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot mute own change" ) ; } if ( ! ( isMuted ( rsrc ) ) ) { stars.mute ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public void testParseFooComment ( ) throws java.lang.Exception { com.google.gerrit.server.git.QueryList ql = com.google.gerrit.server.git.QueryList.parse ( ( ( "#" + ( com.google.gerrit.server.git.QueryListTest.L_FOO ) ) + ( com.google.gerrit.server.git.QueryListTest.L_BAR ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_FOO ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.git.QueryListTest.Q_B ) ; }

Target:
public void testParseFooComment ( ) throws java.lang.Exception { com.google.gerrit.server.account.QueryList ql = com.google.gerrit.server.account.QueryList.parse ( ( ( "#" + ( com.google.gerrit.server.account.QueryListTest.L_FOO ) ) + ( com.google.gerrit.server.account.QueryListTest.L_BAR ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_FOO ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.account.QueryListTest.Q_B ) ; }
Source:
public void onlyResetMatchingRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef = createRef ( "refs/match/test" ) ; org.eclipse.jgit.lib.Ref anotherMatchingRef = createRef ( "refs/another-match/test" ) ; org.eclipse.jgit.lib.Ref nonMatchingRef = createRef ( "refs/no-match/test" ) ; org.eclipse.jgit.lib.Ref updatedNonMatchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . reset ( project , "refs/match/*" , "refs/another-match/*" ) . build ( ) ) { updateRef ( matchingRef ) ; updateRef ( anotherMatchingRef ) ; updatedNonMatchingRef = updateRef ( nonMatchingRef ) ; } assertRef ( matchingRef ) ; assertRef ( anotherMatchingRef ) ; assertRef ( updatedNonMatchingRef ) ; }

Target:
public void onlyResetMatchingRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef = createRef ( "refs/match/test" ) ; org.eclipse.jgit.lib.Ref anotherMatchingRef = createRef ( "refs/another-match/test" ) ; org.eclipse.jgit.lib.Ref nonMatchingRef = createRef ( "refs/no-match/test" ) ; org.eclipse.jgit.lib.Ref updatedNonMatchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . build ( new com.google.gerrit.acceptance.ProjectResetter.Config ( ) . reset ( project , "refs/match/*" , "refs/another-match/*" ) ) ) { updateRef ( matchingRef ) ; updateRef ( anotherMatchingRef ) ; updatedNonMatchingRef = updateRef ( nonMatchingRef ) ; } assertRef ( matchingRef ) ; assertRef ( anotherMatchingRef ) ; assertRef ( updatedNonMatchingRef ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.WebLinks.Link > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.server.WebLinks.Link > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.server.WebLinks.Link ( webLink.getLinkName ( ) , webLink.getPatchSetUrl ( project , commit ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getPatchSetUrl ( project , commit ) ) ) ; } return links ; }
Source:
private java.lang.String resolveImageUrl ( java.lang.String url ) { if ( ( ( ( ( imageLoader ) == null ) || ( url.startsWith ( "https://" ) ) ) || ( url.startsWith ( "http://" ) ) ) || ( url.startsWith ( "data:" ) ) ) { return url ; } return imageLoader.loadImage ( url ) ; }

Target:
java.lang.String image ( java.lang.String dest ) { if ( ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( dest ) ) || ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( dest ) ) ) { return dest ; } else if ( ( imageLoader ) != null ) { return imageLoader.inline ( filePath , dest ) ; } return FilterImageDataUri.INSTANCE.getInnocuousOutput ( ) ; }
Source:
public java.lang.String getLabel ( com.google.gerrit.server.change.RevisionResource resource ) { return java.lang.String.format ( "Submit Patch Set %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( java.lang.String.format ( "Submit Revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }
Source:
private void display ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.extensions.TopMenuItem > items ) { java.util.List < java.util.List < java.lang.String > > values = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.client.extensions.TopMenuItem item : com.google.gerrit.client.rpc.Natives.asList ( items ) ) { values.add ( java.util.Arrays.asList ( item.getName ( ) , item.getUrl ( ) ) ) ; } myMenus.display ( values ) ; }

Target:
private void display ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.TopMenuItem > items ) { java.util.List < java.util.List < java.lang.String > > values = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.client.info.TopMenuItem item : com.google.gerrit.client.rpc.Natives.asList ( items ) ) { values.add ( java.util.Arrays.asList ( item.getName ( ) , item.getUrl ( ) ) ) ; } myMenus.display ( values ) ; }
Source:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; verifyPost ( ) ; }

Target:
public void changeIsIndexed ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . index ( db , change ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String branchRev = branch ( ) . get ( ) . revision ; branch ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch.get ( ) , null , branchRev , branchRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }

Target:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( branch ( ) . get ( ) . canDelete ) . isTrue ( ) ; java.lang.String branchRev = branch ( ) . get ( ) . revision ; branch ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , branch.get ( ) , null , branchRev , branchRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }
Source:
public com.google.gerrit.server.change.VoteResource parse ( com.google.gerrit.server.change.ReviewerResource reviewer , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.change.VoteResource ( reviewer , id.get ( ) ) ; }

Target:
public com.google.gerrit.server.change.VoteResource parse ( com.google.gerrit.server.change.ReviewerResource reviewer , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ! ( reviewer.getRevisionResource ( ) . isCurrent ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "Cannot access on non-current patch set" ) ; } return new com.google.gerrit.server.change.VoteResource ( reviewer , id.get ( ) ) ; }
Source:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( writer ( ) . writeBlob ( org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; return e ; }

Target:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { final org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ; try { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } finally { oi.release ( ) ; } }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case REBASE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_ALWAYS ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { event.stopPropagation ( ) ; }
Source:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }

Target:
public org.eclipse.jgit.lib.RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( rw , oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try { java.io.InputStream in = new java.io.FileInputStream ( pub ) ; try { in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( in ) ; return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } finally { in.close ( ) ; } } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GERRIT_GROUPING ) ; } if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.STORAGE_DIR , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR , getStorageDir ( ) ) ; } super . init ( config ) ; }

Target:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { if ( ( isPropertyInPluginConfig ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN ) ) || ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN , getTransformPattern ( ) ) ; } if ( ( isPropertyInPluginConfig ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.STORAGE_DIR ) ) || ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.STORAGE_DIR , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR ) ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR , getStorageDir ( ) ) ; } super . init ( config ) ; }
Source:
private static org.eclipse.jgit.dircache.DirCache readTree ( final org.eclipse.jgit.lib.Repository pdb , final org.eclipse.jgit.lib.Ref branch ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( pdb ) ) { final org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; final org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , pdb.newObjectReader ( ) , rw.parseTree ( branch.getObjectId ( ) ) ) ; b.finish ( ) ; return dc ; } }

Target:
private static org.eclipse.jgit.dircache.DirCache readTree ( final org.eclipse.jgit.lib.Ref branch , org.eclipse.jgit.revwalk.RevWalk rw ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { final org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; final org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , rw.getObjectReader ( ) , rw.parseTree ( branch.getObjectId ( ) ) ) ; b.finish ( ) ; return dc ; }
Source:
public void onSuccess ( java.lang.Void result ) { goUpToChange ( openReplyBox ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? base.getId ( ) : null ; java.lang.String rev = revision.getId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
private org.eclipse.jgit.treewalk.TreeWalk find ( final org.eclipse.jgit.lib.ObjectId within ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( ( path ) == null ) { return null ; } final org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( db ) ; final org.eclipse.jgit.revwalk.RevTree tree = rw.parseTree ( within ) ; return org.eclipse.jgit.treewalk.TreeWalk.forPath ( db , path , tree ) ; }

Target:
private org.eclipse.jgit.treewalk.TreeWalk find ( final org.eclipse.jgit.lib.ObjectId within ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( ( ( path ) == null ) || ( within == null ) ) { return null ; } final org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; final org.eclipse.jgit.revwalk.RevTree tree = rw.parseTree ( within ) ; return org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , tree ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; ctx.bumpLastUpdatedOn ( false ) ; return true ; }
Source:
protected void display ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo change ) { java.lang.String frameId = "xdoc_unified_diff_iframe" ; com.google.gwt.user.client.ui.Frame frame = new com.google.gwt.user.client.ui.Frame ( com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.getUrl ( change.project ( ) , getRevision ( ) , getFile ( ) ) ) ; frame.getElement ( ) . setId ( frameId ) ; com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.resize ( frame , frameId ) ; add ( frame ) ; }

Target:
protected void display ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo change ) { java.lang.String frameId = "xdoc_unified_diff_iframe" ; com.google.gwt.user.client.ui.Frame frame = new com.google.gwt.user.client.ui.Frame ( com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.getUrl ( change.project ( ) , getRevision ( ) , getPath ( ) ) ) ; frame.getElement ( ) . setId ( frameId ) ; com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.resize ( frame , frameId ) ; add ( frame ) ; }
Source:
void initMeter ( ) { if ( ( 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 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 ( ) ; }