auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void createProject ( java.lang.String name , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; createProject ( in ) ; }

Target:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }
Source:
public void testCarriageReturn ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.performValidation ( repo , c , com.google.common.collect.Sets.newHashSet ( new java.lang.String [ ] { "" } ) ) ; com.google.common.truth.Truth.assertThat ( m ) . hasSize ( 1 ) ; java.util.List < com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage > expected = new java.util.ArrayList < > ( ) ; expected.add ( new com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage ( "found carriage return (CR) character in file: foo.txt" , true ) ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsAllIn ( expected ) ; }

Target:
public void testCarriageReturn ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.performValidation ( repo , c , com.google.common.collect.Sets.newHashSet ( new java.lang.String [ ] { "" } ) ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: found carriage return (CR) character in file: foo.txt" ) ) ; }
Source:
public void trailingSlashes ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar/" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar///" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar/" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar///" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; }

Target:
public void trailingSlashes ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo/bar/" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo/bar///" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo%2Fbar/" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo%2Fbar///" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; }
Source:
synchronized java.util.Set < com.google.gerrit.reviewdb.client.Change > addAll ( java.util.Collection < com.google.gerrit.reviewdb.client.Change > changes ) { java.util.Set < com.google.gerrit.reviewdb.client.Change > r = com.google.common.collect.Sets.newLinkedHashSetWithExpectedSize ( changes.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change c : changes ) { if ( pending.add ( c.getId ( ) ) ) { r.add ( c ) ; } } return r ; }

Target:
synchronized java.util.Set < com.google.gerrit.reviewdb.client.Change > addAll ( java.util.Collection < com.google.gerrit.reviewdb.client.Change > changes , boolean force ) { java.util.Set < com.google.gerrit.reviewdb.client.Change > r = com.google.common.collect.Sets.newLinkedHashSetWithExpectedSize ( changes.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change c : changes ) { if ( force ? forcePending.add ( c.getId ( ) ) : pending.add ( c.getId ( ) ) ) { r.add ( c ) ; } } return r ; }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }

Target:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }
Source:
public void testSinglePeeledTagText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/tags/atag" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; assertEquals ( 200 , res.getStatus ( ) ) ; assertEquals ( ( ( ( ( id ( "refs/tags/atag" ) ) + " refs/tags/atag\n" ) + ( peeled ( "refs/tags/atag" ) ) ) + " refs/tags/atag^{}\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void singlePeeledTagText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/tags/atag" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/tags/atag" ) ) + " refs/tags/atag\n" ) + ( peeled ( "refs/tags/atag" ) ) ) + " refs/tags/atag^{}\n" ) , res.getActualBodyString ( ) ) ; }
Source:
private void beforeCreateProject ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , java.io.IOException { com.google.gerrit.server.project.CreateProjectArgs args = new com.google.gerrit.server.project.CreateProjectArgs ( ) ; args.setProjectName ( name ) ; args.newParent = projectsCollection.get ( ) . parse ( parent.get ( ) ) . getControl ( ) ; for ( com.google.gerrit.server.validators.ProjectCreationValidationListener l : projectCreationValidationListeners ) { try { l.validateNewProject ( args ) ; } catch ( com.google.gerrit.server.validators.ValidationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) , e ) ; } } }

Target:
private void beforeCreateProject ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.CreateProjectArgs args = new com.google.gerrit.server.project.CreateProjectArgs ( ) ; args.setProjectName ( name ) ; args.newParent = projectsCollection.get ( ) . parse ( parent.get ( ) ) . getNameKey ( ) ; for ( com.google.gerrit.server.validators.ProjectCreationValidationListener l : projectCreationValidationListeners ) { try { l.validateNewProject ( args ) ; } catch ( com.google.gerrit.server.validators.ValidationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) , e ) ; } } }
Source:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null , admin ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }

Target:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertErrorStatus ( ) ; r.assertChange ( Change.Status.NEW , null , admin ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }
Source:
private void preMerge ( ) throws com.google.gerrit.server.git.MergeException , com.google.gwtorm.server.OrmException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } }

Target:
private void preMerge ( final com.google.gerrit.server.git.SubmitStrategy strategy , final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }
Source:
protected void init ( ) throws javax.mail.MessagingException { super . init ( ) ; lookupPriorReviewers ( ) ; add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; }

Target:
protected void init ( ) throws javax.mail.MessagingException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; factory ( CommitApiImpl.Factory.class ) ; }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return com.google.common.collect.ImmutableList.copyOf ( db.accountGroups ( ) . all ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getAll ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }
Source:
public static final java.lang.String shortName ( java.lang.String ref ) { return ref.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS ) ? ref.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS.length ( ) ) : ref ; }

Target:
public static final java.lang.String shortName ( java.lang.String ref ) { if ( ref.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS ) ) { return ref.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS.length ( ) ) ; } else if ( ref.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_TAGS ) ) { return ref.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_TAGS.length ( ) ) ; } return ref ; }
Source:
private void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } pruneReviewers ( ) ; }

Target:
private void parseAll ( ) throws java.io.IOException , java.text.ParseException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( walk.parseCommit ( tip ) ) ; pruneReviewers ( ) ; }
Source:
public com.google.gerrit.server.plugins.PluginResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { com.google.gerrit.server.plugins.Plugin p = loader.get ( com.google.gerrit.server.util.Url.decode ( id ) ) ; if ( p == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.plugins.PluginResource ( p ) ; }

Target:
public com.google.gerrit.server.plugins.PluginResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { com.google.gerrit.server.plugins.Plugin p = loader.get ( com.google.gerrit.extensions.restapi.Url.decode ( id ) ) ; if ( p == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.plugins.PluginResource ( p ) ; }
Source:
public java.lang.String toRevision ( final com.google.gerrit.reviewdb.Project.NameKey project , final com.google.gerrit.reviewdb.PatchSet ps ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.common.data.GitwebLink.p ( r , project ) ; com.google.gerrit.common.data.GitwebLink.a ( r , "commit" ) ; com.google.gerrit.common.data.GitwebLink.h ( r , ps ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeComponent ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.PublishResult run ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gwtorm.client.Transaction txn , boolean retry ) throws com.google.gwtorm.client.OrmException { return doPublishComments ( psid , message , approvals , db , txn ) ; }

Target:
public void publishComments ( final com.google.gerrit.reviewdb.PatchSet.Id psid , final java.lang.String msg , final java.util.Set < com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > tags , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > cb ) { com.google.gerrit.httpd.rpc.Handler.wrap ( publishCommentsFactory.create ( psid , msg , tags ) ) . to ( cb ) ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { new com.google.gerrit.client.changes.AbandonChangeDialog ( patchSet.getId ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Object > ( ) { public void onSuccess ( java.lang.Object result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } public void onFailure ( java.lang.Throwable caught ) { } } ) . center ( ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { new com.google.gerrit.client.changes.AbandonChangeDialog ( patchSet.getId ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Object > ( ) { public void onSuccess ( java.lang.Object result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } public void onFailure ( java.lang.Throwable caught ) { } } ) . center ( ) ; }
Source:
public void testCarriageReturnIgnoringBinaries ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithPseudoBinaries ( ) ; java.util.Set < java.lang.String > ignoreFiles = com.google.common.collect.Sets.newHashSet ( new java.lang.String [ ] { "iso" , "jpeg" } ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.performValidation ( repo , c , ignoreFiles ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; }

Target:
public void testCarriageReturn ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator validator = new com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator ( null , new com.googlesource.gerrit.plugins.uploadvalidator.ContentTypeUtil ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.PATTERN_CACHE ) , null , null ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , c , com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.EMPTY_PLUGIN_CONFIG ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: found carriage return (CR) character in file: foo.txt" ) ) ; }
Source:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return parse ( rsrc.getUser ( ) , id ) ; }

Target:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { try { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } return parse ( rsrc.getUser ( ) , id ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { onGutterClick ( cmLine ) ; }

Target:
net.codemirror.lib.CodeMirror.LineHandle setLineNumber ( com.google.gerrit.client.diff.DisplaySide side , final int cmLine , int line ) { com.google.gwt.user.client.ui.Label gutter = new com.google.gwt.user.client.ui.Label ( java.lang.String.valueOf ( line ) ) ; diffTable.add ( gutter ) ; gutter.setStyleName ( UnifiedTable.style.unifiedLineNumber ( ) ) ; return cm.setGutterMarker ( cmLine , ( side == ( DisplaySide.A ) ? UnifiedTable.style.lineNumbersLeft ( ) : UnifiedTable.style.lineNumbersRight ( ) ) , gutter.getElement ( ) ) ; }
Source:
public static void abandon ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "abandon" ) . post ( input , cb ) ; }

Target:
public static void markPrivate ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "private" ) . post ( com.google.gerrit.client.changes.ChangeApi.PrivateInput.create ( ) , cb ) ; }
Source:
public static void query ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; call.get ( callback ) ; }

Target:
public static void query ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; call.get ( callback ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
private com.google.gerrit.server.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.client.AccountDiffPreference dp = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.server.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git , projectKey ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.isAgainstParent ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }

Target:
private com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.client.AccountDiffPreference dp = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git , projectKey ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.isAgainstParent ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }
Source:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createFile ( root ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.nio.file.NotDirectoryException e ) { } } finally { java.nio.file.Files.delete ( root ) ; } }

