auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void write(NutchDocument doc) throws IOException { String id = (String) doc.getFieldValue("id"); String type = doc.getDocumentMeta().get("type"); if (type == null) type = "doc"; IndexRequestBuilder request = client.prepareIndex(defaultIndex, type, id); Map<String, Object> source = new HashMap<String, Object>(); for (String fieldName : doc.getFieldNames()) { if (doc.getFieldValues(fieldName).size() > 1) { source.put(fieldName, doc.getFieldValue(fieldName)); for (Object value : doc.getFieldValues(fieldName)) { bulkLength += value.toString().length(); } } else { source.put(fieldName, doc.getFieldValue(fieldName)); bulkLength += doc.getFieldValue(fieldName).toString().length(); } } request.setSource(source); bulk.add(request); indexedDocs++; bulkDocs++; if (bulkDocs >= maxBulkDocs || bulkLength >= maxBulkLength) { LOG.info("Processing bulk request [docs = " + bulkDocs + ", length = " + bulkLength + ", total docs = " + indexedDocs + ", last doc in bulk = '" + id + "']"); createNewBulk = true; commit(); } }

Target:
public void write(NutchDocument doc) throws IOException { String id = (String) doc.getFieldValue("id"); String type = doc.getDocumentMeta().get("type"); if (type == null) type = "doc"; IndexRequestBuilder request = client.prepareIndex(defaultIndex, type, id); Map<String, Object> source = new HashMap<String, Object>(); for (String fieldName : doc.getFieldNames()) { if (doc.getFieldValues(fieldName).size() > 1) { source.put(fieldName, doc.getFieldValue(fieldName)); for (Object value : doc.getFieldValues(fieldName)) { bulkLength += value.toString().length(); } } else { source.put(fieldName, doc.getFieldValue(fieldName)); bulkLength += doc.getFieldValue(fieldName).toString().length(); } } request.setSource(source); bulk.add(request); indexedDocs++; bulkDocs++; if (bulkDocs >= maxBulkDocs || bulkLength >= maxBulkLength) { LOG.info("Processing bulk request [docs = {}, length = {}, total docs = {}" + ", last doc in bulk = '{}']", bulkDocs, bulkLength, indexedDocs, id ); createNewBulk = true; commit(); } }
Source:
public void run() throws Exception { HadoopConfigurationInjector.prepareResourcesToInject(getJobProps(), getWorkingDirectory()); if (shouldProxy && obtainTokens) { userToProxy = getJobProps().getString("user.to.proxy"); getLog().info("Need to proxy. Getting tokens."); Props props = new Props(); props.putAll(getJobProps()); props.putAll(getSysProps()); String additionalNamenodes = (new Configuration()).get(HadoopJobUtils.MAPREDUCE_JOB_OTHER_NAMENODES); if (additionalNamenodes != null && additionalNamenodes.length() > 0) { HadoopJobUtils.addAdditionalNamenodesToProps(props, additionalNamenodes); } tokenFile = HadoopJobUtils .getHadoopTokens(hadoopSecurityManager, props, getLog()); getJobProps().put("env." + HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath()); } try { super.run(); } catch (Throwable t) { t.printStackTrace(); getLog().error("caught error running the job", t); throw new Exception(t); } finally { if (tokenFile != null) { HadoopJobUtils.cancelHadoopTokens(hadoopSecurityManager, userToProxy, tokenFile, getLog()); if (tokenFile.exists()) { tokenFile.delete(); } } } }

Target:
public void run() throws Exception { HadoopConfigurationInjector.prepareResourcesToInject(getJobProps(), getWorkingDirectory()); if (shouldProxy && obtainTokens) { userToProxy = getJobProps().getString("user.to.proxy"); getLog().info("Need to proxy. Getting tokens."); Props props = new Props(); props.putAll(getJobProps()); props.putAll(getSysProps()); HadoopJobUtils.addAdditionalNamenodesToPropsFromMRJob(props, getLog()); tokenFile = HadoopJobUtils .getHadoopTokens(hadoopSecurityManager, props, getLog()); getJobProps().put("env." + HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath()); } try { super.run(); } catch (Throwable t) { t.printStackTrace(); getLog().error("caught error running the job", t); throw new Exception(t); } finally { if (tokenFile != null) { HadoopJobUtils.cancelHadoopTokens(hadoopSecurityManager, userToProxy, tokenFile, getLog()); if (tokenFile.exists()) { tokenFile.delete(); } } } }
Source:
private String prefixedTimestampTableName() { return AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE.getQualifiedName(); }

Target:
private String prefixedTimestampTableName() { return tablePrefix + timestampTable.getQualifiedName(); }
Source:
public void open(Map conf, final TopologyContext context, SpoutOutputCollector collector) { if(Monitor.connection.client == null || !Monitor.connection.client.isConnected()) Monitor.connection.connect(); delegate.open(conf, context, new SpoutOutputCollector(collector) { @Override public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) { Monitor.startLatency(messageId); return super.emit(streamId, tuple, new MonitoringMessage(messageId, context.getThisComponentId())); } @Override public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) { Monitor.startLatency(messageId); super.emitDirect(taskId, streamId, tuple, new MonitoringMessage(messageId, context.getThisComponentId())); } }); }

Target:
public void open(Map conf, final TopologyContext context, SpoutOutputCollector collector) { spoutService = context.getThisComponentId(); delegate.open(conf, context, new SpoutOutputCollector(collector) { @Override public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) { List<Integer> emitResult = super.emit(streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); return emitResult; } @Override public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) { super.emitDirect(taskId, streamId, tuple, messageId); Monitor.getMonitor().startLatency(messageId); } }); }
Source:
public static void createOrUpdateDevice(UserSessionModel userSession, KeycloakSession session) { if (!Profile.isFeatureEnabled(Profile.Feature.DEVICE_ACTIVITY)) { return; } UserDeviceStore deviceProvider = getDeviceProvider(session); if (deviceProvider == null) { return; } UserModel user = userSession.getUser(); if (user == null) { return; } if (session.getAttribute(DEVICE_UPDATED_FLAG) == null) { DeviceModel current = getCurrentDevice(session); if (current != null) { DeviceModel device = getUserDevice(userSession, current, deviceProvider); if (device == null) { registerDevice(userSession, current, deviceProvider); } else { updateDevice(userSession, current, device, deviceProvider); } session.setAttribute(DEVICE_UPDATED_FLAG, true); } } }

Target:
public static void createOrUpdateDevice(UserSessionModel userSession, KeycloakSession session) { if (!Profile.isFeatureEnabled(Profile.Feature.DEVICE_ACTIVITY)) { return; } if (session.getAttributeOrDefault(DEVICE_UPDATED_FLAG, true)) { UserDeviceStore deviceProvider = (UserDeviceStore) session.users(); for (DeviceFingerPrintProvider provider : session.getAllProviders(DeviceFingerPrintProvider.class)) { DeviceModel current = provider.getCurrentDevice(userSession, deviceProvider); if (current != null) { DeviceModel device = getUserDevice(userSession, current, deviceProvider, provider); if (device == null) { registerDevice(userSession, current, deviceProvider, session); } else { updateDevice(userSession, device, session); } session.setAttribute(DEVICE_UPDATED_FLAG, false); return; } } } }
Source:
public Future<Boolean> triggerCheckpointAsync( CheckpointMetaData metadata, CheckpointOptions options, boolean advanceToEndOfEventTime) { CompletableFuture<Boolean> resultFuture = new CompletableFuture<>(); mainMailboxExecutor.execute( () -> { try { pendingCheckpointCompletedFutures.put(metadata.getCheckpointId(), resultFuture); triggerSourcesCheckpoint(new CheckpointBarrier(metadata.getCheckpointId(), metadata.getTimestamp(), options)); } catch (Exception ex) { pendingCheckpointCompletedFutures.remove(metadata.getCheckpointId()); resultFuture.completeExceptionally(ex); throw ex; } }, "checkpoint %s with %s", metadata, options); return resultFuture; }

Target:
public Future<Boolean> triggerCheckpointAsync( CheckpointMetaData metadata, CheckpointOptions options, boolean advanceToEndOfEventTime) { CompletableFuture<Boolean> resultFuture = new CompletableFuture<>(); mainMailboxExecutor.execute( () -> { try { pendingCheckpointCompletedFutures.put(metadata.getCheckpointId(), resultFuture); checkPendingCheckpointCompletedFuturesSize(); triggerSourcesCheckpoint(new CheckpointBarrier(metadata.getCheckpointId(), metadata.getTimestamp(), options)); } catch (Exception ex) { pendingCheckpointCompletedFutures.remove(metadata.getCheckpointId()); resultFuture.completeExceptionally(ex); throw ex; } }, "checkpoint %s with %s", metadata, options); return resultFuture; }
Source:
public Boolean autoGenerateIdentificationBarcodes() { MisoPropertyExporter exporter = (MisoPropertyExporter)applicationContextProvider.getApplicationContext().getBean("propertyConfigurer"); Map<String, String> misoProperties = exporter.getResolvedProperties(); return misoProperties.containsKey("miso.autoGenerateIdentificationBarcodes") && Boolean.parseBoolean(misoProperties.get("miso.autoGenerateIdentificationBarcodes")); }

Target:
public Boolean autoGenerateIdentificationBarcodes() { MisoPropertyExporter exporter = (MisoPropertyExporter)ApplicationContextProvider.getApplicationContext().getBean("propertyConfigurer"); Map<String, String> misoProperties = exporter.getResolvedProperties(); return misoProperties.containsKey("miso.autoGenerateIdentificationBarcodes") && Boolean.parseBoolean(misoProperties.get("miso.autoGenerateIdentificationBarcodes")); }
Source:
private boolean validateDB(Uri inputUri) throws IOException { boolean ok = false; try (InputStream inputStream = getContentResolver().openInputStream(inputUri)) { byte[] magicBuf = new byte[16]; if (inputStream.read(magicBuf) == magicBuf.length) { ok = Arrays.equals(SQLITE3_MAGIC, magicBuf); } } if (!ok) { Log.i(TAG, "Not a SQLite3 file: " + inputUri.toString()); Snackbar.make(findViewById(R.id.import_export_layout), R.string.import_bad_file, Snackbar.LENGTH_SHORT).show(); } return false; }

Target:
private boolean validateDB(Uri inputUri) throws IOException { try (InputStream inputStream = getContentResolver().openInputStream(inputUri)) { byte[] magicBuf = new byte[SQLITE3_MAGIC.length]; if (inputStream.read(magicBuf) == magicBuf.length) { return Arrays.equals(SQLITE3_MAGIC, magicBuf); } } return false; }
Source:
public String expandVariableSubstitutes(String expression) { assertStarted(); HiveConf hiveConfLocal = getHiveConf(); Preconditions.checkNotNull(hiveConfLocal); return hiveServerContainer.getVariableSubstitution().substitute(hiveConfLocal, expression); }

Target:
public String expandVariableSubstitutes(String expression) { assertStarted(); HiveConf hiveConf = getHiveConf(); Preconditions.checkNotNull(hiveConf); return hiveServerContainer.getVariableSubstitution().substitute(hiveConf, expression); }
Source:
public void draw(GuiContainer guiContainer, boolean isSelectedtab, int guiLeft, int guiTop, int xSize, int ySize, RenderItem itemRender, FontRenderer fontRendererObj) { boolean isFirstRow = isTopRow(); int column = getColumn(); int texX = column * 28; int texY = 0; int x = guiLeft + 28 * column; int y = guiTop; if (isSelectedtab) texY += 32; if (column == 5) x = guiLeft + xSize - 28; else if (column > 0) x += column; if (isFirstRow) y = y - 28; else { texY += 64; y = y + (ySize - 4); } RenderHelper.enableGUIStandardItemLighting(); GlStateManager.disableLighting(); GlStateManager.color(1F, 1F, 1F); GlStateManager.enableBlend(); guiContainer.drawTexturedModalRect(x, y, texX, texY, 28, 32); x = x + 6; y = y + 8 + (isFirstRow ? 1 : -1); GlStateManager.enableLighting(); if (getIconStack() != null) { ItemStack itemstack = getIconStack(); itemRender.renderItemAndEffectIntoGUI(itemstack, x, y); itemRender.renderItemOverlays(fontRendererObj, itemstack, x, y); } else if (getIconResLoc() != null) { Minecraft.getMinecraft().getTextureManager().bindTexture(getIconResLoc()); Gui.drawModalRectWithCustomSizedTexture(x, y, 0f, 0f, 16, 16, 16f, 16f); } GlStateManager.disableLighting(); }

Target:
public void draw(GuiContainer guiContainer, boolean isSelectedtab, int guiLeft, int guiTop, int xSize, int ySize, RenderItem itemRender, FontRenderer fontRendererObj) { boolean isFirstRow = isTopRow(); int column = getColumn(); int texX = column * 28; int texY = 0; int x = guiLeft + 28 * column; int y = guiTop; if (isSelectedtab) texY += 32; else if (column > 0) x += column; if (isFirstRow) y = y - 28; else { texY += 64; y = y + (ySize - 4); } RenderHelper.enableGUIStandardItemLighting(); GlStateManager.disableLighting(); GlStateManager.color(1F, 1F, 1F); GlStateManager.enableBlend(); guiContainer.drawTexturedModalRect(x, y, texX, texY, 28, 32); x = x + 6; y = y + 8 + (isFirstRow ? 1 : -1); GlStateManager.enableLighting(); if (!getIconStack().isEmpty()) { ItemStack itemstack = getIconStack(); itemRender.renderItemAndEffectIntoGUI(itemstack, x, y); itemRender.renderItemOverlays(fontRendererObj, itemstack, x, y); } else if (getIconResLoc() != null) { Minecraft.getMinecraft().getTextureManager().bindTexture(getIconResLoc()); Gui.drawModalRectWithCustomSizedTexture(x, y, 0f, 0f, 16, 16, 16f, 16f); } GlStateManager.disableLighting(); }
Source:
public void clear() { this.domainsVisibility.clear(); }

Target:
public synchronized void clear() { this.domainsVisibility.clear(); }
Source:
public void writeToFileWriter(ParquetFileWriter writer) throws IOException { writer.startColumn(path, totalValueCount, compressor.getCodecName()); if (bloomFilter != null) { 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; }

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:
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 { keepWaiting = true; } 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)); } } }

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:
public void startQuestionnaire(String id) { Questionnaire questionnaire = findQuestionnaireEntity(id); if (questionnaire.getStatus().equals(NOT_STARTED)) { questionnaire.setStatus(OPEN); dataService.update(id, questionnaire); } }

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:
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>(); if( requiresJava6(rtType) || requiresJava7(rtType)) { 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; }

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:
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; default: return; } } else { throw new IllegalArgumentException("unknown dispute agent type " + disputeAgentTypeString); } }

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:
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 = rtcpTransformEngineWrapper.getWrapped(); if (strategy instanceof RecurringRunnable) { recurringRunnablesExecutor .deRegisterRecurringRunnable((RecurringRunnable) strategy); } }

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:
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); }); }

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:
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; } }); } return orderedUpdatesManager.invalidate(keys).handle((nil, t) -> { if (stateTransferLock != null) { stateTransferLock.releaseSharedTopologyLock(); } CompletableFutures.rethrowException(t); return null; }); } catch (Throwable t) { if (stateTransferLock != null) { stateTransferLock.releaseSharedTopologyLock(); } throw t; } }

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:
public synchronized void startEntry(LogEntry logEntry) { LoggerFactory.getLogger(ImportStatus.class).info("Start entry: " + 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); }

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:
public void onResume() { super.onResume(); AppCompatActivity activity = (AppCompatActivity)getActivity(); ActionBar actionBar; try { ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(getString(R.string.search_by_barcode_drawer)); } catch (NullPointerException e) { e.printStackTrace(); } }

Target:
public void onResume() { super.onResume(); try { ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(getString(R.string.search_by_barcode_drawer)); } catch (NullPointerException e) { e.printStackTrace(); } }
Source:
public boolean isChecked() throws RemoteException { return (Boolean) jQueryHelper.getFieldValue(selector); }

Target:
public boolean isChecked() throws RemoteException { Boolean checked = (Boolean) jQueryHelper.getFieldValue(selector); return checked != null && checked; }
Source:
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(3, lineCount); } 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); } } }

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:
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; storeEntry(rCtx, key, computeCommand); if (getStatisticsEnabled()) cacheStores.incrementAndGet(); return rv; }); }

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:
private void auditIncomingExpirations(List<Status> allowedStatuses, Map<Integer, Vo> vosMap) throws InternalErrorException { LocalDate monthBefore = LocalDate.now().plusMonths(1); 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); }

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:
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>"; GlowServer.logger.warning("Skipping Entity with id " + id); } return null; }

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:
public SSLHandlerFactory(SSLConfig sslConfig) { if (sslConfig.getKeyStore() == null) { 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); } }

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:
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)) { mWPOrgPlugin = mPluginStore.getWPOrgPluginBySlug(event.pluginSlug); refreshPluginVersionViews(); } }

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:
public FilesSkipped totalFilesSkipped() { if (totalInstances == 0 || totalFilesSkipped == 0) { return FilesSkipped.NONE; } return totalFilesSkipped == totalInstances ? FilesSkipped.ALL : FilesSkipped.SOME; }

Target:
public FilesSkipped totalFilesSkipped() { if (totalInstances == 0 || totalFilesSkipped == 0) { return FilesSkipped.NONE; } if (totalFilesSkipped == totalInstances) { return FilesSkipped.ALL; } else { return FilesSkipped.SOME; } }
Source:
public JdbcDataflowTaskExecutionDao(DataSource dataSource, String tablePrefix) { this(dataSource); Assert.hasText(tablePrefix, "tablePrefix must not be null nor empty"); this.tablePrefix = tablePrefix; }

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:
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) { callback.onFailure(wrapToInstanceNotActiveException(e)); } }

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:
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; 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); } } }

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:
public boolean getBool(Record rec) { CharSequence cs = getArg().getStr(rec); return cs != null && cs.length()==1 && Character.toLowerCase(cs.charAt(0))==Character.toLowerCase(expected); }

Target:
public boolean getBool(Record rec) { CharSequence cs = getArg().getStr(rec); return cs != null && cs.length()==1 && cs.charAt(0)==expected; }
Source:
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)); }

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:
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("id", 0)); }

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:
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)) { 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; } }

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; } }