auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private byte [ ] indexRowKey ( com.google.gwtorm.nosql.IndexFunction < T > f , T obj ) { com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; b.add ( com.google.gwtorm.nosql.generic.GenericAccess.getRelationName ( ) ) ; b.add ( '.' ) ; b.add ( f.getName ( ) ) ; b.delimiter ( ) ; f.encode ( b , obj ) ; b.delimiter ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; return b.toByteArray ( ) ; }

Target:
protected byte [ ] indexRowKey ( com.google.gwtorm.nosql.IndexFunction < T > idx , T obj ) { com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; b.add ( com.google.gwtorm.nosql.generic.GenericAccess.getRelationName ( ) ) ; b.add ( '.' ) ; b.add ( idx.getName ( ) ) ; b.delimiter ( ) ; idx.encode ( b , obj ) ; b.delimiter ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; return b.toByteArray ( ) ; }
Source:
private org.eclipse.jetty.server.Handler appHandler ( ) { org.eclipse.jetty.servlet.ServletContextHandler handler = new org.eclipse.jetty.servlet.ServletContextHandler ( ) ; handler.setContextPath ( "" ) ; handler.addServlet ( new org.eclipse.jetty.servlet.ServletHolder ( new com.google.gitiles.GitilesServlet ( ) ) , "/*" ) ; return handler ; }

Target:
private static org.eclipse.jgit.lib.Config defaultConfig ( ) throws java.net.UnknownHostException { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String cwd = java.lang.System.getProperty ( "user.dir" ) ; cfg.setString ( "gitiles" , null , "basePath" , cwd ) ; cfg.setBoolean ( "gitiles" , null , "exportAll" , true ) ; cfg.setString ( "gitiles" , null , "baseGitUrl" , ( ( "file://" + cwd ) + "/" ) ) ; java.lang.String networkHostName = java.net.InetAddress.getLocalHost ( ) . getCanonicalHostName ( ) ; cfg.setString ( "gitiles" , null , "siteTitle" , java.lang.String.format ( "Gitiles - %s:%s" , networkHostName , cwd ) ) ; cfg.setString ( "gitiles" , null , "canonicalHostName" , new java.io.File ( cwd ) . getName ( ) ) ; return cfg ; }
Source:
private void save ( com.google.gerrit.server.git.ProjectConfig pc ) throws java.lang.Exception { try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ) { pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; } }

Target:
private void save ( com.google.gerrit.server.project.ProjectConfig pc ) throws java.lang.Exception { try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ) { pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; } }
Source:
public java.lang.String format ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
public java.lang.String format ( java.lang.String projectName , com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } f.setCss ( getCss ( projectName ) ) ; byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
private void doGeneratePassword ( ) { if ( ( id ) != null ) { enableUI ( false ) ; Util.ACCOUNT_SEC.generatePassword ( id.getKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.reviewdb.client.AccountExternalId > ( ) { public void onSuccess ( final com.google.gerrit.reviewdb.client.AccountExternalId result ) { display ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }

Target:
private void doGeneratePassword ( ) { if ( ( id ) != null ) { enableUI ( false ) ; com.google.gerrit.client.account.AccountApi.generateHttpPassword ( "self" , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString newPassword ) { id.setPassword ( newPassword.asString ( ) ) ; display ( id ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }
Source:
private static void install ( com.google.gwt.core.client.JavaScriptObject cb , com.google.gerrit.client.api.JsUiPlugin p ) { try { com.google.gerrit.client.api.ApiGlue.pluginName = p.name ( ) ; com.google.gerrit.client.api.ApiGlue.invoke ( cb , p ) ; } finally { com.google.gerrit.client.api.ApiGlue.pluginName = null ; } }

Target:
private static void install ( com.google.gwt.core.client.JavaScriptObject cb , com.google.gerrit.client.api.Plugin p ) throws java.lang.Exception { try { com.google.gerrit.client.api.ApiGlue.pluginName = p.name ( ) ; com.google.gerrit.client.api.ApiGlue.invoke ( cb , p ) ; p._initialized ( ) ; } catch ( java.lang.Exception e ) { p.failure ( e ) ; throw e ; } finally { com.google.gerrit.client.api.ApiGlue.pluginName = null ; com.google.gerrit.client.api.PluginLoader.loaded ( ) ; } }
Source:
public void testPreformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) ) ; }
Source:
protected boolean canReload ( ) { java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; java.lang.String v = main.getValue ( "Gerrit-ReloadMode" ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( v ) ) || ( "reload" . equalsIgnoreCase ( v ) ) ) { return true ; } else if ( "restart" . equalsIgnoreCase ( v ) ) { return false ; } else { PluginLoader.log.warn ( java.lang.String.format ( "Plugin %s has invalid Gerrit-ReloadMode %s; assuming restart" , getName ( ) , v ) ) ; return false ; } }

Target:
protected boolean canReload ( ) { java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; java.lang.String v = main.getValue ( "Gerrit-ReloadMode" ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( v ) ) || ( "reload" . equalsIgnoreCase ( v ) ) ) { return true ; } else if ( "restart" . equalsIgnoreCase ( v ) ) { return false ; } else { com.google.gerrit.server.plugins.ServerPlugin.log.warn ( java.lang.String.format ( "Plugin %s has invalid Gerrit-ReloadMode %s; assuming restart" , getName ( ) , v ) ) ; return false ; } }
Source:
private java.lang.String n ( com.google.gerrit.common.data.GroupDescription.Basic a ) { if ( a == null ) { return "" ; } java.lang.String n = a.getName ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } return a.getGroupUUID ( ) . get ( ) ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > loadIncludes ( ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupById > groups = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById m : db.accountGroupById ( ) . byGroup ( groupId ) ) { if ( control.canSeeGroup ( ) ) { groups.add ( m ) ; } } return groups ; }
Source:
private java.util.Set < java.lang.String > getManifestProjects ( java.lang.String fromBranch , java.lang.String toBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > toBranchConfig = config.getMergeConfig ( fromBranch , toBranch ) ; java.util.Map < java.lang.String , java.lang.String > manifestProjectInfo = getManifestInfoFromConfig ( toBranchConfig ) ; return getManifestProjectsForBranch ( manifestProjectInfo , toBranch ) ; }

Target:
private java.util.Set < java.lang.String > getManifestProjects ( java.lang.String fromBranch , java.lang.String toBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > toBranchConfig = config.getMergeConfig ( fromBranch , toBranch ) ; if ( toBranchConfig == null ) { return new java.util.HashSet < > ( ) ; } java.util.Map < java.lang.String , java.lang.String > manifestProjectInfo = getManifestInfoFromConfig ( toBranchConfig ) ; return getManifestProjectsForBranch ( manifestProjectInfo , toBranch ) ; }
Source:
protected void configureServlets ( ) { com.googlesource.gerrit.plugins.gitblit.GitBlitModule.log.info ( "Configuring servlet and filters" ) ; bind ( com.gitblit.IUserService.class ) . to ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.class ) ; bind ( com.googlesource.gerrit.plugins.gitblit.app.GerritGitBlit.class ) ; serve ( "/pages/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesServlet.class ) ; serve ( "/feed/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationServlet.class ) ; filter ( "/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.GerritWicketFilter.class ) ; filter ( "/pages/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesFilter.class ) ; filter ( "/feed/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationFilter.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.gitblit.GitBlitTopMenu.class ) ; }
Source:
private void assertInvalid ( final java.lang.String in ) { exception.expect ( java.lang.IllegalArgumentException.class ) ; exception.expectMessage ( ( "Invalid email address: " + in ) ) ; com.google.gerrit.server.mail.Address.parse ( in ) ; }

Target:
private void assertInvalid ( final java.lang.String in ) { try { com.google.gerrit.server.mail.Address.parse ( in ) ; org.junit.Assert.fail ( ( "Expected IllegalArgumentException for " + in ) ) ; } catch ( java.lang.IllegalArgumentException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . isEqualTo ( ( "Invalid email address: " + in ) ) ; } }
Source:
public void visit ( org.pegdown.ast.WikiLinkNode node ) { java.lang.String text = node.getText ( ) ; java.lang.String path = ( text.replace ( ' ' , '-' ) ) + ".md" ; html.open ( "a" ) . attribute ( "href" , href ( path ) ) . appendAndEscape ( text ) . close ( "a" ) ; }

Target:
public void visit ( org.commonmark.node.Emphasis node ) { wrapChildren ( "em" , node ) ; }
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.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setExternalNameKey ( bindTo ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; 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.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setExternalNameKey ( bindTo ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; com.google.gerrit.server.util.FutureUtil.waitFor ( groupCache.evictAsync ( group ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public void fill ( ) throws com.google.gwtorm.server.OrmException { try { directory.fillAccountInfo ( com.google.common.collect.Iterables.concat ( created.values ( ) , provided ) , com.google.gerrit.server.account.AccountInfo.Loader.DETAILED_OPTIONS ) ; } catch ( com.google.gerrit.server.account.AccountDirectory.DirectoryException e ) { com.google.common.base.Throwables.propagateIfPossible ( e.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public void fill ( ) throws com.google.gwtorm.server.OrmException { try { directory.fillAccountInfo ( com.google.common.collect.Iterables.concat ( created.values ( ) , provided ) , ( detailed ? com.google.gerrit.server.account.AccountInfo.Loader.DETAILED_OPTIONS : java.util.EnumSet.of ( FillOptions.NAME ) ) ) ; } catch ( com.google.gerrit.server.account.AccountDirectory.DirectoryException e ) { com.google.common.base.Throwables.propagateIfPossible ( e.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) ) ; dummyApproval.cache ( ctl.getChange ( ) ) ; return dummyApproval ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; dummyApproval.cache ( ctl.getChange ( ) ) ; return dummyApproval ; }
Source:
private void assertIncludes ( java.lang.String group , java.lang.String ... includes ) throws java.lang.Exception { java.lang.Iterable < java.lang.String > actualNames = com.google.common.collect.Iterables.transform ( gApi.groups ( ) . id ( group ) . includedGroups ( ) , new com.google.common.base.Function < com.google.gerrit.extensions.common.GroupInfo , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.extensions.common.GroupInfo in ) { return in.name ; } } ) ; com.google.common.truth.Truth.assertThat ( actualNames ) . containsExactlyElementsIn ( java.util.Arrays.asList ( includes ) ) . inOrder ( ) ; }

Target:
private void assertNoMembers ( java.lang.String group ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( group ) . members ( ) . isEmpty ( ) ) ; }
Source:
public void testTagHeightWidth ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.openElement ( "img" ) ) ; org.junit.Assert.assertSame ( b , b.setHeight ( 100 ) ) ; org.junit.Assert.assertSame ( b , b.setWidth ( 42 ) ) ; org.junit.Assert.assertSame ( b , b.closeSelf ( ) ) ; org.junit.Assert.assertEquals ( "<img height=\"100\" width=\"42\" />" , b.asString ( ) ) ; }

Target:
public void testTagHeightWidth ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.openElement ( "img" ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.setHeight ( 100 ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.setWidth ( 42 ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.closeSelf ( ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "<img height=\"100\" width=\"42\" />" ) ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo getChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ListChangesOption ... options ) throws java.io.IOException { return getChange ( admin , changeId , options ) ; }

Target:
protected TestRepository < ? > . CommitBuilder amendBuilder ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId head = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; TestRepository < ? > . CommitBuilder b = testRepo.amendRef ( "HEAD" ) ; com.google.common.base.Optional < java.lang.String > id = com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , head ) ; if ( id.isPresent ( ) ) { b.insertChangeId ( id.get ( ) . substring ( 1 ) ) ; } else { b.insertChangeId ( ) ; } return b ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.AddSshKey.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to add SSH keys" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.AddSshKey.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseReviewer ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\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" ) ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort , org.eclipse.jgit.revwalk.RevCommit initialTip ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , initialTip , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort , org.eclipse.jgit.revwalk.RevCommit initialTip ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , initialTip , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
private void assertDeleteByRestSucceeds ( java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ref ) ) ; r.assertNoContent ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( ) . get ( ) ; }

Target:
public void deleteMetaBranch ( ) throws java.lang.Exception { java.lang.String metaRef = ( com.google.gerrit.reviewdb.client.RefNames.REFS_META ) + "foo" ; allow ( metaRef , Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( metaRef , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.reviewdb.client.Branch.NameKey metaBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , metaRef ) ; branch ( metaBranch ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; grantDelete ( ) ; assertDeleteByRestSucceeds ( metaBranch , metaRef ) ; }
Source:
public void check ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( r.getChangeId ( ) ) . get ( ) . problems ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( r.getChangeId ( ) ) . get ( java.util.EnumSet.of ( ListChangesOption.CHECK ) ) . problems ) . isEmpty ( ) ; }

Target:
public void check ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( r.getChangeId ( ) ) . get ( ) . problems ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( r.getChangeId ( ) ) . get ( java.util.EnumSet.of ( ListChangesOption.CHECK ) ) . problems ) . isEmpty ( ) ; }
Source:
private void display ( com.google.gerrit.reviewdb.client.AccountExternalId id ) { java.lang.String user ; java.lang.String pass ; if ( id != null ) { user = id.getSchemeRest ( ) ; pass = id.getPassword ( ) ; } else { user = null ; pass = null ; } this . id = id ; com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( user ) ; password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }

Target:
protected void preDisplay ( com.google.gerrit.client.rpc.NativeString httpPassword ) { display ( httpPassword.asString ( ) ) ; }
Source:
public void oneResult ( ) throws java.lang.Exception { java.util.List < org.eclipse.jgit.revwalk.RevCommit > commits = linearCommits ( 1 ) ; walk.markStart ( commits.get ( 0 ) ) ; com.google.gitiles.Paginator p = new com.google.gitiles.Paginator ( walk , 10 , null ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( commits.get ( 0 ) ) , com.google.common.collect.ImmutableList.copyOf ( p ) ) ; org.junit.Assert.assertNull ( p.getPreviousStart ( ) ) ; org.junit.Assert.assertNull ( p.getNextStart ( ) ) ; }

Target:
public void oneResult ( ) throws java.lang.Exception { java.util.List < org.eclipse.jgit.revwalk.RevCommit > commits = linearCommits ( 1 ) ; walk.markStart ( commits.get ( 0 ) ) ; com.google.gitiles.Paginator p = new com.google.gitiles.Paginator ( walk , 10 , null ) ; com.google.common.truth.Truth.assertThat ( p ) . containsExactly ( commits.get ( 0 ) ) ; com.google.common.truth.Truth.assertThat ( p.getPreviousStart ( ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( p.getNextStart ( ) ) . isNull ( ) ; }
Source:
public void abandonWipChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; 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 ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableChangeNotifyOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } saveProjectConfig ( allProjects , pc ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; blockRead ( project , "refs/*" ) ; }
Source:
private boolean inBranch ( final com.google.gerrit.reviewdb.client.Change change ) { if ( ( branch ) == null ) { return true ; } return change.getDest ( ) . get ( ) . equals ( branch ) ; }

Target:
void addPatchSetId ( final java.lang.String token ) { try { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.sshd.commands.CommandUtils.parsePatchSet ( token , db , projectControl , branch ) ; patchSets.add ( ps ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }
Source:
private com.google.gerrit.extensions.common.ApprovalInfo approvalInfo ( com.google.gerrit.reviewdb.client.Account.Id id , java.lang.Integer value , java.sql.Timestamp date ) { com.google.gerrit.extensions.common.ApprovalInfo ai = new com.google.gerrit.extensions.common.ApprovalInfo ( id.get ( ) ) ; ai.value = value ; ai.date = date ; accountLoader.put ( ai ) ; return ai ; }

Target:
private com.google.gerrit.extensions.common.ApprovalInfo approvalInfo ( com.google.gerrit.reviewdb.client.Account.Id id , java.lang.Integer value , java.lang.String tag , java.sql.Timestamp date ) { com.google.gerrit.extensions.common.ApprovalInfo ai = new com.google.gerrit.extensions.common.ApprovalInfo ( id.get ( ) ) ; ai.value = value ; ai.date = date ; ai.tag = tag ; accountLoader.put ( ai ) ; return ai ; }
Source:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/tags/*" ) . setBlock ( ) ; 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 update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; 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 update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }
Source:
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 ) ; }

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 ) ) ; } else if ( ( input instanceof java.util.concurrent.ExecutionException ) && ( ( input.getCause ( ) ) instanceof com.google.gerrit.extensions.restapi.RestApiException ) ) { return ( ( com.google.gerrit.extensions.restapi.RestApiException ) ( input.getCause ( ) ) ) ; } return new com.google.gerrit.extensions.restapi.RestApiException ( "Error inserting change/patchset" , input ) ; }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( projectState ) == null ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( args.db.get ( ) , change ) . isVisible ( args.db.get ( ) ) ) ; }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { return args.permissionBackend.user ( args.identifiedUserFactory.create ( to ) ) . change ( changeData ) . database ( args.db.get ( ) ) . test ( ChangePermission.READ ) ; }
Source:
public void onAssigneeChanged ( com.google.gerrit.extensions.events.AssigneeChangedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.AssigneeChangedEvent event = new com.google.gerrit.server.events.AssigneeChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getWho ( ) ) ; event.oldAssignee = accountAttributeSupplier ( ev.getOldAssignee ( ) ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }

Target:
public void onAssigneeChanged ( com.google.gerrit.extensions.events.AssigneeChangedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.AssigneeChangedEvent event = new com.google.gerrit.server.events.AssigneeChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getWho ( ) ) ; event.oldAssignee = accountAttributeSupplier ( ev.getOldAssignee ( ) ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.permissions.PermissionBackendException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String idString = params.getParameter ( 0 ) ; final com.google.gerrit.client.reviewdb.PatchSet.Id id ; try { id = PatchSet.Id.parse ( idString ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( "Invalid patch set: " + idString ) ) ; } setter.addValue ( id ) ; return 1 ; }

Target:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String token = params.getParameter ( 0 ) ; final com.google.gerrit.client.reviewdb.PatchSet.Id id ; try { id = PatchSet.Id.parse ( token ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "\"" + token ) + "\" is not a valid patch set" ) ) ; } setter.addValue ( id ) ; return 1 ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\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" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\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" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\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" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( "Update change\n\nPatch-set: 1\nTopic: Some Topic\nTopic: Other Topic" ) ; }
Source:
public static java.lang.String messageUUID ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final byte [ ] raw = new byte [ 8 ] ; com.google.gerrit.server.ChangeUtil.fill ( raw , db ) ; return org.eclipse.jgit.util.Base64.encodeBytes ( raw ) ; }

Target:
public static java.lang.String messageUUID ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final byte [ ] raw = new byte [ 8 ] ; com.google.gerrit.server.ChangeUtil.fill ( raw , db ) ; return com.google.common.base.CharMatcher.is ( 'A' ) . trimLeadingFrom ( com.google.common.base.CharMatcher.is ( '=' ) . trimTrailingFrom ( org.eclipse.jgit.util.Base64.encodeBytes ( raw ) ) ) . replace ( '+' , '.' ) . replace ( '/' , '-' ) ; }
Source:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.common.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.common.ListChangesOption.DETAILED_ACCOUNTS ) ) ; if ( has ( com.google.gerrit.extensions.common.ListChangesOption.REVIEWED ) ) { ensureReviewedLoaded ( java.util.Collections.singleton ( cd ) ) ; } com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }
Source:
public void want ( final java.lang.Iterable < com.google.gerrit.reviewdb.Account.Id > ids ) { for ( final com.google.gerrit.reviewdb.Account.Id id : ids ) { want ( id ) ; } }

Target:
private void fetchWants ( ) { java.util.Set < com.google.gerrit.reviewdb.Account.Id > missing = new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( wants ) ; missing.removeAll ( out.keySet ( ) ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.server.account.AccountState > e : accountCache.getAll ( missing ) . entrySet ( ) ) { out.put ( e.getKey ( ) , e.getValue ( ) . getAccount ( ) ) ; } }
Source:
java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getChunkManager ( ) . diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
private static java.lang.Process exec ( final org.eclipse.jgit.lib.Repository repo , final java.util.List < java.lang.String > args ) throws java.io.IOException { final java.lang.String [ ] argv = args.toArray ( new java.lang.String [ args.size ( ) ] ) ; return java.lang.Runtime.getRuntime ( ) . exec ( argv , null , repo.getDirectory ( ) ) ; }

Target:
private org.eclipse.jgit.diff.RawText getRawText ( org.eclipse.jgit.lib.ObjectId id , org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( id.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return new org.eclipse.jgit.diff.RawText ( new byte [ ] { } ) ; } return new org.eclipse.jgit.diff.RawText ( repo.openBlob ( id ) . getCachedBytes ( ) ) ; }
Source:
private void sort ( java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.MergeException { try { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sorted = new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; toSort.clear ( ) ; toSort.addAll ( sorted ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.MergeException { try { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Commit sorting failed" , e ) ; } }
Source:
private void assertLineChsEqual ( net.codemirror.lib.LineCharacter a , net.codemirror.lib.LineCharacter b ) { org.junit.Assert.assertEquals ( ( ( ( a.getLine ( ) ) + "," ) + ( a.getCh ( ) ) ) , ( ( ( b.getLine ( ) ) + "," ) + ( b.getCh ( ) ) ) ) ; }

Target:
private void assertLineChsEqual ( net.codemirror.lib.Pos a , net.codemirror.lib.Pos b ) { org.junit.Assert.assertEquals ( ( ( ( a.line ( ) ) + "," ) + ( a.ch ( ) ) ) , ( ( ( b.line ( ) ) + "," ) + ( b.ch ( ) ) ) ) ; }
Source:
protected void configureServlets ( ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectAccessPathFilter.class ) ; if ( authConfig.isTrustContainerAuth ( ) ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ContainerAuthFilter.class ) ; } else { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectDigestFilter.class ) ; } serve ( "/p/*" ) . with ( com.google.gerrit.httpd.ProjectServlet.class ) ; }

Target:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpFilter.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; filterRegex ( git ) . through ( com.google.gerrit.httpd.GitOverHttpFilter.class ) ; }
Source:
private void updateNoRpc ( final com.google.gerrit.common.data.PatchScript last ) { RpcStatus.INSTANCE.onRpcStart ( null ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( last , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; }

Target:
private void update ( com.google.gerrit.common.data.PatchScriptSettings s ) { if ( ( ( lastScript ) != null ) && ( canReuse ( s , lastScript ) ) ) { lastScript.setSettings ( s ) ; RpcStatus.INSTANCE.onRpcStart ( null ) ; settingsPanel.setEnabled ( false ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; } else { refresh ( false ) ; } }
Source:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( intTerm ( p.getOperator ( ) , value ) ) ; }

Target:
public void markReady ( ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; cfg.setBoolean ( "index" , java.lang.Integer.toString ( schema.getVersion ( ) ) , "ready" , true ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public static java.lang.String readFile ( final java.lang.Class < ? > context , final java.lang.String name ) throws java.io.IOException { final java.io.InputStream in = context.getResourceAsStream ( name ) ; if ( in == null ) { return null ; } try { return com.google.gerrit.httpd.HtmlDomUtil.asString ( in ) ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + name ) , e ) ; } }

Target:
public static org.w3c.dom.Document parseFile ( java.lang.Class < ? > context , java.lang.String name ) throws java.io.IOException { try ( java.io.InputStream in = context.getResourceAsStream ( name ) ) { if ( in == null ) { return null ; } org.w3c.dom.Document doc = com.google.gerrit.httpd.HtmlDomUtil.newBuilder ( ) . parse ( in ) ; com.google.gerrit.httpd.HtmlDomUtil.compact ( doc ) ; return doc ; } catch ( org.xml.sax.SAXException | javax.xml.parsers.ParserConfigurationException | java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + name ) , e ) ; } }
Source:
private static void usage ( ) { java.lang.System.err.println ( "Usage:" ) ; java.lang.System.err.println ( " java -jar cafeteria.jar package:predicate" ) ; java.lang.System.err.println ( " java -jar cafeteria.jar predicate" ) ; java.lang.System.err.println ( " package: package name\n" ) ; java.lang.System.err.println ( " predicate: predicate name (only atom)" ) ; }

Target:
private static void usage ( ) { java.io.PrintStream e = java.lang.System.err ; e.println ( "usage: java -jar cafeteria.jar [options] [goal]" ) ; e.println ( ) ; e.println ( " --enable-io : enable file system access" ) ; e.println ( " --enable-statistics : enable statistics/2" ) ; e.println ( " --max-database-size=N : maximum entries in dynamic database" ) ; e.println ( " --reduction-limit=N : max reductions during execution" ) ; e.println ( ) ; e.println ( " -f source.pl : load file.pl (may be repeated)" ) ; e.println ( ) ; e.println ( " goal : predicate or package:predicate" ) ; e.println ( " (if not specified, runs interactive loop)" ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { for ( java.lang.String name : com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) { project ( ) . branch ( name ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; } assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { allow ( "refs/*" , Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( "refs/*" , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; for ( java.lang.String name : com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) { project ( ) . branch ( name ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; } assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
private void assertBranches ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { java.util.List < java.lang.String > expected = com.google.common.collect.Lists.newArrayList ( "HEAD" , RefNames.REFS_CONFIG , "refs/heads/master" ) ; expected.addAll ( branches ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertRefNames ( expected , project ( ) . branches ( ) . get ( ) ) ; }

Target:
private void assertBranches ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { java.util.List < java.lang.String > expected = com.google.common.collect.Lists.newArrayList ( "HEAD" , RefNames.REFS_CONFIG , "refs/heads/master" ) ; expected.addAll ( branches ) ; com.google.gerrit.acceptance.rest.project.RefAssert.assertRefNames ( expected , project ( ) . branches ( ) . get ( ) ) ; }