From d1c16a728dd30331acc38eb3f548069d58d716db Mon Sep 17 00:00:00 2001
From: thiagotognoli Implementations of this interface are registered to and used by {@link ODataProducerExceptions}.
- * When an OData consumer receives an error message returned by an OData producer, the parsed
- * {@link OError} is wrapped into an exception and thrown via the consumer API.
+ * Implementations of this interface are registered to and used by
+ * {@link ODataProducerExceptions}.
+ * When an OData consumer receives an error message returned by an OData
+ * producer, the parsed
+ * {@link OError} is wrapped into an exception and thrown via the consumer API.
+ * OData producer exceptions can be either created by using one of its sub-classes or by the
- * static factory {@link ODataProducerExceptions}.
+ * OData producer exceptions can be either created by using one of its
+ * sub-classes or by the
+ * static factory {@link ODataProducerExceptions}.
+ * Parameters are delegated to {@link RuntimeException#RuntimeException(String, Throwable)}.
+ * Parameters are delegated to
+ * {@link RuntimeException#RuntimeException(String, Throwable)}.
+ * The default implementation returns the simple name of the underlying class. Sub-classes can override
- * this method and specify a different code.
+ * The default implementation returns the simple name of the underlying class.
+ * Sub-classes can override
+ * this method and specify a different code.
+ * The default implementation returns the exception's message ({@link RuntimeException#getMessage()}) if set.
- * Otherwise the reason phrase of the mapped HTTP status is returned ({@link StatusType#getReasonPhrase()}).
- * Sub-classes can override this method and specify a different message.
+ * The default implementation returns the exception's message
+ * ({@link RuntimeException#getMessage()}) if set.
+ * Otherwise the reason phrase of the mapped HTTP status is returned
+ * ({@link StatusType#getReasonPhrase()}).
+ * Sub-classes can override this method and specify a different message.
+ * The default implementation returns the exception's stack trace ({@link RuntimeException#printStackTrace(PrintWriter)}).
- * Sub-classes can override this method and specify a different inner error.
+ * The default implementation returns the exception's stack trace
+ * ({@link RuntimeException#printStackTrace(PrintWriter)}).
+ * Sub-classes can override this method and specify a different inner error.
+ * This factory is used after deserialization of error responses retrieved from an OData
- * producer; it returns one of the following exceptions based on the HTTP status of the response:
- *
+ * This factory is used after deserialization of error responses retrieved from
+ * an OData
+ * producer; it returns one of the following exceptions based on the HTTP status
+ * of the response:
+ *
Date: Fri, 1 Aug 2025 22:55:48 -0300
Subject: [PATCH 1/3] jee9
---
README.md | 5 +-
odata-core/.classpath | 24 +
odata-core/pom.xml | 10 +-
.../odata4j/consumer/AbstractODataClient.java | 16 +-
.../consumer/ConsumerFunctionCallRequest.java | 8 +-
.../consumer/ODataClientBatchResponse.java | 31 +
.../odata4j/consumer/ODataClientResponse.java | 2 +-
.../behaviors/AzureTableBehavior.java | 2 +-
.../java/org/odata4j/core/ODataConstants.java | 17 +-
.../exceptions/BadRequestException.java | 4 +-
.../odata4j/exceptions/ExceptionFactory.java | 24 +-
.../exceptions/ForbiddenException.java | 4 +-
.../exceptions/MethodNotAllowedException.java | 4 +-
.../exceptions/NotAcceptableException.java | 4 +-
.../exceptions/NotAuthorizedException.java | 4 +-
.../odata4j/exceptions/NotFoundException.java | 4 +-
.../exceptions/NotImplementedException.java | 4 +-
.../exceptions/ODataProducerException.java | 61 +-
.../exceptions/ODataProducerExceptions.java | 32 +-
.../exceptions/ServerErrorException.java | 4 +-
.../UnsupportedMediaTypeException.java | 4 +-
.../odata4j/format/FormatParserFactory.java | 11 +-
.../java/org/odata4j/format/FormatType.java | 2 +-
.../java/org/odata4j/format/FormatWriter.java | 9 +-
.../odata4j/format/FormatWriterFactory.java | 20 +-
.../json/JsonCollectionFormatWriter.java | 5 +-
.../json/JsonComplexObjectFormatWriter.java | 5 +-
.../format/json/JsonEntryFormatWriter.java | 2 +-
.../format/json/JsonErrorFormatWriter.java | 2 +-
.../format/json/JsonFeedFormatParser.java | 2 +-
.../format/json/JsonFeedFormatWriter.java | 83 +--
.../odata4j/format/json/JsonFormatWriter.java | 73 ++-
.../format/json/JsonPropertyFormatWriter.java | 16 +-
.../format/json/JsonRawFormatWriter.java | 160 ++---
.../json/JsonRequestEntryFormatWriter.java | 4 +-
.../json/JsonServiceDocumentFormatWriter.java | 40 +-
.../format/json/JsonSimpleFormatWriter.java | 2 +-
.../json/JsonSingleLinkFormatWriter.java | 14 +-
.../json/JsonSingleLinksFormatWriter.java | 28 +-
.../xml/AtomCollectionFormatWriter.java | 2 +-
.../format/xml/AtomComplexFormatWriter.java | 2 +-
.../format/xml/AtomEntryFormatWriter.java | 5 +-
.../format/xml/AtomErrorFormatWriter.java | 2 +-
.../format/xml/AtomFeedFormatParser.java | 159 ++---
.../format/xml/AtomFeedFormatWriter.java | 10 +-
.../format/xml/AtomRawFormatWriter.java | 158 ++---
.../xml/AtomRequestEntryFormatWriter.java | 2 +-
.../xml/AtomServiceDocumentFormatWriter.java | 2 +-
.../format/xml/AtomSimpleFormatWriter.java | 2 +-
.../xml/AtomSingleLinkFormatWriter.java | 2 +-
.../xml/AtomSingleLinksFormatWriter.java | 2 +-
.../odata4j/format/xml/XmlFormatWriter.java | 21 +-
.../format/xml/XmlPropertyFormatWriter.java | 2 +-
.../org/odata4j/internal/InternalUtil.java | 53 +-
.../producer/ErrorResponseExtension.java | 29 +-
.../producer/ErrorResponseExtensions.java | 14 +-
.../odata4j/producer/ODataContextImpl.java | 16 +-
.../odata4j/producer/ODataHeadersImpl.java | 4 +-
.../odata4j/producer/OMediaLinkExtension.java | 55 +-
.../resources/AbstractODataApplication.java | 8 +-
.../producer/resources/BaseResource.java | 51 +-
.../producer/resources/BatchBodyPart.java | 6 +-
.../ClientAccessPolicyXmlResource.java | 6 +-
.../resources/CrossDomainXmlResource.java | 6 +-
.../DefaultODataProducerProvider.java | 47 +-
.../resources/EntitiesRequestResource.java | 159 ++---
.../resources/EntityRequestResource.java | 127 ++--
.../resources/ExceptionMappingProvider.java | 46 +-
.../producer/resources/FunctionResource.java | 82 +--
.../odata4j/producer/resources/HeaderMap.java | 96 ++-
.../resources/LinksRequestResource.java | 48 +-
.../producer/resources/MetadataResource.java | 58 +-
.../resources/ODataBatchProvider.java | 22 +-
.../resources/OptionsQueryParser.java | 2 +-
.../resources/PropertyRequestResource.java | 106 ++--
.../producer/resources/RootApplication.java | 5 +-
.../resources/ServiceDocumentResource.java | 24 +-
.../resources/ValueRequestResource.java | 30 +-
.../odata4j/producer/server/ODataServer.java | 6 +-
.../stax2/staximpl/StaxXMLWriter2.java | 3 +-
.../odata4j/urlencoder/ConversionUtil.java | 162 +++++
.../unit/expressions/TypeConverterTest.java | 38 +-
.../format/AbstractErrorFormatWriterTest.java | 16 +-
.../format/xml/AtomFeedFormatWriterTest.java | 15 +-
.../producer/ErrorResponseExtensionTest.java | 23 +-
pom.xml | 20 +-
test-integration/.classpath | 19 +
test-integration/pom.xml | 47 +-
.../cxf/consumer/CxfClientResponse.java | 2 +-
.../examples/cxf/consumer/ODataCxfClient.java | 62 +-
.../cxf/consumer/ODataCxfConsumer.java | 33 +-
.../cxf/producer/server/ODataCxfServer.java | 17 +-
.../consumer/DefaultJerseyClientFactory.java | 22 +-
.../jersey/consumer/JerseyClientFactory.java | 9 +-
.../jersey/consumer/JerseyClientResponse.java | 8 +-
.../jersey/consumer/JerseyClientUtil.java | 100 +--
.../jersey/consumer/ODataJerseyClient.java | 366 ++++++++---
.../jersey/consumer/ODataJerseyConsumer.java | 35 +-
.../AllowSelfSignedCertsBehavior.java | 78 ---
.../behaviors/JerseyClientBehavior.java | 11 +-
.../jersey/internal/StringProvider2.java | 26 +-
.../resources/ODataProducerProvider.java | 14 +-
.../producer/server/ODataJerseyServer.java | 122 ++--
.../integration/AbstractIntegrationTest.java | 34 +-
.../AbstractJettyHttpClientTest.java | 12 +-
.../test/integration/AbstractRuntimeTest.java | 48 +-
.../test/integration/CxfRuntimeFacade.java | 99 +--
.../test/integration/JerseyRuntimeFacade.java | 110 ++--
.../test/integration/PortConflictTest.java | 39 ++
.../test/integration/RuntimeFacade.java | 14 +-
.../consumer/BasicAuthenticationTest.java | 28 +-
.../test/integration/consumer/ErrorTest.java | 4 +-
.../function/FunctionImportTest.java | 569 ++++++++++--------
.../test/integration/issues/Issue16Test.java | 8 +-
.../producer/custom/CustomBaseTest.java | 18 +-
.../producer/custom/CustomProducer.java | 56 +-
.../producer/custom/CustomTest.java | 29 +-
.../AddressBookJettyHttpClientTest.java | 16 +-
.../test/integration/server/ContextTest.java | 92 +--
.../test/integration/server/ErrorTest.java | 106 ----
.../server/RequestFilteringTest.java | 24 +-
.../test/integration/server/SmokeTest.java | 28 +-
122 files changed, 2784 insertions(+), 2021 deletions(-)
create mode 100644 odata-core/src/main/java/org/odata4j/consumer/ODataClientBatchResponse.java
create mode 100644 odata-core/src/main/java/org/odata4j/urlencoder/ConversionUtil.java
delete mode 100644 test-integration/src/main/java/org/odata4j/examples/jersey/consumer/behaviors/AllowSelfSignedCertsBehavior.java
create mode 100644 test-integration/src/test/java/org/odata4j/test/integration/PortConflictTest.java
diff --git a/README.md b/README.md
index f2a0ac6..102cbda 100644
--- a/README.md
+++ b/README.md
@@ -6,4 +6,7 @@ OData + Rest + Java ==> shake it ==> o-re-va (that's it, no other meaning behi
This is complete fork of OData4J for the use of Teiid, but I guess anybody who wants to implement OData V2 can use it.
There is no support JPA or JDBC in this version. I always thought they polluted the OData framework, they do not belong in
-the core project. The frameworks needs to be about OData. JPA or JDBC can be additional modules.
\ No newline at end of file
+the core project. The frameworks needs to be about OData. JPA or JDBC can be additional modules.
+
+## Install with
+$ mvn install -P release
\ No newline at end of file
diff --git a/odata-core/.classpath b/odata-core/.classpath
index eff18de..ebbac42 100644
--- a/odata-core/.classpath
+++ b/odata-core/.classpath
@@ -17,6 +17,7 @@
+ *
- * In case the HTTP status cannot be mapped to a specific sub-class, an unspecific ODataProducerException is thrown.
This class is abstract because it delegates the strategy pattern of writing + *
+ * This class is abstract because it delegates the strategy pattern of writing * actual content elements to its (various) subclasses. * - *
Each element in the array to be written can be wrapped in a function call + *
+ * Each element in the array to be written can be wrapped in a function call
* on the JavaScript side by specifying the name of a function to call to the
* constructor.
*
@@ -51,7 +53,7 @@ public abstract class JsonFormatWriter