You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/02/28 13:12:08 UTC

[camel] branch main created (now 04b257c7b7c)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 04b257c7b7c CAMEL-19090: Remove deprecated apis in core

This branch includes the following new commits:

     new c76e3f1811b CAMEL-19090: Remove deprecated apis in core
     new 8f0b6ab5907 CAMEL-19062 - Clean up Parent POM - Junit Pioneer
     new 8a52fd668b9 CAMEL-19062 - Clean up Parent POM - Junit Pioneer
     new a6103bb4e9b Regen for commit 4efb631e666562ec206f756a37eb42e7f0d89c65
     new 04b257c7b7c CAMEL-19090: Remove deprecated apis in core

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 02/05: CAMEL-19062 - Clean up Parent POM - Junit Pioneer

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8f0b6ab590795f0e2744786998d75a640c04ac7e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Feb 28 13:12:00 2023 +0100

    CAMEL-19062 - Clean up Parent POM - Junit Pioneer
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 parent/pom.xml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 8508b792143..54c52b8248a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -2772,11 +2772,6 @@
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
-            <dependency>
-                <groupId>org.junit-pioneer</groupId>
-                <artifactId>junit-pioneer</artifactId>
-                <version>${junit-pioneer-version}</version>
-            </dependency>
             <dependency>
                 <groupId>org.awaitility</groupId>
                 <artifactId>awaitility</artifactId>


[camel] 03/05: CAMEL-19062 - Clean up Parent POM - Junit Pioneer

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8a52fd668b9073901e0124e26a054ea272f69e4b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Feb 28 13:12:39 2023 +0100

    CAMEL-19062 - Clean up Parent POM - Junit Pioneer
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 core/camel-management/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/camel-management/pom.xml b/core/camel-management/pom.xml
index 7f873ab7190..784eff7b9e3 100644
--- a/core/camel-management/pom.xml
+++ b/core/camel-management/pom.xml
@@ -73,6 +73,7 @@
         <dependency>
             <groupId>org.junit-pioneer</groupId>
             <artifactId>junit-pioneer</artifactId>
+            <version>${junit-pioneer-version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>


[camel] 05/05: CAMEL-19090: Remove deprecated apis in core

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 04b257c7b7c7a159529271c2b85692ba979f38e1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Feb 28 13:58:56 2023 +0100

    CAMEL-19090: Remove deprecated apis in core
---
 .../main/java/org/apache/camel/spi/BeanIntrospection.java  | 10 ++++++++++
 .../apache/camel/impl/engine/DefaultBeanIntrospection.java |  9 +++++++++
 .../java/org/apache/camel/converter/ConverterTest.java     | 11 +++++++++--
 .../org/apache/camel/model/ModelSanityCheckerTest.java     | 14 ++++++++++----
 4 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
index c88e37b8ed1..ad01fc882b2 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
@@ -156,6 +156,16 @@ public interface BeanIntrospection extends StaticService, AfterPropertiesConfigu
      */
     Method getPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase) throws NoSuchMethodException;
 
+    /**
+     * Gets the setter method for the property.
+     *
+     * @param  type                  the target class
+     * @param  propertyName          the property name
+     * @return                       the setter method
+     * @throws NoSuchMethodException is thrown if there are no setter method for the property
+     */
+    Method getPropertySetter(Class<?> type, String propertyName) throws NoSuchMethodException;
+
     /**
      * This method supports three modes to set a property:
      *
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
index 9081bd7b05c..0d605aaa0fb 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
@@ -183,6 +183,15 @@ public class DefaultBeanIntrospection extends ServiceSupport implements BeanIntr
         return IntrospectionSupport.getPropertyGetter(type, propertyName, ignoreCase);
     }
 
+    @Override
+    public Method getPropertySetter(Class<?> type, String propertyName) throws NoSuchMethodException {
+        invoked.incrementAndGet();
+        if (!preStartDone || logger.shouldLog()) {
+            log("getPropertySetter", type, propertyName);
+        }
+        return IntrospectionSupport.getPropertySetter(type, propertyName);
+    }
+
     @Override
     public boolean setProperty(
             CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName,
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
index 2ee4c710c85..67c02345979 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
@@ -34,8 +34,8 @@ import org.apache.camel.TypeConverter;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.converter.DefaultTypeConverter;
 import org.apache.camel.impl.engine.DefaultPackageScanClassResolver;
+import org.apache.camel.spi.BeanIntrospection;
 import org.apache.camel.support.DefaultExchange;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.ReflectionInjector;
 import org.junit.jupiter.api.BeforeEach;
@@ -189,9 +189,16 @@ public class ConverterTest extends TestSupport {
     @Test
     public void testPrimitiveIntPropertySetter() {
         MyBean bean = new MyBean();
-        assertDoesNotThrow(() -> IntrospectionSupport.setProperty(converter, bean, "foo", "4"),
+
+        CamelContext context = new DefaultCamelContext();
+        context.start();
+        BeanIntrospection bi = context.getCamelContextExtension().getBeanIntrospection();
+
+        assertDoesNotThrow(() -> bi.setProperty(context, converter, bean, "foo", "4", null, true, true, true),
                 "Setting an int property in a bean, should have succeeded without throwing exceptions");
         assertEquals(4, bean.getFoo(), "The property bean.foo does not match the value that was previously set");
+
+        context.stop();
     }
 
     @Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/model/ModelSanityCheckerTest.java b/core/camel-core/src/test/java/org/apache/camel/model/ModelSanityCheckerTest.java
index a2b4297ef6a..3dfc9607a1a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/model/ModelSanityCheckerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/model/ModelSanityCheckerTest.java
@@ -25,8 +25,10 @@ import jakarta.xml.bind.annotation.XmlAttribute;
 import jakarta.xml.bind.annotation.XmlElement;
 import jakarta.xml.bind.annotation.XmlElementRef;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.engine.DefaultPackageScanClassResolver;
-import org.apache.camel.support.IntrospectionSupport;
+import org.apache.camel.spi.BeanIntrospection;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -49,6 +51,10 @@ public class ModelSanityCheckerTest {
 
     @Test
     public void testSanity() throws Exception {
+        CamelContext context = new DefaultCamelContext();
+        context.start();
+        BeanIntrospection bi = context.getCamelContextExtension().getBeanIntrospection();
+
         Set<Class<?>> classes = discoverJaxbClasses();
         assertNotNull(classes);
         assertTrue(classes.size() > 140, "There should be > 140 classes, was: " + classes.size());
@@ -84,8 +90,8 @@ public class ModelSanityCheckerTest {
                 // check getter/setter
                 if (attribute || element || elementRef) {
                     // check for getter/setter
-                    Method getter = IntrospectionSupport.getPropertyGetter(clazz, field.getName());
-                    Method setter = IntrospectionSupport.getPropertySetter(clazz, field.getName());
+                    Method getter = bi.getPropertyGetter(clazz, field.getName(), false);
+                    Method setter = bi.getPropertySetter(clazz, field.getName());
 
                     assertNotNull(getter, "Getter " + field.getName() + " on class " + clazz.getName() + " is missing");
                     assertNotNull(setter, "Setter " + field.getName() + " on class " + clazz.getName() + " is missing");
@@ -116,7 +122,7 @@ public class ModelSanityCheckerTest {
                                + " should not have @XmlElementRef annotation");
             }
         }
-
+        context.stop();
     }
 
 }


[camel] 01/05: CAMEL-19090: Remove deprecated apis in core

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c76e3f1811bc5430974928cdbbf4e9b0eee033dd
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Feb 28 13:30:46 2023 +0100

    CAMEL-19090: Remove deprecated apis in core
---
 .../org/apache/camel/support/ObjectHelper.java     | 33 ----------------------
 1 file changed, 33 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ObjectHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/ObjectHelper.java
index ec9bedad9c6..1add25b7d88 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ObjectHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ObjectHelper.java
@@ -809,39 +809,6 @@ public final class ObjectHelper {
         }
     }
 
-    /**
-     * Returns true if the collection contains the specified value
-     *
-     * @deprecated use {@link #typeCoerceContains(TypeConverter, Object, Object, boolean)}
-     */
-    @Deprecated
-    public static boolean contains(Object collectionOrArray, Object value) {
-        // favor String types
-        if (collectionOrArray instanceof StringBuffer || collectionOrArray instanceof StringBuilder) {
-            collectionOrArray = collectionOrArray.toString();
-        }
-        if (value instanceof StringBuffer || value instanceof StringBuilder) {
-            value = value.toString();
-        }
-
-        if (collectionOrArray instanceof Collection) {
-            Collection<?> collection = (Collection<?>) collectionOrArray;
-            return collection.contains(value);
-        } else if (collectionOrArray instanceof String && value instanceof String) {
-            String str = (String) collectionOrArray;
-            String subStr = (String) value;
-            return str.contains(subStr);
-        } else {
-            Iterator<?> iter = createIterator(collectionOrArray);
-            while (iter.hasNext()) {
-                if (org.apache.camel.util.ObjectHelper.equal(value, iter.next())) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
     /**
      * Returns true if the collection contains the specified value
      */


[camel] 04/05: Regen for commit 4efb631e666562ec206f756a37eb42e7f0d89c65

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a6103bb4e9bbff268ab115f6e42b1fac09a648b4
Author: davsclaus <da...@users.noreply.github.com>
AuthorDate: Tue Feb 28 12:59:36 2023 +0000

    Regen for commit 4efb631e666562ec206f756a37eb42e7f0d89c65
    
    Signed-off-by: GitHub <no...@github.com>
---
 .../main/java/org/apache/camel/management/mbean/ManagedCamelContext.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index deb019c2587..086c7ecd037 100644
--- a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -45,7 +45,6 @@ import org.apache.camel.api.management.mbean.ManagedProcessorMBean;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
 import org.apache.camel.api.management.mbean.ManagedStepMBean;
 import org.apache.camel.model.Model;
-import org.apache.camel.model.ModelCamelContext;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.model.RouteTemplateDefinition;
 import org.apache.camel.model.RouteTemplatesDefinition;