diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataBatchConstants.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataBatchConstants.java index df0c7fe67..a7e5be29c 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataBatchConstants.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataBatchConstants.java @@ -21,31 +21,30 @@ package org.apache.olingo.client.api; /** * Constant values related to the OData protocol. */ -public class ODataBatchConstants { +public interface ODataBatchConstants { /** * Batch item content type. */ - public static final String ITEM_CONTENT_TYPE = "application/http"; + String ITEM_CONTENT_TYPE = "application/http"; /** * Boundary key. */ - public static final String BOUNDARY = "boundary"; + String BOUNDARY = "boundary"; /** * Item content type. */ - public static String ITEM_CONTENT_TYPE_LINE = "Content-Type: application/http"; + String ITEM_CONTENT_TYPE_LINE = "Content-Type: application/http"; /** * Item transfer encoding. */ - public static String ITEM_TRANSFER_ENCODING_LINE = "Content-Transfer-Encoding: binary"; + String ITEM_TRANSFER_ENCODING_LINE = "Content-Transfer-Encoding: binary"; /** * Content id header name. */ - public static String CHANGESET_CONTENT_ID_NAME = "Content-ID"; - + String CHANGESET_CONTENT_ID_NAME = "Content-ID"; } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java index 99949776f..7ad81a4b0 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java @@ -21,6 +21,7 @@ package org.apache.olingo.client.api; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.format.ContentType; @@ -99,6 +100,9 @@ public final class ODataClientBuilder { } } + /** Empty private constructor for static helper class */ + private ODataClientBuilder() {} + /** * Create an new ODataClient based on via system property ODATA_CLIENT_IMPL_SYS_PROPERTY * class name or if not net the default ODATA_CLIENT_IMPL_CLASS set class. @@ -161,15 +165,19 @@ public final class ODataClientBuilder { Constructor ctor = clazz.getConstructor(ctorParameterClasses); return typeOfClass.cast(ctor.newInstance(ctorParameters)); } catch (ClassNotFoundException e) { - throw new RuntimeException("Requested class '" + className + "' could not be loaded.", e); + throw wrapException(className, e); } catch (InstantiationException e) { - throw new RuntimeException("Requested class '" + className + "' could not be loaded.", e); + throw wrapException(className, e); } catch (IllegalAccessException e) { - throw new RuntimeException("Requested class '" + className + "' could not be loaded.", e); + throw wrapException(className, e); } catch (NoSuchMethodException e) { - throw new RuntimeException("Requested class '" + className + "' could not be loaded.", e); + throw wrapException(className, e); } catch (InvocationTargetException e) { - throw new RuntimeException("Requested class '" + className + "' could not be loaded.", e); + throw wrapException(className, e); } } + + private static ODataRuntimeException wrapException(String className, Exception e) { + return new ODataRuntimeException("Requested class '" + className + "' could not be loaded.", e); + } } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/EdmEnabledInvokeRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/EdmEnabledInvokeRequestFactory.java index 5293f7dae..72ace1228 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/EdmEnabledInvokeRequestFactory.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/EdmEnabledInvokeRequestFactory.java @@ -30,63 +30,63 @@ public interface EdmEnabledInvokeRequestFactory extends InvokeRequestFactory { /** * Gets an invoke request instance for the function import with the given name and no parameters. * - * @param OData domain object result, derived from return type defined in the function import + * @param OData domain object result, derived from return type defined in the function import * @param functionImportName operation to be invoked * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getFunctionImportInvokeRequest( + ODataInvokeRequest getFunctionImportInvokeRequest( String functionImportName); /** * Gets an invoke request instance for the function import with the given name and matching parameter names. * - * @param OData domain object result, derived from return type defined in the function import + * @param OData domain object result, derived from return type defined in the function import * @param functionImportName operation to be invoked * @param parameters parameters to pass to operation import invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getFunctionImportInvokeRequest( + ODataInvokeRequest getFunctionImportInvokeRequest( String functionImportName, Map parameters); /** * Gets an invoke request instance for the action import with the given name. * - * @param OData domain object result, derived from return type defined in the action import + * @param OData domain object result, derived from return type defined in the action import * @param actionImportName operation to be invoked * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getActionImportInvokeRequest( + ODataInvokeRequest getActionImportInvokeRequest( String actionImportName); /** * Gets an invoke request instance for the action import with the given name. * - * @param OData domain object result, derived from return type defined in the action import + * @param OData domain object result, derived from return type defined in the action import * @param actionImportName operation to be invoked * @param parameters parameters to pass to operation import invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getActionImportInvokeRequest( + ODataInvokeRequest getActionImportInvokeRequest( String actionImportName, Map parameters); /** * Gets an invoke request instance for the function bound to given URI (no parameters). * - * @param OData domain object result + * @param OData domain object result * @param bindingParameterURI binding parameter URI * @param functionName operation to be invoked * @param bindingParameterTypeName binding parameter type full qualified name * @param isBindingParameterCollection whether binding parameter is collection * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getBoundFunctionInvokeRequest( + ODataInvokeRequest getBoundFunctionInvokeRequest( URI bindingParameterURI, FullQualifiedName functionName, FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection); /** * Gets an invoke request instance for the function bound to given URI (with parameters). * - * @param OData domain object result + * @param OData domain object result * @param bindingParameterURI binding parameter URI * @param functionName operation to be invoked * @param bindingParameterTypeName binding parameter type full qualified name @@ -94,28 +94,28 @@ public interface EdmEnabledInvokeRequestFactory extends InvokeRequestFactory { * @param parameters parameters to pass to function invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getBoundFunctionInvokeRequest( + ODataInvokeRequest getBoundFunctionInvokeRequest( URI bindingParameterURI, FullQualifiedName functionName, FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection, Map parameters); /** * Gets an invoke request instance for the action bound to given URI (no parameters). * - * @param OData domain object result + * @param OData domain object result * @param bindingParameterURI binding parameter URI * @param actionName operation to be invoked * @param bindingParameterTypeName binding parameter type full qualified name * @param isBindingParameterCollection whether binding parameter is collection * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getBoundActionInvokeRequest( + ODataInvokeRequest getBoundActionInvokeRequest( URI bindingParameterURI, FullQualifiedName actionName, FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection); /** * Gets an invoke request instance for the action bound to given URI (with parameters). * - * @param OData domain object result + * @param OData domain object result * @param bindingParameterURI binding parameter URI * @param actionName operation to be invoked * @param bindingParameterTypeName binding parameter type full qualified name @@ -123,7 +123,7 @@ public interface EdmEnabledInvokeRequestFactory extends InvokeRequestFactory { * @param parameters parameters to pass to function invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getBoundActionInvokeRequest( + ODataInvokeRequest getBoundActionInvokeRequest( URI bindingParameterURI, FullQualifiedName actionName, FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection, Map parameters); diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/InvokeRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/InvokeRequestFactory.java index 7a3f3014f..21388ea5b 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/InvokeRequestFactory.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/invoke/InvokeRequestFactory.java @@ -36,57 +36,57 @@ public interface InvokeRequestFactory { * This method is mainly meant for internal usage, but defined for generic calls from proxy; normally, one of other * methods should be used instead. * - * @param OData domain object result + * @param OData domain object result * @param method HTTP invocation method * @param uri invocation URI * @param resultRef reference Class for result * @param parameters parameters to pass to function invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getInvokeRequest( - HttpMethod method, URI uri, Class resultRef, Map parameters); + ODataInvokeRequest getInvokeRequest( + HttpMethod method, URI uri, Class resultRef, Map parameters); /** * Gets an invoke request instance for the function bound to given URI (no parameters). * - * @param OData domain object result + * @param OData domain object result * @param uri invocation URI * @param resultRef reference Class for result * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getFunctionInvokeRequest(URI uri, Class resultRef); + ODataInvokeRequest getFunctionInvokeRequest(URI uri, Class resultRef); /** * Gets an invoke request instance for the function bound to given URI (with parameters). * - * @param OData domain object result + * @param OData domain object result * @param uri invocation URI * @param resultRef reference Class for result * @param parameters parameters to pass to function invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getFunctionInvokeRequest( - URI uri, Class resultRef, Map parameters); + ODataInvokeRequest getFunctionInvokeRequest( + URI uri, Class resultRef, Map parameters); /** * Gets an invoke request instance for the action bound to given URI (no parameters). * - * @param OData domain object result + * @param OData domain object result * @param uri invocation URI * @param resultRef reference Class for result * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getActionInvokeRequest(URI uri, Class resultRef); + ODataInvokeRequest getActionInvokeRequest(URI uri, Class resultRef); /** * Gets an invoke request instance for the action bound to given URI (with parameters). * - * @param OData domain object result + * @param OData domain object result * @param uri invocation URI * @param resultRef reference Class for result * @param parameters parameters to pass to action invocation * @return new {@link ODataInvokeRequest} instance. */ - ODataInvokeRequest getActionInvokeRequest( - URI uri, Class resultRef, Map parameters); + ODataInvokeRequest getActionInvokeRequest( + URI uri, Class resultRef, Map parameters); } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientCollectionValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientCollectionValue.java index 8a0078efa..d5c6c9fbd 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientCollectionValue.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientCollectionValue.java @@ -23,16 +23,16 @@ import java.util.Collection; /** * OData collection property value. * - * @param The actual ODataValue interface. + * @param The actual ODataValue interface. */ -public interface ClientCollectionValue extends ClientValue, Iterable { +public interface ClientCollectionValue extends ClientValue, Iterable { /** * Adds a value to the collection. * * @param value value to be added. */ - ClientCollectionValue add(ClientValue value); + ClientCollectionValue add(ClientValue value); /** * Checks if collection is empty. diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java index 376404ba5..64247c2d6 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java @@ -44,9 +44,9 @@ import org.slf4j.LoggerFactory; * Please don't forget to call the close()>/ method when not needed any more. * * @param concrete ODataEntity implementation - * @param concrete ODataEntitySet implementation + * @param concrete ODataEntitySet implementation */ -public class ClientEntitySetIterator +public class ClientEntitySetIterator implements Iterator { /** @@ -62,7 +62,7 @@ public class ClientEntitySetIterator annotations = new ArrayList(); @@ -112,8 +112,8 @@ public class ClientLink extends ClientItem implements ClientAnnotatable { public ClientLink(final URI uri, final ClientLinkType type, final String title) { super(title); - link = uri; this.type = type; + setLink(uri); switch (this.type) { case ASSOCIATION: diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientValue.java index de778c53a..85bce73ea 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientValue.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientValue.java @@ -55,10 +55,10 @@ public interface ClientValue { /** * Casts to collection value. * - * @param The actual ODataValue interface. + * @param The actual ODataValue interface. * @return collection value. */ - ClientCollectionValue asCollection(); + ClientCollectionValue asCollection(); /** * Casts to complex value. diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/FilterArgFactory.java index f03a78c6d..9a768b6cc 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/FilterArgFactory.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/FilterArgFactory.java @@ -21,7 +21,7 @@ package org.apache.olingo.client.api.uri; public interface FilterArgFactory { - FilterArg _null(); + FilterArg nullValue(); FilterArg add(FilterArg first, FilterArg second); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/FilterArgFactoryImpl.java index 02e9c63a9..d6996b2e0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/FilterArgFactoryImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/FilterArgFactoryImpl.java @@ -25,7 +25,7 @@ import org.apache.olingo.client.api.uri.URIFilter; public class FilterArgFactoryImpl implements FilterArgFactory { @Override - public FilterArg _null() { + public FilterArg nullValue() { return new FilterConst("null"); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java index cdd489b04..28d152353 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java @@ -35,7 +35,7 @@ public enum ODataPreferenceNames { private final String preferenceName; - private ODataPreferenceNames(final String preferenceName) { + ODataPreferenceNames(final String preferenceName) { this.preferenceName = preferenceName; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java index b6397021c..86125cd29 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java @@ -41,9 +41,9 @@ public abstract class ODataLibraryException extends ODataException { protected static final String DEFAULT_SERVER_BUNDLE_NAME = "server-core-exceptions-i18n"; /** Key for the exception text in the resource bundle. */ - public static interface MessageKey { + public interface MessageKey { /** Gets this key. */ - public String getKey(); + String getKey(); } private MessageKey messageKey; @@ -137,9 +137,9 @@ public abstract class ODataLibraryException extends ODataException { } /** Error message text and {@link Locale} used for it. */ - public class ODataErrorMessage { - String message; - Locale locale; + public static class ODataErrorMessage { + private String message; + private Locale locale; public ODataErrorMessage(final String message, final Locale usedLocale) { this.message = message; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java index 0873e237c..98b0f10f1 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java @@ -24,7 +24,7 @@ package org.apache.olingo.server.api.deserializer.batch; * {@link org.apache.olingo.server.api.deserializer.FixedFormatDeserializer * #parseBatchRequest(java.io.InputStream, String, BatchOptions)} */ -public class BatchOptions { +public final class BatchOptions { private boolean isStrict = true; private String rawBaseUri = ""; private String rawServiceResolutionUri = ""; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java index 028d3b1a7..e97f8779e 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java @@ -19,9 +19,11 @@ package org.apache.olingo.server.api.prefer; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; +import java.util.Set; import org.apache.olingo.commons.api.ODataPreferenceNames; import org.apache.olingo.server.api.prefer.Preferences.Return; @@ -31,8 +33,9 @@ import org.apache.olingo.server.api.prefer.Preferences.Return; * as described in RFC 7240. * There are named methods for preferences defined in the OData standard. */ -public class PreferencesApplied { +public final class PreferencesApplied { + private static final Set SAFE_PREFERENCE_NAMES = new HashSet(); private Map applied; private PreferencesApplied() { @@ -57,14 +60,7 @@ public class PreferencesApplied { final String key = entry.getKey(); result.append(key); if (entry.getValue() != null) { - final boolean safe = ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString().equals(key) - || ODataPreferenceNames.CALLBACK.toString().equals(key) - || ODataPreferenceNames.CONTINUE_ON_ERROR.toString().equals(key) - || ODataPreferenceNames.MAX_PAGE_SIZE.toString().equals(key) - || ODataPreferenceNames.TRACK_CHANGES.toString().equals(key) - || ODataPreferenceNames.RETURN.toString().equals(key) - || ODataPreferenceNames.RESPOND_ASYNC.toString().equals(key) - || ODataPreferenceNames.WAIT.toString().equals(key); + final boolean safe = isSafe(key); result.append('=') .append(safe ? "" : '"') .append(entry.getValue().replaceAll("\\\\|\"", "\\\\$0")) @@ -74,6 +70,20 @@ public class PreferencesApplied { return result.toString(); } + private boolean isSafe(String key) { + if(SAFE_PREFERENCE_NAMES.isEmpty()) { + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CALLBACK.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CONTINUE_ON_ERROR.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.MAX_PAGE_SIZE.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.TRACK_CHANGES.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RETURN.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RESPOND_ASYNC.toString()); + SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.WAIT.toString()); + } + return SAFE_PREFERENCE_NAMES.contains(key); + } + @Override public String toString() { return toValueString(); diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java index c8481c56a..376315acc 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java @@ -19,6 +19,8 @@ package org.apache.olingo.server.api.processor; import java.io.ByteArrayInputStream; +import java.nio.charset.Charset; +import java.util.Locale; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; @@ -116,7 +118,7 @@ public class DefaultProcessor implements MetadataProcessor, ServiceDocumentProce // This should never happen but to be sure we have this catch here to prevent sending a stacktrace to a client. String responseContent = "{\"error\":{\"code\":null,\"message\":\"An unexpected exception occurred during error processing\"}}"; - response.setContent(new ByteArrayInputStream(responseContent.getBytes())); + response.setContent(new ByteArrayInputStream(responseContent.getBytes(Charset.forName("utf-8")))); response.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode()); response.setHeader(HttpHeader.CONTENT_TYPE, ContentType.APPLICATION_JSON.toContentTypeString()); } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java index 00058a697..c58d25dfe 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java @@ -36,6 +36,6 @@ public interface ErrorProcessor extends Processor { * @param serverError the server error * @param responseFormat requested content type after content negotiation */ - public void processError(ODataRequest request, ODataResponse response, ODataServerError serverError, + void processError(ODataRequest request, ODataResponse response, ODataServerError serverError, ContentType responseFormat); } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java index aa88b66ac..3a507c649 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java @@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.data.ContextURL; import org.apache.olingo.commons.api.edm.EdmProperty; /** Options for the OData serializer. */ -public class PrimitiveSerializerOptions { +public final class PrimitiveSerializerOptions { private ContextURL contextURL; private Boolean isNullable; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java index b889595fa..2e979e694 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java @@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.data.ContextURL; import org.apache.olingo.server.api.uri.queryoption.CountOption; /** Options for the OData serializer. */ -public class ReferenceCollectionSerializerOptions { +public final class ReferenceCollectionSerializerOptions { private ContextURL contextURL; private CountOption count; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java index 0479ca4f3..189367a55 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.api.serializer; import org.apache.olingo.commons.api.data.ContextURL; -public class ReferenceSerializerOptions { +public final class ReferenceSerializerOptions { private ContextURL contextURL; /** Gets the {@link ContextURL}. */ diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java index 248790eea..77dfb842b 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java @@ -84,9 +84,9 @@ public enum SystemQueryOptionKind { */ LEVELS("$level"); - String syntax; + private String syntax; - private SystemQueryOptionKind(final String syntax) { + SystemQueryOptionKind(final String syntax) { this.syntax = syntax; }