auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.Collection < org.eclipse.jgit.lib.ObjectId > resolve ( org.eclipse.jgit.lib.AbbreviatedObjectId id ) { throw new java.lang.UnsupportedOperationException ( ) ; }

Target:
public java.util.Collection < org.eclipse.jgit.lib.ObjectId > resolve ( org.eclipse.jgit.lib.AbbreviatedObjectId id ) throws java.io.IOException { java.util.Set < org.eclipse.jgit.lib.ObjectId > result = new java.util.HashSet < > ( ) ; for ( org.eclipse.jgit.lib.ObjectId insId : inserted.keySet ( ) ) { if ( ( id.prefixCompare ( insId ) ) == 0 ) { result.add ( insId ) ; } } result.addAll ( reader.resolve ( id ) ) ; return result ; }
Source:
public void mergeByOtherNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "merged" , sc ) . notTo ( sc.reviewer , sc.ccer , sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOtherCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; setEmailStrategy ( other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . noOneElse ( ) ; }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { try { setHealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set healthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }

Target:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.server.project.SetDashboard.Input in = new com.google.gerrit.server.project.SetDashboard.Input ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.extensions.common.SetDashboardInput in = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }
Source:
public void starWithInvalidLabels ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = ( ( project.get ( ) ) + "~master~" ) + ( r.getChangeId ( ) ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "invalid labels: another invalid label, invalid label" ) ; gApi.accounts ( ) . self ( ) . setStars ( triplet , new com.google.gerrit.extensions.api.changes.StarsInput ( new java.util.HashSet ( java.util.Arrays.asList ( StarredChangesUtil.DEFAULT_LABEL , "invalid label" , "blue" , "another invalid label" ) ) ) ) ; }

Target:
public void starWithInvalidLabels ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = ( ( project.get ( ) ) + "~master~" ) + ( r.getChangeId ( ) ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "invalid labels: another invalid label, invalid label" ) ; gApi.accounts ( ) . self ( ) . setStars ( triplet , new com.google.gerrit.extensions.api.changes.StarsInput ( com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL , "invalid label" , "blue" , "another invalid label" ) ) ) ; }
Source:
protected void configure ( ) { 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.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:
public boolean canAbandon ( ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . isAdministrator ( ) ) ; }

Target:
public boolean canAbandon ( ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; }
Source:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( config ( description ) , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }

Target:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.google.gerrit.extensions.restapi.RestApiException { return createProject ( nameSuffix , parent , true ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Dispatcher.toGroup ( getGroupUUID ( ) , AccountGroupScreen.INFO ) ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.com.google.gerrit.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( newName ) ) ; groupNameTxt.setText ( newName ) ; if ( getGroupUUID ( ) . equals ( getOwnerGroupUUID ( ) ) ) { ownerTxt.setText ( newName ) ; } }
Source:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Callback done ) { java.util.LinkedList < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > suggestions = new java.util.LinkedList < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > ( ) ; for ( final com.google.gerrit.reviewdb.client.Branch b : branches ) { if ( ( b.getName ( ) . indexOf ( request.getQuery ( ) ) ) >= 0 ) { suggestions.add ( new com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion ( b ) ) ; } } done.onSuggestionsReady ( request , new com.google.gerrit.client.ui.Response ( suggestions ) ) ; }

Target:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Callback done ) { java.util.LinkedList < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > suggestions = new java.util.LinkedList < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > ( ) ; for ( final com.google.gerrit.client.projects.BranchInfo b : branches ) { if ( ( b.ref ( ) . indexOf ( request.getQuery ( ) ) ) >= 0 ) { suggestions.add ( new com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion ( b ) ) ; } } done.onSuggestionsReady ( request , new com.google.gerrit.client.ui.Response ( suggestions ) ) ; }
Source:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( options.forcePolyGerritDev ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } if ( p.isDev ( ) ) { return p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) ; } return ( p.warFs ) != null ? p.warFs.getPath ( "/polygerrit_ui" ) : p.unpackedWar.resolve ( "polygerrit_ui" ) ; }

Target:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( options.forcePolyGerritDev ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.sourceRoot ) != null ) , "no source root directory found for PolyGerrit developer mode" ) ; } if ( p.isDev ( ) ) { return p.sourceRoot.resolve ( "polygerrit-ui" ) . resolve ( "app" ) ; } return ( p.warFs ) != null ? p.warFs.getPath ( "/polygerrit_ui" ) : p.unpackedWar.resolve ( "polygerrit_ui" ) ; }
Source:
public void pushWithMultipleChangeIds ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with multiple Change-Id\n" + ( ( "\n" + "Change-Id: I10f98c2ef76e52e23aa23be5afeb71e40b350e86\n" ) + "Change-Id: Ie9a132e107def33bdd513b7854b50de911edba0a\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; }

Target:
private void testPushWithMultipleChangeIds ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with multiple Change-Id\n" + ( ( "\n" + "Change-Id: I10f98c2ef76e52e23aa23be5afeb71e40b350e86\n" ) + "Change-Id: Ie9a132e107def33bdd513b7854b50de911edba0a\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.accessToken = result.accessToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.authorization = result.authorization ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }
Source:
public void shouldFireEventsForReplicationSameRefDifferentProjects ( ) throws java.net.URISyntaxException { org.easymock.EasyMock.resetToDefault ( pushResultProcessingMock ) ; org.eclipse.jgit.transport.URIish uri = new org.eclipse.jgit.transport.URIish ( "git://host1/someRepo.git" ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "project1" , "ref1" , uri , RefPushResult.SUCCEEDED ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "project2" , "ref2" , uri , RefPushResult.SUCCEEDED ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "project1" , "ref1" , 1 ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "project2" , "ref2" , 1 ) ; pushResultProcessingMock.onAllRefsReplicatedToAllNodes ( 2 ) ; org.easymock.EasyMock.replay ( pushResultProcessingMock ) ; replicationState.increasePushTaskCount ( "project1" , "ref1" ) ; replicationState.increasePushTaskCount ( "project2" , "ref2" ) ; replicationState.markAllPushTasksScheduled ( ) ; replicationState.notifyRefReplicated ( "project1" , "ref1" , uri , RefPushResult.SUCCEEDED ) ; replicationState.notifyRefReplicated ( "project2" , "ref2" , uri , RefPushResult.SUCCEEDED ) ; org.easymock.EasyMock.verify ( pushResultProcessingMock ) ; }

Target:
public void shouldFireEventsForReplicationSameRefDifferentProjects ( ) throws java.net.URISyntaxException { org.easymock.EasyMock.resetToDefault ( pushResultProcessingMock ) ; org.eclipse.jgit.transport.URIish uri = new org.eclipse.jgit.transport.URIish ( "git://host1/someRepo.git" ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "project1" , "ref1" , uri , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "project2" , "ref2" , uri , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "project1" , "ref1" , 1 ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "project2" , "ref2" , 1 ) ; pushResultProcessingMock.onAllRefsReplicatedToAllNodes ( 2 ) ; org.easymock.EasyMock.replay ( pushResultProcessingMock ) ; replicationState.increasePushTaskCount ( "project1" , "ref1" ) ; replicationState.increasePushTaskCount ( "project2" , "ref2" ) ; replicationState.markAllPushTasksScheduled ( ) ; replicationState.notifyRefReplicated ( "project1" , "ref1" , uri , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; replicationState.notifyRefReplicated ( "project2" , "ref2" , uri , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; org.easymock.EasyMock.verify ( pushResultProcessingMock ) ; }
Source:
private void removeRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.remove ( cfg , GlobalCapability.RUN_AS , com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }

Target:
private void removeRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.remove ( cfg , GlobalCapability.RUN_AS , systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }
Source:
public com.google.gerrit.server.plugins.ListPlugins.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) { java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return new com.google.gerrit.server.plugins.ListPlugins.PluginInfo ( loader.get ( name ) ) ; }

Target:
public com.google.gerrit.server.plugins.ListPlugins.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote plugin administration is disabled" ) ; } java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return new com.google.gerrit.server.plugins.ListPlugins.PluginInfo ( loader.get ( name ) ) ; }
Source:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.LabelInfo cr = getChange ( r ) . labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "User" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }

Target:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }
Source:
public void legacyAdapterCanParseOutputOfNewAdapter ( ) { java.lang.String instantJson = gson.toJson ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; com.google.common.truth.Truth.assertThat ( instantJson ) . isEqualTo ( ( ( '"' + ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_STR ) ) + '"' ) ) ; com.google.common.truth.Truth.assertThat ( legacyGson.fromJson ( instantJson , java.sql.Timestamp.class ) ) . isEqualTo ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; }

Target:
public void legacyAdapterCanParseOutputOfNewAdapter ( ) { java.lang.String instantJson = gson.toJson ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; com.google.common.truth.Truth.assertThat ( instantJson ) . isEqualTo ( ( ( '"' + ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_STR_TRUNC ) ) + '"' ) ) ; java.sql.Timestamp result = legacyGson.fromJson ( instantJson , java.sql.Timestamp.class ) ; com.google.common.truth.Truth.assertThat ( result ) . isEqualTo ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS_TRUNC ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( ) . start ( start ) . run ( ) ; super . onFailure ( caught ) ; }

Target:
private void deleteBranches ( final java.util.Set < java.lang.String > branches ) { com.google.gerrit.client.projects.ProjectApi.deleteBranches ( getProjectKey ( ) , branches , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( match ) . start ( start ) . run ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( match ) . start ( start ) . run ( ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public void run ( ) { clearSkipBars ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; renderSkips ( prefs.context ( ) ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void parseChangeId ( ) 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 ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Change-id: I159532ef4844d7c18f7f3fd37a0b275590d41b1b" ) ) ) ; }

Target:
public void parseChangeId ( ) 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 ( ( "Update change\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Change-id: I159532ef4844d7c18f7f3fd37a0b275590d41b1b" ) ) ) ; }
Source:
private com.google.gerrit.server.git.MetaDataUpdate newMetaDataUpdate ( ) { com.google.gerrit.server.git.MetaDataUpdate u = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo , null ) ; org.eclipse.jgit.lib.PersonIdent author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "author@example.com" , com.google.gerrit.common.TimeUtil.nowTs ( ) , com.google.gerrit.server.git.VersionedMetaDataTest.TZ ) ; u.getCommitBuilder ( ) . setAuthor ( author ) ; u.getCommitBuilder ( ) . setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( "M. Committer" , "committer@example.com" , author.getWhen ( ) , author.getTimeZone ( ) ) ) ; return u ; }

Target:
private com.google.gerrit.server.git.MetaDataUpdate newMetaDataUpdate ( @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.BatchRefUpdate bru ) { com.google.gerrit.server.git.MetaDataUpdate u = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo , bru ) ; org.eclipse.jgit.lib.CommitBuilder cb = newCommitBuilder ( ) ; u.getCommitBuilder ( ) . setAuthor ( cb.getAuthor ( ) ) ; u.getCommitBuilder ( ) . setCommitter ( cb.getCommitter ( ) ) ; return u ; }
Source:
public void init ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceivePack rp ) { rp.setPreReceiveHook ( org.eclipse.jgit.transport.PreReceiveHookChain.newChain ( com.google.common.collect.Lists.newArrayList ( hook , rp.getPreReceiveHook ( ) ) ) ) ; }

