auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run ( ) { if ( ! ( cm.isClean ( generation ) ) ) { java.lang.String text = cm.getValue ( ) ; final int g = cm.changeGeneration ( false ) ; com.google.gerrit.client.changes.ChangeEditApi.put ( revision.getParentKey ( ) . get ( ) , path , text , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { generation = g ; save.setEnabled ( ( ! ( cm.isClean ( g ) ) ) ) ; } } ) ; } }

Target:
public void run ( ) { if ( ! ( cm.isClean ( generation ) ) ) { java.lang.String text = cm.getValue ( ) ; final int g = cm.changeGeneration ( false ) ; com.google.gerrit.client.changes.ChangeEditApi.put ( revision.getParentKey ( ) . get ( ) , path , text , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { generation = g ; setClean ( cm.isClean ( g ) ) ; } } ) ; } }
Source:
private boolean canDelete ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return ( ( isOwner ( ) ) && ( refControl.canDeleteOwnChanges ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; case MERGED : default : return false ; } }

Target:
private boolean canDelete ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return ( ( isOwner ( ) ) && ( refControl.canPerform ( Permission.DELETE_OWN_CHANGES ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; case MERGED : default : return false ; } }
Source:
public int getIssuePatternGroupIndex ( ) { java.util.regex.Pattern pattern = getIssuePattern ( ) ; int groupCount = pattern.matcher ( "" ) . groupCount ( ) ; int index = gerritConfig.getInt ( pluginName , "commentlinkGroupIndex" , 1 ) ; if ( ( index < 0 ) || ( index > groupCount ) ) { index = ( groupCount == 0 ) ? 0 : 1 ; } return index ; }

Target:
private java.lang.String getPluginConfigString ( java.lang.String key ) { return getCurrentPluginConfig ( ) . getString ( key , gerritConfig.getString ( com.googlesource.gerrit.plugins.its.base.its.ItsConfig.PLUGIN , pluginName , key ) ) ; }
Source:
public void testCreateGroup ( ) throws java.lang.Exception { final java.lang.String newGroupName = "newGroup" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.server.group.GroupJson.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; org.junit.Assert.assertEquals ( newGroupName , g.name ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; org.junit.Assert.assertNotNull ( group ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }

Target:
public void testCreateGroup ( ) throws java.lang.Exception { final java.lang.String newGroupName = "newGroup" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.server.group.GroupJson.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }
Source:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return ( diffScreenType ) == ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.UNIFIED_DIFF ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , patchSetId , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toSideBySide ( base , patchSetId , info.path ( ) ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return ( diffScreenType ) == ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.UNIFIED_DIFF ) ? com.google.gerrit.client.Dispatcher.toUnified ( projectKey , base , patchSetId , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toSideBySide ( projectKey , base , patchSetId , info.path ( ) ) ; }
Source:
private void deleteFile ( java.io.File f ) { if ( ! ( f.delete ( ) ) ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.warn ( ( ( ( "Cannot delete file " + ( f.getName ( ) ) ) + " from cache " ) + ( dir.getAbsolutePath ( ) ) ) ) ; } }

Target:
private void deleteFile ( java.io.File f ) { if ( ( f.exists ( ) ) && ( ! ( f.delete ( ) ) ) ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.warn ( ( ( ( "Cannot delete file " + ( f.getName ( ) ) ) + " from cache " ) + ( dir.getAbsolutePath ( ) ) ) ) ; } }
Source:
private static void runGerrit ( java.lang.String ... args ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.launcher.GerritLauncher.mainImpl ( args ) ) . isEqualTo ( 0 ) ; }

Target:
private void migrate ( java.lang.String ... additionalArgs ) throws java.lang.Exception { java.lang.String [ ] args = java.util.stream.Stream.concat ( java.util.stream.Stream.of ( "migrate-to-note-db" , "-d" , site.toString ( ) , "--show-stack-trace" ) , java.util.stream.Stream.of ( additionalArgs ) ) . toArray ( java.lang.String [ ] :: new ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.launcher.GerritLauncher.mainImpl ( args ) ) . isEqualTo ( 0 ) ; }
Source:
void setEnabled ( final boolean enabled ) { this . enabled = enabled ; for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; row ++ ) { final com.google.gerrit.client.groups.MemberInfo i = getRowItem ( row ) ; if ( i != null ) { ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( row , 1 ) ) ) . setEnabled ( enabled ) ; } } }

Target:
void setEnabled ( final boolean enabled ) { this . enabled = enabled ; for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; row ++ ) { final com.google.gerrit.client.account.AccountInfo i = getRowItem ( row ) ; if ( i != null ) { ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( row , 1 ) ) ) . setEnabled ( enabled ) ; } } }
Source:
public void testCreateProjectApi ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( newProjectName ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProject ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( newProjectName ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
public java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; if ( meEnd > 0 ) { return state ( request ) . substring ( ( meEnd + 1 ) ) ; } else { return "" ; } }

Target:
public static java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; if ( meEnd > 0 ) { return com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . substring ( ( meEnd + 1 ) ) ; } else { return "" ; } }
Source:
private static java.lang.String asString ( final java.io.InputStream in ) throws java.io.IOException , java.io.UnsupportedEncodingException { try { final java.lang.StringBuilder w = new java.lang.StringBuilder ( ) ; final java.io.InputStreamReader r = new java.io.InputStreamReader ( in , com.google.gerrit.httpd.HtmlDomUtil.ENC ) ; final char [ ] buf = new char [ 512 ] ; int n ; while ( ( n = r.read ( buf ) ) > 0 ) { w.append ( buf , 0 , n ) ; } return w.toString ( ) ; } finally { in.close ( ) ; } }

Target:
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 ) ; } }
Source:
private void setSubmitType ( com.google.gerrit.reviewdb.client.Project.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.acceptance.rest.change.ProjectConfigInput in = new com.google.gerrit.acceptance.rest.change.ProjectConfigInput ( ) ; in.submit_type = submitType ; in.use_content_merge = com.google.gerrit.reviewdb.client.Project.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = session.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
private void setSubmitType ( com.google.gerrit.reviewdb.client.Project.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.reviewdb.client.Project.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = session.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ModuleGenerator.class ) . to ( com.google.gerrit.sshd.SshAutoRegisterModuleGenerator.class ) ; bind ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ModuleGenerator.class ) . to ( com.google.gerrit.sshd.SshAutoRegisterModuleGenerator.class ) ; bind ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . toInstance ( com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.registerInParentInjectors ( ) ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }
Source:
private static boolean fail ( final java.lang.String username , final org.apache.sshd.server.session.ServerSession session , final java.lang.String err ) { session.setAttribute ( com.google.gerrit.sshd.SshUtil.AUTH_ATTEMPTED_AS , username ) ; session.setAttribute ( com.google.gerrit.sshd.SshUtil.AUTH_ERROR , err ) ; return false ; }

Target:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.server.account.AccountState state ) { return userFactory.create ( AccessPath.SSH , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , state.getAccount ( ) . getId ( ) ) ; }
Source:
public void indexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }

Target:
public void indexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.index.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerResource rsrc , java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gwtorm.server.OrmException { return format ( new com.google.gerrit.server.change.ReviewerJson.ReviewerInfo ( rsrc.getUser ( ) . getAccountId ( ) ) , rsrc.getUserControl ( ) , approvals ) ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerResource rsrc , java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gwtorm.server.OrmException { return format ( new com.google.gerrit.server.change.ReviewerJson.ReviewerInfo ( rsrc.getUser ( ) . getAccountId ( ) ) , rsrc.getNotes ( ) , rsrc.getUserControl ( ) , approvals ) ; }
Source:
private void createEditReference ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.PatchSet basePatchSet , org.eclipse.jgit.lib.ObjectId newEditCommit , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = changeControl.getChange ( ) ; java.lang.String editRefName = getEditRefName ( change , basePatchSet ) ; updateReference ( repository , editRefName , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , newEditCommit , timestamp ) ; reindex ( change ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > optionalChangeEdit , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gwtorm.server.OrmException { java.util.Optional < com.google.gerrit.reviewdb.client.PatchSet > editBasePatchSet = optionalChangeEdit.map ( ChangeEdit :: getBasePatchSet ) ; return editBasePatchSet.isPresent ( ) ? editBasePatchSet.get ( ) : lookupCurrentPatchSet ( changeControl ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { if ( canSubmit ) { if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; renderSubmitType ( result.asString ( ) ) ; }

Target:
private void renderSubmitType ( com.google.gerrit.reviewdb.client.Change.Status status , boolean canSubmit , com.google.gerrit.extensions.client.SubmitType submitType ) { if ( canSubmit && ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; submitActionText.setInnerText ( com.google.gerrit.client.admin.Util.toLongString ( submitType ) ) ; }
Source:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { return ! ( that.match ( object ) ) ; }

Target:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( that.isMatchable ( ) , ( "match invoked, but child predicate %s " + "doesn't implement %s" ) , that , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; return ! ( that.asMatchable ( ) . match ( object ) ) ; }
Source:
public void testOwnerProject ( ) { grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.OWN , admin , "refs/*" , 1 ) ; com.google.gerrit.server.project.ProjectControl uBlah = user ( devs ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( devs , admin ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testOwnerProject ( ) { grant ( local , com.google.gerrit.common.data.Permission.OWNER , admin , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = user ( devs ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( devs , admin ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }
Source:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }

Target:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { deny ( project , permission , id , ref ) ; }
Source:
private void doGeneratePassword ( ) { if ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) ) != null ) { enableUI ( false ) ; com.google.gerrit.client.account.AccountApi.generateHttpPassword ( "self" , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString newPassword ) { display ( newPassword.asString ( ) ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }

Target:
private void doGeneratePassword ( ) { if ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . username ( ) ) != null ) { enableUI ( false ) ; com.google.gerrit.client.account.AccountApi.generateHttpPassword ( "self" , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString newPassword ) { display ( newPassword.asString ( ) ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }
Source:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch , final com.google.gerrit.client.patches.PatchScreen.Type screenType ) { if ( com.google.gerrit.client.Dispatcher.isChangeScreen2 ( ) ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ; } return screenType == ( PatchScreen.Type.UNIFIED ) ; }

Target:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch , final com.google.gerrit.client.patches.PatchScreen.Type screenType ) { if ( com.google.gerrit.client.Dispatcher.isChangeScreen2 ( ) ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ) ; } return screenType == ( PatchScreen.Type.UNIFIED ) ; }
Source:
private void assertNoProblems ( com.google.gerrit.server.project.ChangeControl ctl , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix ) { com.google.common.truth.Truth.assertThat ( checker.check ( ctl , fix ) . problems ( ) ) . isEmpty ( ) ; }

Target:
private void assertProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( controlForNotes ( notes ) , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
void onSaveSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }

Target:
void onSaveSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; me.setSshUserName ( result.getSshUserName ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }
Source:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions , 1 ) ; }

Target:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 3 ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "description" ) ; }
Source:
public void addRelatedLink ( java.lang.String issueId , java.net.URL relatedUrl , java.lang.String description ) throws java.io.IOException { HEAD ( ( ( 22.0 - ( java ) ) - ( format ) ) ) ; log.debug ( "addRelatedLink({},{},{})" , new java.lang.Object [ ] { issueId , relatedUrl , description } ) ; }

Target:
public void addRelatedLink ( java.lang.String issueId , java.net.URL relatedUrl , java.lang.String description ) throws java.io.IOException { if ( log.isDebugEnabled ( ) ) { log.debug ( "addRelatedLink({},{},{})" , issueId , relatedUrl , description ) ; } }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final java.lang.String newOwner = ownerTxt.getText ( ) . trim ( ) ; if ( ( newOwner.length ( ) ) > 0 ) { Util.PROJECT_SVC.changeProjectOwner ( projectId , newOwner , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveOwner.setEnabled ( false ) ; } } ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String newOwner = ownerTxt.getText ( ) . trim ( ) ; if ( ( newOwner.length ( ) ) > 0 ) { Util.PROJECT_SVC.changeProjectOwner ( projectId , newOwner , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveOwner.setEnabled ( false ) ; } } ) ; } }
Source:
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" ) ; }

Target:
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" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public static void main ( final java.lang.String [ ] argv ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException , java.net.SocketException { com.google.gerrit.server.ssh.GerritSshDaemon.startSshd ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = createSshInjector ( sysInjector ) ; sysInjector.getInstance ( com.google.gerrit.server.cache.CachePool.class ) . start ( ) ; sshInjector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public void run ( ) { if ( cmSrc.hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.LineCharacter.create ( lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.getActiveLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }

Target:
public void run ( ) { if ( ( cm.hasActiveLine ( ) ) && ( ( toLeft && ( cm == ( cmB ) ) ) || ( ( ! toLeft ) && ( cm == ( cmA ) ) ) ) ) { net.codemirror.lib.CodeMirror other = otherCm ( cm ) ; other.setCursor ( net.codemirror.lib.LineCharacter.create ( mapper.lineOnOther ( getSideFromCm ( cm ) , cm.getLineNumber ( cm.getActiveLine ( ) ) ) . getLine ( ) ) ) ; other.focus ( ) ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChangeMessages ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byChange ( notes.getChangeId ( ) ) ) ; } else { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( notes.load ( ) . getChangeMessages ( ) . values ( ) ) ; } }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byChange ( notes.getChangeId ( ) ) ) ; } else { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( notes.load ( ) . getChangeMessages ( ) . values ( ) ) ; } }
Source:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { org.junit.Assert.assertTrue ( ( "missing group " + g ) , actual.remove ( g ) ) ; } org.junit.Assert.assertTrue ( ( "unexpected groups: " + actual ) , actual.isEmpty ( ) ) ; }

Target:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "unexpected groups: " + actual ) ) . that ( ( ( java.lang.Iterable < ? > ) ( actual ) ) ) . isEmpty ( ) ; }
Source:
private void preMerge ( ) throws com.google.gerrit.server.git.MergeException , com.google.gwtorm.server.OrmException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } }

Target:
private void preMerge ( final com.google.gerrit.server.git.SubmitStrategy strategy ) throws com.google.gerrit.server.git.MergeException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }
Source:
private void doList ( ) throws com.google.gerrit.extensions.restapi.RestApiException { for ( java.lang.String name : cacheNames ( ) ) { stderr.print ( name ) ; stderr.print ( '\n' ) ; } stderr.flush ( ) ; }

Target:
private void doList ( ) { for ( java.lang.String name : ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ) { stderr.print ( name ) ; stderr.print ( '\n' ) ; } stderr.flush ( ) ; }
Source:
public void byKey ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }

Target:
public void byOwner ( ) 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 ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) , user2 ) ; assertQuery ( ( "owner:" + ( userId.get ( ) ) ) , change1 ) ; assertQuery ( ( "owner:" + user2 ) , change2 ) ; }
Source:
private static void editTree ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.lib.ObjectInserter ins , java.lang.String path , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { switch ( op ) { case DELETE_ENTRY : dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.DeletePath ( path ) ) ; break ; case CHANGE_ENTRY : case RESTORE_ENTRY : dce.add ( com.google.gerrit.server.edit.ChangeEditModifier.getPathEdit ( op , rw , base , path , ins , content ) ) ; break ; } dce.finish ( ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId toBlob ( org.eclipse.jgit.lib.ObjectInserter ins , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.restapi.RawInput content ) throws java.io.IOException { if ( content == null ) { return null ; } long len = content.getContentLength ( ) ; java.io.InputStream in = content.getInputStream ( ) ; if ( len < 0 ) { return ins.insert ( org.eclipse.jgit.lib.Constants.OBJ_BLOB , com.google.common.io.ByteStreams.toByteArray ( in ) ) ; } return ins.insert ( org.eclipse.jgit.lib.Constants.OBJ_BLOB , len , in ) ; }
Source:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { if ( isHttpTransformPatternrUndefined ( config ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GERRIT_GROUPING ) ; } super . init ( config ) ; }

Target:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GERRIT_GROUPING ) ; } if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.STORAGE_DIR , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR , getStorageDir ( ) ) ; } super . init ( config ) ; }
Source:
public synchronized javax.sql.DataSource get ( ) { if ( ( ds ) == null ) { ds = open ( ) ; } return ds ; }

Target:
public synchronized com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > get ( ) { if ( ( dataSource ) == null ) { dataSource = open ( ) ; } if ( ( ds ) == null ) { try { ds = new com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > ( dataSource , com.google.gerrit.reviewdb.ReviewDb.class ) ; } catch ( com.google.gwtorm.client.OrmException err ) { throw new com.google.inject.ProvisionException ( "Cannot initialize database" , err ) ; } } return ds ; }
Source:
static java.lang.String urlToRepoKey ( java.net.URI baseUrl , java.lang.String name ) { if ( name.startsWith ( baseUrl.toString ( ) ) ) { name = name.substring ( baseUrl.toString ( ) . length ( ) ) ; while ( name.startsWith ( "/" ) ) { name = name.substring ( 1 ) ; } } return name ; }

Target:
static java.lang.String urlToRepoKey ( java.net.URI baseUri , java.lang.String name ) { if ( name.startsWith ( baseUri.toString ( ) ) ) { name = name.substring ( baseUri.toString ( ) . length ( ) ) ; while ( name.startsWith ( "/" ) ) { name = name.substring ( 1 ) ; } } return name ; }
Source:
private static java.lang.String elide ( final java.lang.String s , final int len ) { if ( ( ( s == null ) || ( ( s.length ( ) ) < len ) ) || ( len <= 10 ) ) { return s ; } return ( ( s.substring ( 0 , ( len - 10 ) ) ) + "..." ) + ( s.substring ( ( ( s.length ( ) ) - 10 ) ) ) ; }

Target:
private static java.lang.String elide ( final java.lang.String s , final int len ) { if ( ( ( s == null ) || ( ( s.length ( ) ) <= len ) ) || ( len <= 10 ) ) { return s ; } int i = ( len - 3 ) / 2 ; return ( ( s.substring ( 0 , i ) ) + "..." ) + ( s.substring ( ( ( s.length ( ) ) - i ) ) ) ; }
Source:
void setHeaderVisible ( boolean show ) { headerVisible = show ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( diffHeaderRow , ( show && ( header ) ) ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }

Target:
private void showHeader ( boolean show ) { com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( diffHeaderRow , ( show && ( header ) ) ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }
Source:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; com.google.gerrit.server.index.change.ChangeIndexer.autoReindexIfStale ( cd ) ; }

Target:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; com.google.gerrit.server.index.change.ChangeIndexer.autoReindexIfStale ( cd ) ; }
Source:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment" + " because it didn't previously exist as a draft" ) ) ; deleteComments.add ( c ) ; }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment" + " because it didn't previously exist as a draft" ) ) ; } if ( migration.write ( ) ) { if ( draftNotes.containsComment ( c ) ) { deleteComments.add ( c ) ; } } }
Source:
void openAll ( ) { if ( ( table ) != null ) { java.lang.String self = com.google.gerrit.client.Gerrit.selfRedirect ( null ) ; for ( com.google.gerrit.client.info.FileInfo info : com.google.gerrit.client.rpc.Natives.asList ( table.list ) ) { com.google.gwt.user.client.Window.open ( ( ( self + "#" ) + ( url ( info ) ) ) , "_blank" , null ) ; } } }

Target:
void openAll ( ) { if ( ( table ) != null ) { java.lang.String self = com.google.gerrit.client.Gerrit.selfRedirect ( null ) ; for ( com.google.gerrit.client.info.FileInfo info : com.google.gerrit.client.rpc.Natives.asList ( table.list ) ) { if ( canOpen ( info.path ( ) ) ) { com.google.gwt.user.client.Window.open ( ( ( self + "#" ) + ( url ( info ) ) ) , "_blank" , null ) ; } } } }
Source:
private com.google.gerrit.server.patch.PatchList getPatchList ( com.vmware.gerrit.owners.common.Event event , com.google.gerrit.reviewdb.client.Change change ) { org.eclipse.jgit.lib.ObjectId newId = null ; if ( ( event.getNewObjectId ( ) ) != null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( event.getNewObjectId ( ) ) ; } com.google.gerrit.server.patch.PatchListKey plKey = new com.google.gerrit.server.patch.PatchListKey ( null , newId , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ) ; try { return patchListCache.get ( plKey , change.getProject ( ) ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException e ) { com.vmware.gerrit.owners.common.GitRefListener.logger.warn ( "Could not load patch list: {}" , plKey , e ) ; } return null ; }

Target:
private com.google.gerrit.server.patch.PatchList getPatchList ( com.vmware.gerrit.owners.common.Event event , com.google.gerrit.reviewdb.client.Change change ) { org.eclipse.jgit.lib.ObjectId newId = null ; if ( ( event.getNewObjectId ( ) ) != null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( event.getNewObjectId ( ) ) ; } com.google.gerrit.server.patch.PatchListKey plKey = com.google.gerrit.server.patch.PatchListKey.againstCommit ( null , newId , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ) ; try { return patchListCache.get ( plKey , change.getProject ( ) ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException e ) { com.vmware.gerrit.owners.common.GitRefListener.logger.warn ( "Could not load patch list: {}" , plKey , e ) ; } return null ; }
Source:
protected void postExecute ( java.lang.String errorMsg ) { if ( errorMsg != null ) { v.setEnabled ( true ) ; v.setBackgroundColor ( widgetUtil.color ( R.color.button ) ) ; widgetUtil.showError ( errorMsg ) ; } else { origin.display ( target ) ; } }

Target:
protected void postExecute ( java.lang.String errorMsg ) { if ( errorMsg != null ) { v.setEnabled ( true ) ; v.setBackgroundColor ( widgetUtil.color ( R.color.button ) ) ; widgetUtil.showError ( errorMsg ) ; } else { widgetUtil.toast ( R.string.review_posted ) ; origin.display ( target ) ; } }
Source:
private void service ( ) throws com.google.gerrit.sshd.Failure , java.io.IOException { project = projectControl.getProjectState ( ) . getProject ( ) ; final java.lang.String name = project.getName ( ) ; try { repo = repoManager.openRepository ( name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.sshd.Failure ( 1 , ( ( "fatal: '" + name ) + "': not a git archive" ) , e ) ; } try { runImpl ( ) ; } finally { repo.close ( ) ; } }

Target:
private void service ( ) throws com.google.gerrit.sshd.Failure , java.io.IOException { project = projectControl.getProjectState ( ) . getProject ( ) ; try { repo = repoManager.openRepository ( project.getNameKey ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.sshd.Failure ( 1 , ( ( "fatal: '" + ( project.getName ( ) ) ) + "': not a git archive" ) , e ) ; } try { runImpl ( ) ; } finally { repo.close ( ) ; } }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEventForUnrestrictedListeners ( final com.google.gerrit.server.events.Event event ) { for ( com.google.gerrit.common.EventListener listener : unrestrictedListeners ) { listener.onEvent ( event ) ; } }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.client.data.PatchScript.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( "DiffText" ) ; m.addStyleName ( "DiffText-HUNK_HEADER" ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.client.data.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( "DiffText" ) ; m.addStyleName ( "DiffText-HUNK_HEADER" ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public static com.google.gerrit.acceptance.GitUtil.Commit createCommit ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent i , java.lang.String msg ) throws org.eclipse.jgit.api.errors.GitAPIException { return com.google.gerrit.acceptance.GitUtil.createCommit ( git , i , msg , null ) ; }

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 void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState , result.canModifyMaxObjectSizeLimit ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; }

Target:
public void preDisplay ( com.google.gerrit.client.projects.ConfigInfo result ) { display ( result ) ; }