This is an automated email from the ASF dual-hosted git repository. zhfeng pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 6b4de345056 Fix deprecated API and properties in camel-salesforce-codegen (#9459) 6b4de345056 is described below commit 6b4de345056a1d22e4ce68a7b69d2cf0755d706f Author: Zheng Feng <zh.f...@gmail.com> AuthorDate: Thu Mar 2 20:37:29 2023 +0800 Fix deprecated API and properties in camel-salesforce-codegen (#9459) --- .../salesforce/codegen/AbstractSalesforceExecution.java | 2 +- .../camel/component/salesforce/codegen/GenerateExecution.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java index a7cf151ebb3..e713daca582 100644 --- a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java +++ b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/AbstractSalesforceExecution.java @@ -250,7 +250,7 @@ public abstract class AbstractSalesforceExecution { if (httpProxyExcludedAddresses != null && !httpProxyExcludedAddresses.isEmpty()) { proxy.getExcludedAddresses().addAll(httpProxyExcludedAddresses); } - httpClient.getProxyConfiguration().getProxies().add(proxy); + httpClient.getProxyConfiguration().addProxy(proxy); } if (httpProxyUsername != null && httpProxyPassword != null) { StringHelper.notEmpty(httpProxyAuthUri, "httpProxyAuthUri"); diff --git a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/GenerateExecution.java b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/GenerateExecution.java index de78d181273..67dcc6091a9 100644 --- a/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/GenerateExecution.java +++ b/components/camel-salesforce/camel-salesforce-codegen/src/main/java/org/apache/camel/component/salesforce/codegen/GenerateExecution.java @@ -48,7 +48,8 @@ import org.apache.camel.component.salesforce.api.dto.PickListValue; import org.apache.camel.component.salesforce.api.dto.SObjectDescription; import org.apache.camel.component.salesforce.api.dto.SObjectField; import org.apache.camel.component.salesforce.internal.client.RestClient; -import org.apache.camel.support.IntrospectionSupport; +import org.apache.camel.impl.engine.DefaultBeanIntrospection; +import org.apache.camel.spi.BeanIntrospection; import org.apache.camel.util.StringHelper; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StringEscapeUtils; @@ -69,6 +70,7 @@ public class GenerateExecution extends AbstractSalesforceExecution { private Stack<String> stack; private final Map<String, AtomicInteger> varNames = new HashMap<>(); + private final BeanIntrospection bi = new DefaultBeanIntrospection(); public String current() { return stack.peek(); @@ -259,7 +261,7 @@ public class GenerateExecution extends AbstractSalesforceExecution { public Set<Map.Entry<String, Object>> propertiesOf(final Object object) { final Map<String, Object> properties = new TreeMap<>(); - IntrospectionSupport.getProperties(object, properties, null, false); + bi.getProperties(object, properties, null, false); final Function<Map.Entry<String, Object>, String> keyMapper = e -> StringUtils.capitalize(e.getKey()); final Function<Map.Entry<String, Object>, Object> valueMapper = Map.Entry::getValue; @@ -540,8 +542,8 @@ public class GenerateExecution extends AbstractSalesforceExecution { private VelocityEngine createVelocityEngine() { // initialize velocity to load resources from class loader and use Log4J final Properties velocityProperties = new Properties(); - velocityProperties.setProperty(RuntimeConstants.RESOURCE_LOADER, "cloader"); - velocityProperties.setProperty("cloader.resource.loader.class", ClasspathResourceLoader.class.getName()); + velocityProperties.setProperty(RuntimeConstants.RESOURCE_LOADERS, "cloader"); + velocityProperties.setProperty("resource.loader.cloader.class", ClasspathResourceLoader.class.getName()); velocityProperties.setProperty(RuntimeConstants.RUNTIME_LOG_NAME, LOG.getName()); final VelocityEngine engine = new VelocityEngine(velocityProperties);