auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.AddSshKey.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.common.SshKeyInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
void setDiffPrefs ( final com.google.gerrit.reviewdb.client.AccountDiffPreference dp ) { diffPrefs = dp ; context = diffPrefs.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } }

Target:
void setDiffPrefs ( final com.google.gerrit.extensions.client.DiffPreferencesInfo dp ) { diffPrefs = dp ; context = diffPrefs.context ; if ( ( context ) == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } }
Source:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessage ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }
Source:
private void setNew ( com.google.gerrit.reviewdb.Change c , com.google.gerrit.reviewdb.ChangeMessage msg ) { sendMergeFail ( c , msg , true , true ) ; }

Target:
private boolean isMergeable ( com.google.gerrit.reviewdb.Change c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( c.getId ( ) ) ; final com.google.gerrit.server.git.CommitMergeStatus s = ( commit != null ) ? commit.statusCode : null ; boolean isMergeable = false ; if ( ( s != null ) && ( ( ( s.equals ( CommitMergeStatus.CLEAN_MERGE ) ) || ( s.equals ( CommitMergeStatus.CLEAN_PICK ) ) ) || ( s.equals ( CommitMergeStatus.ALREADY_MERGED ) ) ) ) { isMergeable = true ; } return isMergeable ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ( testDesc.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) , null , null ) ; }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , null , null ) ; }
Source:
void onChangeRevision ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }

Target:
void onHideTaggedComments ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { hideTaggedComments.setVisible ( false ) ; showTaggedComments.setVisible ( true ) ; int n = history.getWidgetCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { com.google.gerrit.client.change.Message m = ( ( com.google.gerrit.client.change.Message ) ( history.getWidget ( i ) ) ) ; if ( ( m.getMessageInfo ( ) . tag ( ) ) != null ) { m.setVisible ( false ) ; } } }
Source:
private void setupCommonMocks ( ) { org.easymock.EasyMock.expect ( itsConfig.getIssuePattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(\\d+)" ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( itsConfig.isEnabled ( "myProject" , null ) ) . andReturn ( true ) . anyTimes ( ) ; }

Target:
private void setupCommonMocks ( ) { org.easymock.EasyMock.expect ( itsConfig.getIssuePattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(\\d+)" ) ) . anyTimes ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "myProject" ) ; org.easymock.EasyMock.expect ( itsConfig.isEnabled ( projectNK , null ) ) . andReturn ( true ) . anyTimes ( ) ; }
Source:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }

Target:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.account.Accounts accounts = StoredValues.ACCOUNTS.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache , accounts ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }
Source:
private javax.net.ssl.SSLContext buildSslContext ( ) { try { javax.net.ssl.TrustManager [ ] trustAllCerts = new javax.net.ssl.TrustManager [ ] { new com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.DummyX509TrustManager ( ) } ; javax.net.ssl.SSLContext context = javax.net.ssl.SSLContext.getInstance ( "TLS" ) ; context.init ( null , trustAllCerts , null ) ; return context ; } catch ( java.security.KeyManagementException | java.security.NoSuchAlgorithmException e ) { com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.log.warn ( "Error building SSLContext object" , e ) ; return null ; } }

Target:
private javax.net.ssl.SSLContext buildSslContext ( ) { try { javax.net.ssl.TrustManager [ ] trustAllCerts = new javax.net.ssl.TrustManager [ ] { new com.ericsson.gerrit.plugins.highavailability.HttpClientProvider.DummyX509TrustManager ( ) } ; javax.net.ssl.SSLContext context = javax.net.ssl.SSLContext.getInstance ( "TLS" ) ; context.init ( null , trustAllCerts , null ) ; return context ; } catch ( java.security.KeyManagementException | java.security.NoSuchAlgorithmException e ) { com.ericsson.gerrit.plugins.highavailability.HttpClientProvider.log.warn ( "Error building SSLContext object" , e ) ; return null ; } }
Source:
private boolean hasOneParent ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) { try { return ( dbProvider.get ( ) . patchSetAncestors ( ) . ancestorsOf ( patchSetId ) . toList ( ) . size ( ) ) == 1 ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Rebase.log.error ( ( "Failed to get ancestors of patch set " + ( patchSetId.toRefName ( ) ) ) , e ) ; return false ; } }

Target:
private boolean hasOneParent ( org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.PatchSet ps ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit c = rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; return ( c.getParentCount ( ) ) == 1 ; }
Source:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { processor.setOutput ( out , QueryProcessor.OutputFormat.TEXT ) ; super . parseCommandLine ( ) ; if ( ( processor.getIncludeFiles ( ) ) && ( ! ( ( processor.getIncludePatchSets ( ) ) || ( processor.getIncludeCurrentPatchSet ( ) ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "--files option needs --patch-sets or --current-patch-set" ) ; } }

Target:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { processor.setOutput ( out , OutputFormat.TEXT ) ; super . parseCommandLine ( ) ; if ( ( processor.getIncludeFiles ( ) ) && ( ! ( ( processor.getIncludePatchSets ( ) ) || ( processor.getIncludeCurrentPatchSet ( ) ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "--files option needs --patch-sets or --current-patch-set" ) ; } }
Source:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ListChangeEdits.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; }
Source:
private void addEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.server.account.CreateEmail.Input in = new com.google.gerrit.server.account.CreateEmail.Input ( ) ; in.email = email ; in.noConfirmation = true ; try { createEmailFactory.create ( email ) . apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw die ( e.getMessage ( ) ) ; } }

Target:
private void addEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.api.accounts.EmailInput in = new com.google.gerrit.extensions.api.accounts.EmailInput ( ) ; in.email = email ; in.noConfirmation = true ; try { createEmailFactory.create ( email ) . apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw die ( e.getMessage ( ) ) ; } }
Source:
protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeManageServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; onSave.onFailure ( caught ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; text.setFocus ( true ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; onSave.onFailure ( caught ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( cell != null ) { switch ( cell.getCellIndex ( ) ) { case 1 : case 3 : break ; default : if ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) { movePointerTo ( cell.getRowIndex ( ) ) ; } break ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.account.AccountProjectWatchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getWatch ( ) . getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }
Source:
private boolean getInheritableBoolean ( java.util.function.Function < com.google.gerrit.reviewdb.client.Project , com.google.gerrit.extensions.client.InheritableBoolean > func ) { for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { switch ( func.apply ( s.getProject ( ) ) ) { case TRUE : return true ; case FALSE : return false ; case INHERIT : default : continue ; } } return false ; }

Target:
public boolean is ( com.google.gerrit.reviewdb.client.BooleanProjectConfig config ) { for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { switch ( s.getProject ( ) . getBooleanConfig ( config ) ) { case TRUE : return true ; case FALSE : return false ; case INHERIT : default : continue ; } } return false ; }
Source:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { java.lang.String token = auth.generateToken ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( token , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }
Source:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names = collectProjects ( progress ) ; return reindexProjects ( index , names , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( final com.google.gerrit.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names = collectProjects ( progress ) ; return reindexProjects ( index , names , progress ) ; }
Source:
public void testBulletList4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug, you have to:\n" + ( "* Be on IMAP or EAS (not on POP)\n" + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug, you have to:\n" + ( "* Be on IMAP or EAS (not on POP)\n" + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) ) ; }
Source:
private static com.google.protobuf.ByteString deflate ( final byte [ ] buf ) { final com.google.protobuf.ByteString.Output r = com.google.protobuf.ByteString.newOutput ( ) ; final java.util.zip.DeflaterOutputStream out = new java.util.zip.DeflaterOutputStream ( r ) ; try { out.write ( buf ) ; out.close ( ) ; } catch ( java.io.IOException err ) { throw new com.google.codereview.manager.StopProcessingException ( "Unexpected IO error" , err ) ; } return r.toByteString ( ) ; }

Target:
private com.google.protobuf.ByteString deflate ( final byte [ ] buf ) { final com.google.protobuf.ByteString.Output r = com.google.protobuf.ByteString.newOutput ( ) ; final java.util.zip.DeflaterOutputStream out ; out = new java.util.zip.DeflaterOutputStream ( r , patchDeflater ) ; try { out.write ( buf ) ; out.close ( ) ; } catch ( java.io.IOException err ) { throw new com.google.codereview.manager.StopProcessingException ( "Unexpected IO error" , err ) ; } finally { patchDeflater.reset ( ) ; } return r.toByteString ( ) ; }
Source:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.7 <= ( Main.parse ( version ) ) ) { return true ; } else { java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 7 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; } }

Target:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.8 <= ( Main.parse ( version ) ) ) { return true ; } java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 8 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; }
Source:
public WorkQueue.Executor get ( ) { final com.google.gerrit.server.git.WorkQueue.Executor executor ; executor = queues.createQueue ( poolSize , "SSH-Stream-Worker" ) ; final java.util.concurrent.ThreadFactory parent = executor.getThreadFactory ( ) ; executor.setThreadFactory ( new java.util.concurrent.ThreadFactory ( ) { @ java.lang.Override public java.lang.Thread newThread ( final java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setPriority ( java.lang.Thread.MIN_PRIORITY ) ; return t ; } } ) ; return executor ; }

Target:
public java.util.concurrent.ScheduledThreadPoolExecutor get ( ) { final java.util.concurrent.ScheduledThreadPoolExecutor executor ; executor = queues.createQueue ( poolSize , "SSH-Stream-Worker" ) ; final java.util.concurrent.ThreadFactory parent = executor.getThreadFactory ( ) ; executor.setThreadFactory ( new java.util.concurrent.ThreadFactory ( ) { @ java.lang.Override public java.lang.Thread newThread ( java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setPriority ( java.lang.Thread.MIN_PRIORITY ) ; return t ; } } ) ; return executor ; }
Source:
private java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } try { return java.net.InetAddress.getLocalHost ( ) . getCanonicalHostName ( ) ; } catch ( java.net.UnknownHostException e ) { return "localhost" ; } }

Target:
private java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } return org.spearce.jgit.util.SystemReader.getInstance ( ) . getHostname ( ) ; }
Source:
private static java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( com.google.gerrit.extensions.common.ChangeInfo ci ) { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > result = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.extensions.common.LabelInfo li : ci.labels.values ( ) ) { for ( com.google.gerrit.extensions.common.ApprovalInfo ai : li.all ) { result.add ( new com.google.gerrit.reviewdb.client.Account.Id ( ai._accountId ) ) ; } } return result ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.ChangeInfo ci = gApi.changes ( ) . id ( changeId ) . get ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > result = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.extensions.common.LabelInfo li : ci.labels.values ( ) ) { for ( com.google.gerrit.extensions.common.ApprovalInfo ai : li.all ) { result.add ( new com.google.gerrit.reviewdb.client.Account.Id ( ai._accountId ) ) ; } } return result ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.acceptance.AccountCreator.class ) ; factory ( PushOneCommit.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.acceptance.AccountCreator.class ) ; factory ( PushOneCommit.Factory.class ) ; factory ( SubmoduleOp.Factory.class ) ; install ( com.google.gerrit.acceptance.InProcessProtocol.module ( ) ) ; install ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; install ( new com.google.gerrit.server.git.AsyncReceiveCommits.Module ( ) ) ; }
Source:
private void setUp ( ) { try { getEventsDb ( ) . createDBIfNotCreated ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( ( "Cannot start the database. Events will be stored locally " + "until database connection can be established" ) , e ) ; setOnline ( false ) ; } if ( online ) { restoreEventsFromLocal ( ) ; } removeOldEvents ( ) ; }

Target:
private void setOnline ( boolean online ) { this . online = online ; setUp ( ) ; if ( ! online ) { checkConnTask = pool.scheduleWithFixedDelay ( new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.CheckConnectionTask ( ) , 0 , connectTime , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } else { cancelCheckConnectionTaskIfScheduled ( false ) ; } }
Source:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; }

Target:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "gsql" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; }
Source:
public void isEnabledForRegexRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = ^refs/heads/mybranch.*\n" + " blockedFileExtension = jar" ) ) ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anotherref" ) ) . isFalse ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/mybranch123" ) ) . isTrue ( ) ; }

Target:
public void isEnabledForRegexRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = ^refs/heads/mybranch.*\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anotherref" , "blockedFileExtension" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/mybranch123" , "blockedFileExtension" ) ) . isTrue ( ) ; }
Source:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { com.google.gwt.dom.client.Element div = com.google.gwt.user.client.DOM.createDiv ( ) ; div.setClassName ( diffTable.style.padding ( ) ) ; div.getStyle ( ) . setHeight ( cnt , Unit.EM ) ; net.codemirror.lib.Configuration config = net.codemirror.lib.Configuration.create ( ) . set ( "coverGutter" , true ) . set ( "above" , ( line == 0 ) ) ; cm.addLineWidget ( ( line == 0 ? 0 : line - 1 ) , div , config ) ; }

