auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void resetHtml ( final com.google.gwt.user.client.ui.FlexTable myTable , final com.google.gwtexpui.safehtml.client.SafeHtml bodyHtml ) { final com.google.gwt.user.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.user.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.user.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; tableElem.removeChild ( oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }

Target:
public void resetHtml ( final com.google.gwt.user.client.ui.FlexTable myTable , final com.google.gwtexpui.safehtml.client.SafeHtml bodyHtml ) { final com.google.gwt.dom.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.dom.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.dom.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; tableElem.removeChild ( oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }
Source:
public static void storeMyMenus ( com.google.gerrit.server.account.VersionedAccountPreferences prefs , java.util.List < com.google.gerrit.extensions.webui.TopMenu.MenuItem > my ) { org.eclipse.jgit.lib.Config cfg = prefs.getConfig ( ) ; if ( my != null ) { com.google.gerrit.server.account.SetPreferences.unsetSection ( cfg , com.google.gerrit.server.account.GetPreferences.MY ) ; for ( com.google.gerrit.extensions.webui.TopMenu.MenuItem item : my ) { com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_URL , item.url ) ; com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_TARGET , item.target ) ; com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_ID , item.id ) ; } } }

Target:
public static void storeMyMenus ( com.google.gerrit.server.account.VersionedAccountPreferences prefs , java.util.List < com.google.gerrit.extensions.webui.TopMenu.MenuItem > my ) { org.eclipse.jgit.lib.Config cfg = prefs.getConfig ( ) ; if ( my != null ) { com.google.gerrit.server.account.SetPreferences.unsetSection ( cfg , UserConfigSections.MY ) ; for ( com.google.gerrit.extensions.webui.TopMenu.MenuItem item : my ) { com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_URL , item.url ) ; com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_TARGET , item.target ) ; com.google.gerrit.server.account.SetPreferences.set ( cfg , item.name , com.google.gerrit.server.account.GetPreferences.KEY_ID , item.id ) ; } } }
Source:
public java.lang.String getCanonicalURL ( ) { java.lang.String u = sConfig.canonicalUrl ; if ( ( u != null ) && ( ! ( u.endsWith ( "/" ) ) ) ) { u += "/" ; } return u ; }

Target:
public java.lang.String getCanonicalURL ( ) { java.lang.String u = getGerritConfig ( ) . getString ( "gerrit" , null , "canonicalweburl" ) ; if ( ( u != null ) && ( ! ( u.endsWith ( "/" ) ) ) ) { u += "/" ; } return u ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { 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.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }

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.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { err.write ( org.eclipse.jgit.lib.Constants.encodeASCII ( "gerrit: no shell available\n" ) ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { err.write ( org.eclipse.jgit.lib.Constants.encodeASCII ( "gerrit: no shell available\r\n" ) ) ; err.flush ( ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }
Source:
protected void format ( ) throws com.google.gerrit.common.errors.EmailException { formatChange ( ) ; appendText ( velocifyFile ( "ChangeFooter.vm" ) ) ; try { java.util.TreeSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id who : getReviewers ( ) . values ( ) ) { names.add ( getNameEmailFor ( who ) ) ; } for ( java.lang.String name : names ) { appendText ( ( ( "Gerrit-Reviewer: " + name ) + "\n" ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { } formatFooter ( ) ; }

Target:
protected void format ( ) throws com.google.gerrit.common.errors.EmailException { formatChange ( ) ; appendText ( velocifyFile ( "ChangeFooter.vm" ) ) ; try { java.util.TreeSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id who : changeData.reviewers ( ) . values ( ) ) { names.add ( getNameEmailFor ( who ) ) ; } for ( java.lang.String name : names ) { appendText ( ( ( "Gerrit-Reviewer: " + name ) + "\n" ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { } formatFooter ( ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term topicTerm = com.googlecode.prolog_cafe.lang.Prolog.Nil ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; java.lang.String topic = change.getTopic ( ) ; if ( topic != null ) { topicTerm = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( topic ) ; } if ( ! ( a1.unify ( topicTerm , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.googlecode.prolog_cafe.lang.Term topicTerm = com.googlecode.prolog_cafe.lang.Prolog.Nil ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; java.lang.String topic = change.getTopic ( ) ; if ( topic != null ) { topicTerm = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( topic ) ; } if ( ! ( a1.unify ( topicTerm , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) , projectConfigValidatorFactory.create ( ) , accountValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }

Target:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) , projectConfigValidatorFactory.create ( ) , accountValidatorFactory.create ( ) , groupValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }
Source:
public static java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > starredBy ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.Account.Id me ) throws com.google.gwtorm.client.OrmException { final java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > existing = new java.util.HashSet < com.google.gerrit.client.reviewdb.Change.Id > ( ) ; if ( me != null ) { for ( final com.google.gerrit.client.reviewdb.StarredChange sc : db.starredChanges ( ) . byAccount ( me ) ) { existing.add ( sc.getChangeId ( ) ) ; } } return existing ; }

Target:
private boolean canRead ( final com.google.gerrit.client.reviewdb.Change c ) { try { return changeControlFactory.controlFor ( c ) . isVisible ( ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }
Source:
public static void deleteEdit ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.edit ( id ) . delete ( cb ) ; }

Target:
public static void publish ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "publish" ) . post ( in , cb ) ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = db.changes ( ) . get ( id ) ; } return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( c , user ) ) ; }

Target:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.Change > changesToUpdate ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( ( ctx.bumpLastUpdatedOn ) && ( c.getLastUpdatedOn ( ) . before ( ctx.getWhen ( ) ) ) ) { c.setLastUpdatedOn ( ctx.getWhen ( ) ) ; } return java.util.Collections.singleton ( c ) ; }
Source:
private void grantTagPermissions ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.CREATE , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; grant ( Permission.PUSH , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; }

Target:
public void createAnnotatedTagNotAllowed ( ) throws java.lang.Exception { block ( Permission.PUSH_TAG , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; input.message = "annotation" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( ( ( "Cannot create annotated tag \"" + ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) + "test\"" ) ) ; tag ( input.ref ) . create ( input ) ; }
Source:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.InheritedBoolean inheritedBoolean = new com.google.gerrit.reviewdb.client.InheritedBoolean ( ) ; inheritedBoolean.setValue ( InheritableBoolean.FALSE ) ; setBool ( contentMerge , inheritedBoolean ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }

Target:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo b = com.google.gerrit.client.projects.ConfigInfo.InheritedBooleanInfo.create ( ) ; b.setConfiguredValue ( InheritableBoolean.FALSE ) ; setBool ( contentMerge , b ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { }

Target:
private void doSign ( ) { submit.setEnabled ( false ) ; if ( ( ( current ) == null ) || ( ! ( Util.C.newAgreementIAGREE ( ) . equalsIgnoreCase ( yesIAgreeBox.getText ( ) ) ) ) ) { yesIAgreeBox.setText ( "" ) ; yesIAgreeBox.setFocus ( true ) ; return ; } doEnterAgreement ( ) ; }
Source:
public static com.google.gerrit.client.account.EditPreferences create ( com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.gerrit.client.account.EditPreferences p = createObject ( ) . cast ( ) ; p.tabSize ( in.tabSize ) ; p.lineLength ( in.lineLength ) ; p.hideTopMenu ( in.hideTopMenu ) ; p.showTabs ( in.showTabs ) ; p.showWhitespaceErrors ( in.showWhitespaceErrors ) ; p.syntaxHighlighting ( in.syntaxHighlighting ) ; p.hideLineNumbers ( in.hideLineNumbers ) ; p.theme ( in.theme ) ; return p ; }

Target:
public static com.google.gerrit.client.account.EditPreferences create ( com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.gerrit.client.account.EditPreferences p = createObject ( ) . cast ( ) ; p.tabSize ( in.tabSize ) ; p.lineLength ( in.lineLength ) ; p.hideTopMenu ( in.hideTopMenu ) ; p.showTabs ( in.showTabs ) ; p.showWhitespaceErrors ( in.showWhitespaceErrors ) ; p.syntaxHighlighting ( in.syntaxHighlighting ) ; p.hideLineNumbers ( in.hideLineNumbers ) ; p.theme ( in.theme ) ; p.keyMapType ( in.keyMapType ) ; return p ; }
Source:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String branchName = "non-existing" ; java.lang.String ref = "refs/for/" + branchName ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertErrorStatus ( r , ( ( "branch " + branchName ) + " not found" ) , ref ) ; }

Target:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String branchName = "non-existing" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/" + branchName ) ) ; r.assertErrorStatus ( ( ( "branch " + branchName ) + " not found" ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( label.getText ( ) ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { cancel ( ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) { com.googlesource.gerrit.plugins.xdocs.XDocResourceKey rk = ( ( com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) ( other ) ) ; return ( ( project.equals ( rk.project ) ) && ( resource.equals ( rk.resource ) ) ) && ( revId.equals ( rk.revId ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) { com.googlesource.gerrit.plugins.xdocs.XDocResourceKey rk = ( ( com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) ( other ) ) ; return ( ( ( formatter.equals ( rk.formatter ) ) && ( project.equals ( rk.project ) ) ) && ( resource.equals ( rk.resource ) ) ) && ( revId.equals ( rk.revId ) ) ; } return false ; }
Source:
private void initForwarding ( ) { setTcpipForwardingFilter ( new org.apache.sshd.common.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canListen ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canConnect ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } } ) ; setTcpipForwarderFactory ( new org.apache.sshd.common.forward.DefaultTcpipForwarderFactory ( ) ) ; }

Target:
private void initForwarding ( ) { setTcpipForwardingFilter ( new org.apache.sshd.server.forward.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.common.session.Session session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.common.session.Session session ) { return false ; } @ java.lang.Override public boolean canListen ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.session.Session session ) { return false ; } @ java.lang.Override public boolean canConnect ( com.google.gerrit.sshd.Type type , org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.session.Session session ) { return false ; } } ) ; setTcpipForwarderFactory ( new org.apache.sshd.common.forward.DefaultTcpipForwarderFactory ( ) ) ; }
Source:
public static com.google.gerrit.common.data.GroupReference findExactSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , com.google.gerrit.server.project.ProjectControl project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }

Target:
public static com.google.gerrit.common.data.GroupReference findExactSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , com.google.gerrit.server.project.ProjectState project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }
Source:
private java.util.regex.Pattern getRegexParameter ( com.googlecode.prolog_cafe.lang.Term term ) { if ( term.isVariable ( ) ) { throw new com.googlecode.prolog_cafe.lang.PInstantiationException ( this , 1 ) ; } if ( ! ( term.isSymbol ( ) ) ) { throw new com.googlecode.prolog_cafe.lang.IllegalTypeException ( this , 1 , "symbol" , term ) ; } return java.util.regex.Pattern.compile ( term.name ( ) , java.util.regex.Pattern.MULTILINE ) ; }

Target:
private java.util.regex.Pattern getRegexParameter ( com.googlecode.prolog_cafe.lang.Term term ) { if ( term instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) { throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; } if ( ! ( term instanceof com.googlecode.prolog_cafe.lang.SymbolTerm ) ) { throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "symbol" , term ) ; } return java.util.regex.Pattern.compile ( term.name ( ) , java.util.regex.Pattern.MULTILINE ) ; }
Source:
private static void initDisableUnwantedKeys ( ) { for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "J" , "K" , "O" , "R" , "U" , "Ctrl-C" } ) { net.codemirror.lib.CodeMirror.disableUnwantedKey ( "vim" , s ) ; } }

Target:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "J" , "K" , "O" , "R" , "U" , "Ctrl-C" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }
Source:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > getRateLimit ( com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.Type type , java.lang.String groupName ) { if ( getRatelimits ( type ) . isPresent ( ) ) { return com.google.common.base.Optional.fromNullable ( getRatelimits ( type ) . get ( ) . get ( groupName ) ) ; } return com.google.common.base.Optional.absent ( ) ; }

Target:
public java.util.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > getRateLimit ( com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.Type type , java.lang.String groupName ) { if ( getRatelimits ( type ) . isPresent ( ) ) { return java.util.Optional.ofNullable ( getRatelimits ( type ) . get ( ) . get ( groupName ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > getBranchSubscriptionGraph ( ) { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > graph = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.Branch.NameKey b : targets.keySet ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.SubmoduleSubscription > ss = targets.get ( b ) ; for ( com.google.gerrit.reviewdb.client.SubmoduleSubscription s : ss ) { graph.put ( b , s.getSubmodule ( ) ) ; } } return graph ; }

Target:
private < T > java.lang.String printCircularPath ( java.util.LinkedHashSet < T > p , T target ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( target ) ; java.util.ArrayList < T > reverseP = new java.util.ArrayList < > ( p ) ; java.util.Collections.reverse ( reverseP ) ; for ( T t : reverseP ) { sb.append ( "->" ) ; sb.append ( t ) ; if ( t.equals ( target ) ) { break ; } } return sb.toString ( ) ; }
Source:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( userPopup.isShowing ( ) ) { userPopup.hide ( ) ; } else { userPopup.showRelativeTo ( l ) ; } event.preventDefault ( ) ; } }

Target:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( ( userPopup.isShowing ( ) ) && ( userPopup.isVisible ( ) ) ) { userPopup.hide ( ) ; } else { userPopup.showRelativeTo ( l ) ; } event.preventDefault ( ) ; } }
Source:
public void execute ( ) { box.setOpen ( true ) ; box.setEdit ( true ) ; }

