auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setDeviceState(String deviceName, Integer deviceAddress, SimpleBinaryDeviceState.DeviceStates state) { if (deviceAddress < 0) { return; } if (!this.containsKey(deviceAddress)) { this.put(deviceAddress, new SimpleBinaryDeviceState()); } SimpleBinaryDeviceState deviceState = this.get(deviceAddress); deviceState.setState(state); if (eventPublisher != null) { for (Map.Entry<String, SimpleBinaryInfoBindingConfig> item : deviceItemsConfigs.entrySet()) { if (item.getValue().device.equals(deviceName) && item.getValue().busAddress == deviceAddress) { if (item.getValue().infoType == InfoType.STATE) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getState().ordinal())); } else if (item.getValue().infoType == InfoType.PREVIOUS_STATE) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getPreviousState().ordinal())); } else if (item.getValue().infoType == InfoType.STATE_CHANGE_TIME) { eventPublisher.postUpdate(item.getValue().item.getName(), new DateTimeType(deviceState.getChangeDate())); } else if (item.getValue().infoType == InfoType.PACKET_LOST) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getPacketLost())); } } } } }

Target:
public void setDeviceState(String deviceName, Integer deviceAddress, SimpleBinaryDeviceState.DeviceStates state) { if (deviceAddress < 0) { return; } if (!this.containsKey(deviceAddress)) { this.put(deviceAddress, new SimpleBinaryDeviceState()); } SimpleBinaryDeviceState deviceState = this.get(deviceAddress); if (deviceState.setState(state) && eventPublisher != null) { for (Map.Entry<String, SimpleBinaryInfoBindingConfig> item : deviceItemsConfigs.entrySet()) { if (item.getValue().device.equals(deviceName) && item.getValue().busAddress == deviceAddress) { if (item.getValue().infoType == InfoType.STATE) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getState().ordinal())); } else if (item.getValue().infoType == InfoType.PREVIOUS_STATE) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getPreviousState().ordinal())); } else if (item.getValue().infoType == InfoType.STATE_CHANGE_TIME) { eventPublisher.postUpdate(item.getValue().item.getName(), new DateTimeType(deviceState.getChangeDate())); } else if (item.getValue().infoType == InfoType.PACKET_LOST) { eventPublisher.postUpdate(item.getValue().item.getName(), new DecimalType(deviceState.getPacketLost())); } } } } }
Source:
public void testToString() { assertEquals(TENOR_3D.toString(), "Tenor[3D]"); assertEquals(TENOR_3W.toString(), "Tenor[3W]"); assertEquals(TENOR_4M.toString(), "Tenor[4M]"); assertEquals(TENOR_18M.toString(), "Tenor[18M]"); assertEquals(TENOR_4Y.toString(), "Tenor[4Y]"); }

Target:
public void testToString() { assertEquals(TENOR_3D.toString(), "3D"); assertEquals(TENOR_2W.toString(), "2W"); assertEquals(TENOR_4M.toString(), "4M"); assertEquals(TENOR_1Y.toString(), "1Y"); assertEquals(TENOR_12M.toString(), "12M"); assertEquals(TENOR_18M.toString(), "18M"); assertEquals(TENOR_4Y.toString(), "4Y"); }
Source:
private Stream<String> getOlderBundleIds(final Date olderThan, final String userId, final boolean isAdmin) throws IOException { return this.getBundleIds( (Integer limit, Integer offset) -> { try { return isAdmin? this.bundleFactory.findSentBundles(olderThan, limit, offset): this.bundleFactory.findSentBundles(olderThan, userId, limit, offset); } catch (DotDataException e) { throw new DotRuntimeException(e); } }, Bundle::getId ); }

Target:
private Stream<String> getOlderBundleIds(final Date olderThan, final String userId, final boolean isAdmin) throws IOException { return this.getBundleIds( (Integer limit, Integer offset) -> { try { return isAdmin? this.bundleFactory.findSentBundles(olderThan, limit, offset): this.bundleFactory.findSentBundles(olderThan, userId, limit, offset); } catch (DotDataException e) { Logger.error(this,"Error getting bundles ids older than: " + olderThan + " by the user :" + userId,e); throw new DotRuntimeException(e); } }, Bundle::getId ); }
Source:
private List<CopyNumberTriStateSegment> getCopyNumberTriStateSegments(final CopyNumberTriStateHiddenMarkovModel model, final List<Target> targets, double[] inputValues) { final double mean = MathUtils.mean(inputValues, 0, inputValues.length); final double invStdev = 1.0 / MathUtils.stddev(inputValues, 0, inputValues.length); final List<Double> inputValuesList = DoubleStream.of(inputValues).boxed().collect(Collectors.toList()); final List<Double> standardizedValuesList = inputAreZscores ? inputValuesList : inputValuesList.stream().map(v -> (v - mean) * invStdev).collect(Collectors.toList()); final List<CopyNumberTriState> bestPath = ViterbiAlgorithm.apply(standardizedValuesList, targets, model); final ForwardBackwardAlgorithm.Result<Double, Target, CopyNumberTriState> fbResult = ForwardBackwardAlgorithm.apply(standardizedValuesList, targets, model); return composeSegments(bestPath, fbResult, inputValuesList); }

Target:
private List<CopyNumberTriStateSegment> getCopyNumberTriStateSegments(final CopyNumberTriStateHiddenMarkovModel model, final List<Target> targets, double[] inputValues) { final double mean = MathUtils.mean(inputValues, 0, inputValues.length); final double stdev = MathUtils.stddev(inputValues, 0, inputValues.length); final List<Double> inputValuesList = DoubleStream.of(inputValues).boxed().collect(Collectors.toList()); final List<Double> standardizedValuesList = inputAreZscores ? inputValuesList : inputValuesList.stream().map(v -> (v - mean) / stdev).collect(Collectors.toList()); final List<CopyNumberTriState> bestPath = ViterbiAlgorithm.apply(standardizedValuesList, targets, model); final ForwardBackwardAlgorithm.Result<Double, Target, CopyNumberTriState> fbResult = ForwardBackwardAlgorithm.apply(standardizedValuesList, targets, model); return composeSegments(bestPath, fbResult, inputValuesList); }
Source:
public String getReviewJSP(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo) { subInfo.put("upload-with-embargo", true); return super.getReviewJSP(context, request, response, subInfo); }

Target:
public String getReviewJSP(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo) { request.setAttribute("submission.step.uploadwithembargo", true); return super.getReviewJSP(context, request, response, subInfo); }
Source:
public void testJavaEE7Setup() throws Exception { Project project = projectHelper.createWebProject(); try (CommandController tester = testHarness.createCommandController(JavaEESetupCommand.class, project.getRoot())) { tester.initialize(); Assert.assertTrue(tester.isValid()); tester.setValueFor("javaEEVersion", "7"); Assert.assertTrue(tester.isValid()); Result result = tester.execute(); Assert.assertEquals("JavaEE 7 has been installed.", result.getMessage()); } project = projectHelper.refreshProject(project); Assert.assertTrue(project.hasFacet(JavaEE7Facet.class)); }

Target:
public void testJavaEE7Setup() throws Exception { Project project = projectHelper.createWebProject(); try (CommandController tester = testHarness.createCommandController(JavaEESetupCommand.class, project.getRoot())) { tester.initialize(); Assert.assertTrue(tester.isValid()); tester.setValueFor("javaEEVersion", "7"); Assert.assertTrue(tester.isValid()); Result result = tester.execute(); Assert.assertEquals("JavaEE 7 has been installed.", result.getMessage()); } project = projectHelper.refreshProject(project); Assert.assertTrue(project.hasFacet(JavaEE7Facet.class)); Assert.assertFalse(dependencyInstaller.isInstalled(project, JAVAEE6)); Assert.assertTrue(dependencyInstaller.isInstalled(project, JAVAEE7)); }
Source:
protected ThreshdConfiguration getConfigForExtensions(Set<ThreshdConfigurationExtension> extensions) { ThreshdConfiguration mergedConfig = new ThreshdConfiguration(); extensions.stream() .map(ThreshdConfigurationExtension::getThreads) .filter(Objects::nonNull) .max(Integer::compareTo) .ifPresent(mergedConfig::setThreads); mergedConfig.setPackages(extensions.stream() .flatMap(e -> e.getPackages().stream()) .map(ThreshdConfigurationExtensionManager::toPackage) .collect(Collectors.toList())); mergedConfig.setThresholders(extensions.stream() .flatMap(e -> e.getThresholders().stream()) .map(ThreshdConfigurationExtensionManager::toThresholder) .collect(Collectors.toList())); return mergedConfig; }

