auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ViewpointSelectionCallbackWithConfimationAndDependenciesHandling() { <START> super(); this.askUserForDependencyActivation = true; <END> }</code><technical_language>"this(true)"</technical_language>

Target:
public ViewpointSelectionCallbackWithConfimationAndDependenciesHandling() { this(true); }
Source:
<code>public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { final Identity identity; <START> try (final DefaultAgentProxy agentProxy = new DefaultAgentProxy()) { <END> identity = agentProxy.list().get(0); } final RecordingTlsClientProtocol protocol = new RecordingTlsClientProtocol( s.getInputStream(), s.getOutputStream(), new SecureRandom()); final SshAgentTlsClient tlsClient = new SshAgentTlsClient(username, identity, protocol); protocol.connect(tlsClient); return new SshAgentTlsSocket(tlsClient, s); }</code><technical_language>final AgentProxy agentProxy = AgentProxies.newInstance()</technical_language>

Target:
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { final RecordingTlsClientProtocol protocol = new RecordingTlsClientProtocol( s.getInputStream(), s.getOutputStream(), new SecureRandom()); final SshAgentTlsClient tlsClient = new SshAgentTlsClient(agentProxy, identity, username, protocol); protocol.connect(tlsClient); return new SshAgentTlsSocket(tlsClient, s); }
Source:
<code>public void dump(PrintWriter writer) { writer.println("===============BEGIN PICASSO STATS ==============="); writer.println("Memory Cache Stats"); writer.print(" Max Cache Size: "); writer.println(maxSize); writer.print(" Cache Size: "); writer.println(size); writer.print(" Cache % Full: "); writer.println((int) Math.ceil((float) size / maxSize * 100)); writer.print(" Cache Hits: "); writer.println(cacheHits); writer.print(" Cache Misses: "); writer.println(cacheMisses); <START> writer.print(" Download Count: "); <END> writer.println(downloadCount); writer.print(" Total Download Size: "); writer.println(totalDownloadSize); writer.print(" Average Download Size: "); writer.println(averageDownloadSize); writer.println("Bitmap Stats"); writer.print(" Total Bitmaps Decoded: "); writer.println(originalBitmapCount); writer.print(" Total Bitmap Size: "); writer.println(totalOriginalBitmapSize); writer.print(" Total Transformed Bitmaps: "); writer.println(transformedBitmapCount); writer.print(" Total Transformed Bitmap Size: "); writer.println(totalTransformedBitmapSize); writer.print(" Average Bitmap Size: "); writer.println(averageOriginalBitmapSize); writer.print(" Average Transformed Bitmap Size: "); writer.println(averageTransformedBitmapSize); writer.println("===============END PICASSO STATS ==============="); writer.flush(); }</code><technical_language>in memory cache section</technical_language>

Target:
public void dump(PrintWriter writer) { writer.println("===============BEGIN PICASSO STATS ==============="); writer.println("Memory Cache Stats"); writer.print(" Max Cache Size: "); writer.println(maxSize); writer.print(" Cache Size: "); writer.println(size); writer.print(" Cache % Full: "); writer.println((int) Math.ceil((float) size / maxSize * 100)); writer.print(" Cache Hits: "); writer.println(cacheHits); writer.print(" Cache Misses: "); writer.println(cacheMisses); writer.println("Network Stats"); writer.print(" Download Count: "); writer.println(downloadCount); writer.print(" Total Download Size: "); writer.println(totalDownloadSize); writer.print(" Average Download Size: "); writer.println(averageDownloadSize); writer.println("Bitmap Stats"); writer.print(" Total Bitmaps Decoded: "); writer.println(originalBitmapCount); writer.print(" Total Bitmap Size: "); writer.println(totalOriginalBitmapSize); writer.print(" Total Transformed Bitmaps: "); writer.println(transformedBitmapCount); writer.print(" Total Transformed Bitmap Size: "); writer.println(totalTransformedBitmapSize); writer.print(" Average Bitmap Size: "); writer.println(averageOriginalBitmapSize); writer.print(" Average Transformed Bitmap Size: "); writer.println(averageTransformedBitmapSize); writer.println("===============END PICASSO STATS ==============="); writer.flush(); }
Source:
<code>public void shouldReturnNoChanges() throws Exception { changeFilesInProject(); showSynchronizationDialog("org.eclipse.egit.ui"); bot.shell("Synchronize repository: egit/.git").activate(); bot.comboBox(0).setSelection(0); bot.comboBox(1).setSelection(0); bot.comboBox(2).setSelection(0); bot.comboBox(3).setSelection(1); bot.button("OK").click(); bot.waitUntil(shellIsActive("Confirm Open Perspective"), 15000); bot.button("No").click(); SWTBotShell gitResSyncShell = bot.shell("Git Resource Synchronization"); <START> bot.waitUntil(shellCloses(gitResSyncShell), 6000000); <END> SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }</code><technical_language>Do want wait 6000s ? This is 2 hours, insane for automated test</technical_language>

Target:
public void shouldReturnNoChanges() throws Exception { changeFilesInProject(); showSynchronizationDialog("org.eclipse.egit.ui"); bot.shell("Synchronize repository: egit" + File.separator + ".git") .activate(); bot.comboBox(0).setSelection("local .git"); bot.comboBox(1).setSelection("HEAD"); bot.comboBox(2).setSelection("local .git"); bot.comboBox(3).setSelection("master"); bot.button("OK").click(); handleConfirmOpenPerspective(); bot.waitUntil(shellIsActive("Git Resource Synchronization"), 15000); SWTBotShell gitResSyncShell = bot.shell("Git Resource Synchronization"); bot.waitUntil(shellCloses(gitResSyncShell), 300000); SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }
Source:
<code>public static boolean currentUserIsAnonymous() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); <START> return authentication == null <END> || (currentUserHasRole(AUTHORITY_ANONYMOUS) && !currentUserHasRole(AUTHORITY_USER)); }</code><technical_language>Is a case authentication != null for anonymous users? In other words: remove part of check</technical_language>

Target:
public static boolean currentUserIsAnonymous() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication == null || (authentication instanceof AnonymousAuthenticationToken); }
Source:
<code>public String getDisplayName() { <START> return "Jenkins Global Configuration File (secrets are filtered out unless saved in clear in the config.xml file)"; <END> }</code><technical_language>text is grammatically incorrect. Encrypted secrets *are* redacted Is a safer shorter statement</technical_language>

Target:
public String getDisplayName() { return "Jenkins Global Configuration File (Encrypted secrets are redacted)"; }
Source:
<code>protected Map<String, Integer> getPortMap() { <START> return ImmutableMap.of("http", getEntity().getAttribute(WebAppService.HTTP_PORT)); <END> }</code><technical_language>getHttpPort() instead of repeating call getAttribute()</technical_language>

Target:
protected Map<String, Integer> getPortMap() { return ImmutableMap.of("http", getHttpPort()); }
Source:
<code>public void setUp() throws Exception { <START> this.workspaceName = NameGenerator.generate("workspace", 5); <END> dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, workspaceName, Collections.emptyList(), null); }</code><technical_language>extracted a constant name: private static final String WORKSPACE_NAME = NameGenerator.generate(DeleteRunningWorkspaceTest.class.getSimpleName(), 5);</technical_language>

Target:
public void setUp() throws Exception { dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, WORKSPACE_NAME, Collections.emptyList(), null); }
Source:
<code>private Date calculateExpirationValue(long value, String units) { Calendar currentTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Long longObj = -value; <START> if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_SEC) && units != null) { <END> currentTime.add(Calendar.SECOND, longObj.intValue()); } else if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_MIN) && units != null) { currentTime.add(Calendar.MINUTE, longObj.intValue()); } else if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_HOUR) && units != null) { currentTime.add(Calendar.HOUR_OF_DAY, longObj.intValue()); } else { currentTime.add(Calendar.DAY_OF_YEAR, longObj.intValue()); } return currentTime.getTime(); }</code><technical_language>this instead NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_SEC.equalsIgnoreCase(units) remove units!= null</technical_language>

Target:
private Date calculateExpirationValue(long value, String units) { Calendar currentTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Long longObj = -value; if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_SEC.equalsIgnoreCase(units)) { currentTime.add(Calendar.SECOND, longObj.intValue()); } else if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_MIN.equalsIgnoreCase(units)) { currentTime.add(Calendar.MINUTE, longObj.intValue()); } else if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_HOUR.equalsIgnoreCase(units)) { currentTime.add(Calendar.HOUR_OF_DAY, longObj.intValue()); } else { currentTime.add(Calendar.DAY_OF_YEAR, longObj.intValue()); } return currentTime.getTime(); }
Source:
<code>public void getAccountPropertiesWithResponse() { formTrainingAsyncClient.getAccountPropertiesWithResponse().subscribe(response -> { <START> AccountProperties accountProperties = response.getValue(); <END> System.out.printf("Max number of models that can be trained for this account: %s%n", accountProperties.getLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountPropertiesWithResponse }</code><technical_language>print status code show difference response</technical_language>

Target:
public void getAccountPropertiesWithResponse() { formTrainingAsyncClient.getAccountPropertiesWithResponse().subscribe(response -> { System.out.printf("Response Status Code: %d.", response.getStatusCode()); AccountProperties accountProperties = response.getValue(); System.out.printf("Max number of models that can be trained for this account: %s%n", accountProperties.getLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountPropertiesWithResponse }
Source:
<code>public void onFocus() { if ( !loading && context != null ) { dataModelerWBContext.setActiveContext( context ); <START> enableDataModelerDocksWhenIsHidden(); <END> } }</code><technical_language>Sorry.. pedantic.. in onFocus handler call a method enableDataModelerDocksWhenIsHidden()... this method called showDataModellerDocks()</technical_language>

Target:
public void onFocus() { if ( !loading && context != null ) { dataModelerWBContext.setActiveContext( context ); showDataModellerDocks(); } }
Source:
<code>public void run() { if (getListener() == null) { logger.info(this + " No listener bound to server connection factory; will not read; exiting..."); return; } try { this.serverChannel = ServerSocketChannel.open(); int port = super.getPort(); getTcpSocketSupport().postProcessServerSocket(this.serverChannel.socket()); this.serverChannel.configureBlocking(false); if (getLocalAddress() == null) { this.serverChannel.socket().bind(new InetSocketAddress(port), Math.abs(getBacklog())); } else { InetAddress whichNic = InetAddress.getByName(getLocalAddress()); this.serverChannel.socket().bind(new InetSocketAddress(whichNic, port), Math.abs(getBacklog())); } if (logger.isInfoEnabled()) { logger.info(this + " Listening"); } <START> publishServerListeningEvent(getPort()); <END> final Selector selector = Selector.open(); if (this.serverChannel == null) { if (logger.isDebugEnabled()) { logger.debug(this + " stopped before registering the server channel"); } } else { this.serverChannel.register(selector, SelectionKey.OP_ACCEPT); setListening(true); this.selector = selector; doSelect(this.serverChannel, selector); } } catch (IOException e) { if (isActive()) { logger.error("Error on ServerChannel; port = " + getPort(), e); publishServerExceptionEvent(e); } stop(); } finally { setListening(false); } }</code><technical_language>I issue TcpNioConnectionTests.int3453RaceTest. Previously waited for TcpConnectionOpenEvent, a new TcpConnectionServerListeningEvent, is emitted connection.publishConnectionOpenEvent();. if (event instanceof TcpConnectionOpenEvent) { connectionLatch.countDown(); } fixes early exit factory setup</technical_language>

Target:
public void run() { if (getListener() == null) { logger.info(this + " No listener bound to server connection factory; will not read; exiting..."); return; } try { this.serverChannel = ServerSocketChannel.open(); int port = super.getPort(); getTcpSocketSupport().postProcessServerSocket(this.serverChannel.socket()); this.serverChannel.configureBlocking(false); if (getLocalAddress() == null) { this.serverChannel.socket().bind(new InetSocketAddress(port), Math.abs(getBacklog())); } else { InetAddress whichNic = InetAddress.getByName(getLocalAddress()); this.serverChannel.socket().bind(new InetSocketAddress(whichNic, port), Math.abs(getBacklog())); } if (logger.isInfoEnabled()) { logger.info(this + " Listening"); } final Selector selector = Selector.open(); if (this.serverChannel == null) { if (logger.isDebugEnabled()) { logger.debug(this + " stopped before registering the server channel"); } } else { this.serverChannel.register(selector, SelectionKey.OP_ACCEPT); setListening(true); publishServerListeningEvent(getPort()); this.selector = selector; doSelect(this.serverChannel, selector); } } catch (IOException e) { if (isActive()) { logger.error("Error on ServerChannel; port = " + getPort(), e); publishServerExceptionEvent(e); } stop(); } finally { setListening(false); } }
Source:
<code>public void delete(final RyaStatement statement, final MongoDBRdfConfiguration conf) throws RyaDAOException { final boolean canDelete = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canDelete) { final DBObject obj = storageStrategy.getQuery(statement); <START> coll.remove(obj); <END> } }</code><technical_language>I @dlotts added some code for removing statements indexers. get erased here</technical_language>

Target:
public void delete(final RyaStatement statement, final MongoDBRdfConfiguration conf) throws RyaDAOException { final boolean canDelete = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canDelete) { final DBObject obj = storageStrategy.getQuery(statement); coll.remove(obj); } else { throw new RyaDAOException("User does not have the required authorizations to delete statement"); } }
Source:
<code><START> DeerIdSearcherAndOwlResolver equivDeerSearchResolver() { <END> TransportClient esClient = getTransportClient(); ContentTitleSearcher contentSearcher = new EsContentTitleSearcher(esClient); return new DeerIdSearcherAndOwlResolver( contentSearcher, Long.parseLong(esTimeout), null, null ); }</code><technical_language>Return type SearchResolver interface for autowiring work if needed in future</technical_language>

Target:
SearchResolver equivDeerSearchResolver() { TransportClient esClient = getTransportClient(); ContentTitleSearcher contentSearcher = new EsContentTitleSearcher(esClient); return new DeerSearchResolver( contentSearcher, Long.parseLong(esTimeout), null, null ); }
Source:
<code><START> public Boolean waitListOfFilesNames(final String text) { <END> return new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until((ExpectedCondition<Boolean>) webDriver -> suggestionPanel.getText().contains(text)); }</code><technical_language>"Wait" require returning value. IMHO rename method isFilenameSuggested(nameFragment) actual commands</technical_language>

Target:
public void waitListOfFilesNames(final String text) { new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until((ExpectedCondition<Boolean>) webDriver -> suggestionPanel.getText().contains(text)); }
Source:
<code>public AutoCompletionCandidates doAutoCompleteJobName(@AncestorInPath @CheckForNull Item project, @QueryParameter String value) { final AutoCompletionCandidates candidates = new AutoCompletionCandidates(); <START> final Jenkins jenkins = Jenkins.getInstance(); <END> if (jenkins == null) { return null; } if (project == null || !project.hasPermission(Item.CONFIGURE)) { return candidates; } for (AbstractProject job: jenkins.getAllItems(AbstractProject.class)) { if (job.getFullName().contains(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }</code><technical_language>Move static getActiveInstance() everywhere</technical_language>

Target:
public AutoCompletionCandidates doAutoCompleteJobName(@AncestorInPath @CheckForNull Item project, @QueryParameter String value) { final AutoCompletionCandidates candidates = new AutoCompletionCandidates(); final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null || project == null || !project.hasPermission(Item.CONFIGURE)) { return candidates; } for (AbstractProject job: jenkins.getAllItems(AbstractProject.class)) { if (job.getFullName().contains(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }
Source:
<code>public void getTokenShouldReturnToken() { BitreserveClient bitreserveClient = new BitreserveClient("foobar"); <START> Assert.assertEquals(bitreserveClient.getToken().getToken(), "foobar"); <END> }</code><technical_language>In order avoid pleonasm, do of renaming token variable Token class to: bearerToken? way, this line become: java Assert.assertEquals(bitreserveClient.getToken().getBearerToken(), "foobar");</technical_language>

Target:
public void getTokenShouldReturnToken() { BitreserveClient bitreserveClient = new BitreserveClient("foobar"); Assert.assertEquals(bitreserveClient.getToken().getBearerToken(), "foobar"); }
Source:
<code>private String updateConfigurationValue(final String line, GCType configuredGC, Map<String, JVMOption> upsertSet, Map<String, JVMOption> excludeSet) { JVMOption option = JVMOption.parse(line); if (option == null) return line; <START> GCType gcType = GCTuner.isOptionAvailable(option); <END> if (gcType != null) { option.setCommented(gcType != configuredGC); } if (upsertSet != null && upsertSet.containsKey(option.getJvmOption())) { JVMOption configuration = upsertSet.get(option.getJvmOption()); option.setCommented(false); option.setValue(configuration.getValue()); upsertSet.remove(option.getJvmOption()); } ; if (excludeSet != null && excludeSet.containsKey(option.getJvmOption())) option.setCommented(true); return option.toString(); }</code><technical_language>Instead of isOptionAvailable, getGcType more sense</technical_language>

Target:
private String updateConfigurationValue(final String line, GCType configuredGC, Map<String, JVMOption> upsertSet, Map<String, JVMOption> excludeSet) { JVMOption option = JVMOption.parse(line); if (option == null) return line; if (option.isHeapJVMOption()) { String configuredValue = null; switch (option.getJvmOption()) { case "-Xmn": configuredValue = config.getHeapNewSize(); break; default: configuredValue = config.getHeapSize(); break; } setHeapSetting(configuredValue, option); } GCType gcType = GCTuner.getGCType(option); if (gcType != null) { option.setCommented(gcType != configuredGC); } if (upsertSet != null && upsertSet.containsKey(option.getJvmOption())) { JVMOption configuration = upsertSet.get(option.getJvmOption()); option.setCommented(false); option.setValue(configuration.getValue()); upsertSet.remove(option.getJvmOption()); } ; if (excludeSet != null && excludeSet.containsKey(option.getJvmOption())) option.setCommented(true); return option.toJVMOptionString(); }
Source:
<code>public void completeCrossDeviceEmailLinkFlow() { setTitle(R.string.fui_email_link_confirm_email_header); EmailLinkEmailPromptFragment fragment = EmailLinkEmailPromptFragment.newInstance(); <START> switchFragment(fragment, R.id.fragment_register_email, <END> EmailLinkCrossDeviceLinkingFragment.TAG, true, true); }</code><technical_language>add this fragment backstack, earlier (line 57) add fragment backstack. explain situations solving for</technical_language>

Target:
public void completeCrossDeviceEmailLinkFlow() { EmailLinkPromptEmailFragment fragment = EmailLinkPromptEmailFragment.newInstance(); switchFragment(fragment, R.id.fragment_register_email, EmailLinkCrossDeviceLinkingFragment.TAG, true, true); }
Source:
<code>public static void calculateUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { <START> final byte[] referenceBases = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())).getBases(); <END> if (record.getBaseQualities() != SAMRecord.NULL_QUALS) { record.setAttribute(SAMTag.UQ.name(), SequenceUtil.sumQualitiesOfMismatches(record, referenceBases, 0, isBisulfiteSequence)); } }</code><technical_language>This moved if avoid unnecessary work if is false</technical_language>

Target:
public static void calculateUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { if (record.getBaseQualities() != SAMRecord.NULL_QUALS) { final byte[] referenceBases = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())).getBases(); record.setAttribute(SAMTag.UQ.name(), SequenceUtil.sumQualitiesOfMismatches(record, referenceBases, 0, isBisulfiteSequence)); } }
Source:
<code>public void createsForkWithOrganization() throws Exception { final MkForks forks = new MkForks(new MkStorage.InFile(), "Test1", new Coordinates.Simple("tests1", "forks1") ); MatcherAssert.assertThat( forks.create("blah"), <START> Matchers.notNullValue() <END> ); }</code><technical_language>Instead of Matchers.notNullValue() please, check actual equals expected</technical_language>

Target:
public void createsForkWithOrganization() throws Exception { final Fork.Smart fork = new Fork.Smart( this.repo().forks().create("OneOrganization") ); MatcherAssert.assertThat( this.repo().forks().get(Integer.parseInt(fork.forkId())), Matchers.notNullValue() ); }
Source:
<code>public Guid getVmTemplateId() { if (isImagesAlreadyOnTarget()) { return getParameters().getContainerId(); <START> } else { <END> return super.getVmTemplateId(); } }</code><technical_language>remove 'else' clause..</technical_language>

Target:
public Guid getVmTemplateId() { if (isImagesAlreadyOnTarget()) { return getParameters().getContainerId(); } return super.getVmTemplateId(); }
Source:
<code>public void search(SortedMap<Integer, String> topics, String submissionFile, Similarity similarity, int numHits, RerankerCascade cascade) throws IOException, ParseException { IndexSearcher searcher = new IndexSearcher(reader); searcher.setSimilarity(similarity); final String runTag = "BM25_EnglishAnalyzer_" + FIELD_BODY + "_" + similarity.toString(); PrintWriter out = new PrintWriter(Files.newBufferedWriter(Paths.get(submissionFile), StandardCharsets.US_ASCII)); QueryParser queryParser = new QueryParser(FIELD_BODY, new EnglishAnalyzer()); queryParser.setDefaultOperator(QueryParser.Operator.OR); for (Map.Entry<Integer, String> entry : topics.entrySet()) { int qID = entry.getKey(); String queryString = entry.getValue(); Query query = queryParser.parse(queryString); TopDocs rs = searcher.search(query, numHits); ScoreDoc[] hits = rs.scoreDocs; List<String> queryTokens = AnalyzerUtils.tokenize(new EnglishAnalyzer(), queryString); RerankerContext context = new RerankerContext(searcher, query, String.valueOf(qID), queryString, queryTokens, FIELD_BODY, null); ScoredDocuments docs = cascade.run(ScoredDocuments.fromTopDocs(rs, searcher), context); for (int i = 0; i < hits.length; i++) { int docId = hits[i].doc; Document doc = searcher.doc(docId); out.print(qID); out.print("\tQ0\t"); out.print(doc.get(FIELD_ID)); out.print("\t"); <START> out.print(i + 1); <END> out.print("\t"); out.print(hits[i].score); out.print("\t"); out.print(runTag); out.println(); } } out.flush(); out.close(); }</code><technical_language>I lost in diffs, this method go</technical_language>

Target:
public void search(SortedMap<Integer, String> topics, String submissionFile, Similarity similarity, int numHits, RerankerCascade cascade) throws IOException, ParseException { final String runTag = "BM25_EnglishAnalyzer_" + FIELD_BODY + "_" + similarity.toString(); search(topics, submissionFile, similarity, numHits, cascade, runTag); }
Source:
<code>public void initWithNiwsConfig(IClientConfig clientConfig) { if (clientConfig == null) { return; } clientName = clientConfig.getClientName(); if (clientName == null) { clientName = "default"; } vipAddresses = clientConfig.resolveDeploymentContextbasedVipAddresses(); maxAutoRetries = clientConfig.getPropertyAsInteger(CommonClientConfigKey.MaxAutoRetries, DefaultClientConfigImpl.DEFAULT_MAX_AUTO_RETRIES); maxAutoRetriesNextServer = clientConfig.getPropertyAsInteger(CommonClientConfigKey.MaxAutoRetriesNextServer,maxAutoRetriesNextServer); okToRetryOnAllOperations = clientConfig.getPropertyAsBoolean(CommonClientConfigKey.OkToRetryOnAllOperations, okToRetryOnAllOperations); tracer = getExecuteTracer(); if(clientConfig.getPropertyAsBoolean(CommonClientConfigKey.ForceClientPortConfiguration, false)){ if(clientConfig.getPropertyAsBoolean(CommonClientConfigKey.IsSecure, false)){ if(clientConfig.containsProperty(CommonClientConfigKey.SecurePort)){ overridePort = clientConfig.getPropertyAsInteger(CommonClientConfigKey.SecurePort, DefaultClientConfigImpl.DEFAULT_PORT); shouldUseOverridePort = true; }else{ logger.warn("%s set to force client port but no secure port is set, so ignoring", clientName); } }else{ if(clientConfig.containsProperty(CommonClientConfigKey.Port)){ overridePort = clientConfig.getPropertyAsInteger(CommonClientConfigKey.Port, DefaultClientConfigImpl.DEFAULT_PORT); shouldUseOverridePort = true; }else{ <START> logger.warn("%s set to force client port but no secure port is set, so ignoring", clientName); <END> } } } Monitors.registerObject("Client_" + clientName, this); }</code><technical_language>I "%s" works here. "{}"</technical_language>

Target:
public void initWithNiwsConfig(IClientConfig clientConfig) { if (clientConfig == null) { return; } clientName = clientConfig.getClientName(); if (clientName == null) { clientName = "default"; } vipAddresses = clientConfig.resolveDeploymentContextbasedVipAddresses(); maxAutoRetries = clientConfig.getPropertyAsInteger(CommonClientConfigKey.MaxAutoRetries, DefaultClientConfigImpl.DEFAULT_MAX_AUTO_RETRIES); maxAutoRetriesNextServer = clientConfig.getPropertyAsInteger(CommonClientConfigKey.MaxAutoRetriesNextServer,maxAutoRetriesNextServer); okToRetryOnAllOperations = clientConfig.getPropertyAsBoolean(CommonClientConfigKey.OkToRetryOnAllOperations, okToRetryOnAllOperations); tracer = getExecuteTracer(); Monitors.registerObject("Client_" + clientName, this); }
Source:
<code>private static void runTest(ICache<Integer, Integer> icacheOnClient, NearCacheConfig.LocalUpdatePolicy localUpdatePolicy) throws InterruptedException { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.put(i, i); if (localUpdatePolicy.equals(INVALIDATE)) { icacheOnClient.get(i); } } <START> AtomicBoolean stop = new AtomicBoolean(false); <END> Runnable getter = () -> { while (!stop.get()) { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.get(i); } } }; Runnable putter = () -> { while (!stop.get()) { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.put(i, i); } } }; ExecutorService executor = Executors.newCachedThreadPool(); int numOfGetters = 3 * RuntimeAvailableProcessors.get(); for (int i = 0; i < numOfGetters; i++) { executor.execute(getter); } executor.execute(putter); sleepSeconds(20); stop.set(true); executor.shutdown(); executor.awaitTermination(30, TimeUnit.SECONDS); }</code><technical_language>Minor: false is a default value</technical_language>

Target:
private static void runTest(ICache<Integer, Integer> icacheOnClient, NearCacheConfig.LocalUpdatePolicy localUpdatePolicy) throws InterruptedException { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.put(i, i); if (localUpdatePolicy.equals(INVALIDATE)) { icacheOnClient.get(i); } } AtomicBoolean stop = new AtomicBoolean(); Runnable getter = () -> { while (!stop.get()) { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.get(i); } } }; Runnable putter = () -> { while (!stop.get()) { for (int i = 0; i < NUM_OF_KEYS; i++) { icacheOnClient.put(i, i); } } }; ExecutorService executor = Executors.newCachedThreadPool(); int numOfGetters = 3 * RuntimeAvailableProcessors.get(); for (int i = 0; i < numOfGetters; i++) { executor.execute(getter); } executor.execute(putter); sleepSeconds(10); stop.set(true); executor.shutdown(); executor.awaitTermination(120, TimeUnit.SECONDS); }
Source:
<code>private void initClientCache() { Region region = getClientCache().createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create(REGION_NAME); <START> region.registerInterest("ALL_KEYS"); <END> }</code><technical_language>Based API doc, ALL_KEYS behavior is deprecated, please alternative</technical_language>

Target:
private void initClientCache() { Region region = getClientCache().createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create(REGION_NAME); region.registerInterestForAllKeys(InterestResultPolicy.KEYS); }
Source:
<code>AzureMonitorExporter(MonitorExporterClient client, String instrumentationKey) { this.client = client; this.instrumentationKey = instrumentationKey; <START> this.telemetryItemNamePrefix = "Microsoft.ApplicationInsights." + instrumentationKey + "."; <END> }</code><technical_language>i dashes need removed ikey</technical_language>

Target:
AzureMonitorExporter(MonitorExporterClient client, String instrumentationKey) { this.client = client; this.instrumentationKey = instrumentationKey; String formattedInstrumentationKey = instrumentationKey.replaceAll("-", ""); this.telemetryItemNamePrefix = "Microsoft.ApplicationInsights." + formattedInstrumentationKey + "."; }
Source:
<code>public Map<RelationKey, RelationWriteMetadata> writeSet() { <START> Map<RelationKey, RelationWriteMetadata> map = new HashMap<RelationKey, RelationWriteMetadata>(2); <END> map.put(sampleRelationKey, new RelationWriteMetadata(sampleRelationKey, getSchema(), true, true)); map.put(countRelationKey, new RelationWriteMetadata(countRelationKey, COUNT_SCHEMA, true, true)); return map; }</code><technical_language>ImmutableMap.of()</technical_language>

Target:
public Map<RelationKey, RelationWriteMetadata> writeSet() { return ImmutableMap.of(getRelationKey(), new RelationWriteMetadata( getRelationKey(), getSchema(), true, true), countRelationKey, new RelationWriteMetadata(countRelationKey, COUNT_SCHEMA, true, true)); }
Source:
<code>protected final void activate(BundleContext bundleContext) { <START> databindingServiceReference = bundleContext.getServiceReference(EMFFormsDatabindingEMF.class); <END> if (databindingServiceReference == null) { throw new IllegalStateException( "The org.eclipse.emfforms.spi.core.services.databinding.emf.EMFFormsDatabindingEMF Service is not available!"); } setEMFFormsDatabinding(bundleContext.getService(databindingServiceReference)); }</code><technical_language>loaded lazy</technical_language>

Target:
protected final void activate(BundleContext bundleContext) { this.bundleContext = bundleContext; }
Source:
<code>protected boolean canDoAction() { Guid userId = getParameters().getUserProfile().getUserId(); if (Guid.isNullOrEmpty(userId)) { userId = getUserId(); getParameters().getUserProfile().setUserId(userId); } else if (!userId.equals(getUserId())) { return failCanDoAction(EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); } String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { return true; } <START> if (!OpenSSHUtils.isPublicKeysValid(sshPublicKey)) { <END> return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } return true; }</code><technical_language>arePublicKeysValid (or it) *VERY* minor</technical_language>

Target:
protected boolean canDoAction() { Guid userId = getParameters().getUserProfile().getUserId(); if (Guid.isNullOrEmpty(userId)) { userId = getUserId(); getParameters().getUserProfile().setUserId(userId); } else if (!userId.equals(getUserId())) { return failCanDoAction(EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); } String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { return true; } if (!OpenSSHUtils.arePublicKeysValid(sshPublicKey)) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } return true; }
Source:
<code>public void testRawStringLiterals() throws IOException { final String code = IOUtils.toString(CPPTokenizerTest.class.getResourceAsStream("cpp/issue-1784.cpp"), StandardCharsets.UTF_8); Tokens tokens = parse(code); <START> System.out.println(tokens.getTokens()); <END> assertTrue(TokenEntry.getEOF() != tokens.getTokens().get(0)); assertEquals(16, tokens.size()); }</code><technical_language>Please remove System.out here..</technical_language>

Target:
public void testRawStringLiterals() throws IOException { final String code = IOUtils.toString(CPPTokenizerTest.class.getResourceAsStream("cpp/issue-1784.cpp"), StandardCharsets.UTF_8); Tokens tokens = parse(code); assertTrue(TokenEntry.getEOF() != tokens.getTokens().get(0)); assertEquals(16, tokens.size()); }
Source:
<code>public Response logout() { logoutCurrentUser(); Status status; Map<String, String> data = new HashMap<>(); if (zConf.isAuthorizationHeaderClear()) { status = Status.UNAUTHORIZED; data.put("clearAuthorizationHeader", "true"); } else { status = Status.FORBIDDEN; data.put("clearAuthorizationHeader", "false"); } if (isKnoxSSOEnabled()) { KnoxJwtRealm knoxJwtRealm = getJTWRealm(); <START> StringBuilder redirectURL = new StringBuilder(knoxJwtRealm.getProviderUrl()); <END> String redirect = knoxJwtRealm.getRedirectParam(); data.put("redirectURL", constructUrl(redirectURL, redirect, knoxJwtRealm.getLogout())); data.put("isLogoutAPI", knoxJwtRealm.getLogoutAPI().toString()); } else if (isKerberosRealmEnabled()) { KerberosRealm kerberosRealm = getKerberosRealm(); StringBuilder redirectURL = new StringBuilder(kerberosRealm.getProviderUrl()); String redirect = kerberosRealm.getRedirectParam(); data.put("redirectURL", constructUrl(redirectURL, redirect, kerberosRealm.getLogout())); } JsonResponse<Map<String, String>> response = new JsonResponse<>(status, "", data); LOG.info(response.toString()); return response.build(); }</code><technical_language>Instead of passing StringBuilder this String</technical_language>

Target:
public Response logout() { logoutCurrentUser(); Status status; Map<String, String> data = new HashMap<>(); if (zConf.isAuthorizationHeaderClear()) { status = Status.UNAUTHORIZED; data.put("clearAuthorizationHeader", "true"); } else { status = Status.FORBIDDEN; data.put("clearAuthorizationHeader", "false"); } if (isKnoxSSOEnabled()) { KnoxJwtRealm knoxJwtRealm = getJTWRealm(); data.put("redirectURL", constructUrl(knoxJwtRealm.getProviderUrl(), knoxJwtRealm.getRedirectParam(), knoxJwtRealm.getLogout())); data.put("isLogoutAPI", knoxJwtRealm.getLogoutAPI().toString()); } else if (isKerberosRealmEnabled()) { KerberosRealm kerberosRealm = getKerberosRealm(); data.put("redirectURL", constructUrl(kerberosRealm.getProviderUrl(), kerberosRealm.getRedirectParam(), kerberosRealm.getLogout())); data.put("isLogoutAPI", kerberosRealm.getLogoutAPI().toString()); } JsonResponse<Map<String, String>> response = new JsonResponse<>(status, "", data); LOG.info(response.toString()); return response.build(); }
Source:
<code>private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful upload to {}", getUploadDescription()); <START> if (stopImageTransferSession(context.entity)) { <END> Guid transferingVdsId = context.entity.getVdsId(); if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(true); unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { setImageStatus(ImageStatus.ILLEGAL); updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } } }</code><technical_language>Please add a log indicating that, like: "stopping session succeed, upload state changed is ${uploadState}"</technical_language>

Target:
private void handleFinalizingSuccess(final StateContext context) { log.info("Finalizing successful upload to {}", getUploadDescription()); if (stopImageTransferSession(context.entity)) { Guid transferingVdsId = context.entity.getVdsId(); if (verifyImage(transferingVdsId)) { setVolumeLegalityInStorage(LEGAL_IMAGE); unLockImage(); updateEntityPhase(ImageTransferPhase.FINISHED_SUCCESS); } else { setImageStatus(ImageStatus.ILLEGAL); updateEntityPhase(ImageTransferPhase.FINALIZING_FAILURE); } } }
Source:
<code>private synchronized long generateBeginQuestionnaireTime(boolean debugging) { Logger.d(TAG, "Calculating time for new BeginQuestionnaire notification"); String startAllowedString = sharedPreferences.getString( "time_window_lb_key", getString(R.string.settings_time_window_lb_default)); now = Calendar.getInstance(); nowUpTime = SystemClock.elapsedRealtime(); Calendar start = (Calendar)now.clone(); startAllowedHour = Util.getHour(startAllowedString); startAllowedMinute = Util.getMinute(startAllowedString); start.set(Calendar.HOUR_OF_DAY, startAllowedHour); start.set(Calendar.MINUTE, startAllowedMinute); <START> <END> Calendar notifTime = (Calendar)start.clone(); notifTime.add(Calendar.MINUTE,30); if (now.getTimeInMillis() > notifTime.getTimeInMillis()) { notifTime.add(Calendar.DAY_OF_YEAR, 1); } long notifTimeMS; if (debugging) { notifTimeMS= now.getTimeInMillis() + 5000; } else { notifTimeMS = notifTime.getTimeInMillis(); } long delay = notifTimeMS - now.getTimeInMillis(); long milliseconds = delay; long hours = milliseconds / (60 * 60 * 1000); milliseconds %= 60 * 60 * 1000; long minutes = milliseconds / (60 * 1000); milliseconds %= 60 * 1000; long seconds = milliseconds / 1000; Logger.i(TAG, "BeginQuestionnaire notifcation scheduled in {0} hours, {1} minutes, " + "and {2} seconds", hours, minutes, seconds); return nowUpTime + delay; }</code><technical_language>This function replace a call fixNowAndGetAllowedWindow</technical_language>

Target:
private synchronized long generateBeginQuestionnaireTime(boolean debugging) { fixNowAndGetAllowedWindow(); Logger.d(TAG, "Calculating time for new BeginQuestionnaire notification"); Calendar start = (Calendar)now.clone(); start.set(Calendar.HOUR_OF_DAY, startAllowedHour); start.set(Calendar.MINUTE, startAllowedMinute); Calendar nextStart = (Calendar)start.clone(); if (now.after(nextStart)) { nextStart.add(Calendar.DAY_OF_YEAR, 1); } long delay; if (debugging) { delay = DEBUG_DELAY; } else { delay = now.getTimeInMillis() - nextStart.getTimeInMillis() + QUESTIONNAIRE_DELAY_AFTER_WINDOW_START; } long milliseconds = delay; long hours = milliseconds / (60 * 60 * 1000); milliseconds %= 60 * 60 * 1000; long minutes = milliseconds / (60 * 1000); milliseconds %= 60 * 1000; long seconds = milliseconds / 1000; Logger.i(TAG, "BeginQuestionnaireService scheduled in {0} hours, {1} minutes, " + "and {2} seconds", hours, minutes, seconds); return nowUpTime + delay; }
Source:
<code>protected void starting(Description description) { this.desc = description; super.starting(description); dirName = "target/" + desc.getClassName() + "/" + desc.getMethodName(); new File(dirName).mkdir(); FileSystem hdfs = null; <START> Path newFilePath = new Path(dirName + "/" + filename); <END> try { hdfs = FileSystem.get(new Configuration()); hdfs.createNewFile(newFilePath); } catch (IOException ex) { DTThrowable.rethrow(ex); } StringBuilder sb = new StringBuilder(); sb.append(SchemaUtils.jarResourceFileToString(filename)); byte[] byt = sb.toString().getBytes(); try { FSDataOutputStream fsOutStream = hdfs.create(newFilePath); fsOutStream.write(byt); fsOutStream.close(); } catch (IOException ex) { DTThrowable.rethrow(ex); } logger.debug("Written data to HDFS file."); }</code><technical_language>This is unit test running locally, is hdfs coming picture? do need hdfs?</technical_language>

Target:
protected void starting(Description description) { this.desc = description; super.starting(description); dirName = "target/" + desc.getClassName(); new File(dirName).mkdir(); FileSystem fileSystem = null; Path newFilePath = new Path(dirName + "/" + filename); try { fileSystem = LocalFileSystem.get(new Configuration()); fileSystem.createNewFile(newFilePath); } catch (IOException ex) { DTThrowable.rethrow(ex); } StringBuilder sb = new StringBuilder(); sb.append(SchemaUtils.jarResourceFileToString(filename)); byte[] byt = sb.toString().getBytes(); try { FSDataOutputStream fsOutStream = fileSystem.create(newFilePath); fsOutStream.write(byt); fsOutStream.close(); } catch (IOException ex) { DTThrowable.rethrow(ex); } }
Source:
<code>public List<ExperimentTaskResult> getResultsOfExperiment(String experimentId) { MapSqlParameterSource parameters = new MapSqlParameterSource(); parameters.addValue("id", experimentId); List<ExperimentTaskResult> result = this.template.query(GET_EXPERIMENT_RESULTS, parameters, new ExperimentTaskResultRowMapper()); for (ExperimentTaskResult e : result) { <START> getVersion(e); <END> addAdditionalResults(e); addSubTasks(e); } return result; }</code><technical_language>@CatherineRomiyo wanted get rid of this additional method? extend GET_EXPERIMENT_RESULTS select version set this information adapting ExperimentTaskResultRowMapper, right? :wink:</technical_language>

Target:
public List<ExperimentTaskResult> getResultsOfExperiment(String experimentId) { MapSqlParameterSource parameters = new MapSqlParameterSource(); parameters.addValue("id", experimentId); List<ExperimentTaskResult> result = this.template.query(GET_EXPERIMENT_RESULTS, parameters, new ExperimentTaskResultRowMapper()); for (ExperimentTaskResult e : result) { addAdditionalResults(e); addSubTasks(e); } return result; }
Source:
<code>public void testSmallTraceSequential() throws TmfAnalysisException, IOException, TmfTraceException { String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); assertNotNull(tracePath); <START> TmfTrace testTrace = new CtfTmfTrace(); <END> SystemCallLatencyAnalysis syscallModule = new SystemCallLatencyAnalysis(); IAnalysisModule kernelModule = new KernelAnalysisModule(); final IAnalysisModuleSource source = new IAnalysisModuleSource() { @Override public @NonNull Iterable<IAnalysisModuleHelper> getAnalysisModules() { return Arrays.asList(new AnalysisModuleHelper(kernelModule), new AnalysisModuleHelper(syscallModule)); } }; TmfAnalysisManager.registerModuleSource(source); testTrace.initTrace(null, tracePath, CtfTmfEvent.class); kernelModule.setTrace(testTrace); syscallModule.setTrace(testTrace); try { testTrace.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } catch (NullPointerException e) { } kernelModule.schedule(); kernelModule.waitForCompletion(); syscallModule.schedule(); syscallModule.waitForCompletion(); final @Nullable ISegmentStore<@NonNull ISegment> segmentStore = syscallModule.getResults(); assertNotNull(segmentStore); assertEquals(1801, segmentStore.size()); }</code><technical_language>need instantiate LttngKernelTrace get a class cast exception</technical_language>

Target:
public void testSmallTraceSequential() throws TmfAnalysisException, IOException, TmfTraceException { String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); assertNotNull(tracePath); TmfTrace testTrace = new LttngKernelTrace(); SystemCallLatencyAnalysis syscallModule = new SystemCallLatencyAnalysis(); IAnalysisModule kernelModule = new KernelAnalysisModule(); final IAnalysisModuleSource source = new IAnalysisModuleSource() { @Override public @NonNull Iterable<IAnalysisModuleHelper> getAnalysisModules() { return Arrays.asList(new AnalysisModuleHelper(kernelModule), new AnalysisModuleHelper(syscallModule)); } }; TmfAnalysisManager.registerModuleSource(source); testTrace.initTrace(null, tracePath, CtfTmfEvent.class); kernelModule.setTrace(testTrace); syscallModule.setTrace(testTrace); try { testTrace.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } catch (NullPointerException e) { } kernelModule.schedule(); kernelModule.waitForCompletion(); syscallModule.schedule(); syscallModule.waitForCompletion(); final @Nullable ISegmentStore<@NonNull ISegment> segmentStore = syscallModule.getResults(); assertNotNull(segmentStore); assertEquals(1801, segmentStore.size()); }
Source:
<code>private static void multipartUpload(EncryptedServerSideMultipartManager multipart) { <START> String uploadObject = MantaClient.SEPARATOR + mantaUsername + "/stor/multipart"; <END> try { MantaMetadata metadata = new MantaMetadata(); metadata.put("e-secretkey", "My Secret Value"); EncryptedMultipartUpload<ServerSideMultipartUpload> upload = multipart.initiateUpload(uploadObject, metadata); MantaMultipartUploadPart part1 = multipart.uploadPart(upload, 1, RandomUtils.nextBytes(5242880)); MantaMultipartUploadPart part2 = multipart.uploadPart(upload, 2, RandomUtils.nextBytes(1000000)); MantaMultipartUploadTuple[] parts = new MantaMultipartUploadTuple[] { part1, part2 }; Stream<MantaMultipartUploadTuple> partsStream = Arrays.stream(parts); multipart.complete(upload, partsStream); System.out.println(uploadObject + " is now assembled!"); } catch (IOException e) { ContextedRuntimeException exception = new ContextedRuntimeException( "A network error occurred when doing a multipart upload to Manta."); exception.setContextValue("path", uploadObject); throw exception; } }</code><technical_language>separator for slashes in /stor/multipart string well</technical_language>

Target:
private static void multipartUpload(EncryptedServerSideMultipartManager multipart) { String uploadObject = SEPARATOR + mantaUsername + SEPARATOR + "stor" + SEPARATOR + "multipart"; try { MantaMetadata metadata = new MantaMetadata(); metadata.put("e-secretkey", "My Secret Value"); EncryptedMultipartUpload<ServerSideMultipartUpload> upload = multipart.initiateUpload(uploadObject, metadata); MantaMultipartUploadPart part1 = multipart.uploadPart(upload, 1, RandomUtils.nextBytes(5242880)); MantaMultipartUploadPart part2 = multipart.uploadPart(upload, 2, RandomUtils.nextBytes(1000000)); MantaMultipartUploadTuple[] parts = new MantaMultipartUploadTuple[] { part1, part2 }; Stream<MantaMultipartUploadTuple> partsStream = Arrays.stream(parts); multipart.complete(upload, partsStream); System.out.println(uploadObject + " is now assembled!"); } catch (IOException e) { ContextedRuntimeException exception = new ContextedRuntimeException( "A network error occurred when doing a multipart upload to Manta."); exception.setContextValue("path", uploadObject); throw exception; } }
Source:
<code>public void testInitialization() { <START> AbstractTest test = new MyTest(); <END> EXPECTED_RESULT = false; test.setUp(); EXPECTED_RESULT = true; test.setUp(); }</code><technical_language>MyTest test = new MyTest() casting a parent class</technical_language>

Target:
public void testInitialization() { MyTest test = new MyTest(); EXPECTED_RESULT = false; test.setUp(); EXPECTED_RESULT = true; test.setUp(); }