Target:
public void init ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceivePack rp ) { rp.setSignedPushConfig ( signedPushConfig ) ; if ( ( signedPushConfig ) != null ) { rp.setPreReceiveHook ( org.eclipse.jgit.transport.PreReceiveHookChain.newChain ( com.google.common.collect.Lists.newArrayList ( hook , rp.getPreReceiveHook ( ) ) ) ) ; } }
Source:
void openCloseAll ( ) { boolean open = false ; for ( int i = 0 ; i < ( getBoxCount ( ) ) ; i ++ ) { if ( ! ( getCommentBox ( i ) . isOpen ( ) ) ) { open = true ; break ; } } for ( int i = 0 ; i < ( getBoxCount ( ) ) ; i ++ ) { getCommentBox ( i ) . setOpen ( open ) ; } }

Target:
void openCloseAll ( ) { boolean open = false ; for ( int i = 0 ; i < ( getBoxCount ( ) ) ; i ++ ) { if ( ! ( getCommentBox ( i ) . isOpen ( ) ) ) { open = true ; break ; } } setOpenAll ( open ) ; }
Source:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , whitespace ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , BaseParser.ANY , body.append ( matchedChar ( ) ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( ( ( com.google.gitiles.doc.DivNode.Style ) ( pop ( ) ) ) , parse ( body ) . getChildren ( ) ) ) ) ; }

Target:
public org.parboiled.Rule typeOfNote ( ) { return firstOf ( sequence ( string ( "note" ) , push ( match ( ) ) ) , sequence ( string ( "promo" ) , push ( match ( ) ) ) , sequence ( string ( "aside" ) , push ( match ( ) ) ) ) ; }
Source:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.append ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) , new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.gerrit.acceptance.pgm.RebuildNotedbIT.runGerrit ( "RebuildNotedb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }

Target:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.append ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) , new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( matches ( right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }

Target:
public com.google.gerrit.common.data.PermissionRange getRange ( java.lang.String permission ) { if ( com.google.gerrit.common.data.Permission.isLabel ( permission ) ) { return com.google.gerrit.server.project.RefControl.toRange ( permission , access ( permission ) ) ; } return null ; }
Source:
private void deleteRef ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( change.getId ( ) ) ; com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > old = cmds.get ( refName ) ; if ( old.isPresent ( ) ) { cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old.get ( ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; } }

Target:
private void deleteChangeMetaRef ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( change.getId ( ) ) ; com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > old = cmds.get ( refName ) ; if ( old.isPresent ( ) ) { cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old.get ( ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; } }
Source:
protected void execute ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String sql ) throws java.sql.SQLException { java.sql.Statement s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { s.execute ( sql ) ; } finally { s.close ( ) ; } }

Target:
protected static void execute ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String sql ) throws java.sql.SQLException { try ( java.sql.Statement s = com.google.gerrit.server.schema.SchemaVersion.newStatement ( db ) ) { s.execute ( sql ) ; } }
Source:
private void defaultTo ( ) throws javax.mail.MessagingException { add ( RecipientType.TO , change.getOwner ( ) ) ; if ( ( patchSet ) != null ) { add ( RecipientType.TO , patchSet.getUploader ( ) ) ; } if ( ( patchSetInfo ) != null ) { add ( RecipientType.TO , patchSetInfo.getAuthor ( ) ) ; add ( RecipientType.TO , patchSetInfo.getCommitter ( ) ) ; } if ( ( fromId ) != null ) { add ( RecipientType.CC , fromId ) ; } }

Target:
private void ccSender ( ) throws javax.mail.MessagingException { if ( ( fromId ) != null ) { add ( RecipientType.CC , fromId ) ; } }
Source:
private static com.google.gerrit.client.reviewdb.SystemConfig.LoginType toType ( final org.spearce.jgit.lib.Config cfg ) { java.lang.String type = cfg.getString ( "auth" , null , "type" ) ; if ( type == null ) { return com.google.gerrit.client.reviewdb.SystemConfig.LoginType.OPENID ; } for ( com.google.gerrit.client.reviewdb.SystemConfig.LoginType t : com.google.gerrit.client.reviewdb.SystemConfig.LoginType.values ( ) ) { if ( type.equalsIgnoreCase ( t.name ( ) ) ) { return t ; } } throw new java.lang.IllegalStateException ( ( "Unsupported auth.type: " + type ) ) ; }