Target:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createFile ( root ) ; exception.expect ( java.nio.file.NotDirectoryException.class ) ; new com.google.gerrit.server.config.SitePaths ( root ) ; } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
private java.lang.String getCommand ( java.lang.String command , com.google.gitiles.RevisionParser.Result result , java.lang.String path ) { if ( ! ( com.google.gitiles.ViewFilter.CMD_AUTO.equals ( command ) ) ) { return command ; } else if ( ( result.getOldRevision ( ) ) != null ) { return com.google.gitiles.ViewFilter.CMD_DIFF ; } else { return com.google.gitiles.ViewFilter.CMD_SHOW ; } }

Target:
private GitilesView.Builder parseDiffCommand ( java.lang.String repoName , com.google.gitiles.RevisionParser.Result result ) { if ( result == null ) { return null ; } return com.google.gitiles.GitilesView.diff ( ) . setRepositoryName ( repoName ) . setRevision ( result.getRevision ( ) ) . setOldRevision ( result.getOldRevision ( ) ) . setPathPart ( result.getPath ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doReloadPlugins ( ) ; }

Target:
private void initPluginList ( ) { pluginTable = new com.google.gerrit.client.admin.PluginListScreen.PluginTable ( ) ; pluginTable.addStyleName ( Gerrit.RESOURCES.css ( ) . pluginsTable ( ) ) ; pluginPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; pluginPanel.setWidth ( "500px" ) ; pluginPanel.add ( pluginTable ) ; add ( pluginPanel ) ; }
Source:
public void testRefsHeads ( ) throws java.lang.Exception { repo.branch ( "refs/heads/foo" ) . commit ( ) . create ( ) ; repo.branch ( "refs/heads/refs/heads/foo" ) . commit ( ) . create ( ) ; java.util.Map < java.lang.String , ? > data = buildData ( ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( ref ( "/b/test/+/foo" , "foo" ) , ref ( "/b/test/+/refs/heads/refs/heads/foo" , "refs/heads/foo" ) ) , data.get ( "branches" ) ) ; }

Target:
public void refsHeads ( ) throws java.lang.Exception { repo.branch ( "refs/heads/foo" ) . commit ( ) . create ( ) ; repo.branch ( "refs/heads/refs/heads/foo" ) . commit ( ) . create ( ) ; java.util.Map < java.lang.String , ? > data = buildData ( ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( ref ( "/b/test/+/foo" , "foo" ) , ref ( "/b/test/+/refs/heads/refs/heads/foo" , "refs/heads/foo" ) ) , data.get ( "branches" ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.group.GroupIndexCollection.class ) ; }

Target:
protected void configure ( ) { switch ( com.google.gerrit.server.index.IndexModule.getIndexType ( injector ) ) { case LUCENE : install ( new com.google.gerrit.pgm.init.index.lucene.LuceneIndexModuleOnInit ( ) ) ; break ; case ELASTICSEARCH : install ( new com.google.gerrit.pgm.init.index.elasticsearch.ElasticIndexModuleOnInit ( ) ) ; break ; default : throw new java.lang.IllegalStateException ( "unsupported index.type" ) ; } }
Source:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } }

Target:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } }
Source:
public void init ( com.google.reviewit.app.ReviewItApp app , com.google.reviewit.app.Change change ) { ( ( com.google.reviewit.widget.ProjectBranchTopicAgeView ) ( findViewById ( R.id.projectBranchTopicAge ) ) ) . init ( change ) ; ( ( com.google.reviewit.widget.UserView ) ( findViewById ( R.id.owner ) ) ) . init ( app , change.info.owner ) ; com.google.gerrit.extensions.common.ChangeInfo info = change.info ; com.google.reviewit.util.WidgetUtil.setText ( findViewById ( R.id.subject ) , info.subject ) ; }

Target:
public void init ( com.google.reviewit.app.ReviewItApp app , com.google.reviewit.app.Change change ) { ( ( com.google.reviewit.widget.ProjectBranchTopicAgeView ) ( findViewById ( R.id.projectBranchTopicAge ) ) ) . init ( change ) ; ( ( com.google.reviewit.widget.UserView ) ( findViewById ( R.id.owner ) ) ) . init ( app , change.info.owner ) ; com.google.gerrit.extensions.common.ChangeInfo info = change.info ; com.google.reviewit.util.WidgetUtil.setText ( findViewById ( R.id.subject ) , info.subject ) ; ( ( com.google.reviewit.widget.CodeReviewVotes ) ( findViewById ( R.id.codeReviewVotes ) ) ) . init ( change ) ; }
Source:
public void createProjectFooBar ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( "foo" ) ; gApi.projects ( ) . name ( "bar" ) . create ( in ) ; }

Target:
public void createProjectWithMismatchedInput ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( "foo" ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "name must match input.name" ) ; gApi.projects ( ) . name ( "bar" ) . create ( in ) ; }
Source:
public void addReviewerToReviewableChangeByOtherInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accounts.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; } ) ; }

Target:
public void addReviewerToReviewableChangeByOtherInNoteDbBatch ( ) throws java.lang.Exception { addReviewerToReviewableChangeByOtherInNoteDb ( batch ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
private com.google.common.collect.FluentIterable < com.google.gerrit.extensions.common.WebLinkInfo > filterLinks ( com.google.gerrit.extensions.registration.DynamicSet < ? extends com.google.gerrit.extensions.webui.WebLink > links , com.google.common.base.Function < com.google.gerrit.extensions.webui.WebLink , com.google.gerrit.extensions.common.WebLinkInfo > transformer ) { return com.google.common.collect.FluentIterable.from ( links ) . transform ( transformer ) . filter ( com.google.gerrit.server.WebLinks.INVALID_WEBLINK ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { return ( ( o instanceof com.google.gerrit.client.reviewdb.ProjectLeadGroup.Key ) && ( ( ( com.google.gerrit.client.reviewdb.ProjectLeadGroup.Key ) ( o ) ) . projectName.equals ( projectName ) ) ) && ( ( ( com.google.gerrit.client.reviewdb.ProjectLeadGroup.Key ) ( o ) ) . groupId.equals ( groupId ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.com.google.gwtorm [ ] members ( ) { return new com.google.gwtorm.client.Key < ? > [ ] { groupId } ; }
Source:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( readFromGit ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.all ( repo , com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ) ; } } return com.google.gerrit.server.account.externalids.ExternalId.from ( db.accountExternalIds ( ) . all ( ) . toList ( ) ) ; }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.io.IOException { checkReadEnabled ( ) ; if ( readFromGit ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.all ( repo , com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ) ; } } return com.google.gerrit.server.account.externalids.ExternalId.from ( db.accountExternalIds ( ) . all ( ) . toList ( ) ) ; }
Source:
protected void onRequestSuggestions ( final com.google.gerrit.client.ui.Request request , final com.google.gerrit.client.ui.Callback done ) { final int suggestFrom = com.google.gerrit.client.Gerrit.getConfig ( ) . getSuggestFrom ( ) ; if ( ( suggestFrom == 0 ) || ( ( request.getQuery ( ) . length ( ) ) >= suggestFrom ) ) { _onRequestSuggestions ( request , done ) ; } }

Target:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request req , com.google.gerrit.client.ui.Callback cb ) { if ( ( req.getQuery ( ) . length ( ) ) >= ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSuggestFrom ( ) ) ) { _onRequestSuggestions ( req , cb ) ; } else { java.util.List < com.google.gerrit.client.ui.Suggestion > none = java.util.Collections.emptyList ( ) ; cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( none ) ) ; } }
Source:
com.google.gerrit.client.diff.DiffChunkInfo getFirst ( ) { return chunks.isEmpty ( ) ? null : chunks.get ( 0 ) ; }

Target:
com.google.gerrit.client.diff.DiffChunkInfo getFirst ( ) { if ( ! ( chunks.isEmpty ( ) ) ) { for ( com.google.gerrit.client.diff.DiffChunkInfo d : chunks ) { if ( ( d.getSide ( ) ) == ( DisplaySide.B ) ) { return d ; } } return chunks.get ( 0 ) ; } return null ; }
Source:
private void assertDeleteForbidden ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( branch ( ) . get ( ) . canDelete ) . isNull ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "delete not permitted" ) ; branch ( ) . delete ( ) ; }

Target:
private void assertDeleteForbidden ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( branch ( branch ) . get ( ) . canDelete ) . isNull ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "delete not permitted" ) ; branch ( branch ) . delete ( ) ; }
Source:
private final org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk ( ) throws java.security.NoSuchProviderException , org.bouncycastle.openpgp.PGPException { final org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder builder = new org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder ( org.bouncycastle.openpgp.PGPEncryptedData.CAST5 ) . setSecureRandom ( prng ) ; org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk = new org.bouncycastle.openpgp.PGPEncryptedDataGenerator ( builder , true ) ; final org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator methodGenerator = new org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator ( dest ) ; cpk.addMethod ( methodGenerator ) ; return cpk ; }

Target:
private final org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk ( ) throws java.security.NoSuchProviderException , org.bouncycastle.openpgp.PGPException { org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk = new org.bouncycastle.openpgp.PGPEncryptedDataGenerator ( org.bouncycastle.openpgp.PGPEncryptedData.CAST5 , true , prng , "BC" ) ; cpk.addMethod ( dest ) ; return cpk ; }
Source:
private static java.lang.String extractTitleFromMarkdown ( java.util.jar.JarFile jar , java.util.jar.JarEntry entry ) throws java.io.IOException { java.lang.String charEnc = null ; java.util.jar.Attributes atts = entry.getAttributes ( ) ; if ( atts != null ) { charEnc = com.google.common.base.Strings.emptyToNull ( atts.getValue ( "Character-Encoding" ) ) ; } if ( charEnc == null ) { charEnc = "UTF-8" ; } return new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . extractTitleFromMarkdown ( com.google.gerrit.httpd.plugins.HttpPluginServlet.readWholeEntry ( jar , entry ) , charEnc ) ; }

Target:
private static java.lang.String extractTitleFromMarkdown ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { java.lang.String charEnc = null ; java.util.Map < java.lang.Object , java.lang.String > atts = entry.getAttrs ( ) ; if ( atts != null ) { charEnc = com.google.common.base.Strings.emptyToNull ( atts.get ( com.google.gerrit.server.plugins.PluginEntry.ATTR_CHARACTER_ENCODING ) ) ; } if ( charEnc == null ) { charEnc = "UTF-8" ; } return new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . extractTitleFromMarkdown ( com.google.gerrit.httpd.plugins.HttpPluginServlet.readWholeEntry ( scanner , entry ) , charEnc ) ; }
Source:
private java.lang.Class < T > generate ( com.google.gwtorm.schema.sql.SqlDialect dialect , final com.google.gwtorm.server.GeneratedClassLoader loader ) throws com.google.gwtorm.client.OrmException { return ( ( java.lang.Class < T > ) ( new com.google.gwtorm.jdbc.gen.SchemaGen ( loader , schemaModel , dialect ) . create ( ) ) ) ; }

Target:
private java.lang.Class < T > generate ( final com.google.gwtorm.schema.sql.SqlDialect dialect , final com.google.gwtorm.server.GeneratedClassLoader loader ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.server.SchemaGen ( loader , schemaModel , com.google.gwtorm.jdbc.JdbcSchema.class , new com.google.gwtorm.server.SchemaGen.AccessGenerator ( ) { @ java.lang.Override public < A extends com.google.gwtorm.client.Access < ? , ? > > java.lang.Class < A > create ( com.google.gwtorm.server.GeneratedClassLoader loader , com.google.gwtorm.schema.RelationModel rm ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.jdbc.gen.AccessGen ( loader , rm , dialect ) . create ( ) ; } } ) . create ( ) ; }
Source:
public void hashtagsWithAccentedCharacters ( ) throws java.lang.Exception { java.lang.String commitMessage = "Jag #måste #öva på min #Svenska!\n\n" + "Jag behöver en #läkare." ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.change.HashtagsUtil.extractTags ( commitMessage ) ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( "måste" , "öva" , "Svenska" , "läkare" ) ) ; }

Target:
public void hashtagsWithAccentedCharacters ( ) throws java.lang.Exception { java.lang.String commitMessage = "Jag #måste #öva på min #Svenska!\n\n" + "Jag behöver en #läkare." ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( com.google.gerrit.server.change.HashtagsUtil.extractTags ( commitMessage ) ) ) ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( "måste" , "öva" , "Svenska" , "läkare" ) ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { res.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; super . service ( req , res ) ; }

Target:
private static void noCache ( javax.servlet.http.HttpServletResponse res ) { res.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; res.setHeader ( "Content-Disposition" , "attachment" ) ; }
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSucessfullQuery ( java.lang.String query ) throws java.lang.Exception { java.lang.String rawResponse = sshSession.exec ( query ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; return getChanges ( rawResponse ) ; }

Target:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params ) throws java.lang.Exception { java.lang.String rawResponse = sshSession.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }
Source:
private static java.lang.String duration ( double ns ) { if ( ns < 0.5 ) { return null ; } java.lang.String suffix = "ns" ; if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "us" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "ms" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "s " ; } return java.lang.String.format ( "%4.1f%s" , ns , suffix ) ; }

Target:
private static java.lang.String duration ( double ns ) { if ( ns < 0.5 ) { return null ; } java.lang.String suffix = "ns" ; if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "us" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "ms" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "s" ; } return java.lang.String.format ( "%4.1f%s" , ns , suffix ) . trim ( ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId writeTree ( org.eclipse.jgit.revwalk.RevTree srcTree , org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException , org.eclipse.jgit.errors.UnmergedPathException { try { newTree = readTree ( srcTree ) ; onSave ( commit ) ; return newTree.writeTree ( inserter ) ; } finally { newTree = null ; } }

Target:
public void close ( ) { newTree = null ; if ( ( inserter ) != null ) { inserter.release ( ) ; inserter = null ; } if ( ( reader ) != null ) { reader.release ( ) ; reader = null ; } }
Source:
protected void configure ( ) { install ( new com.googlesource.gerrit.plugins.xdocs.XDocLoader.Module ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.ProjectWebLink.class ) . to ( com.googlesource.gerrit.plugins.xdocs.XDocProjectWebLink.class ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.xdocs.MenuEntry > getEntries ( ) { java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( "/plugins/" ) ; url.append ( pluginName ) ; url.append ( XDocServlet.PATH_PREFIX ) ; url.append ( "${projectName}/README.md" ) ; return com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuEntry ( com.google.gerrit.extensions.webui.GerritTopMenu.PROJECTS , com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuItem ( "Readme" , url.toString ( ) ) ) ) ) ; }
Source:
public void testInheritRead_AppendWithDenyOfRef ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/heads/*" , 0 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can read" , u.isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/master" ) . isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/tags/foobar" ) . isVisible ( ) ) ; assertTrue ( "no master" , u.controlForRef ( "refs/heads/master" ) . isVisible ( ) ) ; }

Target:
public void testInheritRead_AppendWithDenyOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/heads/*" ) . setDeny ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can read" , u.isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/master" ) . isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/tags/foobar" ) . isVisible ( ) ) ; assertTrue ( "no master" , u.controlForRef ( "refs/heads/master" ) . isVisible ( ) ) ; }
Source:
private com.google.gerrit.server.patch.PatchScriptBuilder newBuilder ( com.google.gerrit.server.diff.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.server.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git , notes.getProjectName ( ) ) ; b.setChange ( notes.getChange ( ) ) ; b.setDiffPrefs ( diffPrefs ) ; b.setTrees ( list.getComparisonType ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }

Target:
private com.google.gerrit.server.patch.PatchScriptBuilder newBuilder ( com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.server.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git , notes.getProjectName ( ) ) ; b.setChange ( notes.getChange ( ) ) ; b.setDiffPrefs ( diffPrefs ) ; b.setTrees ( list.getComparisonType ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }