This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit d94745ccbc24c86c5c535f3d40418ace378bb669 Author: Claus Ibsen <[email protected]> AuthorDate: Tue Jul 11 19:54:37 2023 +0200 Fix compiler warning --- .../java/org/apache/camel/dataformat/thrift/ThriftDataFormat.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/camel-thrift/src/main/java/org/apache/camel/dataformat/thrift/ThriftDataFormat.java b/components/camel-thrift/src/main/java/org/apache/camel/dataformat/thrift/ThriftDataFormat.java index f825bdcfe88..6df290de152 100644 --- a/components/camel-thrift/src/main/java/org/apache/camel/dataformat/thrift/ThriftDataFormat.java +++ b/components/camel-thrift/src/main/java/org/apache/camel/dataformat/thrift/ThriftDataFormat.java @@ -186,14 +186,14 @@ public class ThriftDataFormat extends ServiceSupport Class<?> instanceClass = context.getClassResolver().resolveMandatoryClass(className); if (TBase.class.isAssignableFrom(instanceClass)) { try { - return (TBase) instanceClass.newInstance(); + return (TBase) instanceClass.getDeclaredConstructor().newInstance(); } catch (final Exception ex) { throw new CamelException( - "Can't set the defaultInstance of ThriftDataFormat with " + className + ", caused by " + ex); + "Cannot set the defaultInstance of ThriftDataFormat with " + className + ", caused by " + ex); } } else { throw new CamelException( - "Can't set the defaultInstance of ThriftDataFormat with " + className + "Cannot set the defaultInstance of ThriftDataFormat with " + className + ", as the class is not a subClass of org.apache.thrift.TBase"); } }