Target:
private static com.google.gerrit.client.reviewdb.LoginType toType ( final org.spearce.jgit.lib.Config cfg ) { if ( com.google.gerrit.server.config.AuthConfig.isBecomeAnyoneEnabled ( ) ) { return com.google.gerrit.client.reviewdb.LoginType.DEVELOPMENT_BECOME_ANY_ACCOUNT ; } java.lang.String type = cfg.getString ( "auth" , null , "type" ) ; if ( type == null ) { return com.google.gerrit.client.reviewdb.LoginType.OPENID ; } for ( com.google.gerrit.client.reviewdb.LoginType t : com.google.gerrit.client.reviewdb.LoginType.values ( ) ) { if ( type.equalsIgnoreCase ( t.name ( ) ) ) { return t ; } } throw new java.lang.IllegalStateException ( ( "Unsupported auth.type: " + type ) ) ; }
Source:
private void beforeTest ( org.eclipse.jgit.lib.Config cfg , boolean memory ) throws java.lang.Exception { server = startServer ( cfg , memory ) ; server.getTestInjector ( ) . injectMembers ( this ) ; admin = accounts.admin ( ) ; adminSession = new com.google.gerrit.acceptance.RestSession ( server , admin ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( admin ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { return gApi.changes ( ) . id ( id ) . get ( ) ; }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
private com.google.gerrit.server.git.validators.CommitValidators forGerritCommits ( com.google.gerrit.server.project.RefControl refControl , com.google.gerrit.server.ssh.SshInfo sshInfo , org.eclipse.jgit.lib.Repository repo ) { return new com.google.gerrit.server.git.validators.CommitValidators ( com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.CommitValidators.UploadMergesPermissionValidator ( refControl ) , new com.google.gerrit.server.git.validators.CommitValidators.AmendedGerritMergeCommitValidationListener ( refControl , gerritIdent ) , new com.google.gerrit.server.git.validators.CommitValidators.AuthorUploaderValidator ( refControl , canonicalWebUrl ) , new com.google.gerrit.server.git.validators.CommitValidators.SignedOffByValidator ( refControl ) , new com.google.gerrit.server.git.validators.CommitValidators.ChangeIdValidator ( refControl , canonicalWebUrl , installCommitMsgHookCommand , sshInfo ) , new com.google.gerrit.server.git.validators.CommitValidators.ConfigValidator ( refControl , repo , allUsers ) , new com.google.gerrit.server.git.validators.CommitValidators.PluginCommitValidationListener ( pluginValidators ) ) ) ; }

Target:
private com.google.gerrit.server.git.validators.CommitValidators forGerritCommits ( com.google.gerrit.server.project.RefControl refControl , com.google.gerrit.server.ssh.SshInfo sshInfo , org.eclipse.jgit.lib.Repository repo ) { return new com.google.gerrit.server.git.validators.CommitValidators ( com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.CommitValidators.UploadMergesPermissionValidator ( refControl ) , new com.google.gerrit.server.git.validators.CommitValidators.AmendedGerritMergeCommitValidationListener ( refControl , gerritIdent ) , new com.google.gerrit.server.git.validators.CommitValidators.AuthorUploaderValidator ( refControl , canonicalWebUrl ) , new com.google.gerrit.server.git.validators.CommitValidators.SignedOffByValidator ( refControl ) , new com.google.gerrit.server.git.validators.CommitValidators.ChangeIdValidator ( refControl , canonicalWebUrl , installCommitMsgHookCommand , sshInfo ) , new com.google.gerrit.server.git.validators.CommitValidators.ConfigValidator ( refControl , repo , allUsers ) , new com.google.gerrit.server.git.validators.CommitValidators.PluginCommitValidationListener ( pluginValidators ) , new com.google.gerrit.server.git.validators.CommitValidators.BlockExternalIdUpdateListener ( allUsers ) ) ) ; }
Source:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits ( java.util.List < java.lang.String > hashes ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits = new java.util.ArrayList < > ( hashes.size ( ) ) ; for ( java.lang.String s : hashes ) { commits.add ( com.google.gerrit.server.query.change.InternalChangeQuery.commit ( s ) ) ; } return commits ; }

Target:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits ( java.util.Collection < java.lang.String > hashes ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits = new java.util.ArrayList < > ( hashes.size ( ) ) ; for ( java.lang.String s : hashes ) { commits.add ( com.google.gerrit.server.query.change.InternalChangeQuery.commit ( s ) ) ; } return commits ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { new com.google.gerrit.client.ErrorDialog ( caught.getMessage ( ) ) { @ java.lang.Override public void setText ( final java.lang.String t ) { } } . center ( ) ; enableForm ( true ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { final com.google.gwt.user.client.ui.Anchor projectLink = new com.google.gwt.user.client.ui.Anchor ( k.name ( ) ) ; projectLink.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { sugestParent.setText ( getRowItem ( row ) . name ( ) ) ; } } ) ; table.setWidget ( row , 1 , projectLink ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( accountId == null ) { throw parseException ( "patch set %s requires an identified user as uploader" , psId.get ( ) ) ; } if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , ts , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }

Target:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Account.Id realAccountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( accountId == null ) { throw parseException ( "patch set %s requires an identified user as uploader" , psId.get ( ) ) ; } if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , realAccountId , ts , line ) ; } else { parseAddApproval ( psId , accountId , realAccountId , ts , line ) ; } }
Source:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }

Target:
public void byAuthor ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) , userId ) ; assertQuery ( "author:jauthor@example.com" , change1 ) ; assertQuery ( "author:jauthor" , change1 ) ; assertQuery ( "author:example" , change1 ) ; assertQuery ( "author:example.com" , change1 ) ; assertQuery ( "author:Author" , change1 ) ; assertQuery ( "author:jAuThOr" , change1 ) ; assertQuery ( "author:ExAmPlE" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }
Source:
private com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resourceOf ( java.lang.String resourcePath ) { java.io.File file = getResourceFile ( resourcePath ) ; if ( ( file.exists ( ) ) && ( ( file.length ( ) ) > 0 ) ) { return com.google.common.base.Optional.of ( new com.google.gerrit.server.plugins.PluginEntry ( resourcePath , file.lastModified ( ) , file.length ( ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { return webScanner.getEntry ( resourcePath ) ; }
Source:
public com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , T newItem ) { if ( items.replace ( np , item , newItem ) ) { return new ReloadableHandle ( np , newKey , newItem ) ; } return null ; }

Target:
public com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { if ( items.replace ( np , item , newItem ) ) { return new ReloadableHandle ( np , newKey , newItem ) ; } return null ; }
Source:
public static boolean matches ( java.lang.String refName , java.lang.String refPattern ) { if ( refPattern.endsWith ( "/*" ) ) { java.lang.String prefix = refPattern.substring ( 0 , ( ( refPattern.length ( ) ) - 1 ) ) ; return refName.startsWith ( prefix ) ; } else { return refName.equals ( refPattern ) ; } }

Target:
private static boolean isTemplate ( java.lang.String refPattern ) { return 0 <= ( refPattern.indexOf ( "${" ) ) ; }
Source:
private void ensureAuthenticatedAndPermitted ( com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { ensureAuthenticated ( ) ; ensurePermitted ( changeControl ) ; }

Target:
private void assertCanEdit ( com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( changeControl.getNotes ( ) ) . check ( ChangePermission.ADD_PATCH_SET ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }
Source:
public void remove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void remove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key1 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void 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" ) ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { final int ctx = settings.getContext ( ) ; return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = settings.getContext ( ) ; if ( ctx == ( WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }
Source:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } finally { statesCleanUp ( ) ; } }

Target:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new java.lang.RuntimeException ( e ) ; } finally { statesCleanUp ( ) ; } }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( accountCache , accounts , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( accountCache , accounts , emails , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }