auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { setReviewed ( event.getValue ( ) ) ; }

Target:
void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( patchId ) . view ( "files" ) . id ( fileId ) . view ( "reviewed" ) ; if ( event.getValue ( ) ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
private void assertProblems ( org.bouncycastle.openpgp.PGPPublicKey k , java.lang.String ... expected ) throws java.lang.Exception { if ( ( expected.length ) == 0 ) { throw new java.lang.IllegalArgumentException ( "Use assertNoProblems" ) ; } com.google.gerrit.gpg.CheckResult result = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . check ( k ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertNoProblems ( org.bouncycastle.openpgp.PGPPublicKey k ) { com.google.gerrit.gpg.CheckResult result = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . check ( k ) ; org.junit.Assert.assertEquals ( java.util.Collections.emptyList ( ) , result.getProblems ( ) ) ; }
Source:
static java.util.List < java.lang.String > sort ( java.util.Set < java.lang.String > names ) { java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( names ) ; java.util.Collections.sort ( list ) ; return list ; }

Target:
static void addToMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String key , java.lang.String value ) { if ( ( map.get ( key ) ) == null ) { map.put ( key , new java.util.HashSet < > ( ) ) ; } map.get ( key ) . add ( value ) ; }
Source:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else if ( ( session.isSignedIn ( ) ) && ( session.isValidXGerritAuth ( keyIn ) ) ) { session.getCurrentUser ( ) . setAccessPath ( AccessPath.JSON_RPC ) ; return true ; } return false ; }

Target:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else if ( ( session.isSignedIn ( ) ) && ( session.isValidXGerritAuth ( keyIn ) ) ) { session.getUser ( ) . setAccessPath ( AccessPath.JSON_RPC ) ; return true ; } return false ; }
Source:
private static int getTimeUnit ( org.eclipse.jgit.transport.RemoteConfig rc , org.eclipse.jgit.lib.Config cfg , java.lang.String name , int defValue , java.util.concurrent.TimeUnit unit ) { return ( ( int ) ( com.google.gerrit.server.config.ConfigUtil.getTimeUnit ( cfg , "remote" , rc.getName ( ) , name , defValue , unit ) ) ) ; }

Target:
void pushWasCanceled ( com.googlesource.gerrit.plugins.replication.PushOne pushOp ) { synchronized ( stateLock ) { org.eclipse.jgit.transport.URIish uri = pushOp.getURI ( ) ; pending.remove ( uri ) ; } }
Source:
private void bindSkipLine ( int row , final int skipCnt ) { final com.google.gwt.user.client.ui.FlowPanel skipPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; skipPanel.add ( new com.google.gwt.user.client.ui.InlineLabel ( PatchUtil.M.patchSkipRegion ( skipCnt ) ) ) ; table.setWidget ( row , 1 , skipPanel ) ; }

Target:
private void appendSkipLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int skipCnt ) { m.openTr ( ) ; m.openTd ( ) ; m.setStyleName ( com.google.gerrit.client.patches.S_ICON_CELL ) ; m.nbsp ( ) ; m.closeTd ( ) ; m.openTd ( ) ; m.setStyleName ( "SkipLine" ) ; m.setAttribute ( "colspan" , 4 ) ; m.append ( PatchUtil.M.patchSkipRegion ( skipCnt ) ) ; m.closeTd ( ) ; m.closeTr ( ) ; }
Source:
private static boolean isNoteDbTestEnabled ( ) { final java.lang.String [ ] RUN_FLAGS = new java.lang.String [ ] { "yes" , "y" , "true" } ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( java.util.Arrays.asList ( RUN_FLAGS ) . contains ( value.toLowerCase ( ) ) ) ; }

Target:
protected PushOneCommit.Result createDraftChange ( ) throws java.lang.Exception { return pushTo ( "refs/drafts/master" ) ; }
Source:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }

Target:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }
Source:
public boolean issueExists ( java.lang.String issueKey ) throws com.atlassian.jira.rest.client.api.RestClientException { boolean ret = true ; try { getIssue ( issueKey ) ; } catch ( com.atlassian.jira.rest.client.api.RestClientException e ) { if ( ( e.getStatusCode ( ) . get ( ) ) == 404 ) { com.googlesource.gerrit.plugins.its.jira.JiraClient.log.error ( ( ( "Issue " + issueKey ) + " not found " ) ) ; ret = false ; } else { throw e ; } } return ret ; }

Target:
public com.googlesource.gerrit.plugins.its.jira.restapi.JiraProject [ ] getProjects ( ) throws java.io.IOException { return apiBuilder.getProjects ( ) . doGet ( "" , java.net.HttpURLConnection.HTTP_OK ) ; }
Source:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; return ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( CreateServiceUserCapability.ID ) ) ) ) || ( ctl.canAdministrateServer ( ) ) ; } else { return false ; } }

Target:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { return ( permissionBackend.user ( userProvider ) . testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , CreateServiceUserCapability.ID ) ) ) || ( permissionBackend.user ( userProvider ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ; } else { return false ; } }
Source:
public com.google.gerrit.server.project.ProjectControl validateFor ( final com.google.gerrit.client.reviewdb.Project.NameKey nameKey ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectControl c = controlFor ( nameKey ) ; if ( ! ( c.isVisible ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return c ; }

Target:
public com.google.gerrit.server.project.ProjectControl validateFor ( final com.google.gerrit.client.reviewdb.Project.NameKey nameKey , final int need ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectControl c = controlFor ( nameKey ) ; if ( ( ( need & ( com.google.gerrit.server.project.ProjectControl.VISIBLE ) ) == ( com.google.gerrit.server.project.ProjectControl.VISIBLE ) ) && ( c.isVisible ( ) ) ) { return c ; } if ( ( ( need & ( com.google.gerrit.server.project.ProjectControl.OWNER ) ) == ( com.google.gerrit.server.project.ProjectControl.OWNER ) ) && ( c.isOwner ( ) ) ) { return c ; } throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; }
Source:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } }

Target:
void onExpandAllComments ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.expandAllComments ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.getCommentManager ( ) . setExpandAllComments ( prefs.expandAllComments ( ) ) ; } }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . project = info.projectNameKey ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
public boolean canUserDelete ( ) { switch ( com.google.gerrit.client.Gerrit.getConfig ( ) . getLoginType ( ) ) { case OPENID : if ( getExternalId ( ) . startsWith ( "Google Account " ) ) { return false ; } break ; case HTTP : if ( getExternalId ( ) . startsWith ( "gerrit:" ) ) { return false ; } break ; } return true ; }

Target:
public boolean isScheme ( final java.lang.String scheme ) { final java.lang.String id = getExternalId ( ) ; return ( id != null ) && ( id.startsWith ( scheme ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { if ( ( result.changes ( ) . length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , result.changes ( ) ) ; } }

Target:
public void onFailure ( java.lang.Throwable err ) { setTabTitle ( tabInfo , tabInfo.getTitle ( Resources.C.notAvailable ( ) ) ) ; getTab ( tabInfo ) . setError ( err.getMessage ( ) ) ; onDone ( true ) ; }
Source:
private static java.lang.String bytes ( double value ) { value /= 1024 ; java.lang.String suffix = "k" ; if ( value > 1024 ) { value /= 1024 ; suffix = "m" ; } if ( value > 1024 ) { value /= 1024 ; suffix = "g" ; } return java.lang.String.format ( "%1$6.2f%2$s" , value , suffix ) ; }

Target:
private static java.lang.String bytes ( double value ) { value /= 1024 ; java.lang.String suffix = "k" ; if ( value > 1024 ) { value /= 1024 ; suffix = "m" ; } if ( value > 1024 ) { value /= 1024 ; suffix = "g" ; } return java.lang.String.format ( "%1$6.2f%2$s" , value , suffix ) . trim ( ) ; }
Source:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = asAccountAttribute ( message.getAuthor ( ) ) ; a.message = message.getMessage ( ) ; return a ; }

Target:
public void addApprovals ( com.google.gerrit.server.events.PatchSetAttribute p , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > list ) { if ( ! ( list.isEmpty ( ) ) ) { p.approvals = new java.util.ArrayList < com.google.gerrit.server.events.ApprovalAttribute > ( list.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : list ) { if ( ( a.getValue ( ) ) != 0 ) { p.approvals.add ( asApprovalAttribute ( a ) ) ; } } if ( p.approvals.isEmpty ( ) ) { p.approvals = null ; } } }
Source:
public static boolean isDisabled ( org.eclipse.jgit.lib.Config cfg ) { return ( com.google.gerrit.server.config.GitwebConfig.isEmptyString ( cfg , "gitweb" , null , "url" ) ) || ( com.google.gerrit.server.config.GitwebConfig.isEmptyString ( cfg , "gitweb" , null , "cgi" ) ) ; }

Target:
public static boolean isDisabled ( org.eclipse.jgit.lib.Config cfg ) { return ( ( com.google.gerrit.server.config.GitwebConfig.isEmptyString ( cfg , "gitweb" , null , "url" ) ) || ( com.google.gerrit.server.config.GitwebConfig.isEmptyString ( cfg , "gitweb" , null , "cgi" ) ) ) || ( "disabled" . equals ( cfg.getString ( "gitweb" , null , "type" ) ) ) ; }
Source:
public void testRepositoryIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/repo" ) ; assertEquals ( Type.REPOSITORY_INDEX , view.getType ( ) ) ; assertEquals ( "repo" , view.getRepositoryName ( ) ) ; assertEquals ( Revision.NULL , view.getRevision ( ) ) ; assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; assertNull ( view.getPathPart ( ) ) ; }

Target:
public void repositoryIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/repo" ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , view.getType ( ) ) ; org.junit.Assert.assertEquals ( "repo" , view.getRepositoryName ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getRevision ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; org.junit.Assert.assertNull ( view.getPathPart ( ) ) ; }
Source:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetEditPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.EditPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultEditPreferences ( md , input ) ; accountCache.evictAllNoReindex ( ) ; return updatedPrefs ; } }

Target:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetEditPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.EditPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultEditPreferences ( md , input ) ; accountCache.evictAll ( ) ; return updatedPrefs ; } }
Source:
public static void rm ( org.eclipse.jgit.api.Git gApi , java.lang.String path ) throws org.eclipse.jgit.api.errors.GitAPIException { gApi.rm ( ) . addFilepattern ( path ) . call ( ) ; }

Target:
public static com.google.common.base.Optional < java.lang.String > getChangeId ( org.eclipse.jgit.junit.TestRepository < ? > tr , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit c = tr.getRevWalk ( ) . parseCommit ( id ) ; tr.getRevWalk ( ) . parseBody ( c ) ; java.util.List < java.lang.String > ids = c.getFooterLines ( FooterConstants.CHANGE_ID ) ; if ( ids.isEmpty ( ) ) { return com.google.common.base.Optional.absent ( ) ; } return com.google.common.base.Optional.of ( ids.get ( ( ( ids.size ( ) ) - 1 ) ) ) ; }
Source:
public static java.lang.String readFile ( java.io.File parentDir , java.lang.String name ) throws java.io.IOException { if ( parentDir == null ) { return null ; } java.io.File path = new java.io.File ( parentDir , name ) ; try ( java.io.FileInputStream in = new java.io.FileInputStream ( path ) ) { return new java.lang.String ( com.google.common.io.ByteStreams.toByteArray ( in ) , com.google.gerrit.httpd.HtmlDomUtil.ENC ) ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }

Target:
public static java.lang.String readFile ( java.nio.file.Path parentDir , java.lang.String name ) throws java.io.IOException { if ( parentDir == null ) { return null ; } java.nio.file.Path path = parentDir.resolve ( name ) ; try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( path ) ) { return new java.lang.String ( com.google.common.io.ByteStreams.toByteArray ( in ) , com.google.gerrit.httpd.HtmlDomUtil.ENC ) ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }
Source:
public com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo apply ( com.google.gerrit.server.project.ProjectResource resource ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo info = new com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo ( ) ; com.googlesource.gerrit.plugins.lfs.LfsProjectConfigSection config = lfsConfigFactory.getProjectsConfig ( ) . getForProject ( resource.getNameKey ( ) ) ; if ( config != null ) { info.enabled = config.isEnabled ( ) ; info.maxObjectSize = config.getMaxObjectSize ( ) ; } return info ; }

Target:
public com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo apply ( com.google.gerrit.server.project.ProjectResource resource ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo info = new com.googlesource.gerrit.plugins.lfs.LfsProjectConfigInfo ( ) ; com.googlesource.gerrit.plugins.lfs.LfsProjectConfigSection config = lfsConfigFactory.getProjectsConfig ( ) . getForProject ( resource.getNameKey ( ) ) ; if ( config != null ) { info.enabled = config.isEnabled ( ) ; info.maxObjectSize = config.getMaxObjectSize ( ) ; info.readOnly = config.isReadOnly ( ) ; info.backend = config.getBackend ( ) ; } return info ; }
Source:
private static void whoAmI ( ) { final java.lang.String name = com.google.gerrit.client.FormatUtil.nameEmail ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; final com.google.gwt.user.client.ui.MenuItem me = com.google.gerrit.client.Gerrit.menuBar.addItem ( name , ( ( com.google.gwt.user.client.Command ) ( null ) ) ) ; me.removeStyleName ( "gwt-MenuItem" ) ; me.addStyleName ( "gerrit-MenuBarUserName" ) ; }

Target:
private static void whoAmI ( ) { final java.lang.String name = com.google.gerrit.client.FormatUtil.nameEmail ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; final com.google.gwt.user.client.ui.InlineLabel l = new com.google.gwt.user.client.ui.InlineLabel ( name ) ; l.setStyleName ( "gerrit-MenuBarUserName" ) ; com.google.gerrit.client.Gerrit.menuRight.add ( l ) ; }
Source:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , Sp ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , Line ( body ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( popAsString ( ) , parse ( body ) ) ) ) ; }

Target:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , Sp ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , Line ( body ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( popAsString ( ) , com.google.gitiles.doc.GitilesMarkdown.parse ( body ) ) ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filterMatching ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > rights ) { java.util.List < com.google.gerrit.reviewdb.RefRight > result = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( ) ; for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( com.google.gerrit.server.project.RefControl.matches ( change.getDest ( ) . get ( ) , right.getRefPattern ( ) ) ) { result.add ( right ) ; } } return result ; }

Target:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; for ( com.google.gerrit.reviewdb.ApprovalCategory.Id category : approvalTypes.getApprovalCategories ( ) ) { com.google.gerrit.server.project.RefControl rc = pe.controlFor ( user ) . controlForRef ( change.getDest ( ) ) ; java.util.List < com.google.gerrit.reviewdb.RefRight > categoryRights = rc.getApplicableRights ( category ) ; computeAllowed ( am , categoryRights , category ) ; } }
Source:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( db , project , psId.getParentKey ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }

Target:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.createChecked ( db , project , psId.getParentKey ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }
Source:
public void testSubscriptionToDifferentBranches ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; pushChangeTo ( subRepo , "master" ) ; createSubscription ( superRepo , "master" , "subscribed-to-project" , "foo-1" ) ; pushChangeTo ( subRepo , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "foo-1" ) ; pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionToDifferentBranches ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; createSubscription ( superRepo , "master" , "subscribed-to-project" , "foo" ) ; org.eclipse.jgit.lib.ObjectId subFoo = pushChangeTo ( subRepo , "foo" ) ; pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subFoo ) ; }
Source:
private boolean isPolyGerritEnabled ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { java.lang.String param = req.getParameter ( "polygerrit" ) ; if ( "1" . equals ( param ) ) { return setPolyGerritCookie ( req , res , com.google.gerrit.httpd.raw.StaticModule.UiPreference.POLYGERRIT ) ; } else if ( "0" . equals ( param ) ) { return setPolyGerritCookie ( req , res , com.google.gerrit.httpd.raw.StaticModule.UiPreference.GWT ) ; } else { return isPolyGerritCookie ( req ) ; } }

Target:
private boolean isPolyGerritEnabled ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { if ( ! ( options.enableGwtUi ( ) ) ) { return true ; } java.lang.String param = req.getParameter ( "polygerrit" ) ; if ( "1" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiPreference.POLYGERRIT ) ; } else if ( "0" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiPreference.GWT ) ; } else { return isPolyGerritCookie ( req ) ; } }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void test ( ) { org.parboiled.support.ParsingResult < java.lang.String > result = new org.parboiled.parserunners.ReportingParseRunner < java.lang.String > ( parser.Expression ( ) ) . run ( "42" ) ; com.google.common.truth.Truth.assertThat ( result.hasErrors ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( org.parboiled.support.ParseTreeUtils.printNodeTree ( result ) ) . isEqualTo ( com.google.gerrit.server.util.ParboiledTest.EXPECTED ) ; }

Target:
public void test ( ) { org.parboiled.support.ParsingResult < java.lang.String > result = new org.parboiled.parserunners.ReportingParseRunner < java.lang.String > ( parser.Expression ( ) ) . run ( "42" ) ; com.google.common.truth.Truth.assertThat ( result.isSuccess ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( org.parboiled.support.ParseTreeUtils.printNodeTree ( result ) ) . isEqualTo ( com.google.gerrit.server.util.ParboiledTest.EXPECTED ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; java.io.File zip = new java.io.File ( new java.io.File ( gen , pkg ) , ( target + ".zip" ) ) ; synchronized ( this ) { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , ( ( ( "//" + pkg ) + ":" ) + target ) ) ; if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } chain.doFilter ( request , res ) ; }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; java.lang.String rule = ( ( "//" + pkg ) + ":" ) + target ; java.io.File zip = new java.io.File ( new java.io.File ( gen , pkg ) , ( target + ".zip" ) ) ; synchronized ( this ) { try { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , rule ) ; } catch ( com.google.gerrit.pgm.http.jetty.JettyServer.BuildFailureException e ) { displayFailure ( rule , e.why , ( ( javax.servlet.http.HttpServletResponse ) ( res ) ) ) ; return ; } if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } chain.doFilter ( request , res ) ; }
Source:
public void create ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForExistingCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; } allowPushOfTagsForNewCommits ( ) ; for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.OK ) ; } }

