auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void writeToFileWriter(ParquetFileWriter writer) throws IOException { writer.startColumn(path, totalValueCount, compressor.getCodecName()); <START> if (bloomFilter != null) { <END> writer.writeBloomFilter(bloomFilter); } if (dictionaryPage != null) { writer.writeDictionaryPage(dictionaryPage); } writer.writeDataPages(buf, uncompressedLength, compressedLength, totalStatistics, rlEncodings, dlEncodings, dataEncodings); writer.endColumn(); if (LOG.isDebugEnabled()) { LOG.debug( String.format( "written %,dB for %s: %,d values, %,dB raw, %,dB comp, %d pages, encodings: %s", buf.size(), path, totalValueCount, uncompressedLength, compressedLength, pageCount, new HashSet<Encoding>(dataEncodings)) + (dictionaryPage != null ? String.format( ", dic { %,d entries, %,dB raw, %,dB comp}", dictionaryPage.getDictionarySize(), dictionaryPage.getUncompressedSize(), dictionaryPage.getDictionarySize()) : "")); } rlEncodings.clear(); dlEncodings.clear(); dataEncodings.clear(); pageCount = 0; }</code><technical_language>So, write bloom filters row-group. means seek row-group read if row-group dropped based bloom filter. of similar issue decided put column indexes row-groups (just footer). I if feasible/beneficial for bloom filters well</technical_language>

Target:
public void writeToFileWriter(ParquetFileWriter writer) throws IOException { writer.writeColumnChunk( path, totalValueCount, compressor.getCodecName(), dictionaryPage, buf, uncompressedLength, compressedLength, totalStatistics, columnIndexBuilder, offsetIndexBuilder, rlEncodings, dlEncodings, dataEncodings); if (LOG.isDebugEnabled()) { LOG.debug( String.format( "written %,dB for %s: %,d values, %,dB raw, %,dB comp, %d pages, encodings: %s", buf.size(), path, totalValueCount, uncompressedLength, compressedLength, pageCount, new HashSet<Encoding>(dataEncodings)) + (dictionaryPage != null ? String.format( ", dic { %,d entries, %,dB raw, %,dB comp}", dictionaryPage.getDictionarySize(), dictionaryPage.getUncompressedSize(), dictionaryPage.getDictionarySize()) : "")); } rlEncodings.clear(); dlEncodings.clear(); dataEncodings.clear(); pageCount = 0; }
Source:
<code>private void onRelease() { boolean keepWaiting = false; KeyValuePair<CacheTransaction, Object> timedOutTransaction = null; for (PendingTransaction transaction : pendingTransactions) { KeyValuePair<CacheTransaction, Object> waiting = transaction.findUnreleasedKey(); if (waiting != null) { if (timeService.isTimeExpired(expectedEndTime)) { timedOutTransaction = waiting; } else { <START> keepWaiting = true; <END> } break; } } if (!keepWaiting) { if (timeoutTask != null) { timeoutTask.cancel(false); } if (timedOutTransaction == null) { if (trace) log.tracef("All pending transactions have finished for transaction %s", globalTransaction); notifier.complete(null); } else { if (trace) log.tracef("Timed out waiting for pending transaction %s for transaction %s", timedOutTransaction, globalTransaction); notifier.completeExceptionally(timeout(timedOutTransaction, globalTransaction, timeoutNanos, TimeUnit.NANOSECONDS)); } } }</code><technical_language>if return here, need keepWaiting boolean</technical_language>

Target:
private void onRelease() { KeyValuePair<CacheTransaction, Object> timedOutTransaction = null; for (PendingTransaction transaction : pendingTransactions) { KeyValuePair<CacheTransaction, Object> waiting = transaction.findUnreleasedKey(); if (waiting != null) { if (timeService.isTimeExpired(expectedEndTime)) { timedOutTransaction = waiting; break; } else { return; } } } if (timeoutTask != null) { timeoutTask.cancel(false); } if (timedOutTransaction == null) { if (trace) log.tracef("All pending transactions have finished for transaction %s", globalTransaction); notifier.complete(null); } else { if (trace) log.tracef("Timed out waiting for pending transaction %s for transaction %s", timedOutTransaction, globalTransaction); notifier.completeExceptionally(timeout(timedOutTransaction, globalTransaction, timeoutNanos, TimeUnit.NANOSECONDS)); } }
Source:
<code>public void startQuestionnaire(String id) { <START> Questionnaire questionnaire = findQuestionnaireEntity(id); <END> if (questionnaire.getStatus().equals(NOT_STARTED)) { questionnaire.setStatus(OPEN); dataService.update(id, questionnaire); } }</code><technical_language>if questionnaire is for give id</technical_language>

Target:
public void startQuestionnaire(String id) { Questionnaire questionnaire = findQuestionnaireEntity(id); if (questionnaire == null) { EntityType questionnaireEntityType = dataService.getEntityType(id); questionnaire = questionnaireFactory.create(entityManager.create(questionnaireEntityType, POPULATE)); questionnaire.setOwner(getCurrentUsername()); questionnaire.setStatus(OPEN); dataService.add(id, questionnaire); } }
Source:
<code>public static Process runServer(String homeDir) { String rtType = ParameterUtils.serverHomeToRuntimeType.get(homeDir); System.out.println("Running server " + homeDir + " with rtType = " + rtType); String scriptName = null; String cmd = null; IPath bin = new Path(homeDir).append("bin"); if (Platform.getOS().equals(Platform.OS_WIN32)) { scriptName = "standalone.bat"; IPath script = bin.append(scriptName); fail("These tests cannot run on windows currently"); } else { scriptName = "standalone.sh"; IPath script = bin.append(scriptName); script.toFile().setExecutable(true); cmd = script.toFile().getAbsolutePath(); } List<String> envp = new ArrayList<String>(); <START> if( requiresJava6(rtType) || requiresJava7(rtType)) { <END> String java = System.getProperty(JRE7_SYSPROP); if( java == null || !new File(java).exists()) { fail("Launching " + homeDir + " requires a java7 jdk, which has not been provided via the " + JRE7_SYSPROP + " system property, or does not exist"); } envp.add("JAVA_HOME=" + java); } String[] envList = (String[]) envp.toArray(new String[envp.size()]); Process p = null; try { p = Runtime.getRuntime().exec(cmd, envList); return p; } catch( IOException ioe) { fail(homeDir + " server failed to start: " + ioe.getMessage()); } System.out.println("Somehow launch completed without returning a process"); return null; }</code><technical_language>set javahome property for launches explicit</technical_language>

Target:
public static Process runServer(String homeDir) { String rtType = ParameterUtils.serverHomeToRuntimeType.get(homeDir); System.out.println("Running server " + homeDir + " with rtType = " + rtType); String scriptName = null; String cmd = null; IPath bin = new Path(homeDir).append("bin"); if (Platform.getOS().equals(Platform.OS_WIN32)) { scriptName = "standalone.bat"; IPath script = bin.append(scriptName); fail("These tests cannot run on windows currently"); } else { scriptName = "standalone.sh"; IPath script = bin.append(scriptName); script.toFile().setExecutable(true); cmd = script.toFile().getAbsolutePath(); } List<String> envp = new ArrayList<String>(); envp.add("JAVA_HOME=" + getJavaHome(rtType, homeDir)); String[] envList = (String[]) envp.toArray(new String[envp.size()]); Process p = null; try { p = Runtime.getRuntime().exec(cmd, envList); return p; } catch( IOException ioe) { fail(homeDir + " server failed to start: " + ioe.getMessage()); } System.out.println("Somehow launch completed without returning a process"); return null; }
Source:
<code>void registerDisputeAgent(String disputeAgentTypeString, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); Optional<DisputeAgentType> disputeAgentType = getDisputeAgentTypeForString(disputeAgentTypeString); if (disputeAgentType.isPresent()) { ECKey ecKey; String signature; switch ((disputeAgentType.get())) { case ARBITRATOR: throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case MEDIATOR: ecKey = mediatorManager.getRegistrationKey(registrationKey); signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerMediator(nodeAddress, languageCodes, ecKey, signature); return; case REFUND_AGENT: ecKey = refundAgentManager.getRegistrationKey(registrationKey); signature = refundAgentManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; <START> default: return; <END> } } else { throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentTypeString); } }</code><technical_language>I ignore codacy this merge complaining. configure codacy ignore it</technical_language>

Target:
void registerDisputeAgent(String disputeAgentTypeString, String registrationKey) { if (!p2PService.isBootstrapped()) throw new IllegalStateException("p2p service is not bootstrapped yet"); if (config.baseCurrencyNetwork.isMainnet() || config.baseCurrencyNetwork.isDaoBetaNet() || !config.useLocalhostForP2P) throw new IllegalStateException("dispute agents must be registered in a Bisq UI"); if (!registrationKey.equals(DEV_PRIVILEGE_PRIV_KEY)) throw new IllegalArgumentException("invalid registration key"); Optional<DisputeAgentType> disputeAgentType = getDisputeAgentTypeForString(disputeAgentTypeString); if (disputeAgentType.isPresent()) { ECKey ecKey; String signature; switch ((disputeAgentType.get())) { case ARBITRATOR: throw new IllegalArgumentException("arbitrators must be registered in a Bisq UI"); case MEDIATOR: ecKey = mediatorManager.getRegistrationKey(registrationKey); signature = mediatorManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerMediator(nodeAddress, languageCodes, ecKey, signature); return; case REFUND_AGENT: ecKey = refundAgentManager.getRegistrationKey(registrationKey); signature = refundAgentManager.signStorageSignaturePubKey(Objects.requireNonNull(ecKey)); registerRefundAgent(nodeAddress, languageCodes, ecKey, signature); return; } } else { throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentTypeString); } }
Source:
<code>public void close() { if(logger.isInfoEnabled()) printReceiveStreamStatistics(); stop(); closeSendStreams(); srtpControl.cleanup(this); if (csrcEngine != null) { csrcEngine = null; } if (cachingTransformer != null) { cachingTransformer.close(); cachingTransformer = null; } if (retransmissionRequester != null) { retransmissionRequester.close(); } if (transformEngineChain != null) { PacketTransformer t = transformEngineChain.getRTPTransformer(); if (t != null) t.close(); t = transformEngineChain.getRTCPTransformer(); if (t != null) t.close(); transformEngineChain = null; } if (rtpManager != null) { if (logger.isInfoEnabled()) printFlowStatistics(rtpManager); rtpManager.removeReceiveStreamListener(this); rtpManager.removeSendStreamListener(this); rtpManager.removeSessionListener(this); rtpManager.removeRemoteListener(this); try { rtpManager.dispose(); rtpManager = null; } catch (Throwable t) { if (t instanceof ThreadDeath) throw (ThreadDeath) t; logger.error("Failed to dispose of RTPManager", t); } } if (rtpConnector != null) rtpConnector.removeTargets(); rtpConnectorTarget = null; if (deviceSession != null) deviceSession.close(); RTCPTerminationStrategy strategy <START> = rtcpTransformEngineWrapper.getWrapped(); <END> if (strategy instanceof RecurringRunnable) { recurringRunnablesExecutor .deRegisterRecurringRunnable((RecurringRunnable) strategy); } }</code><technical_language>a MediaStreamImpl#getRTCPTerminationStrategy() method amounts rtcpTransformEngineWrapper.getWrapped(). in method setRTCPTerminationStrategy and, thus, simplify source code for reader</technical_language>

Target:
public void close() { if(logger.isInfoEnabled()) printReceiveStreamStatistics(); stop(); closeSendStreams(); srtpControl.cleanup(this); if (csrcEngine != null) { csrcEngine = null; } if (cachingTransformer != null) { cachingTransformer.close(); cachingTransformer = null; } if (retransmissionRequester != null) { retransmissionRequester.close(); } if (transformEngineChain != null) { PacketTransformer t = transformEngineChain.getRTPTransformer(); if (t != null) t.close(); t = transformEngineChain.getRTCPTransformer(); if (t != null) t.close(); transformEngineChain = null; } if (rtpManager != null) { if (logger.isInfoEnabled()) printFlowStatistics(rtpManager); rtpManager.removeReceiveStreamListener(this); rtpManager.removeSendStreamListener(this); rtpManager.removeSessionListener(this); rtpManager.removeRemoteListener(this); try { rtpManager.dispose(); rtpManager = null; } catch (Throwable t) { if (t instanceof ThreadDeath) throw (ThreadDeath) t; logger.error("Failed to dispose of RTPManager", t); } } if (rtpConnector != null) rtpConnector.removeTargets(); rtpConnectorTarget = null; if (deviceSession != null) deviceSession.close(); RTCPTerminationStrategy strategy = getRTCPTerminationStrategy(); if (strategy instanceof RecurringRunnable) { recurringRunnableExecutor .deRegisterRecurringRunnable((RecurringRunnable) strategy); } }
Source:
<code>private Flux<ByteBuffer> applyReliableDownload(Flux<ByteBuffer> data, int currentRetryCount, DownloadRetryOptions options) { return data .timeout(TIMEOUT_VALUE) .doOnNext(buffer -> { this.info.setOffset(this.info.getOffset() + buffer.remaining()); if (this.info.getCount() != null) { this.info.setCount(this.info.getCount() - buffer.remaining()); } }).onErrorResume(t2 -> { if (this.info.getCount() != null && this.info.getCount() == 0) { return Flux.empty(); } return tryContinueFlux(t2, currentRetryCount + 1, options); }); }</code><technical_language>incomplete</technical_language>

Target:
private Flux<ByteBuffer> applyReliableDownload(Flux<ByteBuffer> data, int currentRetryCount, DownloadRetryOptions options) { return data .timeout(TIMEOUT_VALUE) .doOnNext(buffer -> { this.info.setOffset(this.info.getOffset() + buffer.remaining()); if (this.info.getCount() != null) { this.info.setCount(this.info.getCount() - buffer.remaining()); } }).onErrorResume(t2 -> { if (this.info.getCount() != null && this.info.getCount() == 0) { logger.warning("Exception encountered in ReliableDownload after all data read from the network but " + "but before stream signaled completion. Returning success as all data was downloaded. " + "Exception message: " + t2.getMessage()); return Flux.empty(); } return tryContinueFlux(t2, currentRetryCount + 1, options); }); }
Source:
<code>public CompletableFuture<Object> invokeAsync() { if (stateTransferLock != null) { stateTransferLock.acquireSharedTopologyLock(); } try { if (topologyId >= 0 && stateTransferManager != null && topologyId != stateTransferManager.getCacheTopology().getTopologyId()) { stateTransferLock.releaseSharedTopologyLock(); return CompletableFutures.completedNull(); } for (int i = 0; i < keys.length; ++i) { Object key = keys[i]; if (key == null) break; SimpleClusteredVersion version = new SimpleClusteredVersion(topologyIds[i], versions[i]); dataContainer.compute(key, (k, oldEntry, factory) -> { if (oldEntry == null) { return null; } SimpleClusteredVersion localVersion = (SimpleClusteredVersion) oldEntry.getMetadata().version(); InequalVersionComparisonResult result = localVersion.compareTo(version); if (result == InequalVersionComparisonResult.BEFORE || (removed && result == InequalVersionComparisonResult.EQUAL)) { return null; } else { return oldEntry; } }); } <START> return orderedUpdatesManager.invalidate(keys).handle((nil, t) -> { <END> if (stateTransferLock != null) { stateTransferLock.releaseSharedTopologyLock(); } CompletableFutures.rethrowException(t); return null; }); } catch (Throwable t) { if (stateTransferLock != null) { stateTransferLock.releaseSharedTopologyLock(); } throw t; } }</code><technical_language>invalidate() acquires locks, block while holding shared topology lock. Ideally dataContainer.compute() done while holding lock</technical_language>

Target:
public CompletableFuture<Object> invokeAsync() { if (stateTransferLock != null) { stateTransferLock.acquireSharedTopologyLock(); } try { if (topologyId >= 0 && stateTransferManager != null) { int currentTopologyId = stateTransferManager.getCacheTopology().getTopologyId(); if (topologyId > currentTopologyId) { if (trace) { log.tracef("Delaying command %s, current topology id %d", currentTopologyId); } return stateTransferLock.topologyFuture(topologyId).thenCompose(nil -> invokeAsync()); } else if (topologyId < currentTopologyId) { log.ignoringInvalidateVersionsFromOldTopology(this.topologyId, currentTopologyId); if (trace) { log.tracef("Ignored command is %s", this); } return CompletableFutures.completedNull(); } } for (int i = 0; i < keys.length; ++i) { Object key = keys[i]; if (key == null) break; SimpleClusteredVersion version = new SimpleClusteredVersion(topologyIds[i], versions[i]); dataContainer.compute(key, (k, oldEntry, factory) -> { if (oldEntry == null) { return null; } SimpleClusteredVersion localVersion = (SimpleClusteredVersion) oldEntry.getMetadata().version(); InequalVersionComparisonResult result = localVersion.compareTo(version); if (result == InequalVersionComparisonResult.BEFORE || (removed && result == InequalVersionComparisonResult.EQUAL)) { return null; } else { return oldEntry; } }); } } finally { if (stateTransferLock != null) { stateTransferLock.releaseSharedTopologyLock(); } } return orderedUpdatesManager.invalidate(keys).thenApply(nil -> null); }
Source:
<code>public synchronized void startEntry(LogEntry logEntry) { <START> LoggerFactory.getLogger(ImportStatus.class).info("Start entry: " + logEntry); <END> logEntry.getLogToken().ifPresent(token -> setStatus("Adding entry with token " + token)); logEntry.getRdfCreator() .ifPresent(creator -> setStatus("Creating entry with " + creator.getClass().getSimpleName())); currentLogEntry = logEntry; date = Instant.now().toString(); currentLogEntry.getImportStatus().setDate(date); currentEntryStart = stopwatch.elapsed(TIME_UNIT); }</code><technical_language>a static logger</technical_language>

Target:
public synchronized void startEntry(LogEntry logEntry) { logEntry.getLogToken().ifPresent(token -> setStatus("Adding entry with token " + token)); logEntry.getRdfCreator() .ifPresent(creator -> setStatus("Creating entry with " + creator.getClass().getSimpleName())); currentLogEntry = logEntry; date = Instant.now().toString(); currentLogEntry.getImportStatus().setDate(date); currentEntryStart = stopwatch.elapsed(TIME_UNIT); }
Source:
<code>public void onResume() { super.onResume(); AppCompatActivity activity = (AppCompatActivity)getActivity(); ActionBar actionBar; <START> <END> try { ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(getString(R.string.search_by_barcode_drawer)); } catch (NullPointerException e) { e.printStackTrace(); } }</code><technical_language>a bit of code left code, remove this</technical_language>

Target:
public void onResume() { super.onResume(); try { ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(getString(R.string.search_by_barcode_drawer)); } catch (NullPointerException e) { e.printStackTrace(); } }
Source:
<code>public boolean isChecked() throws RemoteException { <START> return (Boolean) jQueryHelper.getFieldValue(selector); <END> }</code><technical_language>note in JQueryHelper. Needs a nullcheck if null is a return of jQueryHelper.getFieldValue(selector)</technical_language>

Target:
public boolean isChecked() throws RemoteException { Boolean checked = (Boolean) jQueryHelper.getFieldValue(selector); return checked != null && checked; }
Source:
<code>public void testPlaintextLoggingLevels() throws IOException { Database.getLog().getFile().setUsePlaintext(true); File logPath = new File(context.getCacheDir().getAbsolutePath(), "Logs"); FileUtils.deleteRecursive(logPath); Database.getLog().getFile().setDirectory(logPath.getAbsolutePath()); LogLevel levels[] = { LogLevel.NONE, LogLevel.ERROR, LogLevel.WARNING, LogLevel.INFO, LogLevel.VERBOSE }; for (LogLevel level : levels) { Database.getLog().getFile().setLevel(level); Log.v("DATABASE", "TEST VERBOSE"); Log.i("DATABASE", "TEST INFO"); Log.w("DATABASE", "TEST WARNING"); Log.e("DATABASE", "TEST ERROR"); } for(File log : logPath.listFiles()) { BufferedReader fin = new BufferedReader(new FileReader(log)); int lineCount = 0; while(fin.readLine() != null) { lineCount++; } if(log.getAbsolutePath().contains("verbose")) { <START> assertEquals(3, lineCount); <END> } else if(log.getAbsolutePath().contains("info")) { assertEquals(4, lineCount); } else if(log.getAbsolutePath().contains("warning")) { assertEquals(5, lineCount); } else if(log.getAbsolutePath().contains("error")) { assertEquals(6, lineCount); } } }</code><technical_language>This is correct anymore. 2, 3, 4, 5 now</technical_language>

Target:
public void testPlaintextLoggingLevels() throws IOException { Database.getLog().getFile().setUsePlaintext(true); File logPath = new File(context.getCacheDir().getAbsolutePath(), "Logs"); FileUtils.deleteRecursive(logPath); Database.getLog().getFile().setDirectory(logPath.getAbsolutePath()); LogLevel levels[] = { LogLevel.NONE, LogLevel.ERROR, LogLevel.WARNING, LogLevel.INFO, LogLevel.VERBOSE }; for (LogLevel level : levels) { Database.getLog().getFile().setLevel(level); Log.v("DATABASE", "TEST VERBOSE"); Log.i("DATABASE", "TEST INFO"); Log.w("DATABASE", "TEST WARNING"); Log.e("DATABASE", "TEST ERROR"); } for(File log : logPath.listFiles()) { BufferedReader fin = new BufferedReader(new FileReader(log)); int lineCount = 0; while(fin.readLine() != null) { lineCount++; } if(log.getAbsolutePath().contains("verbose")) { assertEquals(2, lineCount); } else if(log.getAbsolutePath().contains("info")) { assertEquals(3, lineCount); } else if(log.getAbsolutePath().contains("warning")) { assertEquals(4, lineCount); } else if(log.getAbsolutePath().contains("error")) { assertEquals(5, lineCount); } } }
Source:
<code>public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { ComputeCommand computeCommand = (ComputeCommand) rCommand; Object key = computeCommand.getKey(); if (!isStoreEnabled(computeCommand) || rCtx.isInTxScope() || !computeCommand.isSuccessful()) return rv; if (!isProperWriter(rCtx, computeCommand, computeCommand.getKey())) return rv; <START> storeEntry(rCtx, key, computeCommand); <END> if (getStatisticsEnabled()) cacheStores.incrementAndGet(); return rv; }); }</code><technical_language>compute remove entries, too</technical_language>

Target:
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable { return invokeNextThenApply(ctx, command, (rCtx, rCommand, rv) -> { ComputeCommand computeCommand = (ComputeCommand) rCommand; Object key = computeCommand.getKey(); if (!isStoreEnabled(computeCommand) || rCtx.isInTxScope() || !computeCommand.isSuccessful()) return rv; if (!isProperWriter(rCtx, computeCommand, computeCommand.getKey())) return rv; if (command.isSuccessful() && rv == null) { boolean resp = persistenceManager .deleteFromAllStores(key, skipSharedStores(rCtx, key, command) ? PRIVATE : BOTH); if (trace) log.tracef("Removed entry under key %s and got response %s from CacheStore", key, resp); } else if (command.isSuccessful()) { storeEntry(rCtx, key, computeCommand); if (getStatisticsEnabled()) cacheStores.incrementAndGet(); } return rv; }); }
Source:
<code>private void auditIncomingExpirations(List<Status> allowedStatuses, Map<Integer, Vo> vosMap) throws InternalErrorException { <START> LocalDate monthBefore = LocalDate.now().plusMonths(1); <END> auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, monthBefore, ExpirationPeriod.MONTH); LocalDate expireInA14Days = LocalDate.now().plusDays(14); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInA14Days, ExpirationPeriod.DAYS_14); LocalDate expireInA7Days = LocalDate.now().plusDays(7); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInA7Days, ExpirationPeriod.DAYS_7); LocalDate expireInADay = LocalDate.now().plusDays(1); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInADay, ExpirationPeriod.DAYS_1); }</code><technical_language>I change variable name. monthBefore is missleading. nextMonth</technical_language>

Target:
private void auditIncomingExpirations(List<Status> allowedStatuses, Map<Integer, Vo> vosMap) throws InternalErrorException { LocalDate nextMonth = LocalDate.now().plusMonths(1); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, nextMonth, ExpirationPeriod.MONTH); LocalDate expireInA14Days = LocalDate.now().plusDays(14); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInA14Days, ExpirationPeriod.DAYS_14); LocalDate expireInA7Days = LocalDate.now().plusDays(7); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInA7Days, ExpirationPeriod.DAYS_7); LocalDate expireInADay = LocalDate.now().plusDays(1); auditInfoAboutIncomingMembersExpirationInGivenTime(allowedStatuses, vosMap, expireInADay, ExpirationPeriod.DAYS_1); }
Source:
<code>private Entity loadPassenger(T vehicle, CompoundTag compoundTag) { Location location = NbtSerialization.listTagsToLocation(vehicle.getWorld(), compoundTag); if (location == null) { NbtSerialization.locationToListTags(vehicle.getLocation(), compoundTag); } try { return EntityStorage.loadEntity(vehicle.getWorld(), compoundTag); } catch (Exception e) { String id = compoundTag.isString("id") ? compoundTag.getString("id") : "<missing>"; <START> GlowServer.logger.warning("Skipping Entity with id " + id); <END> } return null; }</code><technical_language>Log exception</technical_language>

Target:
private Entity loadPassenger(T vehicle, CompoundTag compoundTag) { Location location = NbtSerialization.listTagsToLocation(vehicle.getWorld(), compoundTag); if (location == null) { NbtSerialization.locationToListTags(vehicle.getLocation(), compoundTag); } try { return EntityStorage.loadEntity(vehicle.getWorld(), compoundTag); } catch (Exception e) { String id = compoundTag.isString("id") ? compoundTag.getString("id") : "<missing>"; if (e.getMessage() != null && e.getMessage().startsWith("Unknown entity type to load:")) { GlowServer.logger.warning("Skipping Entity with id " + id); } else { GlowServer.logger.log(Level.WARNING, "Error loading entity " + id, e); } } return null; }
Source:
<code>public SSLHandlerFactory(SSLConfig sslConfig) { <START> if (sslConfig.getKeyStore() == null) { <END> throw new IllegalArgumentException("Certificate Path Not Configured"); } if (sslConfig.getKeyStorePassword() == null) { throw new IllegalArgumentException("KeyStore Password Not Configured"); } String algorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm"); if (algorithm == null) { algorithm = "SunX509"; } try { KeyStore ks = getKeyStore(sslConfig.getKeyStore(), sslConfig.getKeyStorePassword()); KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(ks, sslConfig.getCertificatePassword() != null ? sslConfig.getCertificatePassword().toCharArray() : sslConfig.getKeyStorePassword().toCharArray()); TrustManagerFactory tmf = null; if (sslConfig.getTrustKeyStore() != null) { if (sslConfig.getTrustKeyStorePassword() == null) { throw new IllegalArgumentException("KeyStore Password Not Configured"); } this.needClientAuth = true; KeyStore tks = getKeyStore(sslConfig.getTrustKeyStore(), sslConfig.getTrustKeyStorePassword()); tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(tks); } serverContext = SSLContext.getInstance(protocol); serverContext.init(kmf.getKeyManagers(), tmf != null ? tmf.getTrustManagers() : null, null); } catch (Exception e) { throw new IllegalArgumentException("Failed to initialize the server-side SSLContext", e); } }</code><technical_language>check done in SSLConfig.Builder</technical_language>

Target:
public SSLHandlerFactory(SSLConfig sslConfig) { String algorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm"); if (algorithm == null) { algorithm = "SunX509"; } try { KeyStore ks = getKeyStore(sslConfig.getKeyStore(), sslConfig.getKeyStorePassword()); KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(ks, sslConfig.getCertificatePassword() != null ? sslConfig.getCertificatePassword().toCharArray() : sslConfig.getKeyStorePassword().toCharArray()); KeyManager[] keyManagers = kmf.getKeyManagers(); TrustManager[] trustManagers = null; if (sslConfig.getTrustKeyStore() != null) { this.needClientAuth = true; KeyStore tks = getKeyStore(sslConfig.getTrustKeyStore(), sslConfig.getTrustKeyStorePassword()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(tks); trustManagers = tmf.getTrustManagers(); } serverContext = SSLContext.getInstance(protocol); serverContext.init(keyManagers, trustManagers, null); } catch (Exception e) { throw new IllegalArgumentException("Failed to initialize the server-side SSLContext", e); } }
Source:
<code>public void onWPOrgPluginFetched(OnWPOrgPluginFetched event) { if (isFinishing()) { return; } if (event.isError()) { AppLog.e(AppLog.T.API, "An error occurred while fetching the plugin info with type: " + event.error.type); return; } if (!TextUtils.isEmpty(mPlugin.getSlug()) && mPlugin.getSlug().equals(event.pluginSlug)) { <START> mWPOrgPlugin = mPluginStore.getWPOrgPluginBySlug(event.pluginSlug); <END> refreshPluginVersionViews(); } }</code><technical_language>this change. get plugin store in event</technical_language>

Target:
public void onWPOrgPluginFetched(OnWPOrgPluginFetched event) { if (isFinishing()) { return; } if (event.isError()) { AppLog.e(AppLog.T.API, "An error occurred while fetching wporg plugin with type: " + event.error.type); return; } if (!TextUtils.isEmpty(mSitePlugin.getSlug()) && mSitePlugin.getSlug().equals(event.pluginSlug)) { mWPOrgPlugin = mPluginStore.getWPOrgPluginBySlug(event.pluginSlug); refreshPluginVersionViews(); } }
Source:
<code>public FilesSkipped totalFilesSkipped() { if (totalInstances == 0 || totalFilesSkipped == 0) { return FilesSkipped.NONE; } <START> return totalFilesSkipped == totalInstances ? FilesSkipped.ALL : FilesSkipped.SOME; <END> }</code><technical_language>I avoid ternary operator I find other case in code base confusing times</technical_language>

Target:
public FilesSkipped totalFilesSkipped() { if (totalInstances == 0 || totalFilesSkipped == 0) { return FilesSkipped.NONE; } if (totalFilesSkipped == totalInstances) { return FilesSkipped.ALL; } else { return FilesSkipped.SOME; } }
Source:
<code>public JdbcDataflowTaskExecutionDao(DataSource dataSource, String tablePrefix) { this(dataSource); <START> Assert.hasText(tablePrefix, "tablePrefix must not be null nor empty"); <END> this.tablePrefix = tablePrefix; }</code><technical_language>Want property TaskProperties instead of default</technical_language>

Target:
public JdbcDataflowTaskExecutionDao(DataSource dataSource, String tablePrefix) { Assert.hasText(tablePrefix, "tablePrefix must not be null nor empty."); Assert.notNull(dataSource, "The dataSource must not be null."); this.tablePrefix = tablePrefix; this.jdbcTemplate = new NamedParameterJdbcTemplate(dataSource); }
Source:
<code>private void unblock(final ExecutionCallback<V> callback, Executor executor) { try { executor.execute(new Runnable() { @Override public void run() { try { Object value = resolve(state); if (value instanceof Throwable) { Throwable error = unwrap((Throwable) value); callback.onFailure(error); } else { callback.onResponse((V) value); } } catch (Throwable cause) { logger.severe("Failed asynchronous execution of execution callback: " + callback + " for call " + invocationToString() + ": " + cause, cause); } } }); } catch (RejectedExecutionException e) { <START> callback.onFailure(wrapToInstanceNotActiveException(e)); <END> } }</code><technical_language>executor user provided? (e.g. ICompletableFuture.andThen user provide executor) User executor returning this exception client is shutdown, it</technical_language>

Target:
private void unblock(final ExecutionCallback<V> callback, Executor executor) { try { executor.execute(new Runnable() { @Override public void run() { try { Object value = resolve(state); if (value instanceof Throwable) { Throwable error = unwrap((Throwable) value); callback.onFailure(error); } else { callback.onResponse((V) value); } } catch (Throwable cause) { logger.severe("Failed asynchronous execution of execution callback: " + callback + " for call " + invocationToString() + ": " + cause, cause); } } }); } catch (RejectedExecutionException e) { Exception exception = e; if (executor == defaultExecutor) { exception = wrapToInstanceNotActiveException(e); } callback.onFailure(exception); } }
Source:
<code>protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { T b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } sysNameList = null; <START> sysNameList = getManager().getNamedBeanSet().stream().map( <END> e -> e.getSystemName()).collect( java.util.stream.Collectors.toList() ); for (int i = 0; i < sysNameList.size(); i++) { T b = getBySystemName(sysNameList.get(i)); if (b != null) { b.addPropertyChangeListener(this); } } }</code><technical_language>curious, a problem, set sysNameList null setting map operation</technical_language>

Target:
protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { T b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } sysNameList = getManager().getNamedBeanSet().stream().map( e -> e.getSystemName()).collect( java.util.stream.Collectors.toList() ); for (int i = 0; i < sysNameList.size(); i++) { T b = getBySystemName(sysNameList.get(i)); if (b != null) { b.addPropertyChangeListener(this); } } }
Source:
<code>public boolean getBool(Record rec) { CharSequence cs = getArg().getStr(rec); <START> return cs != null && cs.length()==1 && Character.toLowerCase(cs.charAt(0))==Character.toLowerCase(expected); <END> }</code><technical_language>SQL 'like' is case sensitive</technical_language>

Target:
public boolean getBool(Record rec) { CharSequence cs = getArg().getStr(rec); return cs != null && cs.length()==1 && cs.charAt(0)==expected; }
Source:
<code>public void getSetMembers_shouldNotReturnRetiredInSetMembersIfincludeRetiredIsFalse() throws Exception { executeDataSet(CONCEPT_XML_DATASET_PACKAGE_PATH); Concept c = new Concept(); Concept setMember1 = service.getConcept(867543); c.addSetMember(setMember1); Concept setMember2 = service.getConcept(1234567); c.addSetMember(setMember2); Concept setMember3 = service.getConcept(8675439); c.addSetMember(setMember3); Concept setMember4 = service.getConcept(12345679); c.addSetMember(setMember4); List<Concept> setMembers = c.getSetMembers(false); Assert.assertEquals(2, setMembers.size()); Assert.assertEquals(setMember1, setMembers.get(0)); <START> Assert.assertEquals(setMember2, setMembers.get(1)); <END> }</code><technical_language>confirm objects unretired objects more retired objects in this list</technical_language>

Target:
public void getSetMembers_shouldNotReturnRetiredInSetMembersIfincludeRetiredIsFalse() throws Exception { executeDataSet(CONCEPT_XML_DATASET_PACKAGE_PATH); Concept c = new Concept(); Concept setMember1 = service.getConcept(867543); c.addSetMember(setMember1); Concept setMember2 = service.getConcept(1234567); c.addSetMember(setMember2); Concept setMember3 = service.getConcept(8675439); c.addSetMember(setMember3); Concept setMember4 = service.getConcept(12345679); c.addSetMember(setMember4); List<Concept> setMembers = c.getSetMembers(false); Assert.assertEquals(2, setMembers.size()); Assert.assertEquals(setMember1, setMembers.get(0)); Assert.assertEquals(setMember2, setMembers.get(1)); setMembers.forEach(member -> Assert.assertEquals(true, !member.getRetired())); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.single_run_history_activity); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mMap = mapFragment.getMap(); <START> loadData(getIntent().getLongExtra("id", 0)); <END> }</code><technical_language>hardcoded string "id"</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.single_run_history_activity); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mMap = mapFragment.getMap(); loadData(getIntent().getLongExtra(HistoryActivity.ID_TAG, 0)); }
Source:
<code>public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitVecX, float hitVecY, float hitVecZ) { if (side != 1) { return false; } else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) { <START> if (((BlockBOPPlant)BOPCBlocks.plants).isValidPosition(world, x, y+1, z, 11) && world.isAirBlock(x, y + 1, z)) <END> { world.setBlock(x, y + 1, z, BOPCBlocks.plants); world.setBlockMetadataWithNotify(x, y+1, z, 11, 2); --stack.stackSize; return true; } else { return false; } } else { return false; } }</code><technical_language>y+1 <- Yeah... Nup. Squashing simply hurts eyes</technical_language>

Target:
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitVecX, float hitVecY, float hitVecZ) { if (stack.getItemDamage() != 2) { return false; } if (side != 1) { return false; } else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) { if (((BlockBOPPlant)BOPCBlocks.plants).isValidPosition(world, x, y + 1, z, 11) && world.isAirBlock(x, y + 1, z)) { world.setBlock(x, y + 1, z, BOPCBlocks.plants); world.setBlockMetadataWithNotify(x, y + 1, z, 11, 2); --stack.stackSize; return true; } else { return false; } } else { return false; } }
Source:
<code>public void browserTest() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final String namespace = "namespace"; final String tableName = "table"; Process corfuServer = runSinglePersistentServer(corfuSingleNodeHost, corfuStringNodePort); runtime = createRuntime(singleNodeEndpoint); CorfuStore store = new CorfuStore(runtime); store.openTable( namespace, tableName, SampleSchema.Uuid.class, SampleSchema.Uuid.class, SampleSchema.Uuid.class, TableOptions.builder().build()); final long keyUuid = 1L; final long valueUuid = 3L; final long metadataUuid = 5L; SampleSchema.Uuid uuidKey = SampleSchema.Uuid.newBuilder() .setMsb(keyUuid) .setLsb(keyUuid) .build(); SampleSchema.Uuid uuidVal = SampleSchema.Uuid.newBuilder() .setMsb(valueUuid) .setLsb(valueUuid) .build(); SampleSchema.Uuid metadata = SampleSchema.Uuid.newBuilder() .setMsb(metadataUuid) .setLsb(metadataUuid) .build(); TxBuilder tx = store.tx(namespace); tx.create(tableName, uuidKey, uuidVal, metadata) .update(tableName, uuidKey, uuidVal, metadata) .commit(); runtime.shutdown(); <START> runtime.connect(); <END> CorfuStoreBrowser browser = new CorfuStoreBrowser(runtime); CorfuTable table = browser.getTable(namespace, tableName); browser.printTable(table); Assert.assertEquals(1, table.size()); for(Object obj : table.values()) { CorfuDynamicRecord record = (CorfuDynamicRecord)obj; Assert.assertEquals( UnknownFieldSet.newBuilder().build(), record.getPayload().getUnknownFields()); } }</code><technical_language>Connecting shutdown runtime is a good idea. add a check avoid (Not in this PR). create a new runtime</technical_language>

Target:
public void browserTest() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final String namespace = "namespace"; final String tableName = "table"; Process corfuServer = runSinglePersistentServer(corfuSingleNodeHost, corfuStringNodePort); runtime = createRuntime(singleNodeEndpoint); CorfuStore store = new CorfuStore(runtime); store.openTable( namespace, tableName, SampleSchema.Uuid.class, SampleSchema.Uuid.class, SampleSchema.Uuid.class, TableOptions.builder().build()); final long keyUuid = 1L; final long valueUuid = 3L; final long metadataUuid = 5L; SampleSchema.Uuid uuidKey = SampleSchema.Uuid.newBuilder() .setMsb(keyUuid) .setLsb(keyUuid) .build(); SampleSchema.Uuid uuidVal = SampleSchema.Uuid.newBuilder() .setMsb(valueUuid) .setLsb(valueUuid) .build(); SampleSchema.Uuid metadata = SampleSchema.Uuid.newBuilder() .setMsb(metadataUuid) .setLsb(metadataUuid) .build(); TxBuilder tx = store.tx(namespace); tx.create(tableName, uuidKey, uuidVal, metadata) .update(tableName, uuidKey, uuidVal, metadata) .commit(); runtime.shutdown(); runtime = createRuntime(singleNodeEndpoint); CorfuStoreBrowser browser = new CorfuStoreBrowser(runtime); CorfuTable table = browser.getTable(namespace, tableName); browser.printTable(table); Assert.assertEquals(1, table.size()); for(Object obj : table.values()) { CorfuDynamicRecord record = (CorfuDynamicRecord)obj; Assert.assertEquals( UnknownFieldSet.newBuilder().build(), record.getPayload().getUnknownFields()); } }
Source:
<code>public List<Guid> getCommandIdsBySessionSeqId(long engineSessionSeqId) { List<Guid> cmdIds = new ArrayList<>(); CommandEntity cmdEntity; for (Guid cmdId : commandsCache.keySet()) { cmdEntity = commandsCache.get(cmdId); if (cmdEntity != null && cmdEntity.getEngineSessionSeqId() != <START> -1 <END> && cmdEntity.getEngineSessionSeqId() == engineSessionSeqId) { cmdIds.add(cmdId); } } return cmdIds; }</code><technical_language>please avoid magic numbers - add cmdEntity.hasEngineSessionSeqId() add -1 constant in SSOSessionUtils (or other class) static method SSOSessionUtils.hasEngineSessionSeqId(sessId)</technical_language>

Target:
public List<Guid> getCommandIdsBySessionSeqId(long engineSessionSeqId) { List<Guid> cmdIds = new ArrayList<>(); CommandEntity cmdEntity; for (Guid cmdId : commandsCache.keySet()) { cmdEntity = commandsCache.get(cmdId); if (cmdEntity != null && cmdEntity.getEngineSessionSeqId() != SSOSessionUtils.EMPTY_SESSION_SEQ_ID && cmdEntity.getEngineSessionSeqId() == engineSessionSeqId) { cmdIds.add(cmdId); } } return cmdIds; }
Source:
<code>private String generatePatientId() { <START> int number = new Random().nextInt(10000000); <END> return "CONNECT-" + String.format ("%07d", number); }</code><technical_language>While *excessively* is possibility of this producing a conflict. get current epoc time in milliseconds number instead? able call this method more exact time, wont produce a collision a data standpoint</technical_language>

Target:
private static String generatePatientId() { return "CONNECT-" + new Date().getTime(); }
Source:
<code>public static void initTestCase() throws Exception { <START> EjbUtils.setStrategy(new DaoTestEjbUtilsStrategy()); <END> if(dataSource == null) { dataSource = createDataSource(); dataset = initDataSet(); dbFacade = DbFacadeLocator.getDbFacade(); dbFacade.setDbEngineDialect(DbFacadeLocator.loadDbEngineDialect()); DatabaseOperation.CLEAN_INSERT.execute(getConnection(), dataset); } }</code><technical_language>@AfterClass method unsets this. @MockEJBStrategeyRule save trouble, IIRC</technical_language>

Target:
public static void initTestCase() throws Exception { if(dataSource == null) { dataSource = createDataSource(); ejbRule.mockResource(ContainerManagedResourceType.DATA_SOURCE, dataSource); dataset = initDataSet(); dbFacade = DbFacadeLocator.getDbFacade(); dbFacade.setDbEngineDialect(DbFacadeLocator.loadDbEngineDialect()); DatabaseOperation.CLEAN_INSERT.execute(getConnection(), dataset); } }
Source:
<code>public Function newInstance(ObjList<Function> args, int position, CairoConfiguration configuration) throws SqlException { Function value = args.getQuick(0); CharSequence likeString=args.getQuick(1).getStr(null); if (likeString == null) { <START> throw SqlException.$(args.getQuick(1).getPosition(), "NULL likeString"); <END> } String regex = escapeSpecialChars(likeString). replace('_', '.').replace("%", ".*?"); try { Matcher matcher = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.DOTALL).matcher(""); return new MatchFunction(position, value, matcher); } catch (PatternSyntaxException e) { throw SqlException.$(args.getQuick(1).getPosition() + e.getIndex() + 1, e.getMessage()); } }</code><technical_language>This message is shown user position of error. User needs do this. 'likeString' is a commonly term :)</technical_language>

Target:
public Function newInstance(ObjList<Function> args, int position, CairoConfiguration configuration) throws SqlException { Function value = args.getQuick(0); CharSequence likeString = args.getQuick(1).getStr(null); if (likeString == null) { throw SqlException.$(args.getQuick(1).getPosition(), "NULL input not supported for like"); } String regex = escapeSpecialChars(likeString); Matcher matcher = Pattern.compile(regex, Pattern.DOTALL).matcher(""); return new MatchFunction(position, value, matcher); }
Source:
<code>private void showWord(final Word word) { currentCard.findViewById(R.id.general_crad).setVisibility(View.VISIBLE); currentCard.findViewById(R.id.error_crad).setVisibility(View.GONE); TextView wordTextView = (TextView) currentCard.findViewById(R.id.textview_word); TextView descriptionTextView = (TextView) currentCard.findViewById(R.id.textview_desc); Button goToWikiButton = (Button) currentCard.findViewById(R.id.button_go_to_wiki); wordTextView.setText(word.label); loadImage(word.imageURL); <START> <END> descriptionTextView.setText(word.shortDesc); descriptionTextView.setMovementMethod(new ScrollingMovementMethod()); goToWikiButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(word.url)); startActivity(intent); } }); }</code><technical_language>Some useless white spaces here</technical_language>

Target:
private void showWord(final Word word) { currentCard.findViewById(R.id.general_card).setVisibility(View.VISIBLE); currentCard.findViewById(R.id.error_card).setVisibility(View.GONE); TextView wordTextView = (TextView) currentCard.findViewById(R.id.textview_word); TextView descriptionTextView = (TextView) currentCard.findViewById(R.id.textview_desc); Button goToWikiButton = (Button) currentCard.findViewById(R.id.button_go_to_wiki); wordTextView.setText(word.label); loadImage(word.imageURL); descriptionTextView.setText(word.shortDesc); goToWikiButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(word.url)); startActivity(intent); } }); }
Source:
<code>public Map<Long, ILogData> readRange(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { <START> return globalAddresses.parallelStream() <END> .map(a -> new AbstractMap.SimpleImmutableEntry<>(a, read(runtimeLayout, a))) .collect(Collectors.toMap(r -> r.getKey(), r -> r.getValue())); }</code><technical_language>parallel stream</technical_language>

Target:
public Map<Long, ILogData> readRange(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses.parallelStream() .collect(Collectors.toMap(addr -> addr, addr -> read(runtimeLayout, addr))); }
Source:
<code>String checkForError() { if (artifactTypeCheckbox.isSelected() && artifactList.getSelectedValuesList().isEmpty()) { <START> return "At least one Result type must be selected."; <END> } return ""; }</code><technical_language>this a bundle message</technical_language>

Target:
String checkForError() { if (artifactTypeCheckbox.isSelected() && artifactList.getSelectedValuesList().isEmpty()) { return Bundle.ArtifactTypeFilterPanel_selectionNeeded_text(); } return ""; }