Target:
public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } }
Source:
void set ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.has_actions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacy_id ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
public void noRescheduleOnSuccess ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , remote , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.OK_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private void initTopicLink ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( ( info.topic ( ) ) != null ) && ( ! ( info.topic ( ) . isEmpty ( ) ) ) ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.op ( "topic" , info.topic ( ) ) ) ) ; } }

Target:
private void initTopicLink ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( ( info.topic ( ) ) != null ) && ( ! ( info.topic ( ) . isEmpty ( ) ) ) ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.op ( "exacttopic" , info.topic ( ) ) ) ) ; } }
Source:
public void saveAppendsToExistingList ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; tr.branch ( RefNames.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.server.git.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , key2.getPublicKeyArmored ( ) ) . create ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A U Thor" , "author@example.com" ) ; cb.setAuthor ( ident ) ; cb.setCommitter ( ident ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( cb ) ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; try ( org.eclipse.jgit.lib.ObjectReader reader = tr.getRepository ( ) . newObjectReader ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { org.eclipse.jgit.notes.NoteMap notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tr.getRevWalk ( ) . parseCommit ( tr.getRepository ( ) . getRef ( RefNames.REFS_GPG_KEYS ) . getObjectId ( ) ) ) ; java.lang.String contents = new java.lang.String ( reader.open ( notes.get ( com.google.gerrit.server.git.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) ) ) . getBytes ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; java.lang.String header = "-----BEGIN PGP PUBLIC KEY BLOCK-----" ; int i1 = contents.indexOf ( header ) ; org.junit.Assert.assertTrue ( ( i1 >= 0 ) ) ; int i2 = contents.indexOf ( header , ( i1 + ( header.length ( ) ) ) ) ; org.junit.Assert.assertTrue ( ( i2 >= 0 ) ) ; } }

Target:
private org.eclipse.jgit.lib.CommitBuilder newCommitBuilder ( ) { org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A U Thor" , "author@example.com" ) ; cb.setAuthor ( ident ) ; cb.setCommitter ( ident ) ; return cb ; }
Source:
public void execute ( ) { deferred = null ; operation ( new java.lang.Runnable ( ) { public void run ( ) { for ( java.lang.Runnable thunk : list ) { thunk.run ( ) ; } } } ) ; }

Target:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { if ( lineActiveBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.get ( handle ) . resizePaddingWidget ( ) ; } if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { defer ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( ( cell != 1 ) && ( ( getRowItem ( row ) ) != null ) ) { movePointerTo ( row ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }
Source:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.restoreContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.diff.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; com.google.gerrit.client.JumpKeys.enable ( false ) ; if ( getPrefs ( ) . hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } resizeHandler = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; } } ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } resizeHandler = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; } } ) ; }
Source:
public void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.KEY_BLOCKED_FILE_EXTENSION ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Blocked File Extensions" , null , ProjectConfigEntry.Type.ARRAY , null , false , ( "Forbidden file extensions. Pushes of commits that " + "contain files with these extensions will be rejected." ) ) ) ; }

Target:
public void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.KEY_BLOCKED_FILE_EXTENSION ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Blocked File Extensions" , null , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.ARRAY , null , false , ( "Forbidden file extensions. Pushes of commits that " + "contain files with these extensions will be rejected." ) ) ) ; }
Source:
public java.lang.String format ( ) { if ( ( value ( ) ) == ( ( short ) ( 0 ) ) ) { return '-' + ( label ( ) ) ; } else if ( ( value ( ) ) < 0 ) { return ( label ( ) ) + ( value ( ) ) ; } else { return ( ( label ( ) ) + '+' ) + ( value ( ) ) ; } }

Target:
public java.lang.String format ( ) { return com.google.gerrit.server.util.LabelVote.appendTo ( new java.lang.StringBuilder ( ( ( label ( ) . length ( ) ) + 6 ) ) , label ( ) , value ( ) ) . toString ( ) ; }
Source:
public com.google.gerrit.server.project.ConfigInfo apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.google.gerrit.server.project.PutConfig.Input input ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( rsrc.getControl ( ) . isOwner ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getName ( ) ) ; } return apply ( rsrc.getControl ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.api.projects.ConfigInfo apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.google.gerrit.extensions.api.projects.ConfigInput input ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( rsrc.getControl ( ) . isOwner ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getName ( ) ) ; } return apply ( rsrc.getControl ( ) , input ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.change.IndexRewriter.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.change.IndexRewriter.class ) ; bind ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seedGroups ; if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { seedGroups = realm.groups ( state ( ) ) ; } else { seedGroups = com.google.gerrit.server.IdentifiedUser.registeredGroups ; } effectiveGroups = getIncludedGroups ( seedGroups ) ; } return effectiveGroups ; }

Target:
public com.google.gerrit.server.account.GroupMembership getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( state ( ) ) ; } else { effectiveGroups = groupMembershipFactory.create ( com.google.gerrit.server.IdentifiedUser.registeredGroups ) ; } } return effectiveGroups ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void gitlinkHtml ( ) throws java.lang.Exception { java.lang.String gitmodules = "[submodule \"gitiles\"]\n" + ( " path = gitiles\n" + " url = https://gerrit.googlesource.com/gitiles\n" ) ; final java.lang.String gitilesSha = "2b2f34bba3c2be7e2506ce6b1f040949da350cf9" ; repo.branch ( "master" ) . commit ( ) . add ( ".gitmodules" , gitmodules ) . edit ( new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( "gitiles" ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.GITLINK ) ; ent.setObjectId ( org.eclipse.jgit.lib.ObjectId.fromString ( gitilesSha ) ) ; } } ) . create ( ) ; java.util.Map < java.lang.String , ? > data = buildData ( "/repo/+/master/gitiles" ) ; org.junit.Assert.assertEquals ( "GITLINK" , data.get ( "type" ) ) ; java.util.Map < java.lang.String , ? > linkData = getBlobData ( data ) ; org.junit.Assert.assertEquals ( gitilesSha , linkData.get ( "sha" ) ) ; org.junit.Assert.assertEquals ( "https://gerrit.googlesource.com/gitiles" , linkData.get ( "remoteUrl" ) ) ; org.junit.Assert.assertEquals ( "https://gerrit.googlesource.com/gitiles" , linkData.get ( "httpUrl" ) ) ; }

Target:
public void gitlinkHtml ( ) throws java.lang.Exception { java.lang.String gitmodules = "[submodule \"gitiles\"]\n" + ( " path = gitiles\n" + " url = https://gerrit.googlesource.com/gitiles\n" ) ; final java.lang.String gitilesSha = "2b2f34bba3c2be7e2506ce6b1f040949da350cf9" ; repo.branch ( "master" ) . commit ( ) . add ( ".gitmodules" , gitmodules ) . edit ( new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( "gitiles" ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.GITLINK ) ; ent.setObjectId ( org.eclipse.jgit.lib.ObjectId.fromString ( gitilesSha ) ) ; } } ) . create ( ) ; java.util.Map < java.lang.String , ? > data = buildData ( "/repo/+/master/gitiles" ) ; com.google.common.truth.Truth.assertThat ( data ) . containsEntry ( "type" , "GITLINK" ) ; java.util.Map < java.lang.String , ? > linkData = getBlobData ( data ) ; com.google.common.truth.Truth.assertThat ( linkData ) . containsEntry ( "sha" , gitilesSha ) ; com.google.common.truth.Truth.assertThat ( linkData ) . containsEntry ( "remoteUrl" , "https://gerrit.googlesource.com/gitiles" ) ; com.google.common.truth.Truth.assertThat ( linkData ) . containsEntry ( "httpUrl" , "https://gerrit.googlesource.com/gitiles" ) ; }
Source:
public static void touch ( final com.google.gerrit.reviewdb.Change change , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { try { com.google.gerrit.server.ChangeUtil.updated ( change ) ; db.changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public static void touch ( final com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.server.ChangeUtil.updated ( change ) ; db.changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } }
Source:
private void assertStatus ( org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) { org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = result.getRemoteUpdate ( ref ) ; org.junit.Assert.assertEquals ( message ( refUpdate ) , expectedStatus , refUpdate.getStatus ( ) ) ; org.junit.Assert.assertEquals ( expectedMessage , refUpdate.getMessage ( ) ) ; }

Target:
private void assertStatus ( org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) { org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = result.getRemoteUpdate ( ref ) ; com.google.common.truth.Truth.assertThat ( expectedStatus ) . named ( message ( refUpdate ) ) . isEqualTo ( refUpdate.getStatus ( ) ) ; com.google.common.truth.Truth.assertThat ( expectedMessage ) . isEqualTo ( refUpdate.getMessage ( ) ) ; }
Source:
private void visitedRevisionActionsAssertions ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > origActions , java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > newActions ) { com.google.common.truth.Truth.assertThat ( newActions ) . isNotNull ( ) ; java.util.Set < java.lang.String > expectedNames = new java.util.TreeSet ( origActions.keySet ( ) ) ; expectedNames.remove ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( newActions.keySet ( ) ) . isEqualTo ( expectedNames ) ; com.google.gerrit.extensions.common.ActionInfo rebase = newActions.get ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( rebase ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( rebase.label ) . isEqualTo ( "All Your Base" ) ; }

Target:
private void visitedCurrentRevisionActionsAssertions ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > origActions , java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > newActions ) { com.google.common.truth.Truth.assertThat ( newActions ) . isNotNull ( ) ; java.util.Set < java.lang.String > expectedNames = new java.util.TreeSet ( origActions.keySet ( ) ) ; expectedNames.remove ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( newActions.keySet ( ) ) . isEqualTo ( expectedNames ) ; com.google.gerrit.extensions.common.ActionInfo rebase = newActions.get ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( rebase ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( rebase.label ) . isEqualTo ( "All Your Base" ) ; }
Source:
public SiteIndexer.Result indexAll ( com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }
Source:
private static void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }

Target:
private static void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( submissionId ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }