auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testWikify_OneParagraph2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyTest.html ( "A\nB\n" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( "<p>A\nB\n</p>" , n.asString ( ) ) ; }

Target:
public void testWikify_OneParagraph2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyTest.html ( "A\nB\n" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( "<p>A\nB\n</p>" ) ; }
Source:
private com.google.gerrit.server.mail.Address toAddress ( final com.google.gerrit.reviewdb.Account.Id id ) { final com.google.gerrit.reviewdb.Account a = args.accountCache.get ( id ) . getAccount ( ) ; final java.lang.String e = a.getPreferredEmail ( ) ; if ( e == null ) { return null ; } return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , e ) ; }

Target:
private com.google.gerrit.server.mail.Address toAddress ( final com.google.gerrit.reviewdb.Account.Id id ) { final com.google.gerrit.reviewdb.Account a = args.accountCache.get ( id ) . getAccount ( ) ; final java.lang.String e = a.getPreferredEmail ( ) ; if ( ( ! ( a.isActive ( ) ) ) || ( e == null ) ) { return null ; } return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , e ) ; }
Source:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( change , db ) ; return d ; }

Target:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountCache ( db ) , change ) ; return d ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { display ( r ) ; } public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; table.setSavePointerId ( com.google.gwt.user.client.History.getToken ( ) ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { display ( r ) ; } public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; } } ) ; }
Source:
private void deactivate ( ) { if ( ( activePatchSetId ) != ( - 1 ) ) { com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( activePatchSetId ) ; patchSetPanel.setActive ( false ) ; activePatchSetId = - 1 ; } }

Target:
private int indexOf ( com.google.gerrit.reviewdb.PatchSet.Id id ) { for ( int i = 0 ; i < ( patchSets.size ( ) ) ; i ++ ) { if ( patchSets.get ( i ) . getId ( ) . equals ( id ) ) { return i ; } } return - 1 ; }
Source:
void destroy ( final com.google.gerrit.httpd.WebSessionManager.Key key ) { self.invalidate ( key.token ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val get ( final com.google.gerrit.httpd.WebSessionManager.Key key ) { com.google.gerrit.httpd.WebSessionManager.Val val = self.get ( key ) ; if ( ( val != null ) && ( ( val.expiresAt ) <= ( com.google.gerrit.httpd.WebSessionManager.now ( ) ) ) ) { self.remove ( key ) ; return null ; } return val ; }
Source:
public void onSuccess ( com.google.gerrit.plugin.client.rpc.NativeString result ) { l.setText ( newName ) ; l.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( newName ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }

Target:
public void onSuccess ( com.google.gerrit.plugin.client.rpc.NativeString result ) { updateValue ( newValue ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; listener ( ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.solr.IndexVersionCheck.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; listener ( ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.solr.IndexVersionCheck.class ) ; } }
Source:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; }

Target:
private boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canEditHashtags ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId commit ( final org.eclipse.jgit.merge.Merger m , final org.eclipse.jgit.lib.CommitBuilder mergeCommit ) throws java.io.IOException , java.io.UnsupportedEncodingException { org.eclipse.jgit.lib.ObjectInserter oi = m.getObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( mergeCommit ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( ) { org.eclipse.jgit.merge.ThreeWayMerger m ; if ( destProject.isUseContentMerge ( ) ) { m = MergeStrategy.RESOLVE.newMerger ( repo , true ) ; } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger ( repo ) ; } m.setObjectInserter ( new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; } @ java.lang.Override public void flush ( ) { } @ java.lang.Override public void release ( ) { } } ) ; return m ; }
Source:
public void run ( ) { store.invalidate ( ( ( K ) ( key ) ) ) ; }

Target:
public void invalidate ( final java.lang.Object key ) { if ( ( keyType.getRawType ( ) . isInstance ( key ) ) && ( store.mightContain ( ( ( K ) ( key ) ) ) ) ) { executor.execute ( ( ) -> store.invalidate ( ( ( K ) ( key ) ) ) ) ; } mem.invalidate ( key ) ; }
Source:
static boolean isStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > projects = com.google.common.collect.Sets.union ( states.keySet ( ) , patterns.keySet ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { if ( com.google.gerrit.server.index.change.StalenessChecker.isStale ( repoManager , id , p , states , patterns ) ) { return true ; } } return false ; }

Target:
static boolean refsAreStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > projects = com.google.common.collect.Sets.union ( states.keySet ( ) , patterns.keySet ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { if ( com.google.gerrit.server.index.change.StalenessChecker.refsAreStale ( repoManager , id , p , states , patterns ) ) { return true ; } } return false ; }
Source:
private static org.eclipse.jgit.revwalk.RevCommit maybeParseCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { if ( id == null ) { return null ; } org.eclipse.jgit.revwalk.RevObject obj = rw.parseAny ( id ) ; return obj instanceof org.eclipse.jgit.revwalk.RevCommit ? ( ( org.eclipse.jgit.revwalk.RevCommit ) ( obj ) ) : null ; }

Target:
private static org.eclipse.jgit.revwalk.RevCommit maybeParseCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id , com.google.gerrit.server.schema.UpdateUI ui ) throws java.io.IOException { if ( id != null ) { try { org.eclipse.jgit.revwalk.RevObject obj = rw.parseAny ( id ) ; return obj instanceof org.eclipse.jgit.revwalk.RevCommit ? ( ( org.eclipse.jgit.revwalk.RevCommit ) ( obj ) ) : null ; } catch ( org.eclipse.jgit.errors.MissingObjectException moe ) { ui.message ( ( ( "Missing object: " + ( id.getName ( ) ) ) + "\n" ) ) ; } } return null ; }
Source:
public void testSubscriptionFailOnWrongProjectACL ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "wrong-super-project" , "refs/heads/master" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }

Target:
public void testSubscriptionFailOnWrongBranchACL ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/wrong-branch" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }
Source:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { try ( java.io.OutputStreamWriter w = new java.io.OutputStreamWriter ( out , java.nio.charset.StandardCharsets.ISO_8859_1 ) ; java.io.OutputStream e = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( w ) ) { src.writeTo ( e ) ; e.flush ( ) ; } }

Target:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { try ( java.io.OutputStreamWriter w = new java.io.OutputStreamWriter ( new java.io.FilterOutputStream ( out ) { @ java.lang.Override public void close ( ) { } } , java.nio.charset.StandardCharsets.ISO_8859_1 ) ; java.io.OutputStream e = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( w ) ) { src.writeTo ( e ) ; } }
Source:
private static void addDocLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final java.lang.String href ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( text , com.google.gerrit.client.Gerrit.selfRedirect ( ( "/Documentation/" + href ) ) ) ; atag.setTarget ( "_blank" ) ; m.add ( atag ) ; }

Target:
private static void addDocLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final java.lang.String href ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( text , ( ( com.google.gerrit.client.Gerrit.docUrl ) + href ) ) ; atag.setTarget ( "_blank" ) ; m.add ( atag ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isUnMuteable ( rsrc.getChange ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( isMuted ( rsrc ) ) ; }
Source:
private void checkKeys ( com.google.gitiles.CommitSoyData.KeySet ks ) { com.google.common.base.Preconditions.checkState ( ( ( ! ( ks.contains ( "diffTree" ) ) ) || ( ( walk ) != null ) ) , "RevWalk required for diffTree" ) ; if ( ( ks.contains ( "archiveUrl" ) ) || ( ks.contains ( "archiveType" ) ) ) { com.google.common.base.Preconditions.checkState ( ( ( archiveFormat ) != null ) , "archive format required" ) ; } }

Target:
private void checkFields ( com.google.gitiles.CommitSoyData.FieldSet fs ) { com.google.common.base.Preconditions.checkState ( ( ( ! ( fs.contains ( com.google.gitiles.CommitSoyData.Field.DIFF_TREE ) ) ) || ( ( walk ) != null ) ) , "RevWalk required for diffTree" ) ; if ( ( fs.contains ( com.google.gitiles.CommitSoyData.Field.ARCHIVE_URL ) ) || ( fs.contains ( com.google.gitiles.CommitSoyData.Field.ARCHIVE_TYPE ) ) ) { com.google.common.base.Preconditions.checkState ( ( ( archiveFormat ) != null ) , "archive format required" ) ; } }
Source:
private boolean canDelete ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return ( ( isOwner ( ) ) && ( getRefControl ( ) . 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.canDeleteOwnChanges ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; case MERGED : default : return false ; } }
Source:
public void run ( ) { try { reindex ( ) ; } finally { running.set ( false ) ; } }

Target:
public void run ( ) { boolean ok = false ; try { reindex ( ) ; ok = true ; } finally { running.set ( false ) ; if ( ! ok ) { for ( com.google.gerrit.server.index.OnlineUpgradeListener listener : listeners ) { listener.onFailure ( this . name , oldVersion , newVersion ) ; } } } }
Source:
public void insert ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; org.apache.lucene.document.Document doc = toDocument ( cd ) ; if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { closedIndex.delete ( id ) ; openIndex.insert ( doc ) ; } else { openIndex.delete ( id ) ; closedIndex.insert ( doc ) ; } }

Target:
public void insert ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; org.apache.lucene.document.Document doc = toDocument ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { closedIndex.delete ( id ) ; openIndex.insert ( doc ) ; } else { openIndex.delete ( id ) ; closedIndex.insert ( doc ) ; } }
Source:
com.google.gerrit.prettify.common.PrettyFormatter.Tag pop ( java.lang.StringBuilder buf , java.lang.String html ) { if ( open ) { int sp = html.indexOf ( ' ' , ( ( start ) + 1 ) ) ; if ( ( sp < 0 ) || ( ( end ) < sp ) ) { sp = end ; } buf.append ( "</" ) ; buf.append ( html.substring ( ( ( start ) + 1 ) , sp ) ) ; buf.append ( '>' ) ; open = false ; } return parent ; }

Target:
com.google.gerrit.prettify.client.PrettyFormatter.Tag pop ( java.lang.StringBuilder buf , java.lang.String html ) { if ( open ) { int sp = html.indexOf ( ' ' , ( ( start ) + 1 ) ) ; if ( ( sp < 0 ) || ( ( end ) < sp ) ) { sp = end ; } buf.append ( "</" ) ; buf.append ( html.substring ( ( ( start ) + 1 ) , sp ) ) ; buf.append ( '>' ) ; open = false ; } return parent ; }
Source:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.api.Git git , java.lang.String ref ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = git.push ( ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }

Target:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.api.Git git , java.lang.String ref , boolean pushTags ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = git.push ( ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; if ( pushTags ) { pushCmd.setPushTags ( ) ; } java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }
Source:
public void testSortWithRegex ( ) { grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint ) throws java.io.IOException { return httpClient.execute ( new org.apache.http.client.methods.HttpPost ( ( ( url ) + endpoint ) ) , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( url ) + endpoint ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( content ) ) ) { post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; } return httpClient.execute ( post , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }
Source:
private com.google.gerrit.server.query.Predicate < T > defaultField ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.server.query.QueryParseException { switch ( r.getType ( ) ) { case com.google.gerrit.server.query.QueryParser.SINGLE_WORD : case com.google.gerrit.server.query.QueryParser.EXACT_PHRASE : if ( ( r.getChildCount ( ) ) != 0 ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Expected no children under: " + r ) ) ; } return defaultField ( r.getText ( ) ) ; default : throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Unsupported node: " + r ) ) ; } }

Target:
private com.google.gerrit.server.query.Predicate < T > defaultField ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.index.query.QueryParseException { switch ( r.getType ( ) ) { case com.google.gerrit.index.query.QueryParser.SINGLE_WORD : case com.google.gerrit.index.query.QueryParser.EXACT_PHRASE : if ( ( r.getChildCount ( ) ) != 0 ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Expected no children under: " + r ) ) ; } return defaultField ( r.getText ( ) ) ; default : throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Unsupported node: " + r ) ) ; } }
Source:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { display ( result ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { enableForm ( result.canModify ) ; saveName.setVisible ( result.canModify ) ; saveOwner.setVisible ( result.canModify ) ; saveDesc.setVisible ( result.canModify ) ; saveGroupOptions.setVisible ( result.canModify ) ; delMember.setVisible ( result.canModify ) ; members.setEnabled ( result.canModify ) ; saveType.setVisible ( result.canModify ) ; display ( result ) ; }
Source:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( change , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }

Target:
public void emptyPermissionRangeKeepsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) ) , norm.normalize ( notes , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( project ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( target ) ; }
Source:
private void sendResource ( java.util.jar.JarFile jar , java.util.jar.JarEntry entry , javax.servlet.http.HttpServletResponse res , java.lang.String pluginName ) throws java.io.IOException { sendResource ( jar , entry , res , pluginName , false ) ; }

Target:
void send ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { if ( 0 < ( lastModified ) ) { res.setDateHeader ( "Last-Modified" , lastModified ) ; } res.setContentType ( contentType ) ; if ( ( characterEncoding ) != null ) { res.setCharacterEncoding ( characterEncoding ) ; } res.setContentLength ( data.length ) ; res.getOutputStream ( ) . write ( data ) ; }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric0 < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { define ( name , desc ) ; return new com.google.gerrit.metrics.dropwizard.CallbackMetricImpl0 ( this , registry , name , valueClass ) ; }

Target:
public < V > com.google.gerrit.metrics.CallbackMetric0 < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkMetricName ( name ) ; define ( name , desc ) ; return new com.google.gerrit.metrics.dropwizard.CallbackMetricImpl0 ( this , registry , name , valueClass ) ; }
Source:
public static void deleteGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.GpgKeyInfo > > cb ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.delete ( fingerprints ) , cb ) ; }

Target:
public static void deleteGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.GpgKeyInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.delete ( fingerprints ) , cb ) ; }
Source:
int findApproval ( ) throws com.google.gwtorm.server.OrmException { if ( com.googlesource.gerrit.plugins.findowners.Checker.isExemptFromOwnerApproval ( changeData ) ) { return 0 ; } com.googlesource.gerrit.plugins.findowners.OwnersDb db = com.googlesource.gerrit.plugins.findowners.Cache.getInstance ( ) . get ( repository , changeData ) ; if ( ( db.getNumOwners ( ) ) <= 0 ) { return 0 ; } if ( ( minVoteLevel ) <= 0 ) { minVoteLevel = com.googlesource.gerrit.plugins.findowners.Config.getMinOwnerVoteLevel ( changeData ) ; } com.googlesource.gerrit.plugins.findowners.Checker.log.trace ( ( "findApproval db key = " + ( db.key ) ) ) ; return findApproval ( db ) ; }

Target:
int findApproval ( com.google.gerrit.server.account.AccountCache accountCache ) throws com.google.gwtorm.server.OrmException { if ( com.googlesource.gerrit.plugins.findowners.Checker.isExemptFromOwnerApproval ( changeData ) ) { return 0 ; } com.googlesource.gerrit.plugins.findowners.OwnersDb db = com.googlesource.gerrit.plugins.findowners.Cache.getInstance ( ) . get ( repository , changeData ) ; if ( ( db.getNumOwners ( ) ) <= 0 ) { return 0 ; } if ( ( minVoteLevel ) <= 0 ) { minVoteLevel = com.googlesource.gerrit.plugins.findowners.Config.getMinOwnerVoteLevel ( changeData ) ; } com.googlesource.gerrit.plugins.findowners.Checker.log.trace ( ( "findApproval db key = " + ( db.key ) ) ) ; return findApproval ( accountCache , db ) ; }
Source:
static java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > performValidation ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c , int maxPathLength ) throws java.io.IOException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; for ( java.lang.String file : com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.getChangedPaths ( repo , c ) ) { if ( ( file.length ( ) ) > maxPathLength ) { messages.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( "path too long: " + file ) , true ) ) ; } } return messages ; }

Target:
static java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > performValidation ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c , org.eclipse.jgit.revwalk.RevWalk revWalk , int maxPathLength ) throws java.io.IOException { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; for ( java.lang.String file : com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.getChangedPaths ( repo , c , revWalk ) ) { if ( ( file.length ( ) ) > maxPathLength ) { messages.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( "path too long: " + file ) , true ) ) ; } } return messages ; }
Source:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { int value ; try { value = java.lang.Integer.parseInt ( p.getValue ( ) ) ; } catch ( java.lang.NumberFormatException e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( com.google.gerrit.lucene.QueryBuilder.intTerm ( p.getField ( ) . getName ( ) , value ) ) ; }

Target:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.index.query.IndexPredicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { int value ; try { value = java.lang.Integer.parseInt ( p.getValue ( ) ) ; } catch ( java.lang.NumberFormatException e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( com.google.gerrit.lucene.QueryBuilder.intTerm ( p.getField ( ) . getName ( ) , value ) ) ; }
Source:
public static synchronized void stopSshd ( ) { if ( ( com.google.gerrit.server.ssh.SshServlet.sshd ) != null ) { try { com.google.gerrit.server.ssh.SshServlet.sshd.stop ( ) ; } finally { com.google.gerrit.server.ssh.SshServlet.sshd = null ; } } }

Target:
public static synchronized void stopSshd ( ) { if ( ( com.google.gerrit.server.ssh.SshServlet.sshd ) != null ) { try { com.google.gerrit.server.ssh.SshServlet.sshd.stop ( ) ; com.google.gerrit.server.ssh.SshServlet.log.info ( ( "Stopped Gerrit SSHD on 0.0.0.0:" + ( com.google.gerrit.server.ssh.SshServlet.sshd.getPort ( ) ) ) ) ; } finally { com.google.gerrit.server.ssh.SshServlet.sshd = null ; } } }
Source:
public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities result ) { if ( result.canPerform ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) { com.google.gerrit.client.Gerrit.addLink ( menuBar , com.google.gerrit.client.Gerrit.C.menuPlugins ( ) , PageLinks.ADMIN_PLUGINS ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities result ) { if ( result.canPerform ( com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER ) ) { com.google.gerrit.client.Gerrit.addLink ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPluginsInstalled ( ) , PageLinks.ADMIN_PLUGINS ) ; com.google.gerrit.client.Gerrit.menuLeft.insert ( pluginsBar , com.google.gerrit.client.Gerrit.C.menuPlugins ( ) , ( ( com.google.gerrit.client.Gerrit.menuLeft.getWidgetIndex ( groupsBar ) ) + 1 ) ) ; } }
Source:
public boolean isOwner ( ) { final com.google.gerrit.reviewdb.AccountGroup.Id owner = group.getOwnerGroupId ( ) ; return ( getCurrentUser ( ) . getEffectiveGroups ( ) . contains ( owner ) ) || ( getCurrentUser ( ) . isAdministrator ( ) ) ; }

Target:
public boolean isOwner ( ) { if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.AccountGroup g = groupCache.get ( group.getOwnerGroupId ( ) ) ; com.google.gerrit.reviewdb.AccountGroup.UUID ownerUUID = ( g != null ) ? g.getGroupUUID ( ) : null ; isOwner = ( getCurrentUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getCurrentUser ( ) . isAdministrator ( ) ) ; } return isOwner ; }
Source:
private javax.mail.Address toAddress ( final com.google.gerrit.client.reviewdb.Account.Id id ) throws javax.mail.internet.AddressException { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( id ) ; if ( a == null ) { return null ; } final java.lang.String e = a.getPreferredEmail ( ) ; if ( e == null ) { return null ; } try { final java.lang.String an = a.getFullName ( ) ; return new javax.mail.internet.InternetAddress ( e , an ) ; } catch ( java.io.UnsupportedEncodingException e1 ) { return new javax.mail.internet.InternetAddress ( e ) ; } }

Target:
private com.google.gerrit.server.mail.Address toAddress ( final com.google.gerrit.client.reviewdb.Account.Id id ) { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( id ) ; if ( a == null ) { return null ; } final java.lang.String e = a.getPreferredEmail ( ) ; if ( e == null ) { return null ; } return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , e ) ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String name = dcmd.getCommandName ( ) ; java.lang.StringBuilder commandName = new java.lang.StringBuilder ( ( name == null ? "" : name ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }
Source:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace w ) { switch ( w ) { default : case IGNORE_NONE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.NONE ) ; case IGNORE_SPACE_AT_EOL : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.TRAILING ) ; case IGNORE_SPACE_CHANGE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.CHANGED ) ; case IGNORE_ALL_SPACE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.ALL ) ; } }

Target:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace w ) { switch ( w ) { default : case IGNORE_NONE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.NONE ) ; case IGNORE_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.TRAILING ) ; case IGNORE_LEADING_AND_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.CHANGED ) ; case IGNORE_ALL : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.ALL ) ; } }
Source:
private Account.Id user ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.server.account.AccountState s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.get ( org.easymock.EasyMock.eq ( s.getAccount ( ) . getId ( ) ) ) ) . andReturn ( s ) ; return s.getAccount ( ) . getId ( ) ; }

Target:
private Account.Id user ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.Account s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.getAccount ( org.easymock.EasyMock.eq ( s.getId ( ) ) ) ) . andReturn ( com.google.common.util.concurrent.Futures.immediateFuture ( s ) ) ; return s.getId ( ) ; }
Source:
private static com.google.common.base.Function < com.google.gerrit.extensions.common.CommentInfo , com.google.gerrit.extensions.api.changes.DraftInput > infoToDraft ( final java.lang.String path ) { return new com.google.common.base.Function < com.google.gerrit.extensions.common.CommentInfo , com.google.gerrit.extensions.api.changes.DraftInput > ( ) { @ java.lang.Override public com.google.gerrit.extensions.api.changes.DraftInput apply ( com.google.gerrit.extensions.common.CommentInfo info ) { com.google.gerrit.extensions.api.changes.DraftInput di = new com.google.gerrit.extensions.api.changes.DraftInput ( ) ; di.path = path ; com.google.gerrit.acceptance.server.change.CommentsIT.copy ( info , di ) ; return di ; } } ; }

Target:
private static com.google.common.base.Function < com.google.gerrit.extensions.common.CommentInfo , com.google.gerrit.extensions.api.changes.DraftInput > infoToDraft ( java.lang.String path ) { return com.google.gerrit.acceptance.server.change.CommentsIT.infoToInput ( path , DraftInput :: new ) ; }
Source:
public boolean dispatchTouchEvent ( android.view.MotionEvent event ) { android.app.Fragment fragment = getFragmentManager ( ) . findFragmentById ( R.id.mainFrame ) ; if ( fragment instanceof com.google.reviewit.DispatchTouchEventAware ) { ( ( com.google.reviewit.DispatchTouchEventAware ) ( fragment ) ) . dispatchTouchEvent ( event ) ; } return super . dispatchTouchEvent ( event ) ; }

Target:
public boolean dispatchTouchEvent ( android.view.MotionEvent event ) { android.support.v4.app.Fragment fragment = getSupportFragmentManager ( ) . findFragmentById ( R.id.mainFrame ) ; if ( fragment instanceof com.google.reviewit.DispatchTouchEventAware ) { ( ( com.google.reviewit.DispatchTouchEventAware ) ( fragment ) ) . dispatchTouchEvent ( event ) ; } return super . dispatchTouchEvent ( event ) ; }
Source:
public java.lang.Void get ( long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , java.util.concurrent.TimeoutException { if ( ! ( isDone ( ) ) ) { if ( reopenThread.waitForGeneration ( gen , ( ( int ) ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( timeout , unit ) ) ) ) ) { set ( null ) ; } else { throw new java.util.concurrent.TimeoutException ( ) ; } } return super . get ( timeout , unit ) ; }

Target:
public java.lang.Void get ( long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , java.util.concurrent.TimeoutException { if ( ! ( isDone ( ) ) ) { if ( ! ( reopenThread.waitForGeneration ( gen , ( ( int ) ( unit.toMillis ( timeout ) ) ) ) ) ) { throw new java.util.concurrent.TimeoutException ( ) ; } set ( null ) ; } return super . get ( timeout , unit ) ; }
Source:
public com.google.gerrit.extensions.common.DiffInfo diff ( int parent ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.setParent ( parent ) . apply ( file ) . value ( ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.project.InvalidChangeOperationException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve diff" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.DiffInfo diff ( int parent ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.setParent ( parent ) . apply ( file ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve diff" , e ) ; } }
Source:
private void logDebug ( java.lang.String msg , java.lang.Object ... args ) { if ( com.google.gerrit.server.git.MergeOp.log.isDebugEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.debug ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) , args ) ; } }

Target:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) ) ; } } }
Source:
private void initApprovals ( final com.google.gerrit.common.data.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.common.data.ApprovalType ct : com.google.gerrit.client.Gerrit.getConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }

Target:
private void enableForm ( final boolean enabled ) { for ( final com.google.gerrit.client.changes.PublishCommentScreen.ValueRadioButton approvalButton : approvalButtons ) { approvalButton.setEnabled ( enabled ) ; } message.setEnabled ( enabled ) ; for ( final com.google.gerrit.client.patches.CommentEditorPanel commentEditor : commentEditors ) { commentEditor.enableButtons ( enabled ) ; } send.setEnabled ( enabled ) ; submit.setEnabled ( enabled ) ; cancel.setEnabled ( enabled ) ; }
Source:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { return createVal ( key , val.getAccountId ( ) , val.isPersistentCookie ( ) ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin ) ; }
Source:
protected void configure ( ) { if ( ! ( com.google.gerrit.server.util.BouncyCastleUtil.havePGP ( ) ) ) { com.google.gerrit.server.git.gpg.SignedPushModule.log.info ( ( "BouncyCastle PGP not installed; signed push verification is" + " disabled" ) ) ; return ; } bind ( com.google.gerrit.server.git.gpg.PublicKeyChecker.class ) . to ( com.google.gerrit.server.git.gpg.GerritPublicKeyChecker.class ) ; bind ( com.google.gerrit.server.git.gpg.PublicKeyStore.class ) . toProvider ( com.google.gerrit.server.git.gpg.SignedPushModule.StoreProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.server.git.gpg.SignedPushModule.Initializer.class ) ; }

Target:
protected void configure ( ) { if ( ! ( com.google.gerrit.gpg.BouncyCastleUtil.havePGP ( ) ) ) { throw new com.google.inject.ProvisionException ( "Bouncy Castle PGP not installed" ) ; } bind ( com.google.gerrit.gpg.PublicKeyChecker.class ) . to ( com.google.gerrit.gpg.GerritPublicKeyChecker.class ) ; bind ( com.google.gerrit.gpg.PublicKeyStore.class ) . toProvider ( com.google.gerrit.gpg.SignedPushModule.StoreProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.gpg.SignedPushModule.Initializer.class ) ; }
Source:
protected void doRun ( ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { java.util.regex.Matcher matcher = com.googlesource.gerrit.plugins.lfs.locks.LfsGetLocksAction.LFS_LOCKS_URL.matcher ( context.path ) ; if ( matcher.matches ( ) ) { java.lang.String project = matcher.group ( 1 ) ; listLocks ( project ) ; } throw new org.eclipse.jgit.lfs.errors.LfsException ( ( "no repository at " + ( context.path ) ) ) ; }

Target:
protected java.lang.String getProjectName ( ) throws org.eclipse.jgit.lfs.errors.LfsException { java.util.regex.Matcher matcher = com.googlesource.gerrit.plugins.lfs.locks.LfsGetLocksAction.LFS_LOCKS_URL_PATTERN.matcher ( context.path ) ; if ( matcher.matches ( ) ) { return matcher.group ( 1 ) ; } throw new org.eclipse.jgit.lfs.errors.LfsException ( ( "no repository at " + ( context.path ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Sync remote index" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.highavailability.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-index-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.highavailability.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }
Source:
public static void write ( final java.io.ObjectOutputStream out , final org.spearce.jgit.lib.AnyObjectId id ) throws java.io.IOException { if ( id != null ) { out.writeBoolean ( true ) ; out.writeInt ( id.w1 ) ; out.writeInt ( id.w2 ) ; out.writeInt ( id.w3 ) ; out.writeInt ( id.w4 ) ; out.writeInt ( id.w5 ) ; } else { out.writeBoolean ( false ) ; } }

Target:
public static void writeNotNull ( final java.io.OutputStream out , final org.spearce.jgit.lib.AnyObjectId id ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt32 ( out , id.w1 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt32 ( out , id.w2 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt32 ( out , id.w3 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt32 ( out , id.w4 ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeFixInt32 ( out , id.w5 ) ; }