auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void flushEventsToDraftUpdate ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.EventList < com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.PatchLineCommentEvent > events , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { if ( events.isEmpty ( ) ) { return ; } com.google.gerrit.server.notedb.ChangeDraftUpdate update = draftUpdateFactory.create ( change , events.getAccountId ( ) , events.newAuthorIdent ( ) , events.getWhen ( ) ) ; update.setPatchSetId ( events.getPatchSetId ( ) ) ; for ( com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.PatchLineCommentEvent e : events ) { e.applyDraft ( update ) ; } manager.add ( update ) ; events.clear ( ) ; }

Target:
private void flushEventsToDraftUpdate ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.rebuild.EventList < com.google.gerrit.server.notedb.rebuild.PatchLineCommentEvent > events , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { if ( events.isEmpty ( ) ) { return ; } com.google.gerrit.server.notedb.ChangeDraftUpdate update = draftUpdateFactory.create ( change , events.getAccountId ( ) , newAuthorIdent ( events ) , events.getWhen ( ) ) ; update.setPatchSetId ( events.getPatchSetId ( ) ) ; for ( com.google.gerrit.server.notedb.rebuild.PatchLineCommentEvent e : events ) { e.applyDraft ( update ) ; } manager.add ( update ) ; events.clear ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { renderSubmitType ( result.asString ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; if ( status == ( Change.Status.NEW ) ) { statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; assigneeLink.setText ( ( ( info.assignee ( ) ) != null ? info.assignee ( ) . name ( ) : "" ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? getName ( assignee ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
public static com.google.gson.GsonBuilder defaultGsonBuilder ( ) { final com.google.gson.GsonBuilder gb = new com.google.gson.GsonBuilder ( ) ; gb.registerTypeAdapter ( java.sql.Date.class , new com.google.gwtjsonrpc.server.SqlDateDeserializer ( ) ) ; gb.registerTypeAdapter ( java.sql.Timestamp.class , new com.google.gwtjsonrpc.server.SqlTimestampDeserializer ( ) ) ; return gb ; }

Target:
public static com.google.gson.GsonBuilder defaultGsonBuilder ( ) { final com.google.gson.GsonBuilder gb = new com.google.gson.GsonBuilder ( ) ; gb.registerTypeAdapter ( java.util.Map.class , new com.google.gwtjsonrpc.server.MapDeserializer ( ) ) ; gb.registerTypeAdapter ( java.sql.Date.class , new com.google.gwtjsonrpc.server.SqlDateDeserializer ( ) ) ; gb.registerTypeAdapter ( java.sql.Timestamp.class , new com.google.gwtjsonrpc.server.SqlTimestampDeserializer ( ) ) ; return gb ; }
Source:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = sysInjector.createChildInjector ( new com.google.gerrit.server.ssh.SshModule ( ) ) ; sshInjector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = sysInjector.createChildInjector ( new com.google.gerrit.server.ssh.SshModule ( ) ) ; sysInjector.getInstance ( com.google.gerrit.server.cache.CachePool.class ) . start ( ) ; sshInjector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval deletedApproval ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( ps.getId ( ) , accountId , new com.google.gerrit.reviewdb.client.LabelId ( label ) ) , ( ( short ) ( 0 ) ) , ctx.getWhen ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval deletedApproval ( com.google.gerrit.server.update.ChangeContext ctx ) { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( ps.getId ( ) , accountId , new com.google.gerrit.reviewdb.client.LabelId ( label ) ) , ( ( short ) ( 0 ) ) , ctx.getWhen ( ) ) ; }
Source:
private static byte [ ] message ( org.eclipse.jetty.server.HttpConnection conn ) { java.lang.String msg = conn.getHttpChannel ( ) . getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getHttpChannel ( ) . getResponse ( ) . getStatus ( ) ) ; } return msg.getBytes ( java.nio.charset.StandardCharsets.ISO_8859_1 ) ; }

Target:
private static byte [ ] message ( org.eclipse.jetty.server.HttpConnection conn ) { java.lang.String msg ; if ( conn == null ) { msg = "" ; } else { msg = conn.getHttpChannel ( ) . getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getHttpChannel ( ) . getResponse ( ) . getStatus ( ) ) ; } } return msg.getBytes ( java.nio.charset.StandardCharsets.ISO_8859_1 ) ; }
Source:
public void rebuildEmptySiteStartingWithNoteDbEnabled ( ) throws java.lang.Exception { initSite ( ) ; setNotesMigrationState ( NotesMigrationState.NOTE_DB_UNFUSED ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath , "--show-stack-trace" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.config.SitePaths sitePaths = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; sitePath = sitePaths.site_path.toString ( ) ; gerritConfig = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; initSite ( ) ; }
Source:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( req.getReader ( ) ) . andThrow ( new java.io.IOException ( "someError" ) ) ; rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , "someError" ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( "someOtherError" ) ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; org.mockito.Mockito.doThrow ( new java.io.IOException ( "someOtherError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setSuggest ( true ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.restapi.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setSuggest ( true ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1.isVariable ( ) ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "variable" , a1 ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.builtin.JavaObjectTerm ( engine.getHashManager ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.VariableTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "variable" , a1 ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.builtin.JavaObjectTerm ( engine.getHashManager ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }
Source:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'a' ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'b' ) ) ; com.google.common.truth.Truth.assertThat ( "ab" ) ; }

Target:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'a' ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'b' ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "ab" ) ; }
Source:
private static com.google.gwt.user.client.ui.Anchor anchor ( final java.lang.String text , final java.lang.String to ) { final com.google.gwt.user.client.ui.Anchor a = new com.google.gwt.user.client.ui.Anchor ( text , to ) ; a.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . menuItem ( ) ) ; com.google.gwt.user.client.ui.Accessibility.setRole ( a.getElement ( ) , Accessibility.ROLE_MENUITEM ) ; return a ; }

Target:
private static com.google.gwt.user.client.ui.Anchor anchor ( final java.lang.String text , final java.lang.String to ) { final com.google.gwt.user.client.ui.Anchor a = new com.google.gwt.user.client.ui.Anchor ( text , to ) ; a.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . menuItem ( ) ) ; com.google.gwt.aria.client.Roles.getMenuitemRole ( ) . set ( a.getElement ( ) ) ; return a ; }
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 onClose ( final com.google.gwt.event.logical.shared.CloseEvent < com.google.gwt.user.client.ui.PopupPanel > event ) { com.google.gwtexpui.globalkey.client.GlobalKey.active = com.google.gwtexpui.globalkey.client.GlobalKey.global ; }
Source:
private void initCipers ( ) { setCipherFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Cipher > > asList ( new org.apache.sshd.common.cipher.AES128CBC.Factory ( ) , new org.apache.sshd.common.cipher.TripleDESCBC.Factory ( ) , new org.apache.sshd.common.cipher.BlowfishCBC.Factory ( ) , new org.apache.sshd.common.cipher.AES192CBC.Factory ( ) , new org.apache.sshd.common.cipher.AES256CBC.Factory ( ) ) ) ; }

Target:
private void initCiphers ( final org.spearce.jgit.lib.RepositoryConfig cfg ) { setCipherFactories ( com.google.gerrit.server.ssh.GerritSshDaemon.filter ( cfg , "cipher" , new org.apache.sshd.common.cipher.AES128CBC.Factory ( ) , new org.apache.sshd.common.cipher.TripleDESCBC.Factory ( ) , new org.apache.sshd.common.cipher.BlowfishCBC.Factory ( ) , new org.apache.sshd.common.cipher.AES192CBC.Factory ( ) , new org.apache.sshd.common.cipher.AES256CBC.Factory ( ) , null , new org.apache.sshd.common.cipher.CipherNone.Factory ( ) ) ) ; }
Source:
public void start ( ) { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( p ) ; if ( projectState != null ) { installCommandAsync ( projectState ) ; } } }

Target:
public void run ( ) { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( p ) ; if ( projectState != null ) { com.google.gerrit.server.config.PluginConfig cfg = projectState.getConfig ( ) . getPluginConfig ( pluginName ) ; for ( java.lang.String name : cfg.getNames ( ) ) { installCommand ( projectState.getProject ( ) . getNameKey ( ) , name , cfg.getString ( name ) ) ; } } } }
Source:
public static void forceLogout ( final javax.servlet.http.HttpServletResponse rsp ) { javax.servlet.http.Cookie c ; c = new javax.servlet.http.Cookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE , "" ) ; c.setMaxAge ( 0 ) ; rsp.addCookie ( c ) ; c = new javax.servlet.http.Cookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE , "" ) ; c.setMaxAge ( 0 ) ; rsp.addCookie ( c ) ; }

Target:
private void callback ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp , final com.google.gerrit.client.account.SignInResult result ) throws java.io.IOException { final java.io.StringWriter body = new java.io.StringWriter ( ) ; body.write ( "<html>" ) ; body.write ( "<script><!--\n" ) ; body.write ( req.getParameter ( com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER ) ) ; body.write ( "(" ) ; com.google.gwtjsonrpc.server.JsonServlet.defaultGsonBuilder ( ) . create ( ) . toJson ( result , body ) ; body.write ( ");\n" ) ; body.write ( "// -->\n" ) ; body.write ( "</script>" ) ; body.write ( "</html>" ) ; sendHtml ( req , rsp , body.toString ( ) ) ; }
Source:
private com.google.inject.Injector getPluginInjector ( java.io.File jarFile ) { java.lang.String jarFileName = jarFile.getName ( ) ; final java.lang.String pluginName = jarFileName.substring ( 0 , jarFileName.lastIndexOf ( '.' ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }

Target:
private com.google.inject.Injector getPluginInjector ( java.io.File jarFile ) throws java.io.IOException { final java.lang.String pluginName = com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.PluginLoader.getGerritPluginName ( jarFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( jarFile ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }
Source:
public void onLoad ( ) { if ( ( diffTable ) == null ) { initUI ( ) ; } super . onLoad ( ) ; PatchUtil.DETAIL_SVC.unifiedPatchDetail ( patchId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.UnifiedPatchDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.UnifiedPatchDetail r ) { if ( isAttached ( ) ) { display ( r ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( diffTable ) == null ) { initUI ( ) ; } super . onLoad ( ) ; PatchUtil.DETAIL_SVC.unifiedPatchDetail ( patchId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.UnifiedPatchDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.data.UnifiedPatchDetail r ) { display ( r ) ; } } ) ; }
Source:
private void createTestSiteDirs ( ) throws java.io.IOException { testSite = tempSiteDir.getRoot ( ) . toPath ( ) ; com.google.gerrit.server.config.SitePaths sitePath = new com.google.gerrit.server.config.SitePaths ( testSite ) ; pluginsSitePath = java.nio.file.Files.createDirectories ( sitePath.plugins_dir ) ; java.nio.file.Files.createDirectories ( sitePath.tmp_dir ) ; }

Target:
private void buildPluginJar ( ) throws java.io.IOException , java.lang.InterruptedException { java.util.Properties properties = loadBuckProperties ( ) ; java.lang.String buck = com.google.common.base.MoreObjects.firstNonNull ( properties.getProperty ( com.google.gerrit.acceptance.PluginDaemonTest.BUCKLC ) , com.google.gerrit.acceptance.PluginDaemonTest.BUCKLC ) ; java.lang.String target ; if ( standalone ) { target = "//:" + ( pluginName ) ; } else { target = pluginSubPath.toString ( ) ; } java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder ( buck , "build" , target ) . directory ( pluginRoot.toFile ( ) ) . redirectErrorStream ( true ) ; processBuilder.environment ( ) . put ( "NO_BUCKD" , "1" ) ; java.nio.file.Path forceJar = pluginSource.resolve ( "src/main/java/ForceJarIfMissing.java" ) ; java.nio.file.Files.deleteIfExists ( forceJar ) ; java.nio.file.Files.createFile ( forceJar ) ; testSite = tempSiteDir.getRoot ( ) . toPath ( ) ; java.nio.file.Path log = testSite.resolve ( "log" ) ; processBuilder.redirectErrorStream ( true ) ; processBuilder.redirectOutput ( java.lang.ProcessBuilder.Redirect.appendTo ( log.toFile ( ) ) ) ; try { processBuilder.start ( ) . waitFor ( ) ; } finally { java.nio.file.Files.delete ( forceJar ) ; processBuilder.start ( ) . waitFor ( ) ; } }
Source:
public void run ( ) { }

Target:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return ( ) -> { ( hasPrev ? prev : up ) . go ( ) ; } ; case NEXT : return ( ) -> { ( hasNext ? next : up ) . go ( ) ; } ; default : return ( ) -> { } ; } }
Source:
private org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws java.io.IOException { if ( repos.containsKey ( name ) ) { return repos.get ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; repos.put ( name , repo ) ; return repo ; }

Target:
private org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws java.io.IOException { if ( repos.containsKey ( name ) ) { return repos.get ( name ) ; } name = com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.urlToRepoKey ( canonicalWebUrl , name ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; repos.put ( name , repo ) ; return repo ; }
Source:
public void testIsEnabledEventNoBranches ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > in ) { java.util.List < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( in.length ( ) ) ; for ( com.google.gerrit.client.info.AccountInfo p : com.google.gerrit.client.rpc.Natives.asList ( in ) ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AccountInfo > in ) { java.util.List < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( in.length ( ) ) ; for ( com.google.gerrit.client.info.AccountInfo p : com.google.gerrit.client.rpc.Natives.asList ( in ) ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p , req.getQuery ( ) ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( name , e ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group name" , e ) ; } }

Target:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( name , e ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group name" , e ) ; } }
Source:
private void deleteLock ( java.lang.String project , java.lang.String lockId , com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext action ) throws java.io.IOException { com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput input = action.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsPutLocksAction.log.debug ( "Delete (-f {}) lock for in project {}" , java.lang.Boolean.TRUE.equals ( input.force ) , lockId , project ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLock lock = new com.googlesource.gerrit.plugins.lfs.locks.LfsLock ( "random_id" , "some/path/to/file" , now ( ) , new com.googlesource.gerrit.plugins.lfs.locks.LfsLockOwner ( "Lock Owner <lock_owner@example.com>" ) ) ; action.sendResponse ( lock ) ; }

Target:
protected void doRun ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { action.run ( project , user ) ; }
Source:
public static void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet dest , boolean trivialRebase ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > sourceApprovals = db.patchSetApprovals ( ) . byPatchSet ( source ) ; com.google.gerrit.server.ApprovalsUtil.copyLabels ( db , labelTypes , sourceApprovals , source , dest , trivialRebase ) ; }

Target:
public static void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet dest , com.google.gerrit.server.change.PatchSetInserter.ChangeKind changeKind ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > sourceApprovals = db.patchSetApprovals ( ) . byPatchSet ( source ) ; com.google.gerrit.server.ApprovalsUtil.copyLabels ( db , labelTypes , sourceApprovals , source , dest , changeKind ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { if ( ( format ) == ( com.google.gerrit.server.OutputFormat.TEXT ) ) { java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream ( ) ; display ( buf ) ; return com.google.gerrit.extensions.restapi.BinaryResult.create ( buf.toByteArray ( ) ) . setContentType ( "text/plain" ) . setCharacterEncoding ( "UTF-8" ) ; } format = com.google.gerrit.server.OutputFormat.JSON ; return display ( null ) ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.server.project.ProjectJson.ProjectInfo > apply ( ) { format = com.google.gerrit.server.OutputFormat.JSON ; return display ( null ) ; }
Source:
protected void ccExistingReviewers ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . byState ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . byState ( ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; org.junit.Assert.assertTrue ( "push is blocked for anonymous to refs/drafts/master" , util.user ( local ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; org.junit.Assert.assertFalse ( "push is blocked for admin refs/drafts/master" , util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; com.google.gerrit.server.project.ProjectControl a = util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }
Source:
public void setUp ( ) { easyMock = new org.easymock.EasyMockSupport ( ) ; storeMock = easyMock.createMock ( com.ericsson.gerrit.plugins.eventslog.EventStore.class ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.EventHandlerTest.PoolMock ( 1 ) ; listener = new com.ericsson.gerrit.plugins.eventslog.EventHandler ( storeMock , poolMock ) ; }

Target:
public void nonProjectEvent ( ) { poolMock = easyMock.createMock ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) ; com.google.gerrit.server.events.Event eventMock = easyMock.createMock ( com.google.gerrit.server.events.Event.class ) ; easyMock.replayAll ( ) ; listener = new com.ericsson.gerrit.plugins.eventslog.EventHandler ( storeMock , poolMock ) ; listener.onEvent ( eventMock ) ; easyMock.verifyAll ( ) ; }
Source:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "I" , "O" , "R" , "U" , "Ctrl-C" , "Ctrl-O" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }

Target:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "I" , "O" , "R" , "U" , "Ctrl-C" , "Ctrl-O" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "j" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "k" , "gk" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Down" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Up" , "gk" ) ; }
Source:
public void testReplaceOneLink ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( "A\n<a href=\"?42\">issue 42</a>\nB" , n.asString ( ) ) ; }

Target:
public void testReplaceOneLink ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( "A\n<a href=\"?42\">issue 42</a>\nB" ) ; }
Source:
protected void populate ( final int row , final com.google.gerrit.reviewdb.Project k ) { final com.google.gwt.user.client.ui.Anchor projectLink = new com.google.gwt.user.client.ui.Anchor ( k.getName ( ) ) ; projectLink.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { sugestParent.setText ( getRowItem ( row ) . getName ( ) ) ; } } ) ; table.setWidget ( row , 1 , projectLink ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { doCreateProject ( ) ; }
Source:
public void changeMessageUuid ( ) throws java.lang.Exception { java.util.regex.Pattern pat = java.util.regex.Pattern.compile ( "^[0-9a-f]{8}_[0-9a-f]{8}$" ) ; com.google.common.truth.Truth.assertThat ( "abcd1234_0987fedc" ) . matches ( pat ) ; com.google.gerrit.reviewdb.server.ReviewDb db = new com.google.gerrit.server.ChangeUtilTest.FakeDb ( ) ; java.lang.String id1 = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; com.google.common.truth.Truth.assertThat ( id1 ) . matches ( pat ) ; java.lang.String id2 = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; com.google.common.truth.Truth.assertThat ( id2 ) . isNotEqualTo ( id1 ) ; com.google.common.truth.Truth.assertThat ( id2 ) . matches ( pat ) ; }

Target:
public void changeMessageUuid ( ) throws java.lang.Exception { java.util.regex.Pattern pat = java.util.regex.Pattern.compile ( "^[0-9a-f]{8}_[0-9a-f]{8}$" ) ; com.google.common.truth.Truth.assertThat ( "abcd1234_0987fedc" ) . matches ( pat ) ; java.lang.String id1 = com.google.gerrit.server.ChangeUtil.messageUuid ( ) ; com.google.common.truth.Truth.assertThat ( id1 ) . matches ( pat ) ; java.lang.String id2 = com.google.gerrit.server.ChangeUtil.messageUuid ( ) ; com.google.common.truth.Truth.assertThat ( id2 ) . isNotEqualTo ( id1 ) ; com.google.common.truth.Truth.assertThat ( id2 ) . matches ( pat ) ; }
Source:
public void testNoPropertySets ( ) { com.googlesource.gerrit.plugins.hooks.workflow.ActionController actionController = createActionController ( ) ; com.google.gerrit.server.events.ChangeEvent event = createMock ( com.google.gerrit.server.events.ChangeEvent.class ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > propertySets = java.util.Collections.emptySet ( ) ; org.easymock.EasyMock.expect ( propertyExtractor.extractFrom ( event ) ) . andReturn ( propertySets ) . anyTimes ( ) ; replayMocks ( ) ; actionController.onChangeEvent ( event ) ; }

Target:
public void testNoPropertySets ( ) { com.googlesource.gerrit.plugins.hooks.workflow.ActionController actionController = createActionController ( ) ; com.google.gerrit.server.events.ChangeEvent event = createMock ( com.google.gerrit.server.events.ChangeEvent.class ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > propertySets = java.util.Collections.emptySet ( ) ; org.easymock.EasyMock.expect ( propertyExtractor.extractFrom ( event ) ) . andReturn ( propertySets ) . anyTimes ( ) ; replayMocks ( ) ; actionController.onEvent ( event ) ; }
Source:
private void saveQuerySettings ( ) { getApp ( ) . getConfigManager ( ) . setQueryConfig ( new com.google.reviewit.app.QueryConfig.Builder ( ) . setServerId ( getServerId ( ) ) . setQuery ( textOf ( R.id.queryInput ) ) . setLabel ( textOf ( R.id.labelInput ) ) . build ( ) ) ; display ( com.google.reviewit.SortChangesFragment.class ) ; }

Target:
private void saveQuerySettings ( ) { getApp ( ) . getConfigManager ( ) . setQueryConfig ( new com.google.reviewit.app.QueryConfig.Builder ( ) . setServerId ( getServerId ( ) ) . setQuery ( textOf ( R.id.queryInput ) ) . setLabel ( textOf ( R.id.labelInput ) ) . build ( ) ) ; switch ( getApp ( ) . getPrefs ( ) . startScreen ) { case REVIEW_SCREEN : display ( com.google.reviewit.ReviewChangesFragment.class ) ; break ; case SORT_SCREEN : default : display ( com.google.reviewit.SortChangesFragment.class ) ; } }
Source:
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 ; }

Target:
private com.google.gerrit.server.git.SubmitStrategy createStrategy ( final com.google.gerrit.reviewdb.client.Project.SubmitType submitType ) throws com.google.gerrit.server.git.MergeException { return submitStrategyFactory.create ( submitType , db , repo , rw , inserter , canMergeFlag , getAlreadyAccepted ( branchTip ) , destBranch , destProject.isUseContentMerge ( ) ) ; }
Source:
private void authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , com.google.gerrit.server.ldap.LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( password != null ? password : "" ) ) ; try { new javax.naming.directory.InitialDirContext ( env ) . close ( ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AccountException ( "Incorrect username or password" , e ) ; } }

Target:
private java.util.Properties createContextProperties ( ) { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , com.google.gerrit.server.ldap.LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( server.startsWith ( "ldaps:" ) ) && ( ! ( sslVerify ) ) ) { java.lang.Class < ? extends javax.net.ssl.SSLSocketFactory > factory = com.google.gerrit.server.ioutil.BlindSSLSocketFactory.class ; env.put ( "java.naming.ldap.factory.socket" , factory.getName ( ) ) ; } return env ; }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.Objects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }
Source:
public static java.lang.String keyToString ( org.bouncycastle.openpgp.PGPPublicKey key ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > it = key.getUserIDs ( ) ; return java.lang.String.format ( "%s %s(%s)" , com.google.gerrit.server.git.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) , ( it.hasNext ( ) ? ( it.next ( ) ) + " " : "" ) , com.google.gerrit.server.git.gpg.PublicKeyStore.fingerprintToString ( key.getFingerprint ( ) ) ) ; }

Target:
public static java.lang.String keyToString ( org.bouncycastle.openpgp.PGPPublicKey key ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.lang.String > it = key.getUserIDs ( ) ; return java.lang.String.format ( "%s %s(%s)" , com.google.gerrit.server.git.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) , ( it.hasNext ( ) ? ( it.next ( ) ) + " " : "" ) , com.google.gerrit.server.git.gpg.Fingerprint.toString ( key.getFingerprint ( ) ) ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupMember k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.common.com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupMember k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getAccountId ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanRead ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }

Target:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }
Source:
public void display ( final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { final java.lang.StringBuilder nc = new java.lang.StringBuilder ( ) ; appendHeader ( nc ) ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { appendRow ( nc , p ) ; } appendRow ( nc , null ) ; resetHtml ( nc.toString ( ) ) ; int row = 1 ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { setRowItem ( ( row ++ ) , p ) ; } }

Target:
void initMeter ( ) { if ( ( meter ) == null ) { resetHtml ( "<tr><td></td></tr>" ) ; meter = new com.google.gerrit.client.ui.ProgressMeter ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( db.patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
public void addGroupMembers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.Id groupId , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > foundGroup = groups.get ( db , groupId ) ; if ( ! ( foundGroup.isPresent ( ) ) ) { return ; } com.google.gerrit.reviewdb.client.AccountGroup group = foundGroup.get ( ) ; addGroupMembers ( db , group , accountIds ) ; }

Target:
public void addGroupMember ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { addGroupMembers ( db , groupUuid , com.google.common.collect.ImmutableSet.of ( accountId ) ) ; }
Source:
public void conflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }

Target:
public void conflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }