auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void resolveBetwixtCommit ( ) throws java.lang.Exception { com.google.gerrit.common.data.IncludedInDetail detail = resolve ( commit_v1_3 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_1_3 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5_ANNOTATED ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5_ANNOTATED_TWICE ) ; assertEquals ( expTags , detail.getTags ( ) ) ; expBranches.add ( com.google.gerrit.server.change.IncludedInResolverTest.BRANCH_1_3 ) ; expBranches.add ( com.google.gerrit.server.change.IncludedInResolverTest.BRANCH_2_5 ) ; assertEquals ( expBranches , detail.getBranches ( ) ) ; }

Target:
public void resolveBetwixtCommit ( ) throws java.lang.Exception { com.google.gerrit.server.change.IncludedInResolver.Result detail = resolve ( commit_v1_3 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_1_3 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5 ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5_ANNOTATED ) ; expTags.add ( com.google.gerrit.server.change.IncludedInResolverTest.TAG_2_5_ANNOTATED_TWICE ) ; assertEquals ( expTags , detail.getTags ( ) ) ; expBranches.add ( com.google.gerrit.server.change.IncludedInResolverTest.BRANCH_1_3 ) ; expBranches.add ( com.google.gerrit.server.change.IncludedInResolverTest.BRANCH_2_5 ) ; assertEquals ( expBranches , detail.getBranches ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( java.lang.String changeId , java.lang.String query , int n ) throws java.lang.Exception { return gApi.changes ( ) . id ( changeId ) . suggestReviewers ( query ) . withLimit ( n ) . get ( ) ; }
Source:
java.lang.String elide ( final java.lang.String s ) { if ( ( s == null ) || ( ( s.length ( ) ) < 40 ) ) { return s ; } return ( ( s.substring ( 0 , 30 ) ) + "..." ) + ( s.substring ( ( ( s.length ( ) ) - 10 ) ) ) ; }

Target:
static java.lang.String elide ( final java.lang.String s , final int len ) { if ( ( ( s == null ) || ( ( s.length ( ) ) < len ) ) || ( len <= 10 ) ) { return s ; } return ( ( s.substring ( 0 , ( len - 10 ) ) ) + "..." ) + ( s.substring ( ( ( s.length ( ) ) - 10 ) ) ) ; }
Source:
public void parseSubmissionId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) + "Submission-id: 1-1453387607626-96fabc25" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submission-id: 1-1453387901516-5d1e2450" ) ) ) ; }

Target:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }
Source:
public int allowedValueForRef ( java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups ) { int val = java.lang.Integer.MIN_VALUE ; for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( groups.contains ( right.getAccountGroupId ( ) ) ) { val = java.lang.Math.max ( right.getMaxValue ( ) , val ) ; } } return val ; }

Target:
private boolean allowedValueForRef ( java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups , short level ) { for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( ( groups.contains ( right.getAccountGroupId ( ) ) ) && ( ( right.getMaxValue ( ) ) >= level ) ) { return true ; } } return false ; }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change\nሴ<Owner>" , "\n\nx<@>gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( "Update change\n\nPatch-set: 1\n" , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( "Update change\n\nPatch-set: 1\n" , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( "Update change\n\nPatch-set: 1\n" , new org.eclipse.jgit.lib.PersonIdent ( "Change\nሴ<Owner>" , "\n\nx<@>gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
private void sethost ( final com.google.gerrit.pgm.init.Section database , final java.net.InetSocketAddress addr ) { database.set ( "hostname" , com.google.gerrit.server.util.SocketUtil.hostname ( addr ) ) ; if ( 0 < ( addr.getPort ( ) ) ) { database.set ( "port" , java.lang.String.valueOf ( addr.getPort ( ) ) ) ; } }

Target:
private void sethost ( final com.google.gerrit.pgm.init.api.Section database , final java.net.InetSocketAddress addr ) { database.set ( "hostname" , com.google.gerrit.server.util.SocketUtil.hostname ( addr ) ) ; if ( 0 < ( addr.getPort ( ) ) ) { database.set ( "port" , java.lang.String.valueOf ( addr.getPort ( ) ) ) ; } }
Source:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . addParameter ( "q" , query ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }

Target:
public static void suggest ( java.lang.String query , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > > cb ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . addParameter ( "q" , query ) . addParameter ( "n" , limit ) . background ( ) . get ( cb ) ; }
Source:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private com.google.gerrit.extensions.api.changes.DraftInput newDraft ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , java.lang.String message ) { com.google.gerrit.extensions.api.changes.DraftInput d = new com.google.gerrit.extensions.api.changes.DraftInput ( ) ; return com.google.gerrit.acceptance.server.change.CommentsIT.populate ( d , path , side , line , message ) ; }
Source:
public void testTreeAndBlobTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; org.eclipse.jgit.revwalk.RevTree tree = repo.tree ( repo.file ( "foo" , blob ) ) ; assertEquals ( java.lang.Long.MIN_VALUE , getTime ( blob ) ) ; assertEquals ( java.lang.Long.MIN_VALUE , getTime ( tree ) ) ; }

Target:
public void treeAndBlobTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; org.eclipse.jgit.revwalk.RevTree tree = repo.tree ( repo.file ( "foo" , blob ) ) ; org.junit.Assert.assertEquals ( java.lang.Long.MIN_VALUE , getTime ( blob ) ) ; org.junit.Assert.assertEquals ( java.lang.Long.MIN_VALUE , getTime ( tree ) ) ; }
Source:
private static java.lang.String get ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , java.lang.String key ) { java.lang.String val = cfg.getString ( "library" , name , key ) ; if ( ( val == null ) || ( val.isEmpty ( ) ) ) { throw new java.lang.IllegalStateException ( ( ( ( ( ( "Variable library." + name ) + "." ) + key ) + " is required within " ) + ( com.google.gerrit.pgm.init.Libraries.RESOURCE_FILE ) ) ) ; } return val ; }

Target:
private static final java.lang.String doGet ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , java.lang.String key , boolean required ) { java.lang.String val = cfg.getString ( "library" , name , key ) ; if ( ( ( val == null ) || ( val.isEmpty ( ) ) ) && required ) { throw new java.lang.IllegalStateException ( ( ( ( ( ( "Variable library." + name ) + "." ) + key ) + " is required within " ) + ( com.google.gerrit.pgm.init.Libraries.RESOURCE_FILE ) ) ) ; } return val ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( canIgnore ( rsrc ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "failed to ignore change" , e ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( canIgnore ( rsrc ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gerrit.server.StarredChangesUtil.MutuallyExclusiveLabelsException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "failed to ignore change" , e ) ; } }
Source:
protected void configure ( ) { install ( new com.googlesource.gerrit.plugins.uploadvalidator.PatternCacheModule ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidFilenameValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.module ( ) ) ; }

Target:
protected void configure ( ) { install ( new com.googlesource.gerrit.plugins.uploadvalidator.PatternCacheModule ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.ContentTypeUtil.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidFilenameValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.module ( ) ) ; install ( com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.module ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval psa ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String label , int value ) { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( change.currentPatchSetId ( ) , accountId , new com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId ( label ) ) , ( ( short ) ( value ) ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval psa ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String label , int value ) { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( change.currentPatchSetId ( ) , accountId , new com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId ( label ) ) , ( ( short ) ( value ) ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
public void rewriteAtEndOfLineIsRecognized ( ) throws java.lang.Exception { java.lang.String a = "abc1\n" ; java.lang.String b = "abc2\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.wordEdit ( 3 , 4 , 3 , 4 ) ) ; }

Target:
public void rewriteAtEndOfLineIsRecognized ( ) throws java.lang.Exception { java.lang.String a = "abc1\n" ; java.lang.String b = "abc2\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . common ( "abc" ) . replace ( "1" , "2" ) . common ( "\n" ) . edits ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit revision , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( revision.getParents ( ) ) ; builder.setAuthor ( revision.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit revision , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg , java.sql.Timestamp when ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( revision.getParents ( ) ) ; builder.setAuthor ( revision.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me , when ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }
Source:
private com.google.gerrit.server.git.MetaDataUpdate createMetaDataUpdate ( ) { org.eclipse.jgit.lib.PersonIdent serverIdent = com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) ; com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , new com.google.gerrit.reviewdb.client.Project.NameKey ( "Test Repository" ) , repo ) ; metaDataUpdate.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; metaDataUpdate.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; return metaDataUpdate ; }

Target:
private com.google.gerrit.server.git.meta.MetaDataUpdate createMetaDataUpdate ( ) { org.eclipse.jgit.lib.PersonIdent serverIdent = com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) ; com.google.gerrit.server.git.meta.MetaDataUpdate metaDataUpdate = new com.google.gerrit.server.git.meta.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , new com.google.gerrit.reviewdb.client.Project.NameKey ( "Test Repository" ) , repo ) ; metaDataUpdate.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; metaDataUpdate.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; return metaDataUpdate ; }
Source:
public java.lang.String authenticate ( com.google.gerrit.server.CurrentUser user , java.util.List < java.lang.String > args ) throws com.google.gerrit.sshd.BaseCommand.Failure , com.google.gerrit.sshd.BaseCommand.UnloggedFailure { try { java.net.URL url = new java.net.URL ( canonicalWebUrl ) ; java.lang.String href = ( ( ( ( ( ( url.getProtocol ( ) ) + "://" ) + ( url.getAuthority ( ) ) ) + ( url.getPath ( ) ) ) + "/" ) + ( args.get ( 0 ) ) ) + "/info/lfs" ; org.eclipse.jgit.lfs.server.Response.Action response = new org.eclipse.jgit.lfs.server.Response.Action ( ) ; response.href = href ; response.header = java.util.Collections.singletonMap ( org.eclipse.jgit.util.HttpSupport.HDR_AUTHORIZATION , "not:required" ) ; return gson.toJson ( response ) ; } catch ( java.net.MalformedURLException e ) { throw new com.google.gerrit.sshd.BaseCommand.Failure ( 1 , ( ( ( "Server configuration error: " + "forming Git LFS endpoint URL from canonicalWebUrl [" ) + ( canonicalWebUrl ) ) + "] failed." ) ) ; } }

Target:
public java.lang.String authenticate ( com.google.gerrit.server.CurrentUser user , java.util.List < java.lang.String > args ) throws com.google.gerrit.sshd.BaseCommand.Failure , com.google.gerrit.sshd.BaseCommand.UnloggedFailure { try { java.net.URL url = new java.net.URL ( canonicalWebUrl ) ; java.lang.String path = url.getPath ( ) ; java.lang.String project = args.get ( 0 ) ; java.lang.String operation = args.get ( 1 ) ; java.lang.StringBuilder href = new java.lang.StringBuilder ( url.getProtocol ( ) ) . append ( "://" ) . append ( url.getAuthority ( ) ) . append ( path ) . append ( ( path.endsWith ( "/" ) ? "" : "/" ) ) . append ( project ) . append ( "/info/lfs" ) ; com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.SshAuthInfo info = auth.generateAuthInfo ( user , project , operation ) ; com.googlesource.gerrit.plugins.lfs.ExpiringAction action = new com.googlesource.gerrit.plugins.lfs.ExpiringAction ( href.toString ( ) , info ) ; return gson.toJson ( action ) ; } catch ( java.net.MalformedURLException e ) { throw new com.google.gerrit.sshd.BaseCommand.Failure ( 1 , ( ( ( "Server configuration error: " + "forming Git LFS endpoint URL from canonicalWebUrl [" ) + ( canonicalWebUrl ) ) + "] failed." ) ) ; } }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
private void assertCannotRead ( com.google.gerrit.server.project.ProjectControl u ) { com.google.common.truth.Truth.assertThat ( u.isVisible ( ) ) . named ( "cannot read" ) . isFalse ( ) ; }
Source:
public java.io.InputStream getInputStream ( com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { java.lang.String name = entry.getName ( ) ; if ( name.endsWith ( "html" ) ) { return new com.googlesource.gerrit.plugins.web.SSIPageInputStream ( staticResourcesPath , name ) ; } else { return new java.io.FileInputStream ( getResourceFile ( name ) ) ; } }

Target:
public java.io.InputStream getInputStream ( com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { java.lang.String name = entry.getName ( ) ; if ( name.endsWith ( "html" ) ) { return new com.googlesource.gerrit.plugins.web.SSIPageInputStream ( staticResourcesPath , name ) ; } else { return java.nio.file.Files.newInputStream ( getResourceFile ( name ) ) ; } }
Source:
public static boolean isValid ( java.lang.String addr ) { return org.apache.commons.validator.routines.EmailValidator.getInstance ( true , true ) . isValid ( addr ) ; }

Target:
public static boolean isValid ( java.lang.String addr ) { if ( ! ( com.google.gerrit.server.mail.OutgoingEmailValidator.initialized.getAndSet ( true ) ) ) { org.apache.commons.validator.routines.DomainValidator.updateTLDOverride ( org.apache.commons.validator.routines.DomainValidator.ArrayType.GENERIC_PLUS , new java.lang.String [ ] { "local" } ) ; } return org.apache.commons.validator.routines.EmailValidator.getInstance ( true , true ) . isValid ( addr ) ; }
Source:
public void setParentForAllProjects_Conflict ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , new com.google.gerrit.acceptance.rest.project.SetParentIT.ParentInput ( project ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CONFLICT , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setParentForAllProjects_Conflict ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , newParentInput ( project ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CONFLICT , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
void setSettings ( final com.google.gerrit.common.data.PatchScriptSettings s ) { settings = s ; context = settings.getContext ( ) ; }

Target:
void setSettings ( final com.google.gerrit.common.data.PatchScriptSettings s ) { settings = s ; context = settings.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } }
Source:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.DiffSummary value ) { int size = ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ; for ( java.lang.String p : value.getPaths ( ) ) { size += p.length ( ) ; } size += ( value.getPaths ( ) . size ( ) ) - 1 ; size += 8 ; return size ; }

Target:
public int weigh ( com.google.gerrit.server.patch.DiffSummaryKey key , com.google.gerrit.server.patch.DiffSummary value ) { int size = ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ; for ( java.lang.String p : value.getPaths ( ) ) { size += p.length ( ) ; } size += ( value.getPaths ( ) . size ( ) ) - 1 ; return size ; }
Source:
public void testCreateGroupWithoutCapability_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = new com.google.gerrit.acceptance.RestSession ( server , user ) . put ( "/groups/newGroup" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
public void testCreateGroupWithoutCapability_Forbidden ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = new com.google.gerrit.acceptance.RestSession ( server , user ) . put ( ( "/groups/" + newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }
Source:
public void publishComments ( final com.google.gerrit.reviewdb.client.PatchSet.Id psid , final java.lang.String msg , final java.util.Set < com.google.gerrit.reviewdb.client.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 , false ) ) . to ( cb ) ; }

Target:
public void publishComments ( final com.google.gerrit.reviewdb.client.PatchSet.Id psid , final java.lang.String msg , final java.util.Set < com.google.gerrit.reviewdb.client.ApprovalCategoryValue.Id > tags , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > cb ) { com.google.gerrit.httpd.rpc.Handler.wrap ( publishCommentsFactory.create ( psid , msg , tags , false ) ) . to ( cb ) ; }
Source:
public java.lang.String authenticate ( com.google.gerrit.server.CurrentUser user , java.util.List < java.lang.String > args ) throws com.google.gerrit.sshd.BaseCommand.Failure , com.google.gerrit.sshd.BaseCommand.UnloggedFailure { try { java.net.URL url = new java.net.URL ( canonicalWebUrl ) ; java.lang.String href = ( ( ( ( ( ( url.getProtocol ( ) ) + "://" ) + ( url.getAuthority ( ) ) ) + ( url.getPath ( ) ) ) + "/" ) + ( args.get ( 0 ) ) ) + "/info/lfs" ; org.eclipse.jgit.lfs.server.Response.Action response = new org.eclipse.jgit.lfs.server.Response.Action ( ) ; response.href = href ; response.header = java.util.Collections.singletonMap ( org.eclipse.jgit.util.HttpSupport.HDR_AUTHORIZATION , "not:required" ) ; return gson.toJson ( response ) ; } catch ( java.net.MalformedURLException e ) { throw new com.google.gerrit.sshd.BaseCommand.Failure ( 1 , ( ( ( "Server configuration error: " + "forming Git LFS endpoint URL from canonicalWebUrl [" ) + ( canonicalWebUrl ) ) + "] failed." ) ) ; } }

Target:
public java.lang.String authenticate ( com.google.gerrit.server.CurrentUser user , java.util.List < java.lang.String > args ) throws com.google.gerrit.sshd.BaseCommand.Failure , com.google.gerrit.sshd.BaseCommand.UnloggedFailure { try { java.net.URL url = new java.net.URL ( canonicalWebUrl ) ; java.lang.String path = url.getPath ( ) ; java.lang.StringBuilder href = new java.lang.StringBuilder ( url.getProtocol ( ) ) . append ( "://" ) . append ( url.getAuthority ( ) ) . append ( path ) . append ( ( path.endsWith ( "/" ) ? "" : "/" ) ) . append ( args.get ( 0 ) ) . append ( "/info/lfs" ) ; org.eclipse.jgit.lfs.server.Response.Action response = new org.eclipse.jgit.lfs.server.Response.Action ( ) ; response.href = href.toString ( ) ; response.header = java.util.Collections.singletonMap ( org.eclipse.jgit.util.HttpSupport.HDR_AUTHORIZATION , "not:required" ) ; return gson.toJson ( response ) ; } catch ( java.net.MalformedURLException e ) { throw new com.google.gerrit.sshd.BaseCommand.Failure ( 1 , ( ( ( "Server configuration error: " + "forming Git LFS endpoint URL from canonicalWebUrl [" ) + ( canonicalWebUrl ) ) + "] failed." ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { onSubmitResult ( result ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.restore ( changeDetail.getChange ( ) . getChangeId ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( new com.google.gerrit.reviewdb.client.Change.Id ( result._number ( ) ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }

Target:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxTerms" , 0 ) , cfg.getInt ( "index" , null , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
private void checkPermission ( ) throws com.google.gerrit.common.errors.PermissionDeniedException { if ( ! ( currentUser.getCapabilities ( ) . canAccessDatabase ( ) ) ) { throw new com.google.gerrit.common.errors.PermissionDeniedException ( java.lang.String.format ( "%s does not have \"Access Database\" capability." , currentUser.getUserName ( ) ) ) ; } }

Target:
private void checkPermission ( ) throws com.google.gerrit.common.errors.PermissionDeniedException { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; if ( ! ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( AccessCiDatabaseCapability.ID ) ) ) ) ) { throw new com.google.gerrit.common.errors.PermissionDeniedException ( java.lang.String.format ( "%s does not have \"%s\" capability." , userProvider.get ( ) . getUserName ( ) , new com.googlesource.gerrit.plugins.verifystatus.AccessCiDatabaseCapability ( ) . getDescription ( ) ) ) ; } }
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }

Target:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { com.google.gerrit.server.project.RefControl.Factory refControlFactory = new com.google.gerrit.server.project.RefControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.project.RefControl create ( final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String ref ) { return new com.google.gerrit.server.project.RefControl ( systemConfig , projectControl , ref ) ; } } ; return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , refControlFactory , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }
Source:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; final com.google.gerrit.server.account.AccountState uploader = accountCache.get ( patchSet.getUploader ( ) ) ; p.uploader = asAccountAttribute ( uploader.getAccount ( ) ) ; return p ; }

Target:
public void addTrackingIds ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.TrackingId > ids ) { if ( ! ( ids.isEmpty ( ) ) ) { a.trackingIds = new java.util.ArrayList < com.google.gerrit.server.events.TrackingIdAttribute > ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.TrackingId t : ids ) { a.trackingIds.add ( asTrackingIdAttribute ( t ) ) ; } } }
Source:
public static void assertBranchInfo ( com.google.gerrit.acceptance.rest.project.BranchInfo expected , com.google.gerrit.acceptance.rest.project.BranchInfo actual ) { org.junit.Assert.assertEquals ( expected.ref , actual.ref ) ; if ( ( expected.revision ) != null ) { org.junit.Assert.assertEquals ( expected.revision , actual.revision ) ; } org.junit.Assert.assertEquals ( expected.can_delete , com.google.gerrit.acceptance.rest.project.BranchAssert.toBoolean ( actual.can_delete ) ) ; }

Target:
public static void assertBranchInfo ( com.google.gerrit.server.project.ListBranches.BranchInfo expected , com.google.gerrit.server.project.ListBranches.BranchInfo actual ) { org.junit.Assert.assertEquals ( expected.ref , actual.ref ) ; if ( ( expected.revision ) != null ) { org.junit.Assert.assertEquals ( expected.revision , actual.revision ) ; } org.junit.Assert.assertEquals ( expected.canDelete , com.google.gerrit.acceptance.rest.project.BranchAssert.toBoolean ( actual.canDelete ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; }

Target:
private void doGeneratePassword ( ) { if ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) ) != 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 ) { display ( newPassword.asString ( ) ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }
Source:
protected void configureServlets ( ) { serveRegex ( com.google.gerrit.httpd.plugins.LfsPluginServlet.URL_REGEX ) . with ( com.googlesource.gerrit.plugins.lfs.LfsApiServlet.class ) ; populateRepository ( defaultBackend ) ; for ( com.googlesource.gerrit.plugins.lfs.LfsBackend backend : backends.values ( ) ) { populateRepository ( backend ) ; } }

Target:
protected void configureServlets ( ) { serveRegex ( com.google.gerrit.httpd.plugins.LfsPluginServlet.URL_REGEX ) . with ( com.googlesource.gerrit.plugins.lfs.LfsApiServlet.class ) ; populateRepository ( defaultBackend ) ; for ( com.googlesource.gerrit.plugins.lfs.LfsBackend backend : backends.values ( ) ) { populateRepository ( backend ) ; } com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "lfs-project-info.js" ) ) ; }
Source:
public void testGetUrl ( ) throws java.lang.Exception { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetPeerInfoStrategy ( ) { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . strategy ( ) ) . isSameAs ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ; org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . strategy ( ) ) . isSameAs ( Configuration.PeerInfoStrategy.JGROUPS ) ; }
Source:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }

Target:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ModuleGenerator.class ) . to ( com.google.gerrit.sshd.SshAutoRegisterModuleGenerator.class ) ; bind ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }
Source:
public void delete ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteChange.apply ( change , null ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete change" , e ) ; } }

Target:
public void setPrivate ( boolean value ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( value ) { putPrivate.apply ( change , null ) ; } else { deletePrivate.apply ( change , null ) ; } } catch ( com.google.gerrit.server.update.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot change private status" , e ) ; } }
Source:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; try { createClassUnderTest ( ) . delete ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testUpdateOneConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
public void fullName ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/meta/config" ) ) . isEqualTo ( "refs/meta/config" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/heads/master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/tags/v1.0" ) ) . isEqualTo ( "refs/tags/v1.0" ) ; }

Target:
public void fullName ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( RefNames.REFS_CONFIG ) ) . isEqualTo ( RefNames.REFS_CONFIG ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/heads/master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/tags/v1.0" ) ) . isEqualTo ( "refs/tags/v1.0" ) ; }
Source:
private boolean matchAny ( java.lang.Iterable < com.google.gerrit.common.data.PermissionRule > rules , com.google.common.base.Predicate < com.google.gerrit.common.data.PermissionRule > predicate ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( com.google.common.collect.Iterables.filter ( rules , predicate ) , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.memberOfAny ( ids ) ; }

Target:
private boolean matchAny ( java.lang.Iterable < com.google.gerrit.common.data.PermissionRule > rules , com.google.common.base.Predicate < com.google.gerrit.common.data.PermissionRule > predicate ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( com.google.common.collect.Iterables.filter ( rules , predicate ) , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }
Source:
public void write ( com.google.gerrit.server.git.VersionedMetaData config , org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException { doSave ( config , commit ) ; final org.eclipse.jgit.lib.ObjectId res = newTree.writeTree ( inserter ) ; if ( res.equals ( srcTree ) ) { return ; } commit.setTreeId ( res ) ; if ( ( src ) != null ) { commit.addParentId ( src ) ; } src = inserter.insert ( commit ) ; srcTree = res ; }

Target:
public void write ( com.google.gerrit.server.git.VersionedMetaData config , org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException { doSave ( config , commit ) ; final org.eclipse.jgit.lib.ObjectId res = newTree.writeTree ( inserter ) ; if ( ( res.equals ( srcTree ) ) && ( ! ( update.allowEmpty ( ) ) ) ) { return ; } commit.setTreeId ( res ) ; if ( ( src ) != null ) { commit.addParentId ( src ) ; } src = inserter.insert ( commit ) ; srcTree = res ; }
Source:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( config.scopes.get ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }

Target:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( scopesForKey ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }