You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ji...@apache.org on 2025/05/16 11:53:46 UTC
(camel-quarkus) 28/29: Fixed #7340: removed unnecessary substitution in salesforce extension
This is an automated email from the ASF dual-hosted git repository.
jiriondrusek pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit b679f75e8bbf9611ab68ad088efe415dd750a58e
Author: Jiri Ondrusek <on...@gmail.com>
AuthorDate: Thu May 15 09:08:55 2025 +0200
Fixed #7340: removed unnecessary substitution in salesforce extension
---
extensions/salesforce/runtime/pom.xml | 5 ---
.../graalvm/JettyJSONContextSubstitute.java | 51 ----------------------
2 files changed, 56 deletions(-)
diff --git a/extensions/salesforce/runtime/pom.xml b/extensions/salesforce/runtime/pom.xml
index 4570d1dc57..42e3c34095 100644
--- a/extensions/salesforce/runtime/pom.xml
+++ b/extensions/salesforce/runtime/pom.xml
@@ -67,11 +67,6 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-salesforce</artifactId>
</dependency>
- <dependency>
- <groupId>org.graalvm.sdk</groupId>
- <artifactId>nativeimage</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
diff --git a/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java b/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java
deleted file mode 100644
index 50a2c21836..0000000000
--- a/extensions/salesforce/runtime/src/main/java/org/apache/camel/quarkus/component/salesforce/graalvm/JettyJSONContextSubstitute.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.component.salesforce.graalvm;
-
-import java.lang.reflect.Field;
-import java.text.ParseException;
-import java.util.List;
-
-import com.oracle.svm.core.annotate.Alias;
-import com.oracle.svm.core.annotate.Substitute;
-import com.oracle.svm.core.annotate.TargetClass;
-import org.cometd.common.JettyJSONContext;
-import org.eclipse.jetty.util.ajax.JSON;
-
-@TargetClass(JettyJSONContext.class)
-final class JettyJSONContextSubstitute {
-
- @Alias
- private List adapt(Object object) {
- return null;
- }
-
- @Substitute
- public List parse(String json) throws ParseException {
- try {
- //the type of the field `_messagesParser` is `FieldJSON`, which is a private class.
- // Therefore, I can not alias the field and it has to be gained reflectively
- Field messagesParserField = JettyJSONContext.class.getDeclaredField("_messagesParser");
- messagesParserField.setAccessible(true);
- JSON messagesParser = (JSON) messagesParserField.get(this);
- Object object = messagesParser.parse(new JSON.StringSource(json));
- return adapt(object);
- } catch (Exception x) {
- throw (ParseException) new ParseException(json, -1).initCause(x);
- }
- }
-}