auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Mono<ThroughputResponse> replaceThroughput(ThroughputProperties throughputProperties) { return this.read() .flatMap(response -> this.database.getDocClientWrapper() .queryOffers("select * from c where c.offerResourceId = '" + response.getProperties() .getResourceId() + "'", new FeedOptions()) .single() .flatMap(offerFeedResponse -> { if (offerFeedResponse.getResults().isEmpty()) { return Mono.error(BridgeInternal .createCosmosClientException( HttpConstants.StatusCodes.BADREQUEST, "No offers found for the " + "resource")); } Offer existingOffer = offerFeedResponse.getResults().get(0); ModelBridgeInternal.updateOfferFromProperties(existingOffer, throughputProperties); return this.database.getDocClientWrapper() .replaceOffer(existingOffer) .single(); }).map(ModelBridgeInternal::createThroughputRespose)); }

Target:
public Mono<ThroughputResponse> replaceThroughput(ThroughputProperties throughputProperties) { return this.read() .flatMap(response -> this.database.getDocClientWrapper() .queryOffers(database.getOfferQuerySpecFromResourceId(response .getProperties() .getResourceId()) , new FeedOptions()) .single() .flatMap(offerFeedResponse -> { if (offerFeedResponse.getResults().isEmpty()) { return Mono.error(BridgeInternal .createCosmosClientException( HttpConstants.StatusCodes.BADREQUEST, "No offers found for the " + "resource " + this.getId())); } Offer existingOffer = offerFeedResponse.getResults().get(0); Offer updatedOffer = ModelBridgeInternal.updateOfferFromProperties(existingOffer, throughputProperties); return this.database.getDocClientWrapper() .replaceOffer(updatedOffer) .single(); }).map(ModelBridgeInternal::createThroughputRespose)); }
Source:
private Object applyModificationsAndThen(TxInvocationContext ctx, PrepareCommand command, WriteCommand[] modifications, int startIndex, InvocationSuccessFunction handler) throws Throwable { for (int i = startIndex; i < modifications.length; i++) { WriteCommand c = modifications[i]; c.setTopologyId(command.getTopologyId()); Object result = c.acceptVisitor(ctx, entryWrappingVisitor); InvocationStage visitorStage = null; boolean done = true; if (result instanceof InvocationStage) { visitorStage = (InvocationStage) result; done = visitorStage.isDone(); if (done) { visitorStage.get(); } } if (done) { if (c.hasAnyFlag(FlagBitSets.PUT_FOR_X_SITE_STATE_TRANSFER)) { ctx.getCacheTransaction().setStateTransferFlag(Flag.PUT_FOR_X_SITE_STATE_TRANSFER); } } else { int nextIndex = i + 1; if (nextIndex >= modifications.length) { return visitorStage.thenApply(ctx, command, handler); } return visitorStage.thenApply(ctx, command, (rCtx, rCommand, rv) -> applyModificationsAndThen(ctx, command, modifications, nextIndex, handler)); } } return handler.apply(ctx, command, null); }

Target:
private Object applyModificationsAndThen(TxInvocationContext ctx, PrepareCommand command, WriteCommand[] modifications, int startIndex, InvocationSuccessFunction handler) throws Throwable { for (int i = startIndex; i < modifications.length; i++) { WriteCommand c = modifications[i]; c.setTopologyId(command.getTopologyId()); if (c.hasAnyFlag(FlagBitSets.PUT_FOR_X_SITE_STATE_TRANSFER)) { ctx.getCacheTransaction().setStateTransferFlag(Flag.PUT_FOR_X_SITE_STATE_TRANSFER); } Object result = c.acceptVisitor(ctx, entryWrappingVisitor); if (!isSuccessfullyDone(result)) { int nextIndex = i + 1; if (nextIndex >= modifications.length) { return makeStage(result).thenApply(ctx, command, handler); } return makeStage(result).thenApply(ctx, command, (rCtx, rCommand, rv) -> applyModificationsAndThen(ctx, command, modifications, nextIndex, handler)); } } return handler.apply(ctx, command, null); }
Source:
public void testEventBridge() throws Exception { EventsCollector eventsCollector = new EventsCollector(); sessionRepository.setApplicationEventPublisher(eventsCollector); MapSession sessionToBeDeleted = sessionRepository.createSession(); MapSession sessionToBeExpired = sessionRepository.createSession(); sessionToBeExpired.setMaxInactiveIntervalInSeconds(1); sessionRepository.save(sessionToBeExpired); sessionRepository.save(sessionToBeDeleted); sessionRepository.delete(sessionToBeDeleted.getId()); TimeUnit.SECONDS.sleep(1); callEviction(); assertNull(cache.get(sessionToBeExpired.getId())); assertNull(cache.get(sessionToBeDeleted.getId())); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionCreatedEvent.class, 2, 2, TimeUnit.SECONDS); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionDeletedEvent.class, 1, 2, TimeUnit.SECONDS); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionExpiredEvent.class, 1, 2, TimeUnit.SECONDS); }

Target:
public void testEventBridge() throws Exception { EventsCollector eventsCollector = new EventsCollector(); sessionRepository.setApplicationEventPublisher(eventsCollector); MapSession sessionToBeDeleted = sessionRepository.createSession(); MapSession sessionToBeExpired = sessionRepository.createSession(); sessionToBeExpired.setMaxInactiveIntervalInSeconds(1); sessionRepository.save(sessionToBeExpired); sessionRepository.save(sessionToBeDeleted); sessionRepository.delete(sessionToBeDeleted.getId()); TimeUnit.SECONDS.sleep(1); callEviction(); assertNull(springCache.get(sessionToBeExpired.getId())); assertNull(springCache.get(sessionToBeDeleted.getId())); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionCreatedEvent.class, 2, 2, TimeUnit.SECONDS); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionDeletedEvent.class, 1, 2, TimeUnit.SECONDS); EventsWaiter.assertNumberOfEvents(() -> eventsCollector.getEvents(), SessionExpiredEvent.class, 1, 2, TimeUnit.SECONDS); }
Source:
public static void validateArtifactoryServerAndRepo(String serverKey, String repositoryKey, ServerConfigManager serverConfigManager, @NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection) { if (!params.containsKey(serverKey)) { return; } long configuredServerId = getConfiguredServerId(serverKey, params); if (configuredServerId == -1) { return; } validateServerConfigExists(configuredServerId, serverKey, serverConfigManager, errorCollection); validateRepo(repositoryKey, params, errorCollection); }

Target:
public static void validateArtifactoryServerAndRepo(String serverKey, String repositoryKey, ServerConfigManager serverConfigManager, @NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection) { boolean shouldCheckRepo = validateServer(serverKey, serverConfigManager, params, errorCollection); if (shouldCheckRepo) { validateRepo(repositoryKey, params, errorCollection); } }
Source:
public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation != null) { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { return mLocationManager.getLastKnownLocation(mLocationProvider); } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }

Target:
public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation != null) { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { mLocation = mLocationManager.getLastKnownLocation(mLocationProvider); return mLocation; } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }
Source:
public void isSameAllergen_shouldReturnFalseForDifferentNonCodedAllergen() { Concept concept = Context.getConceptService().getConceptByUuid(otherNonCodedConceptUuid); Assert.assertFalse(new Allergen(null, concept, "OTHER VALUE1").isSameAllergen(new Allergen(null, concept, "OTHER VALUE2"))); }

Target:
public void isSameAllergen_shouldReturnFalseForDifferentNonCodedAllergen() { Concept concept = Context.getConceptService().getConceptByUuid(Allergen.getOtherNonCodedConceptUuid()); Assert.assertFalse(new Allergen(null, concept, "OTHER VALUE1").isSameAllergen(new Allergen(null, concept, "OTHER VALUE2"))); }
Source:
public boolean isImageAdInCorrectSize(double imageHeight, String slotSelector) throws InterruptedException { long time = System.currentTimeMillis(); long endTime = time+5000; while(time < endTime) { if (imageHeight == getAdSlotHeight(slotSelector)){ return true; } Thread.sleep(200); time = System.currentTimeMillis(); } PageObjectLogging.log("isImageAdInCorrectSize", "Image is not in correct, required size " + imageHeight + " is not equal with actual size " + getAdSlotHeight(slotSelector), false, driver); return false; }

Target:
public boolean isImageAdInCorrectSize(double imageHeight, String slotSelector) throws InterruptedException { long time = System.currentTimeMillis(); long endTime = time+3000; while(time < endTime) { if (imageHeight == getAdSlotHeight(slotSelector)){ return true; } TimeUnit.MILLISECONDS.sleep(200); time = System.currentTimeMillis(); } PageObjectLogging.log("isImageAdInCorrectSize", "Image is not in correct, required size " + imageHeight + " is not equal with actual size " + getAdSlotHeight(slotSelector), false, driver); return false; }
Source:
public static Map<String, String> loadMountPoints() throws IOException { Map<String, String> mounts = null; String home = System.getProperty("user.home"); File mountFile = new File( home + File.separator + ".knoxshell" + File.separator + KNOXMOUNTPOINTS_JSON); if (mountFile.exists()) { String json = readFileToString(mountFile); mounts = getMapFromJsonString(json); } return mounts; }

Target:
public static Map<String, String> loadMountPoints() throws IOException { Map<String, String> mounts = new HashMap<>(); String home = System.getProperty("user.home"); File mountFile = new File( home + File.separator + ".knoxshell" + File.separator + KNOXMOUNTPOINTS_JSON); if (mountFile.exists()) { String json = readFileToString(mountFile); mounts = getMapFromJsonString(json); } return mounts; }
Source:
protected void syncSearch() { super.syncSearch(); Task.Create(this, null).InvokeUIThread(); }

Target:
protected void syncSearch() { super.syncSearch(); updateOptionsAsync(getPrefix() + getSearchString()); }
Source:
private void insertRow() { db.executeInsert( "PROJECT_BRANCHES", "UUID", "dummy_uuid", "PROJECT_UUID", "dummy_project_uuid", "KEE", "dummy_key", "CREATED_AT", 456789, "UPDATED_AT", 456789, "BRANCH_TYPE", ScannerReport.Metadata.BranchType.PULL_REQUEST.name()); }

Target:
private void insertRow() { db.executeInsert( "PROJECT_BRANCHES", "UUID", "dummy_uuid", "PROJECT_UUID", "dummy_project_uuid", "KEE", "dummy_key", "CREATED_AT", 456789, "UPDATED_AT", 456789, "BRANCH_TYPE", "PULL_REQUEST"); }
Source:
public boolean accept(Path path) { if (!super.accept(path)) { return false; } String filename = path.getName(); Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new AssertionError("match expected because of CommittedFileFilter"); } String topic = m.group(1); return topic.equals(this.topic); }

Target:
public boolean accept(Path path) { if (!super.accept(path)) { return false; } String filename = path.getName(); Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new AssertionError("match expected because of CommittedFileFilter"); } String topic = m.group(HdfsSinkConnectorConstants.PATTERN_TOPIC_GROUP); return topic.equals(this.topic); }
Source:
private void asyncInstall(Set<String> editionPluginKeys, UpdateCenter updateCenter) { try { editionPluginDownloader.installEdition(pluginsToInstall(editionPluginKeys), updateCenter); for (String pluginKey : pluginsToRemove(editionPluginKeys)) { editionPluginUninstaller.uninstall(pluginKey); } editionManagementState.automaticInstallReady(); } finally { lock.unlock(); } }

Target:
private void asyncInstall(Set<String> editionPluginKeys, UpdateCenter updateCenter) { Map<String, PluginInfo> pluginInfosByKeys = pluginRepository.getPluginInfosByKeys(); Set<String> pluginsToRemove = pluginsToRemove(editionPluginKeys, pluginInfosByKeys.values()); Set<String> pluginsToInstall = pluginsToInstall(editionPluginKeys, pluginInfosByKeys.keySet()); try { editionPluginDownloader.downloadEditionPlugins(pluginsToInstall, updateCenter); for (String pluginKey : pluginsToRemove) { editionPluginUninstaller.uninstall(pluginKey); } editionManagementState.automaticInstallReady(); } finally { lock.unlock(); } }
Source:
public void testCodeSpanEscaped() { builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("A single backtick in a code span: "); builder.beginSpan(SpanType.CODE, new Attributes()); builder.characters("`"); builder.endSpan(); builder.endBlock(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("A backtick-delimited string in a code span: "); builder.beginSpan(SpanType.CODE, new Attributes()); builder.characters("`foo`"); builder.endSpan(); builder.endBlock(); builder.endDocument(); assertMarkup("A single backtick in a code span: `` ` ``\n\nA backtick-delimited string in a code span: `` `foo` ``\n\n"); }

Target:
public void testCodeSpanEscaped() { builder.beginDocument(); builder.characters("A single backtick in a code span: "); builder.beginSpan(SpanType.CODE, new Attributes()); builder.characters("`"); builder.endSpan(); builder.lineBreak(); builder.characters("A backtick-delimited string in a code span: "); builder.beginSpan(SpanType.CODE, new Attributes()); builder.characters("`foo`"); builder.endSpan(); builder.endDocument(); assertMarkup("A single backtick in a code span: `` ` `` \nA backtick-delimited string in a code span: `` `foo` ``\n\n"); }
Source:
private static PrivateKey readPEMRSAPrivateKey(Reader reader) { PEMParser pemParser = new PEMParser(reader); PKCS8EncodedKeySpec privateKey = null; try { PEMKeyPair pemKeyPair = (PEMKeyPair) pemParser.readObject(); privateKey = new PKCS8EncodedKeySpec(pemKeyPair.getPrivateKeyInfo().getEncoded()); } catch (IOException ioex) { new IOException("Failed to read PrivateKey").initCause(ioex); } PrivateKey privateKeyOutput = null; try { privateKeyOutput = KeyFactory.getInstance("RSA").generatePrivate(privateKey); } catch (InvalidKeySpecException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return privateKeyOutput; }

Target:
private static PrivateKey readPEMRSAPrivateKey(Reader reader) { PEMParser pemParser = new PEMParser(reader); PKCS8EncodedKeySpec privateKey = null; try { PEMKeyPair pemKeyPair = (PEMKeyPair) pemParser.readObject(); privateKey = new PKCS8EncodedKeySpec(pemKeyPair.getPrivateKeyInfo().getEncoded()); } catch (IOException ioex) { throw new WinstoneException(ioex.getMessage(), ioex); } PrivateKey privateKeyOutput = null; try { privateKeyOutput = KeyFactory.getInstance("RSA").generatePrivate(privateKey); } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { throw new WinstoneException(e.getMessage(), e); } return privateKeyOutput; }
Source:
public void createChain() throws Exception { SigningKeyPair oldUser = SigningKeyPair.random(new SafeRandom.Java(), new Ed25519.Java()); SigningKeyPair newUser = SigningKeyPair.random(new SafeRandom.Java(), new Ed25519.Java()); PublicKeyHash oldHash = ipfs.putSigningKey( oldUser.secretSigningKey.signOnly(oldUser.publicSigningKey.serialize()), ipfs.hashKey(oldUser.publicSigningKey), oldUser.publicSigningKey).get(); PublicKeyHash newHash = ipfs.putSigningKey( newUser.secretSigningKey.signOnly(newUser.publicSigningKey.serialize()), ipfs.hashKey(newUser.publicSigningKey), newUser.publicSigningKey).get(); SigningPrivateKeyAndPublicHash oldSigner = new SigningPrivateKeyAndPublicHash(oldHash, oldUser.secretSigningKey); SigningPrivateKeyAndPublicHash newSigner = new SigningPrivateKeyAndPublicHash(newHash, newUser.secretSigningKey); List<UserPublicKeyLink> links = UserPublicKeyLink.createChain(oldSigner, newSigner, "someuser", LocalDate.now().plusYears(2)); links.forEach(link -> testSerialization(link)); }

Target:
public void createChain() throws Exception { SigningKeyPair oldUser = SigningKeyPair.random(new SafeRandom.Java(), new Ed25519.Java()); SigningKeyPair newUser = SigningKeyPair.random(new SafeRandom.Java(), new Ed25519.Java()); PublicKeyHash oldHash = putPublicSigningKey(oldUser); PublicKeyHash newHash = putPublicSigningKey(newUser); SigningPrivateKeyAndPublicHash oldSigner = new SigningPrivateKeyAndPublicHash(oldHash, oldUser.secretSigningKey); SigningPrivateKeyAndPublicHash newSigner = new SigningPrivateKeyAndPublicHash(newHash, newUser.secretSigningKey); List<UserPublicKeyLink> links = UserPublicKeyLink.createChain(oldSigner, newSigner, "someuser", LocalDate.now().plusYears(2)); links.forEach(link -> testSerialization(link)); }
Source:
public HTTPKasperResponse asHttp(){ if (HTTPKasperResponse.class.isAssignableFrom(this.getClass())) { return (HTTPKasperResponse) this; } throw new KasperException("Not an HTTP response"); }

Target:
public HTTPKasperResponse asHttp(){ if (TransportMode.HTTP.equals(getTransportMode())) { return (HTTPKasperResponse) this; } throw new KasperException("Not an HTTP response"); }
Source:
public void visitIfStatement(IfStatementTree tree) { insideIfStatement = true; if (isThisAResourceNullCheck(tree, NOT_EQUAL)) { updateNullCheckedResources(tree, true); } else if (isThisAResourceNullCheck(tree, EQUAL)) { insideEqualNullCheck = true; } super.visitIfStatement(tree); if (returnOccurredInsideEqualNullCheck) { updateNullCheckedResources(tree, true); } cleanFlagsAfterIfStatement(tree); }

Target:
public void visitIfStatement(IfStatementTree tree) { insideIfStatement = true; if (isResourceNullCheckOfType(tree, NOT_EQUAL_TO.name())) { updateNullCheckedResources(tree, true); } else if (isResourceNullCheckOfType(tree, EQUAL_TO.name())) { insideEqualNullCheck = true; } super.visitIfStatement(tree); if (returnOccurredInsideEqualNullCheck) { updateNullCheckedResources(tree, true); } cleanFlagsAfterIfStatement(tree); }
Source:
public void testAutoRefreshWithoutForceRefresh() throws Exception { genericSetUp(SEMANTIC_MODEL_PATH_FOR_NULL_VALUE, MODELER_DESCRIPTION_PATH_FOR_NULL_VALUE, SESSION_PATH_FOR_NULL_VALUE); changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), true); Iterator<DRepresentation> iterator = getRepresentations("PackageDiag").iterator(); DDiagram firstDiag = (DDiagram) iterator.next(); DiagramEditor diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, firstDiag, new NullProgressMonitor()); DDiagram secondDiag = (DDiagram) iterator.next(); diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, secondDiag, new NullProgressMonitor()); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); try { applyNodeCreationTool("createPackageNotRefresh", secondDiag, secondDiag); assertEquals("Diagram should not be empty", 1, secondDiag.getOwnedDiagramElements().size()); assertEquals("Diagram should not be empty", 1, firstDiag.getOwnedDiagramElements().size()); } catch (NullPointerException exception) { Assert.fail("No expcetion should have been raised during Node creation. This is a regression."); } }

Target:
public void testAutoRefreshWithoutForceRefresh() throws Exception { changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), true); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); applyNodeCreationTool("createPackageNotRefresh", secondDiag, secondDiag); assertEquals("Force refresh diagram has not been refreshed", 1, secondDiag.getOwnedDiagramElements().size()); assertEquals("Non 'Force refresh' diagram has not been refreshed.", 1, firstDiag.getOwnedDiagramElements().size()); }
Source:
public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<ShareableMetacardImpl, ShareableMetacardImpl> previous = (update) -> ShareableMetacardImpl.from(existingMetacards.get(update.getId())); Set<String> notOwners = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter(ShareableMetacardImpl::canShare) .map(ShareableMetacardImpl::from) .filter(update -> isSharingUpdated(previous.apply(update), update)) .map(previous) .map(ShareableMetacardImpl::getOwner) .filter(this::isNotOwner) .collect(Collectors.toSet()); if (!notOwners.isEmpty()) { throw new StopProcessingException( "Cannot update metacard. Subject cannot change sharing permissions because they are not the owner."); } return input; }

Target:
public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<ShareableMetacardImpl, ShareableMetacardImpl> oldVersionOfMetacard = (update) -> ShareableMetacardImpl.create(existingMetacards.get(update.getId())).orElse(null); Set<String> notOwners = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter(ShareableMetacardImpl::canShare) .map(ShareableMetacardImpl::createOrThrow) .filter(update -> isSharingUpdated(oldVersionOfMetacard.apply(update), update)) .map(oldVersionOfMetacard) .filter(Objects::nonNull) .map(ShareableMetacardImpl::getOwner) .filter(this::isNotOwner) .collect(Collectors.toSet()); if (!notOwners.isEmpty()) { throw new StopProcessingException( "Cannot update metacard. Subject cannot change sharing permissions because they are not the owner."); } return input; }
Source:
public void testServerIssueTracking() { VirtualFile file = mock(VirtualFile.class); ServerIssue serverIssue = mock(ServerIssue.class); when(file.getPath()).thenReturn(""); ConnectedSonarLintEngine engine = mock(ConnectedSonarLintEngine.class); when(bindingManager.getConnectedEngine()).thenReturn(engine); SonarQubeServer server = mock(SonarQubeServer.class); when(server.getHostUrl()).thenReturn("http://localhost:9000"); when(bindingManager.getSonarQubeServer()).thenReturn(server); when(engine.downloadServerIssues(any(ServerConfiguration.class), anyString(), anyString())) .thenReturn(Collections.singleton(serverIssue).iterator()); settings.setBindingEnabled(true); updater.initComponent(); updater.fetchAndMatchServerIssues(Collections.singletonList(file)); verify(issueManager, timeout(1000).times(1)).matchWithServerIssues(eq(file), argThat(new CustomMatcher<Collection<Trackable>>("one trackable") { @Override public boolean matches(Object o) { Collection<Trackable> issues = (Collection<Trackable>) o; return issues.size() == 1; } })); verify(bindingManager).getConnectedEngine(); verify(console, never()).error(anyString()); verify(console, never()).error(anyString(), any(Throwable.class)); }

Target:
public void testServerIssueTracking() { VirtualFile file = mock(VirtualFile.class); ServerIssue serverIssue = mock(ServerIssue.class); when(file.getPath()).thenReturn(""); ConnectedSonarLintEngine engine = mock(ConnectedSonarLintEngine.class); when(bindingManager.getConnectedEngine()).thenReturn(engine); SonarQubeServer server = mock(SonarQubeServer.class); when(server.getHostUrl()).thenReturn("http://dummyserver:9000"); when(bindingManager.getSonarQubeServer()).thenReturn(server); when(engine.downloadServerIssues(any(ServerConfiguration.class), anyString(), anyString())) .thenReturn(Collections.singleton(serverIssue).iterator()); settings.setBindingEnabled(true); updater.initComponent(); updater.fetchAndMatchServerIssues(Collections.singletonList(file)); verify(issueManager, timeout(1000).times(1)).matchWithServerIssues(eq(file), argThat(new CustomMatcher<Collection<Trackable>>("one trackable") { @Override public boolean matches(Object o) { Collection<Trackable> issues = (Collection<Trackable>) o; return issues.size() == 1; } })); verify(bindingManager).getConnectedEngine(); verify(console, never()).error(anyString()); verify(console, never()).error(anyString(), any(Throwable.class)); }
Source:
private void verifyIfCkptSet(Map<String, String> props, String dumpDir) { assertTrue(props.containsKey(ReplUtils.REPL_CHECKPOINT_KEY)); assertTrue(props.get(ReplUtils.REPL_CHECKPOINT_KEY).equalsIgnoreCase(dumpDir)); }

Target:
private void verifyIfCkptSet(Map<String, String> props, String dumpDir) { assertTrue(props.containsKey(ReplUtils.REPL_CHECKPOINT_KEY)); assertTrue(props.get(ReplUtils.REPL_CHECKPOINT_KEY).equals(dumpDir)); }
Source:
public String rerunFailedJobs(Request req, Response res) throws IOException { String pipelineName = req.params("pipeline_name"); String pipelineCounter = req.params("pipeline_counter"); String stageName = req.params("stage_name"); HttpOperationResult result = new HttpOperationResult(); scheduleService.rerunFailedJobs(pipelineName, pipelineCounter, stageName, result); return renderHTTPOperationResult(result, req, res); }

Target:
public String rerunFailedJobs(Request req, Response res) throws IOException { HttpOperationResult result = new HttpOperationResult(); Optional<Stage> optionalStage = getStageFromRequestParam(req, result); optionalStage.ifPresent(stage -> scheduleService.rerunFailedJobs(stage, result)); return renderHTTPOperationResult(result, req, res); }
Source:
public void update(final VDS host) { Collection<String> packages = getPackagesForCheckUpdate(host.getVdsType(), host.getClusterCompatibilityVersion()); try (final VdsDeploy hostPackagesManager = createPackagesManager(host, true)) { hostPackagesManager.addUnit(new VdsDeployPackagesUnit(packages, false)); hostPackagesManager.execute(); } catch (final Exception e) { log.error("Failed to update host '{}' packages '{}'.", host.getName(), StringUtils.join(packages, ", ")); log.error("Exception", e.getMessage()); log.debug("Exception", e); throw new RuntimeException(e); } }

Target:
public void update(final VDS host) { Collection<String> packages = getPackagesForCheckUpdate(host.getVdsType(), host.getClusterCompatibilityVersion()); try (final VdsDeploy hostPackagesManager = createPackagesManager(host, true)) { hostPackagesManager.addUnit(new VdsDeployPackagesUnit(packages, false)); hostPackagesManager.execute(); } catch (final Exception e) { log.error("Failed to update host '{}' packages '{}': {}", host.getName(), StringUtils.join(packages, ", "), e.getMessage()); log.debug("Exception", e); throw new RuntimeException(e); } }
Source:
private SystemProducer createAndInitializeSystemProducer() { SystemFactory samzaFactory = ReflectionUtils.createInstance(_factoryClassName); if (samzaFactory == null) { String msg = "Unable to instantiate the factory class " + _factoryClassName; LOG.error(msg); throw new DatastreamRuntimeException(msg); } SystemProducer systemProducer = samzaFactory.getProducer(_systemName, _samzaConfig, new NoOpMetricsRegistry()); systemProducer.register(_source); systemProducer.start(); return systemProducer; }

Target:
private SystemProducer createAndInitializeSystemProducer() { SystemFactory samzaFactory = ReflectionUtils.createInstance(_factoryClassName); if (samzaFactory == null) { String msg = "Unable to instantiate the factory class " + _factoryClassName; LOG.error(msg); throw new DatastreamRuntimeException(msg); } SystemProducer systemProducer = samzaFactory.getProducer(_systemName, _samzaConfig, new NoOpMetricsRegistry()); systemProducer.register(_destination); systemProducer.start(); return systemProducer; }
Source:
private void validate(final List<BatchItem> batch, final EventType eventType) throws EventValidationException, EventSizeValidationException, InternalNakadiException { for (final BatchItem item : batch) { item.setStep(EventPublishingStep.VALIDATING); try { validateSchema(item.getEvent(), eventType); validateEventSize(item); } catch (final EventValidationException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, e.getMessage()); throw e; } catch (final EventSizeValidationException e) { item.updateStatusAndDetail(EventPublishingStatus.ABORTED, e.getMessage()); throw e; } } }

Target:
private void validate(final List<BatchItem> batch, final EventType eventType) throws EventValidationException, InternalNakadiException, NoSuchEventTypeException { for (final BatchItem item : batch) { item.setStep(EventPublishingStep.VALIDATING); try { validateSchema(item.getEvent(), eventType); validateEventSize(item); } catch (final EventValidationException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, e.getMessage()); throw e; } } }
Source:
public Collection<ConfiguredBundle<AirpalConfiguration>> getConfiguredBundles() { Collection<ConfiguredBundle<AirpalConfiguration>> bundles = super.getConfiguredBundles(); bundles.add(new ShiroBundle<AirpalConfiguration>() { @Override protected ShiroConfiguration narrow(AirpalConfiguration configuration) { return configuration.getShiro(); } }); return bundles; }

Target:
public Iterable<ConfiguredBundle<AirpalConfiguration>> getConfiguredBundles() { Iterable<ConfiguredBundle<AirpalConfiguration>> bundles = super.getConfiguredBundles(); ImmutableList.Builder<ConfiguredBundle<AirpalConfiguration>> builder = ImmutableList.builder(); for (ConfiguredBundle<AirpalConfiguration> bundle : bundles) { builder.add(bundle); } builder.add(new ShiroBundle<AirpalConfiguration>() { @Override protected ShiroConfiguration narrow(AirpalConfiguration configuration) { return configuration.getShiro(); } }); return builder.build(); }
Source:
public void testFailedContainerRegistration() throws ApiException { ApiClient client = getWebClient(); ContainersApi containersApi = new ContainersApi(client); List<DockstoreTool> containers = containersApi.allPublishedContainers(null, null, null, null, null); assertEquals(1, containers.size()); UsersApi usersApi = new UsersApi(client); User user = usersApi.getUser(); containers = usersApi.userContainers(user.getId()); assertEquals(5, containers.size()); List<DockstoreTool> pagedToolsLowercase = containersApi.allPublishedContainers("0", 1, "test", "stars", "desc"); assertEquals(1, pagedToolsLowercase.size()); List<DockstoreTool> pagedToolsUppercase = containersApi.allPublishedContainers("0", 1, "TEST", "stars", "desc"); assertEquals(1, pagedToolsUppercase.size()); DockstoreTool container = containersApi.getContainerByToolPath("quay.io/test_org/test2"); assertFalse(container.isIsPublished()); long containerId = container.getId(); PublishRequest pub = SwaggerUtility.createPublishRequest(true); thrown.expect(ApiException.class); containersApi.publish(containerId, pub); }

Target:
public void testFailedContainerRegistration() throws ApiException { ApiClient client = getWebClient(); ContainersApi containersApi = new ContainersApi(client); List<DockstoreTool> containers = containersApi.allPublishedContainers(null, null, null, null, null); assertEquals(1, containers.size()); UsersApi usersApi = new UsersApi(client); User user = usersApi.getUser(); containers = usersApi.userContainers(user.getId()); assertEquals(5, containers.size()); List<DockstoreTool> pagedToolsLowercase = containersApi.allPublishedContainers("0", 1, "test", "stars", "desc"); assertEquals(1, pagedToolsLowercase.size()); List<DockstoreTool> pagedToolsUppercase = containersApi.allPublishedContainers("0", 1, "TEST", "stars", "desc"); assertEquals(1, pagedToolsUppercase.size()); assertEquals(pagedToolsLowercase, pagedToolsUppercase); DockstoreTool container = containersApi.getContainerByToolPath("quay.io/test_org/test2"); assertFalse(container.isIsPublished()); long containerId = container.getId(); PublishRequest pub = SwaggerUtility.createPublishRequest(true); thrown.expect(ApiException.class); containersApi.publish(containerId, pub); }
Source:
public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes) { for (SqlPathElement element : session.getPath().getParsedPath()) { FunctionNamespace namespace = functionNamespaces.get(fetchCatalog(element, session)); if (namespace != null) { try { Signature signature = namespace.resolveFunction(name, parameterTypes); return new FunctionHandle(signature, fetchCatalog(element, session), TEMP_DEFAULT_SCHEMA); } catch (PrestoException e) { if (e.getErrorCode().getCode() != FUNCTION_NOT_FOUND.toErrorCode().getCode()) { throw e; } } } } throw new PrestoException(FUNCTION_NOT_FOUND, format("Function %s not found in path: %s", name, session.getPath())); }

Target:
public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes) { try { Signature operatorSignature = operatorNamespace.resolveFunction(name, parameterTypes); return createOperatorHandle(operatorSignature); } catch (Exception e) { } for (SqlPathElement element : session.getPath().getParsedPath()) { FunctionNamespace namespace = functionNamespaces.get(getCatalog(element, session)); if (namespace != null) { try { Signature signature = namespace.resolveFunction(name, parameterTypes); return new FunctionHandle(signature, getCatalog(element, session), TEMP_DEFAULT_SCHEMA); } catch (PrestoException e) { if (!e.getErrorCode().equals(FUNCTION_NOT_FOUND.toErrorCode())) { throw e; } } } } throw new PrestoException(FUNCTION_NOT_FOUND, format("Function %s not found in path: %s", name, session.getPath())); }
Source:
public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); final long seekToTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(seekToTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; ITmfEvent currentEvent = getCurrentEvent(); ret &= (currentEvent != null); ITmfEvent previousEvent = currentEvent; for (long i = 0; ret && i < ctfLocationData.getIndex(); i++) { if (seekToTimestamp >= Objects.requireNonNull(currentEvent).getTimestamp().getValue()) { index++; } else { index = 0; break; } ret = advance(); previousEvent = currentEvent; currentEvent = getCurrentEvent(); } if (ret) { fCurLocation = new CtfLocation(new CtfLocationInfo(Objects.requireNonNull(previousEvent).getTimestamp().getValue(), index)); } else { fCurLocation = NULL_LOCATION; } return ret; }

Target:
public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); final long seekToTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(seekToTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; ITmfEvent currentEvent = getCurrentEvent(); ret &= (currentEvent != null); long offset = ctfLocationData.getIndex(); while (currentEvent != null && index < offset) { if (seekToTimestamp >= Objects.requireNonNull(currentEvent).getTimestamp().getValue()) { index++; } else { index = 0; break; } ret = advance(); currentEvent = getCurrentEvent(); } if (ret) { long time = Objects.requireNonNull(currentEvent).getTimestamp().getValue(); fCurLocation = new CtfLocation(new CtfLocationInfo(time, time != seekToTimestamp ? 0 : index)); } else { fCurLocation = NULL_LOCATION; } return ret; }
Source:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } if (!checkStorageDomain()) { return false; } boolean localFs = isLocalFs(dom); if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); boolean localFs = isLocalFs(dom); if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }
Source:
private String getProperty(String key, String defaultValue) { String value = getProperty(key); return value != null && !value.equals("") ? value : defaultValue; }

Target:
private String getProperty(String key, String defaultValue) { String value = getProperty(key); return value != null && !value.trim().equals("") ? value : defaultValue; }
Source:
static DriverConfigLoader fromUrl(@NonNull URL url) { return new DefaultDriverConfigLoader( () -> { ConfigFactory.invalidateCaches(); Config config = ConfigFactory.defaultOverrides() .withFallback(ConfigFactory.parseURL(url)) .withFallback(ConfigFactory.defaultReference()) .resolve(); return config.getConfig("datastax-java-driver"); }); }

Target:
static DriverConfigLoader fromUrl(@NonNull URL url) { return new DefaultDriverConfigLoader( () -> { ConfigFactory.invalidateCaches(); Config config = ConfigFactory.defaultOverrides() .withFallback(ConfigFactory.parseURL(url)) .withFallback(ConfigFactory.defaultReference()) .resolve(); return config.getConfig(DefaultDriverConfigLoader.DEFAULT_ROOT_PATH); }); }
Source:
public static Object getMessageAnnotationProperty(AMQPMessage message, Symbol symbol) { return message.getMessageAnnotationProperty(symbol); }

Target:
public static Object getMessageAnnotationProperty(AMQPMessage message, Symbol symbol) { return message.getMessageAnnotation(symbol); }
Source:
public static Set<Person> getCurrentDepartmentPresidents(Department department) { Set<Person> departmentPresidents = new HashSet<Person>(); for (final Accountability accountability : department.getDepartmentUnit().getChildsSet()) { if (accountability instanceof PersonFunction && accountability.isActive()) { final PersonFunction personFunction = (PersonFunction) accountability; final Function function = personFunction.getFunction(); if (function != null && function.getFunctionType() == FunctionType.PRESIDENT) { final Party childParty = accountability.getChildParty(); if (childParty != null && childParty.isPerson()) { departmentPresidents.add((Person) childParty); } } } } return departmentPresidents; }

Target:
private static Stream<Person> getCurrentDepartmentPresidents(Department department) { return department.getDepartmentUnit().getChildsSet().stream() .filter(a -> a instanceof PersonFunction && a.isActive() && ((PersonFunction) a).getFunction() != null && ((PersonFunction) a).getFunction().getFunctionType() == FunctionType.PRESIDENT && a.getChildParty() != null && a.getChildParty().isPerson()) .map(a -> (Person) a.getChildParty()); }
Source:
public StateItem[] getStateTable() { StateItem[] stateItems = new StateItem[1]; stateItems[0] = new StateItem(new RGB(174, 174, 51), "Allocated"); return stateItems; }

Target:
public StateItem[] getStateTable() { return THE_ONE_TRUE_STATE_TABLE; }
Source:
protected String getFileName() { final String fileText = getFileText(); String[] extensions = getFileExtensions(); for (int i = 0; i < extensions.length; ++i) { String extension = extensions[i]; if (extension.isEmpty() || (!extension.isEmpty() && fileText.endsWith("." + extension))) { return fileText; } } return fileText + "." + extensions[0]; }

Target:
protected String getFileName() { final String fileText = getFileText(); String[] extensions = getFileExtensions(); for (int i = 0; i < extensions.length; ++i) { String extension = extensions[i]; if (!extension.isEmpty() && fileText.endsWith("." + extension)) { return fileText; } } if (extensions[0].isEmpty()) { return fileText; } return fileText + "." + extensions[0]; }
Source:
public Map<Partition, List<Message>> getResourceMessages(String resourceName) { Map<Partition, List<Message>> map = _messagesMap.get(resourceName); if (map != null) { return map; } return Collections.emptyMap(); }

Target:
public Map<Partition, List<Message>> getResourceMessages(String resourceName) { Map<Partition, List<Message>> map = _messagesMap.get(resourceName); if (map != null) { return Collections.unmodifiableMap(map); } return Collections.emptyMap(); }
Source:
public void createTable(String tableName, KijiTableLayout tableLayout) throws IOException { if (!tableName.equals(tableLayout.getName())) { throw new RuntimeException(String.format( "Table name from layout descriptor '%s' does match table name '%s'.", tableLayout.getName(), tableName)); } createTable(tableLayout.getDesc()); }

Target:
public void createTable(String tableName, KijiTableLayout tableLayout) throws IOException { throw new UnsupportedOperationException("Table creation is outside the scope of async-kiji"); }
Source:
private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students) { ArrayList<StudentAttributes>[] lists = new ArrayList[StudentAttributes.UpdateStatus.STATUS_COUNT]; for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { lists[i] = new ArrayList<StudentAttributes>(); } for (StudentAttributes student : students) { lists[student.updateStatus.numericRepresentation].add(student); } return lists; }

Target:
private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students) { ArrayList<StudentAttributes>[] lists = new ArrayList[StudentAttributes.UpdateStatus.STATUS_COUNT]; for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { lists[i] = new ArrayList<StudentAttributes>(); } for (StudentAttributes student : students) { lists[student.updateStatus.numericRepresentation].add(student); } for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { StudentAttributes.sortByNameAndThenByEmail(lists[i]); } return lists; }
Source:
public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) { return OperatorConversions.convertCall(plannerContext, rowSignature, rexNode, inputExpressions -> { final DruidExpression arg = inputExpressions.get(0); final Expr digitsExpr = inputExpressions.size() > 1 ? inputExpressions.get(1).parse(plannerContext.getExprMacroTable()) : null; if (digitsExpr == null) { return DruidExpression.fromExpression(StringUtils.format("round(%s)", arg.getExpression())); } else { final int digits = ((Number) digitsExpr.getLiteralValue()).intValue(); String digitsString = DruidExpression.numberLiteral(digits); return DruidExpression.fromExpression(StringUtils.format("round(%s, %s)", arg.getExpression(), digitsString)); } }); }

Target:
public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) { return OperatorConversions.convertCall(plannerContext, rowSignature, rexNode, inputExpressions -> { return DruidExpression.fromFunctionCall( "round", inputExpressions ); }); }
Source:
public static void webSocketIdleTimeoutMillis(int timeoutMillis) { webSocketIdleTimeoutMillis = Optional.of(timeoutMillis); }

Target:
public static void webSocketIdleTimeoutMillis(int timeoutMillis) { if (initialized) { throwBeforeRouteMappingException(); } if (runFromServlet) { throw new IllegalStateException("WebSockets are only supported in the embedded server"); } webSocketIdleTimeoutMillis = Optional.of(timeoutMillis); }
Source:
public ParquetRecordReader(ReadSupport<T> readSupport) { internalReader = new InternalParquetRecordReader<T>(readSupport, null, null); }

Target:
public ParquetRecordReader(ReadSupport<T> readSupport) { this(readSupport, FilterCompat.NOOP); }
Source:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, osgpException, e)); }

Target:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_TARIFF_SWITCHING, "An unknown error occurred", e); } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, osgpException, e)); }