Target:
public void createTagForNewCommit ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowPushOnRefsTags ( ) ; pushTagForNewCommit ( tagType , Status.OK ) ; removePushFromRefsTags ( ) ; } }
Source:
public Account.Id lookup ( final java.lang.String accountName ) { return usernameCache.get ( accountName ) ; }

Target:
public Account.Id lookup ( java.lang.String accountName ) { if ( com.google.common.base.Strings.isNullOrEmpty ( accountName ) ) { return null ; } try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orNull ( ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }
Source:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }

Target:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( columns * ( cmA.defaultCharWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( columns * ( cmB.defaultCharWidth ( ) ) ) , Unit.PX ) ; }
Source:
public java.lang.Class < com.google.gwtorm.client.Schema > create ( ) throws com.google.gwtorm.client.OrmException { defineRelationClasses ( ) ; init ( ) ; implementRelationFields ( ) ; implementConstructor ( ) ; implementSequenceMethods ( ) ; implementRelationMethods ( ) ; cw.visitEnd ( ) ; classLoader.defineClass ( getImplClassName ( ) , cw.toByteArray ( ) ) ; return loadClass ( ) ; }

Target:
public java.lang.Class < com.google.gwtorm.client.Schema > create ( ) throws com.google.gwtorm.client.OrmException { defineRelationClasses ( ) ; init ( ) ; implementRelationFields ( ) ; implementConstructor ( ) ; implementSequenceMethods ( ) ; implementRelationMethods ( ) ; implementAllRelationsMethod ( ) ; cw.visitEnd ( ) ; classLoader.defineClass ( getImplClassName ( ) , cw.toByteArray ( ) ) ; return loadClass ( ) ; }
Source:
java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getChunkManager ( ) . diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
private static void extension ( final java.lang.String token ) { com.google.gerrit.client.api.ExtensionScreen view = new com.google.gerrit.client.api.ExtensionScreen ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ; if ( view.isFound ( ) ) { com.google.gerrit.client.Gerrit.display ( token , view ) ; } else { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "someError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.THROW_ORM_EXCEPTION ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; org.mockito.Mockito.verifyZeroInteractions ( indexer ) ; }

Target:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "someError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; setupPostMocks ( com.ericsson.gerrit.plugins.multimaster.SyncIndexRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.multimaster.SyncIndexRestApiServletTest.THROW_ORM_EXCEPTION ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; org.mockito.Mockito.verifyZeroInteractions ( indexer ) ; }
Source:
public void patchSetAction ( final com.google.gerrit.client.reviewdb.ApprovalCategoryValue.Id value , final com.google.gerrit.client.reviewdb.PatchSet.Id patchSetId , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > cb ) { final com.google.gerrit.client.reviewdb.ApprovalCategory.Id category = value.getParentKey ( ) ; if ( ( ApprovalCategory.SUBMIT.equals ( category ) ) && ( ( value.get ( ) ) == 1 ) ) { submitAction.create ( patchSetId ) . to ( cb ) ; } else { cb.onFailure ( new java.lang.IllegalArgumentException ( ( value + " not supported" ) ) ) ; } }

Target:
public void submit ( final com.google.gerrit.client.reviewdb.PatchSet.Id patchSetId , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.ChangeDetail > cb ) { submitAction.create ( patchSetId ) . to ( cb ) ; }
Source:
static com.google.gson.JsonObject getHTTPJsonObject ( java.lang.String url , boolean ignoreIOException ) { java.lang.String data = com.googlesource.gerrit.plugins.findowners.Util.getHTTP ( url , ignoreIOException ) ; return null == data ? new com.google.gson.JsonObject ( ) : new com.google.gson.JsonParser ( ) . parse ( data ) . getAsJsonObject ( ) ; }

Target:
static void addToMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String key , java.lang.String value ) { if ( ( map.get ( key ) ) == null ) { map.put ( key , new java.util.HashSet < > ( ) ) ; } map.get ( key ) . add ( value ) ; }
Source:
private void mkdir ( final java.io.File dir ) throws java.io.IOException { if ( ! ( dir.isDirectory ( ) ) ) { mkdir ( dir.getParentFile ( ) ) ; if ( ! ( dir.mkdir ( ) ) ) throw new java.io.IOException ( ( "Cannot mkdir " + ( dir.getAbsolutePath ( ) ) ) ) ; dir.deleteOnExit ( ) ; } }

Target:
private static void mkdir ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.isDirectory ( ) ) ) { com.google.gerrit.pgm.http.jetty.JettyServer.mkdir ( dir.getParentFile ( ) ) ; if ( ! ( dir.mkdir ( ) ) ) throw new java.io.IOException ( ( "Cannot mkdir " + ( dir.getAbsolutePath ( ) ) ) ) ; dir.deleteOnExit ( ) ; } }
Source:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }

Target:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }
Source:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; org.junit.Assert.assertEquals ( 1 , results.size ( ) ) ; results = query ( "status:closed" ) ; org.junit.Assert.assertTrue ( results.isEmpty ( ) ) ; }

Target:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 1 ) ; results = query ( "status:closed" ) ; com.google.common.truth.Truth.assertThat ( results.isEmpty ( ) ) . isTrue ( ) ; }
Source:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }

Target:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }
Source:
protected void onOpenItem ( final java.lang.Object item ) { if ( item instanceof com.google.gerrit.client.reviewdb.PatchLineComment ) { final com.google.gerrit.client.ui.ComplexDisclosurePanel p = ( ( com.google.gerrit.client.ui.ComplexDisclosurePanel ) ( table.getWidget ( getCurrentRow ( ) , 1 ) ) ) ; p.setOpen ( ( ! ( p.isOpen ( ) ) ) ) ; } }

Target:
protected void onOpenItem ( final java.lang.Object item ) { if ( item instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { for ( final com.google.gerrit.client.ui.ComplexDisclosurePanel p : ( ( com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) ( item ) ) . panels ) { p.setOpen ( ( ! ( p.isOpen ( ) ) ) ) ; } } }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.getControl ( ) , n.getPatchsetId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.getPatchsetId ( ) ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , ctl , psId ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + psId ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } }
Source:
protected int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
protected void logError ( java.lang.String name , java.lang.String type , java.lang.Object defaultValue , java.lang.Exception e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( "invalid value for{}; using default value {}" , name , defaultValue ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( "Failed retrieve value: {}" , type , e.getMessage ( ) , e ) ; }
Source:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; setApiUser ( user ) ; assertCreateFails ( com.google.gerrit.extensions.restapi.AuthException.class ) ; }
Source:
private java.lang.Runnable upToChange ( final boolean openReplyBox ) { return new java.lang.Runnable ( ) { public void run ( ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; } } ; }

Target:
public void onSuccess ( java.lang.Void result ) { goUpToChange ( openReplyBox ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }
Source:
private java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.BazelBuild.Label label ) { return new java.lang.ProcessBuilder ( "bazel" , "build" , label.fullName ( ) ) ; }

Target:
private java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.BazelBuild.Label label ) throws java.io.IOException { java.util.Properties properties = loadBuildProperties ( sourceRoot.resolve ( ".bazel_path" ) ) ; java.lang.String bazel = com.google.common.base.MoreObjects.firstNonNull ( properties.getProperty ( "bazel" ) , "bazel" ) ; java.lang.ProcessBuilder proc = new java.lang.ProcessBuilder ( bazel , "build" , label.fullName ( ) ) ; if ( properties.containsKey ( "PATH" ) ) { proc.environment ( ) . put ( "PATH" , properties.getProperty ( "PATH" ) ) ; } return proc ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . values ( ) ) { if ( id.equals ( accountId ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { if ( ( ! ( allowDrafts ) ) && ( ( object.change ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) ) { return false ; } for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . values ( ) ) { if ( id.equals ( accountId ) ) { return true ; } } return false ; }