Target:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int nextLine , int cnt ) { addPaddingWidget ( cm , diffTable.style.padding ( ) , ( nextLine - 1 ) , cnt , Unit.EM ) ; }
Source:
private static java.util.List < java.lang.String > parseChangeTableColumns ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg ) { java.util.List < java.lang.String > changeTable = com.google.gerrit.server.account.PreferencesConfig.changeTable ( cfg ) ; if ( ( changeTable == null ) && ( defaultCfg != null ) ) { changeTable = com.google.gerrit.server.account.PreferencesConfig.changeTable ( defaultCfg ) ; } return changeTable ; }

Target:
private static java.util.List < java.lang.String > parseChangeTableColumns ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg ) { java.util.List < java.lang.String > changeTable = com.google.gerrit.server.account.Preferences.changeTable ( cfg ) ; if ( ( changeTable == null ) && ( defaultCfg != null ) ) { changeTable = com.google.gerrit.server.account.Preferences.changeTable ( defaultCfg ) ; } return changeTable ; }
Source:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev/heads/foobar" , d ) ; }
Source:
private java.lang.String buildText ( java.lang.String pathAndQuery , java.lang.String expectedMode ) throws java.lang.Exception { com.google.gitiles.TestViewFilter.Result res = service ( pathAndQuery ) ; org.junit.Assert.assertNull ( res.getResponse ( ) . getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) ; org.junit.Assert.assertEquals ( expectedMode , res.getResponse ( ) . getHeader ( PathServlet.MODE_HEADER ) ) ; return res.getResponse ( ) . getActualBodyString ( ) ; }

Target:
private java.lang.String buildText ( java.lang.String pathAndQuery , java.lang.String expectedMode ) throws java.lang.Exception { com.google.gitiles.TestViewFilter.Result res = service ( pathAndQuery ) ; org.junit.Assert.assertEquals ( "text/plain" , res.getResponse ( ) . getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) ; org.junit.Assert.assertEquals ( expectedMode , res.getResponse ( ) . getHeader ( PathServlet.MODE_HEADER ) ) ; return res.getResponse ( ) . getActualBodyString ( ) ; }
Source:
private java.lang.String newChange2 ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; return push.rm ( git , "refs/for/master" ) . getChangeId ( ) ; }

Target:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { org.junit.Assert.assertEquals ( "no changes were made" , e.getMessage ( ) ) ; } }
Source:
public void defaultGroupsCreated_ssh ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; org.junit.Assert.assertFalse ( session.getError ( ) , session.hasError ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Non-Interactive Users" ) ) ; session.close ( ) ; }

Target:
public void defaultGroupsCreated_ssh ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "Administrators" ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "Non-Interactive Users" ) ; session.close ( ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.reviewdb.client.Change c = dbProvider.get ( ) . changes ( ) . get ( id ) ; if ( c == null ) { return null ; } return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( c ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( dbProvider.get ( ) , rsrc.getProject ( ) , id ) ; return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( notes ) ; }
Source:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . addReviewer ( in ) ; }

Target:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; com.google.gerrit.extensions.api.changes.ChangeApi cApi = gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) ; cApi.addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , com.google.gerrit.acceptance.api.change.ChangeIT.getReviewers ( cApi.get ( ) ) ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.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 = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; tr.branch ( RefNames.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }

Target:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; tr.branch ( com.google.gerrit.gpg.PublicKeyStore.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( comment.id ( ) ) == null ) { removeUI ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }

Target:
private boolean isNew ( ) { return ( comment.id ( ) ) == null ; }
Source:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }

Target:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; long maxMs = ChangeRebuilder.MAX_WINDOW_MS ; com.google.common.truth.Truth.assertThat ( maxMs ) . isGreaterThan ( 1000L ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( ( maxMs * 2 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsSummaryPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsSummaryPanel.Factory ( ) ) ; } if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; } }
Source:
public static java.lang.String refsUsers ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) ; int account = accountId.get ( ) ; int m = account % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( account ) ; return r.toString ( ) ; }

Target:
public static java.lang.String refsUsers ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( accountId.get ( ) ) ) ; return r.toString ( ) ; }