auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void display ( android.app.Fragment fragment , boolean addToBackStack ) { android.app.FragmentManager fragmentManager = getFragmentManager ( ) ; android.app.FragmentTransaction t = fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , fragment ) ; if ( addToBackStack ) { t.addToBackStack ( null ) ; } t.commit ( ) ; }

Target:
public void display ( android.support.v4.app.Fragment fragment , boolean addToBackStack ) { android.support.v4.app.FragmentManager fragmentManager = getFragmentManager ( ) ; android.support.v4.app.FragmentTransaction t = fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , fragment ) ; if ( addToBackStack ) { t.addToBackStack ( null ) ; } t.commit ( ) ; }
Source:
public static com.google.gerrit.client.DiffObject parse ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String str ) { if ( ( str == null ) || ( str.isEmpty ( ) ) ) { return new com.google.gerrit.client.DiffObject ( false ) ; } if ( com.google.gerrit.client.DiffObject.AUTO_MERGE.equals ( str ) ) { return new com.google.gerrit.client.DiffObject ( true ) ; } try { return new com.google.gerrit.client.DiffObject ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , java.lang.Integer.parseInt ( str ) ) ) ; } catch ( java.lang.NumberFormatException e ) { return null ; } }

Target:
public static com.google.gerrit.client.DiffObject parse ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String str ) { if ( ( str == null ) || ( str.isEmpty ( ) ) ) { return new com.google.gerrit.client.DiffObject ( false ) ; } if ( com.google.gerrit.client.DiffObject.AUTO_MERGE.equals ( str ) ) { return new com.google.gerrit.client.DiffObject ( true ) ; } return new com.google.gerrit.client.DiffObject ( com.google.gerrit.client.Dispatcher.toPsId ( changeId , str ) ) ; }
Source:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; assertNotNull ( r ) ; assertEquals ( ident.getName ( ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( name + " (Code Review)" ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo info , com.google.gerrit.client.diff.DiffInfo diffInfo ) { for ( com.google.gerrit.client.ui.InlineHyperlink link : getLinks ( ) ) { linkPanel.add ( link ) ; } if ( info != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( info.web_links ( ) ) ) ; } else if ( diffInfo != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffInfo.web_links ( ) ) ) ; } }

Target:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo editInfo , com.google.gwt.core.client.JsArray < com.google.gerrit.client.DiffWebLinkInfo > diffLinks ) { renderLinksToDiff ( ) ; if ( editInfo != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( editInfo.web_links ( ) ) ) ; } else if ( diffLinks != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffLinks ) ) ; } }
Source:
public void setNonExistingParent_UnprocessibleEntity ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , new com.google.gerrit.acceptance.rest.project.SetParentIT.ParentInput ( "non-existing" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_UNPROCESSABLE_ENTITY , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setNonExistingParent_UnprocessibleEntity ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , newParentInput ( "non-existing" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_UNPROCESSABLE_ENTITY , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
public java.lang.String getHttpUrl ( com.google.gerrit.acceptance.GerritServer server ) { return java.lang.String.format ( "http://%s:%s@%s:%d" , username , httpPassword , server.getHttpAddress ( ) . getAddress ( ) . getHostAddress ( ) , server.getHttpAddress ( ) . getPort ( ) ) ; }

Target:
public java.lang.String getHttpUrl ( com.google.gerrit.acceptance.GerritServer server ) { java.net.InetSocketAddress addr = server.getHttpAddress ( ) ; return new org.apache.http.client.utils.URIBuilder ( ) . setScheme ( "http" ) . setUserInfo ( username , httpPassword ) . setHost ( com.google.common.net.InetAddresses.toUriString ( addr.getAddress ( ) ) ) . setPort ( addr.getPort ( ) ) . toString ( ) ; }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String idString = params.getParameter ( 0 ) ; final com.google.gerrit.client.reviewdb.PatchSet.Id id ; try { id = PatchSet.Id.parse ( idString ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new org.kohsuke.args4j.CmdLineException ( ( "Invalid patch set: " + idString ) ) ; } setter.addValue ( id ) ; return 1 ; }

Target:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String idString = params.getParameter ( 0 ) ; final com.google.gerrit.client.reviewdb.PatchSet.Id id ; try { id = PatchSet.Id.parse ( idString ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( "Invalid patch set: " + idString ) ) ; } setter.addValue ( id ) ; return 1 ; }
Source:
public void close ( ) { rw.close ( ) ; if ( close ) { if ( ( finalIns ) != null ) { finalIns.close ( ) ; } repo.close ( ) ; } }

Target:
public void close ( ) { rw.getObjectReader ( ) . close ( ) ; rw.close ( ) ; if ( close ) { if ( ( finalIns ) != null ) { finalIns.close ( ) ; } repo.close ( ) ; } }
Source:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setText ( row , 1 , k.name ( ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_NAME , k.name ( ) ) ; table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ) || ( user.memberOf ( group.getGroupUUID ( ) ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId createNewTree ( org.eclipse.jgit.lib.Repository repository , org.eclipse.jgit.revwalk.RevCommit baseCommit , com.google.gerrit.server.edit.tree.TreeModification treeModification ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.server.edit.tree.TreeCreator treeCreator = new com.google.gerrit.server.edit.tree.TreeCreator ( baseCommit ) ; treeCreator.addTreeModification ( treeModification ) ; org.eclipse.jgit.lib.ObjectId newTreeId = treeCreator.createNewTreeAndGetId ( repository ) ; if ( org.eclipse.jgit.lib.ObjectId.equals ( newTreeId , baseCommit.getTree ( ) ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( "no changes were made" ) ; } return newTreeId ; }

Target:
private static org.eclipse.jgit.lib.ObjectId createNewTree ( org.eclipse.jgit.lib.Repository repository , org.eclipse.jgit.revwalk.RevCommit baseCommit , java.util.List < com.google.gerrit.server.edit.tree.TreeModification > treeModifications ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.server.edit.tree.TreeCreator treeCreator = new com.google.gerrit.server.edit.tree.TreeCreator ( baseCommit ) ; treeCreator.addTreeModifications ( treeModifications ) ; org.eclipse.jgit.lib.ObjectId newTreeId = treeCreator.createNewTreeAndGetId ( repository ) ; if ( org.eclipse.jgit.lib.ObjectId.equals ( newTreeId , baseCommit.getTree ( ) ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( "no changes were made" ) ; } return newTreeId ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public java.lang.String format ( java.lang.String projectName , java.lang.String revision , com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } f.setCss ( getCss ( projectName ) ) ; byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
public java.lang.String format ( java.lang.String projectName , java.lang.String revision , com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String raw ) throws java.io.UnsupportedEncodingException { com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter f = new com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatter ( ) ; if ( ! ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_ALLOW_HTML , false ) ) ) { f.suppressHtml ( ) ; } f.setCss ( util.getCss ( projectName , "markdown" ) ) ; byte [ ] b = f.markdownToDocHtml ( raw , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new java.lang.String ( b , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.FieldName > getEditableFields ( ) { java.util.Set < com.google.gerrit.reviewdb.client.Account.FieldName > fields = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.FieldName n : Account.FieldName.values ( ) ) { if ( allowsEdit ( n ) ) { if ( n == ( com.google.gerrit.reviewdb.client.Account.FieldName.REGISTER_NEW_EMAIL ) ) { if ( ( ( emailSender ) != null ) && ( emailSender.isEnabled ( ) ) ) { fields.add ( n ) ; } } else { fields.add ( n ) ; } } } return fields ; }

Target:
public java.util.Set < com.google.gerrit.extensions.client.AccountFieldName > getEditableFields ( ) { java.util.Set < com.google.gerrit.extensions.client.AccountFieldName > fields = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.extensions.client.AccountFieldName n : com.google.gerrit.extensions.client.AccountFieldName.values ( ) ) { if ( allowsEdit ( n ) ) { if ( n == ( com.google.gerrit.extensions.client.AccountFieldName.REGISTER_NEW_EMAIL ) ) { if ( ( ( emailSender ) != null ) && ( emailSender.isEnabled ( ) ) ) { fields.add ( n ) ; } } else { fields.add ( n ) ; } } } return fields ; }
Source:
private static java.lang.String getSecureStoreClassFromGerritConfig ( com.google.gerrit.server.config.SitePaths sitePaths ) { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config , org.eclipse.jgit.util.FS.DETECTED ) ; try { cfg.load ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.lang.RuntimeException ( "Cannot read gerrit.config file" , e ) ; } return cfg.getString ( "gerrit" , null , "secureStoreClass" ) ; }

Target:
private static java.lang.String getSecureStoreClassFromGerritConfig ( com.google.gerrit.server.config.SitePaths sitePaths ) { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.DETECTED ) ; try { cfg.load ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.lang.RuntimeException ( "Cannot read gerrit.config file" , e ) ; } return cfg.getString ( "gerrit" , null , "secureStoreClass" ) ; }
Source:
private void setIgnoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace s ) { for ( int i = 0 ; i < ( ignoreWhitespace.getItemCount ( ) ) ; i ++ ) { if ( ignoreWhitespace.getValue ( i ) . equals ( s.name ( ) ) ) { ignoreWhitespace.setSelectedIndex ( i ) ; return ; } } ignoreWhitespace.setSelectedIndex ( 0 ) ; }

Target:
private void setIgnoreWhitespace ( com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace s ) { for ( int i = 0 ; i < ( ignoreWhitespace.getItemCount ( ) ) ; i ++ ) { if ( ignoreWhitespace.getValue ( i ) . equals ( s.name ( ) ) ) { ignoreWhitespace.setSelectedIndex ( i ) ; return ; } } ignoreWhitespace.setSelectedIndex ( 0 ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( versionManager.isKnownIndex ( name ) ) { if ( versionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } else { stderr.println ( "Cannot reindex, index is unknown based on this name" ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( versionManager.isKnownIndex ( name ) ) { if ( versionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } else { stderr.println ( java.lang.String.format ( "Cannot reindex %s: unknown" , name ) ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public java.lang.Void call ( ) throws java.io.IOException { index.replace ( new com.google.gerrit.server.query.change.ChangeData ( change ) ) ; return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { try { index.replace ( new com.google.gerrit.server.query.change.ChangeData ( change ) ) ; return null ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.index.ChangeIndexerImpl.log.error ( java.lang.String.format ( "Failed to index change %d in %s" , change.getChangeId ( ) , change.getProject ( ) . get ( ) ) , e ) ; throw e ; } }
Source:
private void cleanInBackground ( ) { int cnt = java.lang.Math.max ( 0 , ( ( cleanupHandles.size ( ) ) - ( running.size ( ) ) ) ) ; if ( 0 < cnt ) { cleaner.get ( ) . clean ( cnt ) ; } }

Target:
private static java.lang.String getExtension ( java.lang.String name ) { int ext = name.lastIndexOf ( '.' ) ; return 0 < ext ? name.substring ( ext ) : "" ; }
Source:
public void testMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "automerger.config" , result.getChange ( ) . project ( ) . get ( ) ) ; result.assertOkStatus ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( "Failed to submit 1 change due to the following problems:\n" + "Change 1: Missing downstream branches for [ds_one]. Please recreate the automerges." ) ) ; merge ( result ) ; }

Target:
public void testMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "automerger.config" , result.getChange ( ) . project ( ) . get ( ) ) ; result.assertOkStatus ( ) ; int changeNumber = result.getChange ( ) . getId ( ) . id ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( ( "Failed to submit 1 change due to the following problems:\nChange " + changeNumber ) + ": Missing downstream branches ds_one. Please recreate the automerges." ) ) ; merge ( result ) ; }
Source:
private void onKey ( int key ) { if ( key == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) ) { setText ( prevText ) ; com.google.gwt.user.client.ui.Widget p = getParent ( ) ; if ( p instanceof com.google.gwt.user.client.ui.SuggestBox ) { ( ( com.google.gwt.user.client.ui.SuggestBox ) ( p ) ) . showSuggestionList ( ) ; ( ( com.google.gwt.user.client.ui.SuggestBox ) ( p ) ) . hideSuggestionList ( ) ; } setFocus ( false ) ; } }

Target:
private void onKey ( int key ) { if ( key == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) ) { setText ( prevText ) ; com.google.gwt.user.client.ui.Widget p = getParent ( ) ; if ( p instanceof com.google.gwt.user.client.ui.SuggestBox ) { ( ( com.google.gwt.user.client.ui.SuggestBox ) ( p ) ) . showSuggestionList ( ) ; ( ( com.google.gwt.user.client.ui.SuggestBox.DefaultSuggestionDisplay ) ( ( ( com.google.gwt.user.client.ui.SuggestBox ) ( p ) ) . getSuggestionDisplay ( ) ) ) . hideSuggestions ( ) ; } setFocus ( false ) ; } }
Source:
private void abandonChange ( java.lang.Integer changeNumber ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.info ( "Abandoning change: {}" , changeNumber ) ; com.google.gerrit.extensions.api.changes.AbandonInput abandonInput = new com.google.gerrit.extensions.api.changes.AbandonInput ( ) ; abandonInput.notify = com.google.gerrit.extensions.api.changes.NotifyHandling.NONE ; abandonInput.message = "Merge parent updated; abandoning due to upstream conflict." ; gApi.changes ( ) . id ( changeNumber ) . abandon ( abandonInput ) ; }

Target:
private void abandonChange ( java.lang.Integer changeNumber ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Abandoning change: {}" , changeNumber ) ; com.google.gerrit.extensions.api.changes.AbandonInput abandonInput = new com.google.gerrit.extensions.api.changes.AbandonInput ( ) ; abandonInput.notify = com.google.gerrit.extensions.api.changes.NotifyHandling.NONE ; abandonInput.message = "Merge parent updated; abandoning due to upstream conflict." ; gApi.changes ( ) . id ( changeNumber ) . abandon ( abandonInput ) ; }
Source:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }

Target:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }
Source:
void setNoDiff ( boolean visible ) { com.google.gwt.user.client.ui.UIObject.setVisible ( noDiff , visible ) ; }

Target:
void setNoDiff ( com.google.gerrit.client.diff.DiffInfo diff ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.DiffInfo.Region > regions = diff.content ( ) ; boolean b = ( ( regions.length ( ) ) == 0 ) || ( ( ( regions.length ( ) ) == 1 ) && ( ( regions.get ( 0 ) . ab ( ) ) != null ) ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( noDiff , b ) ; }
Source:
public void postUpdate ( com.google.gerrit.server.update.Context ctx ) { if ( workInProgress ) { return ; } email.create ( NotifyHandling.ALL , com.google.common.collect.ImmutableListMultimap.of ( ) , notes , ps , ctx.getIdentifiedUser ( ) , cmsg , com.google.common.collect.ImmutableList.of ( ) , cmsg.getMessage ( ) , com.google.common.collect.ImmutableList.of ( ) ) . sendAsync ( ) ; }

Target:
public void postUpdate ( com.google.gerrit.server.update.Context ctx ) { if ( ( workInProgress ) || ( ( notify.ordinal ( ) ) < ( NotifyHandling.OWNER_REVIEWERS.ordinal ( ) ) ) ) { return ; } email.create ( notify , com.google.common.collect.ImmutableListMultimap.of ( ) , notes , ps , ctx.getIdentifiedUser ( ) , cmsg , com.google.common.collect.ImmutableList.of ( ) , cmsg.getMessage ( ) , com.google.common.collect.ImmutableList.of ( ) ) . sendAsync ( ) ; }
Source:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = GroupBundle.Factory.fromReviewDb ( db , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( createdGroup.groupId ) ) ; deleteGroupRefs ( reviewDbBundle ) ; assertMigratedCleanly ( rebuild ( reviewDbBundle ) , reviewDbBundle ) ; }

Target:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = GroupBundle.Factory.fromReviewDb ( db , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( createdGroup.id ) ) ; deleteGroupRefs ( reviewDbBundle ) ; assertMigratedCleanly ( rebuild ( reviewDbBundle ) , reviewDbBundle ) ; }
Source:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = notesFactory.create ( db , new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) , id ) . getChange ( ) ; indexerFactory.create ( executor , indexes ) . index ( db , c ) ; return null ; }

Target:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = notesFactory.createChecked ( db , new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) , id ) . getChange ( ) ; indexerFactory.create ( executor , indexes ) . index ( db , c ) ; return null ; }
Source:
private static void init ( ) { if ( ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) == null ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( ) ; com.google.gwtexpui.globalkey.client.DocWidget.get ( ) . addKeyPressHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( Util.C.applicationSection ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.add ( new com.google.gwtexpui.globalkey.client.ShowHelpCommand ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; }
Source:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( scopesForKey ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }

Target:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( config.scopes.get ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }
Source:
public Account.Id lookup ( java.lang.String externalId ) throws com.google.gerrit.server.account.AccountException { try { com.google.gerrit.server.account.AccountState accountState = accountQueryProvider.get ( ) . oneByExternalId ( externalId ) ; return accountState != null ? accountState.getAccount ( ) . getId ( ) : null ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.account.AccountException ( ( "Cannot lookup account " + externalId ) , e ) ; } }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > lookup ( java.lang.String externalId ) throws com.google.gerrit.server.account.AccountException { try { com.google.gerrit.server.account.AccountState accountState = accountQueryProvider.get ( ) . oneByExternalId ( externalId ) ; return accountState != null ? java.util.Optional.of ( accountState.getAccount ( ) . getId ( ) ) : java.util.Optional.empty ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.account.AccountException ( ( "Cannot lookup account " + externalId ) , e ) ; } }
Source:
private boolean exists ( java.lang.String groupDn ) { try { javax.naming.directory.DirContext ctx = helper.open ( ) ; try { javax.naming.Name compositeGroupName = new javax.naming.CompositeName ( ) . add ( groupDn ) ; ctx.getAttributes ( compositeGroupName ) ; return true ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( "Cannot close LDAP query handle" , e ) ; } } } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( "Cannot query LDAP for group" , e ) ; } return false ; }