Target:
protected ThreshdConfiguration getConfigForExtensions(Set<ThreshdConfigurationExtension> extensions) { ThreshdConfiguration mergedConfig = new ThreshdConfiguration(); mergedConfig.setPackages(extensions.stream() .flatMap(e -> e.getPackages().stream()) .map(ThreshdConfigurationExtensionManager::toPackage) .collect(Collectors.toList())); return mergedConfig; }
Source:
public void run() { try { RabbitTemplate rabbitTemplate = new RabbitTemplate(AmqpAppender.this.connectionFactory); while (true) { final Event event = AmqpAppender.this.events.take(); MessageProperties amqpProps = AmqpAppender.this.prepareMessageProperties(event); String routingKey = AmqpAppender.this.routingKeyLayout.doLayout(event.getEvent()); sendOneEncoderPatternMessage(rabbitTemplate, routingKey); doSend(rabbitTemplate, event, event.getEvent(), name, amqpProps, routingKey); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }

Target:
public void run() { try { RabbitTemplate rabbitTemplate = new RabbitTemplate(AmqpAppender.this.connectionFactory); while (true) { final Event event = AmqpAppender.this.events.take(); MessageProperties amqpProps = prepareMessageProperties(event); String routingKey = AmqpAppender.this.routingKeyLayout.doLayout(event.getEvent()); sendOneEncoderPatternMessage(rabbitTemplate, routingKey); doSend(rabbitTemplate, event, event.getEvent(), name, amqpProps, routingKey); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
Source:
private void sendResultToScheduler(TaskTerminateNotification terminateNotification, TaskResultImpl taskResult) { if (isNodeShuttingDown()) { return; } int pingAttempts = initializer.getPingAttempts(); int pingPeriodMs = initializer.getPingPeriod() * 1000; TaskTerminateNotification currentTerminateNotification = terminateNotification; for (int i = 0; i < pingAttempts; i++) { try { currentTerminateNotification.terminate(taskId, taskResult); logger.debug("Successfully notified task termination " + taskId); return; } catch (Throwable t) { logger.warn("Cannot notify task termination, trying to rebind to to the task termination handler", t); TaskTerminateNotification rebindedTerminateNotification = taskLauncherRebinder.getRebindedTaskTerminateNotificationHandler(); if (rebindedTerminateNotification != null) { currentTerminateNotification = rebindedTerminateNotification; continue; } logger.warn("Cannot notify task termination " + taskId + ", will try again in " + pingPeriodMs + " ms", t); if (i != pingAttempts - 1) { try { Thread.sleep(pingPeriodMs); } catch (InterruptedException e) { logger.error("Interrupted while waiting to notify task termination", e); } } } } logger.error("Cannot notify task termination " + taskId + " after " + pingAttempts + " attempts, terminating task launcher now"); }

Target:
private void sendResultToScheduler(TaskTerminateNotification terminateNotification, TaskResultImpl taskResult) { if (isNodeShuttingDown()) { return; } int pingAttempts = initializer.getPingAttempts(); int pingPeriodMs = initializer.getPingPeriod() * 1000; TaskTerminateNotification currentTerminateNotification = terminateNotification; for (int i = 0; i < pingAttempts; i++) { try { currentTerminateNotification.terminate(taskId, taskResult); logger.debug("Successfully notified task termination " + taskId); return; } catch (Throwable t) { logger.warn("Cannot notify task termination, trying to rebind to the task termination handler", t); TaskTerminateNotification rebindedTerminateNotification = taskLauncherRebinder.getRebindedTaskTerminateNotificationHandler(); if (rebindedTerminateNotification != null) { currentTerminateNotification = rebindedTerminateNotification; continue; } decreasePingAttemptsAndWait(pingAttempts, pingPeriodMs, i, t); } } logger.error("Cannot notify task termination " + taskId + " after " + pingAttempts + " attempts, terminating task launcher now"); }
Source:
private void handleApiVersionsResponse(List<ClientResponse> responses, InFlightRequest req, long now, ApiVersionsResponse apiVersionsResponse) { final String node = req.destination; if (apiVersionsResponse.data.errorCode() != Errors.NONE.code()) { if (req.request.version() == 0 || apiVersionsResponse.data.errorCode() != Errors.UNSUPPORTED_VERSION.code()) { log.warn("Received error from node when making an ApiVersionsRequest with correlation id {}. Disconnecting.", Errors.forCode(apiVersionsResponse.data.errorCode()), node, req.header.correlationId()); this.selector.close(node); processDisconnection(responses, node, now, ChannelState.LOCAL_CLOSE); } else { short failbackVersion = 0; if (apiVersionsResponse.data.apiKeys().size() > 0) { ApiVersionsResponseKey apiVersion = apiVersionsResponse.data.apiKeys().find(ApiKeys.API_VERSIONS.id); if (apiVersion != null) { failbackVersion = apiVersion.maxVersion(); } } nodesNeedingApiVersionsFetch.put(node, new ApiVersionsRequest.Builder(failbackVersion)); } return; } NodeApiVersions nodeVersionInfo = new NodeApiVersions(apiVersionsResponse.data.apiKeys()); apiVersions.update(node, nodeVersionInfo); this.connectionStates.ready(node); log.debug("Recorded API versions for node {}: {}", node, nodeVersionInfo); }

Target:
private void handleApiVersionsResponse(List<ClientResponse> responses, InFlightRequest req, long now, ApiVersionsResponse apiVersionsResponse) { final String node = req.destination; if (apiVersionsResponse.data.errorCode() != Errors.NONE.code()) { if (req.request.version() == 0 || apiVersionsResponse.data.errorCode() != Errors.UNSUPPORTED_VERSION.code()) { log.warn("Received error from node when making an ApiVersionsRequest with correlation id {}. Disconnecting.", Errors.forCode(apiVersionsResponse.data.errorCode()), node, req.header.correlationId()); this.selector.close(node); processDisconnection(responses, node, now, ChannelState.LOCAL_CLOSE); } else { short maxApiVersion = 0; if (apiVersionsResponse.data.apiKeys().size() > 0) { ApiVersionsResponseKey apiVersion = apiVersionsResponse.data.apiKeys().find(ApiKeys.API_VERSIONS.id); if (apiVersion != null) { maxApiVersion = apiVersion.maxVersion(); } } nodesNeedingApiVersionsFetch.put(node, new ApiVersionsRequest.Builder(maxApiVersion)); } return; } NodeApiVersions nodeVersionInfo = new NodeApiVersions(apiVersionsResponse.data.apiKeys()); apiVersions.update(node, nodeVersionInfo); this.connectionStates.ready(node); log.debug("Recorded API versions for node {}: {}", node, nodeVersionInfo); }
Source:
private void onEditorFinalTouchesBeforeShowing() { refreshEditorTheme(); if (mShowGutenbergEditor && mEditorFragment instanceof GutenbergEditorFragment) { refreshEditorContent(); List<MediaModel> failedMedia = mMediaStore.getMediaForPostWithState(mEditPostRepository.getPost(), MediaUploadState.FAILED); if (failedMedia != null && !failedMedia.isEmpty()) { HashSet<Integer> mediaIds = new HashSet<>(); for (MediaModel media : failedMedia) { if (!media.getMarkedLocallyAsFeatured()) { mediaIds.add(media.getId()); } } ((GutenbergEditorFragment) mEditorFragment).resetUploadingMediaToFailed(mediaIds); } } else if (mShowAztecEditor && mEditorFragment instanceof AztecEditorFragment) { mPostEditorAnalyticsSession.start(null); } }

Target:
private void onEditorFinalTouchesBeforeShowing() { refreshEditorContent(); if (mShowGutenbergEditor && mEditorFragment instanceof GutenbergEditorFragment) { refreshEditorTheme(); List<MediaModel> failedMedia = mMediaStore.getMediaForPostWithState(mEditPostRepository.getPost(), MediaUploadState.FAILED); if (failedMedia != null && !failedMedia.isEmpty()) { HashSet<Integer> mediaIds = new HashSet<>(); for (MediaModel media : failedMedia) { if (!media.getMarkedLocallyAsFeatured()) { mediaIds.add(media.getId()); } } ((GutenbergEditorFragment) mEditorFragment).resetUploadingMediaToFailed(mediaIds); } } else if (mShowAztecEditor && mEditorFragment instanceof AztecEditorFragment) { mPostEditorAnalyticsSession.start(null); } }
Source:
private static List<IkePayload> getChildCreatePayloads( IkeSaPayload saPayload, IkeTrafficSelector[] initTs, IkeTrafficSelector[] respTs, boolean isTransport, boolean isFirstChildSa, RandomnessFactory randomFactory) throws ResourceUnavailableException { List<IkePayload> payloadList = new ArrayList<>(5); payloadList.add(saPayload); payloadList.add(new IkeTsPayload(true , initTs)); payloadList.add(new IkeTsPayload(false , respTs)); if (!isFirstChildSa) { payloadList.add(new IkeNoncePayload(randomFactory.getRandom())); } DhGroupTransform[] dhGroups = ((ChildProposal) saPayload.proposalList.get(0)) .saProposal.getDhGroupTransforms(); if (dhGroups.length != 0 && dhGroups[0].id != DH_GROUP_NONE) { payloadList.add(new IkeKePayload(dhGroups[0].id, randomFactory.getRandom())); } if (isTransport) payloadList.add(new IkeNotifyPayload(NOTIFY_TYPE_USE_TRANSPORT_MODE)); return payloadList; }

Target:
private static List<IkePayload> getChildCreatePayloads( IkeSaPayload saPayload, IkeTrafficSelector[] initTs, IkeTrafficSelector[] respTs, boolean isTransport, boolean isFirstChildSa, RandomnessFactory randomFactory) throws ResourceUnavailableException { List<IkePayload> payloadList = new ArrayList<>(5); payloadList.add(saPayload); payloadList.add(new IkeTsPayload(true , initTs)); payloadList.add(new IkeTsPayload(false , respTs)); if (!isFirstChildSa) { payloadList.add(new IkeNoncePayload(randomFactory)); } DhGroupTransform[] dhGroups = ((ChildProposal) saPayload.proposalList.get(0)) .saProposal.getDhGroupTransforms(); if (dhGroups.length != 0 && dhGroups[0].id != DH_GROUP_NONE) { payloadList.add(new IkeKePayload(dhGroups[0].id, randomFactory)); } if (isTransport) payloadList.add(new IkeNotifyPayload(NOTIFY_TYPE_USE_TRANSPORT_MODE)); return payloadList; }
Source:
public Optional<Operation> filterOperation(Operation operation, ApiDescription api, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if(operation.getExtensions() != null && operation.getExtensions().containsKey(Constants.X_INFLECTOR_HIDDEN)) { return Optional.of(operation); } return Optional.of(operation); }

Target:
public Optional<Operation> filterOperation(Operation operation, ApiDescription api, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if(operation.getExtensions() != null && operation.getExtensions().containsKey(Constants.X_INFLECTOR_HIDDEN)) { return Optional.of(operation); } return Optional.empty(); }
Source:
public static BinaryData fromStream(InputStream inputStream) { Objects.requireNonNull(inputStream, "'inputStream' cannot be null."); final int bufferSize = 1024; try { ByteArrayOutputStream dataOutputBuffer = new ByteArrayOutputStream(); int nRead; byte[] data = new byte[bufferSize]; while ((nRead = inputStream.read(data, 0, data.length)) != -1) { dataOutputBuffer.write(data, 0, nRead); } return fromBytes(dataOutputBuffer.toByteArray()); } catch (IOException ex) { ClientLogger logger = new ClientLogger(BinaryData.class); throw logger.logExceptionAsError(new UncheckedIOException(ex)); } }

Target:
public static BinaryData fromStream(InputStream inputStream) { Objects.requireNonNull(inputStream, "'inputStream' cannot be null."); final int bufferSize = 1024; try { ByteArrayOutputStream dataOutputBuffer = new ByteArrayOutputStream(); int nRead; byte[] data = new byte[bufferSize]; while ((nRead = inputStream.read(data, 0, data.length)) != -1) { dataOutputBuffer.write(data, 0, nRead); } return fromBytes(dataOutputBuffer.toByteArray()); } catch (IOException ex) { throw LOGGER.logExceptionAsError(new UncheckedIOException(ex)); } }
Source:
public void shouldReplaceServiceNameWithContainerNameInLinks() { final String serviceNameToLink = "service"; final String containerNameToLink = "container"; List<String> links = new ArrayList<>(); links.add(serviceNameToLink); CheServiceImpl serviceToNormalizeLinks = new CheServiceImpl().withLinks(links); CheServiceImpl service1 = mock(CheServiceImpl.class); CheServiceImpl service2 = mock(CheServiceImpl.class); Map<String, CheServiceImpl> allServices = new HashMap<>(); allServices.put("this", serviceToNormalizeLinks); allServices.put(serviceNameToLink, service1); allServices.put("anotherService", service2); when(service1.getContainerName()).thenReturn(containerNameToLink); engine.normalizeLinks(serviceToNormalizeLinks, allServices); assertEquals(serviceToNormalizeLinks.getLinks().size(), 1); assertEquals(serviceToNormalizeLinks.getLinks().get(0), containerNameToLink + ':' + serviceNameToLink); }

Target:
public void shouldReplaceServiceNameWithContainerNameInLinks() { final String serviceNameToLink = "service"; final String containerNameToLink = "container"; List<String> links = new ArrayList<>(); links.add(serviceNameToLink); CheServiceImpl serviceToNormalizeLinks = new CheServiceImpl().withLinks(links); CheServiceImpl service1 = mock(CheServiceImpl.class); CheServiceImpl service2 = mock(CheServiceImpl.class); Map<String, CheServiceImpl> allServices = new HashMap<>(); allServices.put("this", serviceToNormalizeLinks); allServices.put(serviceNameToLink, service1); allServices.put("anotherService", service2); when(service1.getContainerName()).thenReturn(containerNameToLink); engine.normalizeLinks(serviceToNormalizeLinks, allServices); assertEquals(serviceToNormalizeLinks.getLinks().size(), 1); assertEquals(serviceToNormalizeLinks.getLinks().get(0), containerNameToLink); }
Source:
public List<ArtifactTypeBean> types() throws ArtificerUiException { List<String> types = null; try { types = ArtificerApiClientAccessor.getClient().getTypes(); } catch (ArtificerClientException e) { e.printStackTrace(); } catch (ArtificerServerException e) { e.printStackTrace(); } List<ArtifactTypeBean> returnTypes = new ArrayList<ArtifactTypeBean>(); if (types != null && !types.isEmpty()) { for (String type : types) { returnTypes.add(new ArtifactTypeBean(type)); } } return returnTypes; }

Target:
public List<ArtifactTypeBean> types() throws ArtificerUiException { List<String> types = null; try { types = ArtificerApiClientAccessor.getClient().getTypes(); } catch (ArtificerClientException e) { throw new ArtificerUiException(e.getMessage()); } catch (ArtificerServerException e) { throw new ArtificerUiException(e.getMessage()); } List<ArtifactTypeBean> returnTypes = new ArrayList<ArtifactTypeBean>(); if (types != null && !types.isEmpty()) { for (String type : types) { returnTypes.add(new ArtifactTypeBean(type)); } } return returnTypes; }
Source:
default <R, A> R collect(Collector<? super T,A,R> collector) { return collector.finisher() .apply(this.collect(collector.supplier(), collector.accumulator(), null)); }

Target:
default <R, A> R collect(Collector<? super T,A,R> collector) { return StreamSupport.stream(spliterator(), false).collect(collector); }
Source:
public <T extends LwM2mResponse> void send(final Registration destination, final DownlinkRequest<T> request, ResponseCallback<T> responseCallback, ErrorCallback errorCallback) { if (destination.getLwM2mQueue().isClientSleeping()) { return; } final LwM2mModel model = modelProvider.getObjectModel(destination); CoapRequestBuilder coapRequestBuilder = new CoapRequestBuilder( new InetSocketAddress(destination.getAddress(), destination.getPort()), destination.getRootPath(), destination.getId(), destination.getEndpoint(), model, encoder); request.accept(coapRequestBuilder); final Request coapRequest = coapRequestBuilder.getRequest(); coapRequest.addMessageObserver(new AsyncRequestObserver<T>(coapRequest, responseCallback, errorCallback) { @Override public T buildResponse(Response coapResponse) { LwM2mResponseBuilder<T> lwm2mResponseBuilder = new LwM2mResponseBuilder<>(coapRequest, coapResponse, destination, model, observationService, decoder); request.accept(lwm2mResponseBuilder); return lwm2mResponseBuilder.getResponse(); } }); addPendingRequest(destination, coapRequest); Endpoint endpoint = getEndpointForClient(destination); endpoint.sendRequest(coapRequest); if (destination.usesQueueMode() && !destination.getLwM2mQueue().isClientSleeping()) { destination.getLwM2mQueue().startClientAwakeTimer(); } }

Target:
public <T extends LwM2mResponse> void send(final Registration destination, final DownlinkRequest<T> request, ResponseCallback<T> responseCallback, ErrorCallback errorCallback) { if (destination.getLwM2mQueue().isClientSleeping()) { LOG.info("The destination client is sleeping, request couldn't been sent."); return; } final LwM2mModel model = modelProvider.getObjectModel(destination); CoapRequestBuilder coapRequestBuilder = new CoapRequestBuilder( new InetSocketAddress(destination.getAddress(), destination.getPort()), destination.getRootPath(), destination.getId(), destination.getEndpoint(), model, encoder); request.accept(coapRequestBuilder); final Request coapRequest = coapRequestBuilder.getRequest(); coapRequest.addMessageObserver(new AsyncRequestObserver<T>(coapRequest, responseCallback, errorCallback) { @Override public T buildResponse(Response coapResponse) { LwM2mResponseBuilder<T> lwm2mResponseBuilder = new LwM2mResponseBuilder<>(coapRequest, coapResponse, destination, model, observationService, decoder); request.accept(lwm2mResponseBuilder); return lwm2mResponseBuilder.getResponse(); } }); addPendingRequest(destination, coapRequest); Endpoint endpoint = getEndpointForClient(destination); endpoint.sendRequest(coapRequest); if (destination.usesQueueMode() && !destination.getLwM2mQueue().isClientSleeping()) { destination.getLwM2mQueue().startClientAwakeTimer(); } }
Source:
private boolean portExists(String portName) { @SuppressWarnings("unchecked") Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers(); boolean portExists = false; logger.debug("Searching autodetected ports for:" + portName); while (portEnum.hasMoreElements()) { CommPortIdentifier portIdentifier = portEnum.nextElement(); if (portIdentifier.getPortType() == CommPortIdentifier.PORT_SERIAL) { logger.debug("Found serial port:" + portIdentifier.getName()); if (portIdentifier.getName().equals(portName)) { portExists = true; } } } if (!portExists) { Properties properties = System.getProperties(); String currentPorts = properties.getProperty("gnu.io.rxtx.SerialPorts", ""); if (currentPorts.indexOf(portName) >= 0) { logger.debug(portName + " is listed in system property gnu.io.rxtx.SerialPorts"); portExists = true; } else { logger.debug(portName + " is not listed in system property gnu.io.rxtx.SerialPorts"); } } return portExists; }

Target:
private boolean portExists(String portName) { @SuppressWarnings("unchecked") Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers(); boolean portExists = false; logger.debug("Searching autodetected ports for: {}", portName); while (portEnum.hasMoreElements()) { CommPortIdentifier portIdentifier = portEnum.nextElement(); if (portIdentifier.getPortType() == CommPortIdentifier.PORT_SERIAL) { logger.debug("Found serial port: {}", portIdentifier.getName()); if (portIdentifier.getName().equals(portName)) { portExists = true; } } } if (!portExists) { Properties properties = System.getProperties(); String currentPorts = properties.getProperty("gnu.io.rxtx.SerialPorts", ""); if (currentPorts.indexOf(portName) >= 0) { logger.debug("{} is listed in system property gnu.io.rxtx.SerialPorts", portName); portExists = true; } else { logger.debug("{} is not listed in system property gnu.io.rxtx.SerialPorts", portName); } } return portExists; }
Source:
public int partition(RowData record, byte[] key, byte[] value, String targetTopic, int[] partitions) { return record.getInt(PARTITION_ID_FIELD_IN_SCHEMA) % partitions.length; }

Target:
public int partition(RowData record, byte[] key, byte[] value, String targetTopic, int[] partitions) { return partitions[record.getInt(PARTITION_ID_FIELD_IN_SCHEMA) % partitions.length]; }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); FailureCollector collector = context.getFailureCollector(); collector.getOrThrowException(); if (fields != null) { FieldOperation operation = new FieldTransformOperation("Parse", "Parsed field", Collections.singletonList(config.field), fields.stream().map(Schema.Field::getName) .collect(Collectors.toList())); context.record(Collections.singletonList(operation)); } }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); extractMappings(context.getFailureCollector()); if (isSimple) { context.record(TransformLineageRecorderUtils.generateOneToMany(config.field, TransformLineageRecorderUtils .getFields(context.getOutputSchema()), "Parse", "Parsed fields as JSON.")); return; } List<String> mappedFields = TransformLineageRecorderUtils.getFields(context.getOutputSchema()).stream() .filter(mapping::containsKey).collect(Collectors.toList()); List<String> identityFields = TransformLineageRecorderUtils.getFields(context.getInputSchema()); identityFields.removeAll(mappedFields); List<FieldOperation> output = new ArrayList<>(); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(mappedFields, "Parse", "Parsed fields as JSON.")); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(identityFields, "identity", TransformLineageRecorderUtils.IDENTITY_TRANSFORM_DESCRIPTION)); context.record(output); }
Source:
public void accumulate(long cx) { N += cx; M += (cx == 0 ? 0 : cx * Math.log(cx)); }

Target:
public void accumulate(long cx) { if(cx > 0) { N += cx; M += cx * Math.log(cx); } }
Source:
protected OperationRequest(ConnectionPool connectionPool, BlockingQueue<OperationResponse> responseQueue, OperationContext context, BlobId blobId, ReplicaId replicaId, RequestOrResponse request) { this.connectionPool = connectionPool; this.responseQueue = responseQueue; this.context = context; this.blobId = blobId; this.replicaId = replicaId; this.request = request; this.sslEnabled = isSslEnabled(); this.responseHandler = context.getResponseHandler(); }

Target:
protected OperationRequest(ConnectionPool connectionPool, BlockingQueue<OperationResponse> responseQueue, OperationContext context, BlobId blobId, ReplicaId replicaId, RequestOrResponse request) { this.connectionPool = connectionPool; this.responseQueue = responseQueue; this.context = context; this.blobId = blobId; this.replicaId = replicaId; this.request = request; this.responseHandler = context.getResponseHandler(); this.port = replicaId.getDataNodeId().getPortToConnectTo(context.getSslEnabledDatacenters()); this.sslEnabled = port.getPortType() == PortType.SSL; }
Source:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { if (getId() != null && getId() < 1L) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided"); } List<Role> roles = roleService.findAllRolesBy(getId(), getName(), getRoleType()); ListResponse<RoleResponse> response = new ListResponse<>(); List<RoleResponse> roleResponses = new ArrayList<>(); for (Role role : roles) { if (role == null) { continue; } RoleResponse roleResponse = new RoleResponse(); roleResponse.setId(role.getUuid()); roleResponse.setRoleName(role.getName()); roleResponse.setRoleType(role.getRoleType()); roleResponse.setDescription(role.getDescription()); roleResponse.setObjectName("role"); roleResponses.add(roleResponse); } response.setResponses(roleResponses); response.setResponseName(getCommandName()); setResponseObject(response); }

Target:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { final List<Role> roles; if (getId() != null && getId() > 0L) { roles = Collections.singletonList(roleService.findRole(getId())); } else if (!Strings.isNullOrEmpty(getName())) { roles = roleService.findRolesByName(getName()); } else if (getRoleType() != null){ roles = roleService.findRolesByType(getRoleType()); } else { roles = roleService.listRoles(); } setupResponse(roles); }
Source:
public static boolean validateDate(String dateString, DateTime minDate, DateTime maxDate) { String s = dateString.trim(); if (s.isEmpty() || s.length() < 8 || s.length() > 10) { return false; } if (!s.contains("/")) { return false; } int numberOfDashes = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '/') { numberOfDashes++; } } if (numberOfDashes != 2) { return false; } else { String[] bundledDate = s.split("/"); int day = Integer.parseInt(bundledDate[0]), month = Integer.parseInt(bundledDate[1]), year = Integer.parseInt(bundledDate[2]); int maxDays = month == 2 ? (year % 4 == 0 ? 29 : 28) : (day == 31 && month == 4 || month == 6 || month == 9 || month == 11 ? 30 : 31); int maxMonths = 12; if (day <= 0 || day > maxDays || month <= 0 || month > maxMonths || year <= minDate.getYear() || year > maxDate.getYear()) { return false; } else { DateTimeFormatter formatter = DateTimeFormat.forPattern(DateUtils.DEFAULT_DATE_FORMAT); DateTime dob = formatter.parseDateTime(s); return dob.isAfter(minDate.toInstant()) && dob.isBefore(maxDate.toInstant()); } } }

Target:
public static boolean validateDate(String dateString, DateTime minDate, DateTime maxDate) { DateTime minimumDate = minDate, maximumDate = maxDate; if (minimumDate.isAfter(maximumDate) || maximumDate.isBefore(minimumDate)) { minimumDate = maxDate; maximumDate = minDate; } String s = dateString.trim(); if (s.isEmpty() || s.length() < 8 || s.length() > 10) { return false; } if (!s.contains("/")) { return false; } int numberOfDashes = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '/') { numberOfDashes++; } } if (numberOfDashes != 2) { return false; } else { String[] bundledDate = s.split("/"); int day = Integer.parseInt(bundledDate[0]), month = Integer.parseInt(bundledDate[1]), year = Integer.parseInt(bundledDate[2]); int maxDays; if (month == 2) { if (year % 4 == 0) { maxDays = 29; } else { maxDays = 28; } } else if (day == 31 && month == 4 || month == 6 || month == 9 || month == 11) { maxDays = 30; } else { maxDays = 31; } int maxMonths = 12; if (day <= 0 || day > maxDays || month <= 0 || month > maxMonths || year <= minimumDate.getYear() || year > maximumDate.getYear()) { return false; } else { DateTimeFormatter formatter = DateTimeFormat.forPattern(DateUtils.DEFAULT_DATE_FORMAT); DateTime dob = formatter.parseDateTime(s); return dob.isAfter(minimumDate.toInstant()) && dob.isBefore(maxDate.toInstant()); } } }
Source:
public GifFrameManager(Context context, BitmapPool bitmapPool, GifDecoder decoder, Handler mainHandler, Transformation<Bitmap> transformation, int targetWidth, int targetHeight, int frameWidth, int frameHeight) { this.context = context; this.decoder = decoder; this.mainHandler = mainHandler; this.transformation = new Transformation[] {transformation}; this.targetWidth = targetWidth; this.targetHeight = targetHeight; this.totalFrameSize = frameWidth * frameHeight * (decoder.isTransparent() ? 4 : 2); calculator = new MemorySizeCalculator(context); frameLoader = new GifFrameModelLoader(); frameResourceDecoder = new GifFrameResourceDecoder(bitmapPool); sourceEncoder = NullEncoder.get(); if (transformation == null) { throw new NullPointerException("Transformation must not be null"); } if (!decoder.isTransparent()) { cacheDecoder = new FileToStreamDecoder<Bitmap>(new StreamBitmapDecoder(context)); encoder = new BitmapEncoder(); } else { cacheDecoder = NullDecoder.get(); encoder = NullResourceEncoder.get(); } }

Target:
public GifFrameManager(Context context, BitmapPool bitmapPool, GifDecoder decoder, Handler mainHandler, Transformation<Bitmap> transformation, int targetWidth, int targetHeight, int frameWidth, int frameHeight) { if (transformation == null) { throw new NullPointerException("Transformation must not be null"); } this.context = context; this.frameResourceDecoder = new GifFrameResourceDecoder(bitmapPool); this.decoder = decoder; this.mainHandler = mainHandler; this.transformation = new Transformation[] {transformation}; this.targetWidth = targetWidth; this.targetHeight = targetHeight; this.totalFrameSize = frameWidth * frameHeight * (decoder.isTransparent() ? 4 : 2); this.calculator = new MemorySizeCalculator(context); this.frameLoader = new GifFrameModelLoader(); this.sourceEncoder = NullEncoder.get(); if (!decoder.isTransparent()) { this.cacheDecoder = new FileToStreamDecoder<Bitmap>(new StreamBitmapDecoder(context)); this.encoder = new BitmapEncoder(); } else { this.cacheDecoder = NullDecoder.get(); this.encoder = NullResourceEncoder.get(); } }
Source:
private void startAutoMove(EntityRef entity) { isAutoMove = true; ClientComponent clientComponent = entity.getComponent(ClientComponent.class); new Thread(() -> { while(isAutoMove) { try { Vector3f viewDir = entity.getComponent(LocationComponent.class).getWorldDirection(); clientComponent.character.send(new CharacterImpulseEvent(viewDir.mul(8f))); Thread.sleep(200); } catch (Exception e) { isAutoMove = false; } } }).start(); }

Target:
private void startAutoMove(EntityRef entity) { isAutoMove = true; delayManager.addPeriodicAction(entity, AUTO_MOVE_ID, 0, 200); }
Source:
public Map<String, Object> saveExistingQuestions( @RequestBody QuestionListPayload payLoad) { final Map<String, Object> response = new HashMap<String, Object>(); RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); statusDto.setMessage("No questions to change"); final List<QuestionDto> requestList = payLoad.getQuestions(); if (requestList != null && requestList.size() > 0) { for (final QuestionDto questionDto : requestList) { if (questionDto != null) { Long keyId = questionDto.getKeyId(); Question q; if (keyId != null) { q = questionDao.getByKey(keyId); if (q != null) { BeanUtils.copyProperties(questionDto, q, new String[] { "createdDateTime", "type", "optionList" }); if (questionDto.getType() != null) q.setType(Question.Type.valueOf(questionDto.getType() .toString())); q = questionDao.save(q); } else { statusDto.setMessage("Cannot change unknown question " + keyId); response.put("meta", statusDto); return response; } } else { statusDto.setMessage("Cannot change question without id"); response.put("meta", statusDto); return response; } } } } statusDto.setStatus("ok"); statusDto.setMessage(""); response.put("meta", statusDto); return response; }

Target:
public Map<String, Object> saveExistingQuestions( @RequestBody QuestionListPayload payLoad) { final Map<String, Object> response = new HashMap<String, Object>(); RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); statusDto.setMessage("No questions to change"); List<Question> saveList = new ArrayList<>(); final List<QuestionDto> requestList = payLoad.getQuestions(); if (requestList != null && requestList.size() > 0) { for (final QuestionDto questionDto : requestList) { if (questionDto != null) { Long keyId = questionDto.getKeyId(); Question q; if (keyId != null) { q = questionDao.getByKey(keyId); if (q != null) { BeanUtils.copyProperties(questionDto, q, new String[] { "createdDateTime", "type", "optionList" }); if (questionDto.getType() != null) q.setType(Question.Type.valueOf(questionDto.getType() .toString())); saveList.add(q); } else { statusDto.setMessage("Cannot change unknown question " + keyId); response.put("meta", statusDto); return response; } } else { statusDto.setMessage("Cannot change question without id"); response.put("meta", statusDto); return response; } } } questionDao.save(saveList); statusDto.setStatus("ok"); statusDto.setMessage(""); } response.put("meta", statusDto); return response; }
Source:
public void accept(final Socket socket) throws IOException { this.threads.add(new BkTimeable.ThreadInfo(Thread.currentThread())); this.origin.accept(socket); }

Target:
public void accept(final Socket socket) throws IOException { this.threads.add(new BkTimeable.ThreadInfo()); this.origin.accept(socket); }
Source:
private static Map<String, String> metadata(Object... services) { Map<String, String> result = new HashMap<>(); for (Object service : services) { Collection<Class<?>> serviceInterfaces = serviceProcessor.extractServiceInterfaces(service); for (Class<?> serviceInterface : serviceInterfaces) { ServiceDefinition def = serviceProcessor.introspectServiceInterface(serviceInterface); result.put(def.serviceName(), "service"); } } return result; }

Target:
private static Map<String, String> metadata(Object... services) { return Arrays.stream(services).flatMap(service -> { Collection<Class<?>> serviceInterfaces = serviceProcessor.extractServiceInterfaces(service); return serviceInterfaces.stream().map(serviceProcessor::introspectServiceInterface); }).collect(Collectors.toMap(ServiceDefinition::serviceName,def -> "service")); }
Source:
public void waitHttpAsAction() { String server = String.format("http://localhost:%s", serverPort); httpServer.setPort(serverPort); start(httpServer); parallel().actions( sequential().actions( waitFor() .execution() .action(send(server)) ), sequential().actions( http().server(httpServer).receive().post(), http().server(httpServer).receive().post(), http().server(httpServer).respond(HttpStatus.OK) ) ); doFinally().actions(stop(httpServer)); }

Target:
public void waitHttpAsAction() { String server = startHttpServerAndGetUrl(); parallel().actions( sequential().actions( waitFor() .execution() .action(send(server)) ), sequential().actions( http().server(httpServer).receive().post(), http().server(httpServer).receive().post(), http().server(httpServer).respond(HttpStatus.OK) ) ); doFinally().actions(stop(httpServer)); }
Source:
public static Set<Language> getLanguages() { return new LinkedHashSet<>(getInstance().languages.values()); }

Target:
public static Set<Language> getLanguages() { return getInstance().languages; }
Source:
public void testUmbrellaHeader() { UmbrellaHeader header = new UmbrellaHeader(ImmutableList.of("header1.h", "header2.h")); assertEquals("#import \"header1.h\"\n" + "#import \"header2.h\"\n", header.render()); }

Target:
public void testUmbrellaHeader() { UmbrellaHeader header = new UmbrellaHeader("lib", ImmutableList.of("header1.h", "header2.h")); assertThat( "#import <lib/header1.h>\n#import <lib/header2.h>\n", equalToIgnoringPlatformNewlines(header.render())); }
Source:
private void verifySafeObject(final AnyObjectId id, final int type, final byte[] data, long size) throws IOException { if (0 < maxObjectSizeLimit && maxObjectSizeLimit < size) { throw new IOException("Object " + id.name() + " is too large. Use: \"git ls-tree -r HEAD | grep " + id.name() + "\" to find out the path of the object in your Git repository"); } if (objCheck != null) { try { objCheck.check(type, data); } catch (CorruptObjectException e) { throw new IOException(MessageFormat.format( JGitText.get().invalidObject, Constants .typeString(type), id.name(), e.getMessage())); } } if (isCheckObjectCollisions()) { try { final ObjectLoader ldr = readCurs.open(id, type); final byte[] existingData = ldr.getCachedBytes(data.length); if (!Arrays.equals(data, existingData)) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, id.name())); } } catch (MissingObjectException notLocal) { } } }

Target:
private void verifySafeObject(final AnyObjectId id, final int type, final byte[] data, long size) throws IOException { if (0 < maxObjectSizeLimit && maxObjectSizeLimit < size) { throw new IOException(MessageFormat.format( JGitText.get().receivePackObjectTooLarge, id.name())); } if (data == null) return; if (objCheck != null) { try { objCheck.check(type, data); } catch (CorruptObjectException e) { throw new IOException(MessageFormat.format( JGitText.get().invalidObject, Constants .typeString(type), id.name(), e.getMessage())); } } if (isCheckObjectCollisions()) { try { final ObjectLoader ldr = readCurs.open(id, type); final byte[] existingData = ldr.getCachedBytes(data.length); if (!Arrays.equals(data, existingData)) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, id.name())); } } catch (MissingObjectException notLocal) { } } }
Source:
public void writeData(ObjectDataOutput out) throws IOException { out.writeByte(schemaVersion); out.writeObject(targetAddress); out.writeBoolean(reply); out.writeLong(uuid.getMostSignificantBits()); out.writeLong(uuid.getLeastSignificantBits()); int size = (localAddresses == null) ? 0 : localAddresses.size(); out.writeInt(size); if (size == 0) { return; } for (Map.Entry<ProtocolType, Collection<Address>> addressEntry : localAddresses.entrySet()) { out.writeInt(addressEntry.getKey().ordinal()); writeCollection(addressEntry.getValue(), out); } }

Target:
public void writeData(ObjectDataOutput out) throws IOException { out.writeByte(schemaVersion); out.writeObject(targetAddress); out.writeBoolean(reply); writeUUID(out, uuid); int size = (localAddresses == null) ? 0 : localAddresses.size(); out.writeInt(size); if (size == 0) { return; } for (Map.Entry<ProtocolType, Collection<Address>> addressEntry : localAddresses.entrySet()) { out.writeInt(addressEntry.getKey().ordinal()); writeCollection(addressEntry.getValue(), out); } }
Source:
public void nonHtmlStringWithPercentageReturnsEmptyMap() { MapConverter cnv = new MapConverter(); assertEquals(new HashMap<>(), cnv.fromString("1%")); }

Target:
public void nonHtmlStringWithPercentageReturnsEmptyMap() { makeMap("1%"); assertEquals(0, result.size()); }
Source:
private Value getOutputPort( OutputPortInfo portInfo ) { Value response = Value.create(); response.getFirstChild( "name" ).setValue( portInfo.id() ); if( portInfo.location() != null ) { response.getFirstChild( "location" ).setValue( portInfo.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "undefined" ); } if( portInfo.protocol() != null ) { response.getFirstChild( "protocol" ).setValue( portInfo.protocol().toString() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } for( int intf_index = 0; intf_index < portInfo.getInterfaceList().size(); intf_index++ ) { InterfaceDefinition interfaceDefinition = portInfo.getInterfaceList().get( intf_index ); response.getChildren( "interfaces" ).get( intf_index ) .deepCopy( getInterfaceAndInsertTypes( interfaceDefinition, null, null ) ); } return response; }

Target:
private Value getOutputPort( OutputPortInfo portInfo ) { Value response = Value.create(); response.getFirstChild( "name" ).setValue( portInfo.id() ); if( portInfo.location() != null ) { response.getFirstChild( "location" ).setValue( portInfo.location().toString() ); } else { response.getFirstChild( "location" ).setValue( "undefined" ); } if( portInfo.protocolId() != null ) { response.getFirstChild( "protocol" ).setValue( portInfo.protocolId() ); } else { response.getFirstChild( "protocol" ).setValue( "" ); } for( int intf_index = 0; intf_index < portInfo.getInterfaceList().size(); intf_index++ ) { InterfaceDefinition interfaceDefinition = portInfo.getInterfaceList().get( intf_index ); response.getChildren( "interfaces" ).get( intf_index ) .deepCopy( getInterfaceAndInsertTypes( interfaceDefinition, null, null ) ); } return response; }
Source:
protected void onStoreCollection(RecordStore recordStore) { assertRunningOnPartitionThread(); ((DefaultRecordStore) recordStore).clearOtherResourcesThanStorage(true); }

Target:
protected void onStoreCollection(RecordStore recordStore) { assertRunningOnPartitionThread(); ((DefaultRecordStore) recordStore).clearOtherDataThanStorage(true); }
Source:
protected Object getResponseBody(Exchange exchange) throws Exception { HttpResponse response; Message answer; if (exchange.hasOut()) { response = consumer.getEndpoint().getNettyHttpBinding().toNettyResponse(exchange.getOut(), consumer.getConfiguration()); answer = exchange.getOut(); } else { response = consumer.getEndpoint().getNettyHttpBinding().toNettyResponse(exchange.getIn(), consumer.getConfiguration()); answer = exchange.getIn(); } handleNoContent(exchange, answer, response); return response; }

Target:
protected Object getResponseBody(Exchange exchange) throws Exception { return consumer.getEndpoint().getNettyHttpBinding().toNettyResponse(exchange.getMessage(), consumer.getConfiguration()); }