Target:
public boolean isVisibleToAll ( ) { return false ; }
Source:
protected void createReplyEditor ( final com.google.gerrit.client.patches.LineCommentPanel currentPanel ) { final int row = rowOf ( currentPanel.getElement ( ) ) ; if ( row >= 0 ) { final int column = columnOf ( currentPanel.getElement ( ) ) ; final com.google.gerrit.client.reviewdb.PatchLineComment c = currentPanel.comment ; final com.google.gerrit.client.reviewdb.PatchLineComment.Key k = c.getKey ( ) ; createCommentEditor ( row , column , c.getLine ( ) , c.getSide ( ) , k.get ( ) ) ; } }

Target:
protected void createReplyEditor ( final com.google.gerrit.client.patches.AbstractPatchContentTable.PublishedCommentPanel currentPanel ) { final int row = rowOf ( currentPanel.getElement ( ) ) ; if ( row >= 0 ) { final int column = columnOf ( currentPanel.getElement ( ) ) ; final com.google.gerrit.client.reviewdb.PatchLineComment c = currentPanel.comment ; final com.google.gerrit.client.reviewdb.PatchLineComment.Key k = c.getKey ( ) ; createCommentEditor ( row , column , c.getLine ( ) , c.getSide ( ) , k.get ( ) ) ; } }
Source:
public static com.google.gwtorm.server.OrmException convertError ( java.lang.String op , java.sql.SQLException err ) { switch ( com.google.gerrit.server.schema.H2AccountPatchReviewStore.getSQLStateInt ( err ) ) { case 23001 : case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( "ACCOUNT_PATCH_REVIEWS" , err ) ; default : if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.server.OrmException ( ( op + " failure on ACCOUNT_PATCH_REVIEWS" ) , err ) ; } }

Target:
public static com.google.gwtorm.server.OrmException convertError ( java.lang.String op , java.sql.SQLException err ) { switch ( com.google.gerrit.server.schema.H2AccountPatchReviewStore.getSQLStateInt ( err ) ) { case 23001 : case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( "account_patch_reviews" , err ) ; default : if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.server.OrmException ( ( op + " failure on account_patch_reviews" ) , err ) ; } }
Source:
public void onReviewerAdded ( com.google.gerrit.extensions.events.ReviewerAddedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet patch = db.get ( ) . patchSets ( ) . get ( change.currentPatchSetId ( ) ) ; hooks.doReviewerAddedHook ( change , getAccount ( ev.getReviewer ( ) ) , patch , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ReviewerAdded hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
public void onReviewerAdded ( com.google.gerrit.extensions.events.ReviewerAddedListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doReviewerAddedHook ( notes.getChange ( ) , getAccount ( ev.getReviewer ( ) ) , psUtil.current ( db.get ( ) , notes ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ReviewerAdded hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > byChangeFromIndex ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String label ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accounts = new java.util.HashSet < > ( ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.Account.Id , java.util.Collection < java.lang.String > > e : byChangeFromIndex ( changeId ) . asMap ( ) . entrySet ( ) ) { if ( e.getValue ( ) . contains ( label ) ) { accounts.add ( e.getKey ( ) ) ; } } return accounts ; }

Target:
private static void checkMutuallyExclusiveLabels ( java.util.Set < java.lang.String > labels ) { if ( labels.containsAll ( com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL , com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) ) ) { throw com.google.gerrit.server.StarredChangesUtil.IllegalLabelException.mutuallyExclusiveLabels ( com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL , com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) ; } }
Source:
public void onSuccess ( java.lang.String content ) { parent.setSideBContent ( content ) ; }

Target:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( ( idActive ) == null ) ? other.idActive : idActive ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }
Source:
public boolean isSafeInline ( final eu.medsea.mimeutil.MimeType type ) { if ( MimeUtil2.UNKNOWN_MIME_TYPE.equals ( type ) ) { return false ; } final org.spearce.jgit.lib.RepositoryConfig cfg = server.getGerritConfig ( ) ; final boolean any = com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , "*/*" , false ) ; final boolean genericMedia = com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , ( ( type.getMediaType ( ) ) + "/*" ) , any ) ; return com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , type.toString ( ) , genericMedia ) ; }

Target:
public boolean isSafeInline ( final eu.medsea.mimeutil.MimeType type ) { if ( MimeUtil2.UNKNOWN_MIME_TYPE.equals ( type ) ) { return false ; } final org.spearce.jgit.lib.Config cfg = server.getGerritConfig ( ) ; final boolean any = com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , "*/*" , false ) ; final boolean genericMedia = com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , ( ( type.getMediaType ( ) ) + "/*" ) , any ) ; return com.google.gerrit.server.MimeUtilFileTypeRegistry.isSafe ( cfg , type.toString ( ) , genericMedia ) ; }
Source:
private static java.util.Set < com.google.gerrit.common.data.GroupReference > getGroups ( java.util.List < com.google.gerrit.server.project.SectionMatcher > sectionMatcherList ) { final java.util.Set < com.google.gerrit.common.data.GroupReference > all = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.project.SectionMatcher matcher : sectionMatcherList ) { final com.google.gerrit.common.data.AccessSection section = matcher.section ; for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { all.add ( rule.getGroup ( ) ) ; } } } return all ; }

Target:
private static java.util.Set < com.google.gerrit.common.data.GroupReference > getGroups ( java.util.List < com.google.gerrit.server.project.SectionMatcher > sectionMatcherList ) { final java.util.Set < com.google.gerrit.common.data.GroupReference > all = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.project.SectionMatcher matcher : sectionMatcherList ) { final com.google.gerrit.common.data.AccessSection section = matcher.getSection ( ) ; for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { all.add ( rule.getGroup ( ) ) ; } } } return all ; }
Source:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; list.setMatchPrefix ( this . getPrefix ( ) ) ; list.setMatchSubstring ( this . getSubstring ( ) ) ; list.setMatchRegex ( this . getRegex ( ) ) ; return list.apply ( TopLevelResource.INSTANCE ) ; }

Target:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { return listProvider.get ( ) . request ( this ) . apply ( TopLevelResource.INSTANCE ) ; }
Source:
public void sortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }

Target:
public void blockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( row ) ; } else if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) { } else if ( ( 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 ) { return ; } if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( cell.getRowIndex ( ) ) ; } else if ( ( cell.getCellIndex ( ) ) == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) { } else if ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }
Source:
private static com.google.gerrit.reviewdb.client.PatchLineComment newPatchLineComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String uuid , java.lang.String inReplyToUuid , java.lang.String filename , com.google.gerrit.extensions.common.Side side , int line , com.google.gerrit.reviewdb.client.Account.Id authorId , long millis , java.lang.String message , com.google.gerrit.reviewdb.client.CommentRange range ) { return com.google.gerrit.server.change.CommentsTest.newPatchLineComment ( psId , uuid , inReplyToUuid , filename , side , line , authorId , millis , message , range , Status.PUBLISHED ) ; }

Target:
private static com.google.gerrit.reviewdb.client.PatchLineComment newPatchLineComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String uuid , java.lang.String inReplyToUuid , java.lang.String filename , com.google.gerrit.extensions.client.Side side , int line , com.google.gerrit.reviewdb.client.Account.Id authorId , long millis , java.lang.String message , com.google.gerrit.reviewdb.client.CommentRange range ) { return com.google.gerrit.server.change.CommentsTest.newPatchLineComment ( psId , uuid , inReplyToUuid , filename , side , line , authorId , millis , message , range , Status.PUBLISHED ) ; }
Source:
private java.lang.String healthCheckAccess ( ) throws java.rmi.RemoteException { com.googlesource.gerrit.plugins.its.jira.JiraClient client = new com.googlesource.gerrit.plugins.its.jira.JiraClient ( getUrl ( ) ) ; com.googlesource.gerrit.plugins.its.jira.JiraSession token = client.login ( getUsername ( ) , getPassword ( ) ) ; client.logout ( token ) ; final java.lang.String result = ( "{\"status\"=\"ok\",\"username\"=\"" + ( getUsername ( ) ) ) + "\"}" ; log.debug ( "Healtheck on access result: {}" , result ) ; return result ; }

Target:
private java.lang.String healthCheckAccess ( ) throws java.io.IOException { client ( ) . sysInfo ( ) ; final java.lang.String result = ( "{\"status\"=\"ok\",\"username\"=\"" + ( getUsername ( ) ) ) + "\"}" ; log.debug ( "Healtheck on access result: {}" , result ) ; return result ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.Change.Status status ) { if ( status == null ) { return "" ; } switch ( status ) { case NEW : return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; case SUBMITTED : return com.google.gerrit.client.changes.Util.C.statusLongSubmitted ( ) ; case MERGED : return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; case ABANDONED : return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; default : return status.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.Change.Status status ) { if ( status == null ) { return "" ; } switch ( status ) { case DRAFT : return com.google.gerrit.client.changes.Util.C.statusLongDraft ( ) ; case NEW : return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; case SUBMITTED : return com.google.gerrit.client.changes.Util.C.statusLongSubmitted ( ) ; case MERGED : return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; case ABANDONED : return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; default : return status.name ( ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { return defaultSetter.get ( ) . apply ( resource , input ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { return defaultSetter.get ( ) . apply ( resource , input ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public static java.lang.Iterable < org.eclipse.jgit.lib.ObjectId > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { return com.google.common.collect.FluentIterable.from ( repo.getRefDatabase ( ) . getRefs ( Constants.R_HEADS ) . values ( ) ) . append ( repo.getRefDatabase ( ) . getRefs ( Constants.R_TAGS ) . values ( ) ) . transform ( new com.google.common.base.Function < org.eclipse.jgit.lib.Ref , org.eclipse.jgit.lib.ObjectId > ( ) { @ java.lang.Override public org.eclipse.jgit.lib.ObjectId apply ( org.eclipse.jgit.lib.Ref r ) { return r.getObjectId ( ) ; } } ) ; }

Target:
public static java.lang.Iterable < org.eclipse.jgit.lib.ObjectId > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { return com.google.common.collect.FluentIterable.from ( repo.getRefDatabase ( ) . getRefs ( Constants.R_HEADS ) . values ( ) ) . append ( repo.getRefDatabase ( ) . getRefs ( Constants.R_TAGS ) . values ( ) ) . transform ( Ref :: getObjectId ) ; }
Source:
public static com.google.gerrit.server.config.ScheduleConfig.Builder builder ( org.eclipse.jgit.lib.Config config , java.lang.String section ) { return new com.google.gerrit.server.config.AutoValue_ScheduleConfig.Builder ( ) . setNow ( java.time.ZonedDateTime.now ( java.time.ZoneId.systemDefault ( ) ) ) . setKeyInterval ( com.google.gerrit.server.config.ScheduleConfig.KEY_INTERVAL ) . setKeyStartTime ( com.google.gerrit.server.config.ScheduleConfig.KEY_STARTTIME ) . setConfig ( config ) . setSection ( section ) ; }

Target:
private static java.time.ZonedDateTime computeNow ( ) { return java.time.ZonedDateTime.now ( java.time.ZoneId.systemDefault ( ) ) ; }
Source:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }

Target:
private < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertOK ( ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }