http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java index 5bbbcff..ed27725 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java @@ -74,7 +74,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private static final String ODATA_CONTROL_INFORMATION_PREFIX = "@odata."; @Override - public DeserializerResult entityCollection(InputStream stream, EdmEntityType edmEntityType) + public DeserializerResult entityCollection(final InputStream stream, final EdmEntityType edmEntityType) throws DeserializerException { try { final ObjectNode tree = parseJsonTree(stream); @@ -92,7 +92,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - private EntityCollection consumeEntitySetNode(EdmEntityType edmEntityType, final ObjectNode tree, + private EntityCollection consumeEntitySetNode(final EdmEntityType edmEntityType, final ObjectNode tree, final ExpandTreeBuilder expandBuilder) throws DeserializerException { EntityCollection entitySet = new EntityCollection(); @@ -131,7 +131,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { return entitySet; } - private List<Entity> consumeEntitySetArray(EdmEntityType edmEntityType, JsonNode jsonNode, + private List<Entity> consumeEntitySetArray(final EdmEntityType edmEntityType, final JsonNode jsonNode, final ExpandTreeBuilder expandBuilder) throws DeserializerException { List<Entity> entities = new ArrayList<Entity>(); for (JsonNode arrayElement : jsonNode) { @@ -146,7 +146,8 @@ public class ODataJsonDeserializer implements ODataDeserializer { } @Override - public DeserializerResult entity(InputStream stream, EdmEntityType edmEntityType) throws DeserializerException { + public DeserializerResult entity(final InputStream stream, final EdmEntityType edmEntityType) + throws DeserializerException { try { final ObjectNode tree = parseJsonTree(stream); final ExpandTreeBuilderImpl expandBuilder = new ExpandTreeBuilderImpl(); @@ -167,7 +168,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } - private Entity consumeEntityNode(EdmEntityType edmEntityType, final ObjectNode tree, + private Entity consumeEntityNode(final EdmEntityType edmEntityType, final ObjectNode tree, final ExpandTreeBuilder expandBuilder) throws DeserializerException { Entity entity = new Entity(); entity.setType(edmEntityType.getFullQualifiedName().getFullQualifiedNameAsString()); @@ -187,14 +188,14 @@ public class ODataJsonDeserializer implements ODataDeserializer { } @Override - public DeserializerResult actionParameters(InputStream stream, final EdmAction edmAction) + public DeserializerResult actionParameters(final InputStream stream, final EdmAction edmAction) throws DeserializerException { try { ObjectNode tree = parseJsonTree(stream); Map<String, Parameter> parameters = new LinkedHashMap<String, Parameter>(); if (tree != null) { consumeParameters(edmAction, tree, parameters); - + final List<String> toRemove = new ArrayList<String>(); Iterator<Entry<String, JsonNode>> fieldsIterator = tree.fields(); while (fieldsIterator.hasNext()) { @@ -226,7 +227,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - private ObjectNode parseJsonTree(InputStream stream) + private ObjectNode parseJsonTree(final InputStream stream) throws IOException, JsonParseException, JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true); @@ -235,8 +236,9 @@ public class ODataJsonDeserializer implements ODataDeserializer { return tree; } - private void consumeParameters(final EdmAction edmAction, ObjectNode node, Map<String, Parameter> parameters) - throws DeserializerException { + private void consumeParameters(final EdmAction edmAction, final ObjectNode node, + final Map<String, Parameter> parameters) + throws DeserializerException { List<String> parameterNames = edmAction.getParameterNames(); if (edmAction.isBound()) { // The binding parameter must not occur in the payload. @@ -287,7 +289,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { /** * Consume all remaining fields of Json ObjectNode and try to map found values * to according Entity fields and omit to be ignored OData fields (e.g. control information). - * + * * @param edmEntityType edm entity type which for which the json node is consumed * @param node json node which is consumed * @param entity entity instance which is filled @@ -381,7 +383,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - private Link consumeBindingLink(String key, JsonNode jsonNode, EdmEntityType edmEntityType) + private Link consumeBindingLink(final String key, final JsonNode jsonNode, final EdmEntityType edmEntityType) throws DeserializerException { String[] splitKey = key.split("@"); String navigationPropertyName = splitKey[0]; @@ -422,7 +424,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { return bindingLink; } - private void assertIsNullNode(String key, JsonNode jsonNode) throws DeserializerException { + private void assertIsNullNode(final String key, final JsonNode jsonNode) throws DeserializerException { if (jsonNode.isNull()) { throw new DeserializerException("Annotation: " + key + "must not have a null value.", DeserializerException.MessageKeys.INVALID_NULL_ANNOTATION, key); @@ -431,7 +433,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private Property consumePropertyNode(final String name, final EdmType type, final boolean isCollection, final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final boolean isUnicode, final EdmMapping mapping, JsonNode jsonNode) throws DeserializerException { + final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode) throws DeserializerException { Property property = new Property(); property.setName(name); property.setType(type.getFullQualifiedName().getFullQualifiedNameAsString()); @@ -447,7 +449,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private void consumePropertySingleNode(final String name, final EdmType type, final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final boolean isUnicode, final EdmMapping mapping, JsonNode jsonNode, Property property) + final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode, final Property property) throws DeserializerException { switch (type.getKind()) { case PRIMITIVE: @@ -475,8 +477,9 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - private Object readComplexNode(final String name, final EdmType type, final boolean isNullable, JsonNode jsonNode) - throws DeserializerException { + private Object readComplexNode(final String name, final EdmType type, final boolean isNullable, + final JsonNode jsonNode) + throws DeserializerException { // read and add all complex properties ComplexValue value = readComplexValue(name, type, isNullable, jsonNode); @@ -505,7 +508,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private void consumePropertyCollectionNode(final String name, final EdmType type, final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final boolean isUnicode, final EdmMapping mapping, JsonNode jsonNode, Property property) + final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode, final Property property) throws DeserializerException { if (!jsonNode.isArray()) { throw new DeserializerException("Value for property: " + name + " must be an array but is not.", @@ -555,7 +558,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } private ComplexValue readComplexValue(final String name, final EdmType type, - final boolean isNullable, JsonNode jsonNode) throws DeserializerException { + final boolean isNullable, final JsonNode jsonNode) throws DeserializerException { if (isValidNull(name, isNullable, jsonNode)) { return null; } @@ -589,7 +592,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } private Object readTypeDefinitionValue(final String name, final EdmType type, - final boolean isNullable, final EdmMapping mapping, JsonNode jsonNode) throws DeserializerException { + final boolean isNullable, final EdmMapping mapping, final JsonNode jsonNode) throws DeserializerException { checkForValueNode(name, jsonNode); if (isValidNull(name, isNullable, jsonNode)) { return null; @@ -626,7 +629,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private Object readEnumValue(final String name, final EdmType type, final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final boolean isUnicode, final EdmMapping mapping, JsonNode jsonNode) throws DeserializerException { + final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode) throws DeserializerException { checkForValueNode(name, jsonNode); if (isValidNull(name, isNullable, jsonNode)) { return null; @@ -651,7 +654,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { private Object readPrimitiveValue(final String name, final EdmType type, final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final boolean isUnicode, final EdmMapping mapping, JsonNode jsonNode) throws DeserializerException { + final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode) throws DeserializerException { checkForValueNode(name, jsonNode); if (isValidNull(name, isNullable, jsonNode)) { return null; @@ -675,7 +678,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { * @param edmPrimitiveType * @return the java class to be used during deserialization */ - private Class<?> getJavaClassForPrimitiveType(EdmMapping mapping, EdmPrimitiveType edmPrimitiveType) { + private Class<?> getJavaClassForPrimitiveType(final EdmMapping mapping, final EdmPrimitiveType edmPrimitiveType) { return mapping == null || mapping.getMappedJavaClass() == null ? edmPrimitiveType.getDefaultType() : mapping.getMappedJavaClass(); @@ -698,11 +701,11 @@ public class ODataJsonDeserializer implements ODataDeserializer { /** * Validate that node is empty (<code>node.size == 0</code>) and if not throw * an <code>DeserializerException</code>. - * + * * @param node node to be checked * @throws DeserializerException if node is not empty */ - private void assertJsonNodeIsEmpty(JsonNode node) throws DeserializerException { + private void assertJsonNodeIsEmpty(final JsonNode node) throws DeserializerException { if (node.size() != 0) { final String unknownField = node.fieldNames().next(); throw new DeserializerException("Tree should be empty but still has content left: " + unknownField, @@ -710,8 +713,9 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - private void checkJsonTypeBasedOnPrimitiveType(String propertyName, String edmPrimitiveTypeName, JsonNode jsonNode) - throws DeserializerException { + private void checkJsonTypeBasedOnPrimitiveType(final String propertyName, final String edmPrimitiveTypeName, + final JsonNode jsonNode) + throws DeserializerException { EdmPrimitiveTypeKind primKind; try { primKind = EdmPrimitiveTypeKind.valueOf(edmPrimitiveTypeName); @@ -761,7 +765,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } @Override - public DeserializerResult property(InputStream stream, EdmProperty edmProperty) + public DeserializerResult property(final InputStream stream, final EdmProperty edmProperty) throws DeserializerException { try { ObjectMapper objectMapper = new ObjectMapper(); @@ -797,7 +801,8 @@ public class ODataJsonDeserializer implements ODataDeserializer { } } - public DeserializerResult entityReferences(InputStream stream) throws DeserializerException { + @Override + public DeserializerResult entityReferences(final InputStream stream) throws DeserializerException { try { ArrayList<URI> parsedValues = new ArrayList<URI>(); ObjectMapper objectMapper = new ObjectMapper();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java index 4f6447b..3661907 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java @@ -68,7 +68,8 @@ public class BatchResponseSerializer { return builder; } - private void appendChangeSet(ODataResponsePart part, StringBuilder builder) throws BatchSerializerException { + private void appendChangeSet(final ODataResponsePart part, final StringBuilder builder) + throws BatchSerializerException { final String changeSetBoundary = generateBoundary("changeset"); appendChangeSetHeader(builder, changeSetBoundary); @@ -82,7 +83,7 @@ public class BatchResponseSerializer { builder.append(getCloseDelimiter(changeSetBoundary)); } - private void appendBodyPart(ODataResponse response, StringBuilder builder, boolean isChangeSet) + private void appendBodyPart(final ODataResponse response, final StringBuilder builder, final boolean isChangeSet) throws BatchSerializerException { byte[] body = getBody(response); @@ -120,12 +121,12 @@ public class BatchResponseSerializer { } } - private void appendChangeSetHeader(StringBuilder builder, final String changeSetBoundary) { + private void appendChangeSetHeader(final StringBuilder builder, final String changeSetBoundary) { appendHeader(HttpHeader.CONTENT_TYPE, HttpContentType.MULTIPART_MIXED + "; boundary=" + changeSetBoundary, builder); } - private void appendHeader(String name, String value, StringBuilder builder) { + private void appendHeader(final String name, final String value, final StringBuilder builder) { builder.append(name) .append(COLON) .append(SP) @@ -133,7 +134,7 @@ public class BatchResponseSerializer { .append(CRLF); } - private void appendStatusLine(ODataResponse response, StringBuilder builder) { + private void appendStatusLine(final ODataResponse response, final StringBuilder builder) { builder.append("HTTP/1.1") .append(SP) .append(response.getStatusCode()) @@ -142,7 +143,8 @@ public class BatchResponseSerializer { .append(CRLF); } - private void appendResponseHeader(ODataResponse response, int contentLength, StringBuilder builder) { + private void appendResponseHeader(final ODataResponse response, final int contentLength, + final StringBuilder builder) { final Map<String, String> header = response.getHeaders(); for (final String key : header.keySet()) { @@ -155,7 +157,8 @@ public class BatchResponseSerializer { appendHeader(HttpHeader.CONTENT_LENGTH, "" + contentLength, builder); } - private void appendBodyPartHeader(ODataResponse response, StringBuilder builder, boolean isChangeSet) + private void + appendBodyPartHeader(final ODataResponse response, final StringBuilder builder, final boolean isChangeSet) throws BatchSerializerException { appendHeader(HttpHeader.CONTENT_TYPE, HttpContentType.APPLICATION_HTTP, builder); appendHeader(BatchParserCommon.HTTP_CONTENT_TRANSFER_ENCODING, BatchParserCommon.BINARY_ENCODING, builder); @@ -170,7 +173,7 @@ public class BatchResponseSerializer { } } - private String getDashBoundary(String boundary) { + private String getDashBoundary(final String boundary) { return DOUBLE_DASH + boundary + CRLF; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java index b7b16a2..53dca19 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java @@ -24,29 +24,29 @@ import org.apache.olingo.server.api.serializer.SerializerResult; public class SerializerResultImpl implements SerializerResult { private InputStream content; - + @Override public InputStream getContent() { return content; } - + public static SerializerResultBuilder with() { return new SerializerResultBuilder(); } - + public static class SerializerResultBuilder { private InputStream content; - + public SerializerResultBuilder content(final InputStream input) { content = input; - + return this; } - + public SerializerResult build() { SerializerResultImpl result = new SerializerResultImpl(); result.content = content; - + return result; } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java index 70d6364..97faaa0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java @@ -29,7 +29,7 @@ import com.fasterxml.jackson.core.JsonGenerator; public class ODataErrorSerializer { - public void writeErrorDocument(JsonGenerator json, final ODataError error) + public void writeErrorDocument(final JsonGenerator json, final ODataError error) throws IOException, SerializerException { if (error == null) { throw new SerializerException("ODataError object MUST NOT be null!", @@ -55,7 +55,8 @@ public class ODataErrorSerializer { json.writeEndObject(); } - private void writeODataError(JsonGenerator json, String code, String message, String target) throws IOException { + private void writeODataError(final JsonGenerator json, final String code, final String message, final String target) + throws IOException { json.writeFieldName(Constants.ERROR_CODE); if (code == null) { json.writeNull(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java index 3fe4fcb..7e43742 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java @@ -148,7 +148,7 @@ public class ODataJsonSerializer implements ODataSerializer { json.writeNumberField(Constants.JSON_COUNT, entitySet.getCount()); } json.writeFieldName(Constants.VALUE); - if(options == null) { + if (options == null) { writeEntitySet(metadata, entityType, entitySet, null, null, false, json); } else { writeEntitySet(metadata, entityType, entitySet, @@ -175,7 +175,7 @@ public class ODataJsonSerializer implements ODataSerializer { writeEntity(metadata, entityType, entity, contextURL, options == null ? null : options.getExpand(), options == null ? null : options.getSelect(), - options == null ? false: options.onlyReferences(), json); + options == null ? false : options.onlyReferences(), json); json.close(); } catch (final IOException e) { throw new SerializerException("An I/O exception occurred.", e, @@ -212,7 +212,7 @@ public class ODataJsonSerializer implements ODataSerializer { protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType, final Entity entity, final ContextURL contextURL, final ExpandOption expand, - final SelectOption select, boolean onlyReference, final JsonGenerator json) + final SelectOption select, final boolean onlyReference, final JsonGenerator json) throws IOException, SerializerException { json.writeStartObject(); if (format != ODataFormat.JSON_NO_METADATA) { @@ -242,7 +242,7 @@ public class ODataJsonSerializer implements ODataSerializer { } else { EdmEntityType resolvedType = resolveEntityType(metadata, entityType, entity.getType()); if (!resolvedType.equals(entityType)) { - json.writeStringField(Constants.JSON_TYPE, "#"+entity.getType()); + json.writeStringField(Constants.JSON_TYPE, "#" + entity.getType()); } writeProperties(resolvedType, entity.getProperties(), select, json); writeNavigationProperties(metadata, resolvedType, entity, expand, json); @@ -250,8 +250,8 @@ public class ODataJsonSerializer implements ODataSerializer { } } - protected EdmEntityType resolveEntityType(ServiceMetadata metadata, EdmEntityType baseType, - String derivedTypeName) throws SerializerException { + protected EdmEntityType resolveEntityType(final ServiceMetadata metadata, final EdmEntityType baseType, + final String derivedTypeName) throws SerializerException { if (derivedTypeName == null || baseType.getFullQualifiedName().getFullQualifiedNameAsString().equals(derivedTypeName)) { return baseType; @@ -274,8 +274,8 @@ public class ODataJsonSerializer implements ODataSerializer { .getFullQualifiedName().getFullQualifiedNameAsString()); } - protected EdmComplexType resolveComplexType(ServiceMetadata metadata, EdmComplexType baseType, - String derivedTypeName) throws SerializerException { + protected EdmComplexType resolveComplexType(final ServiceMetadata metadata, final EdmComplexType baseType, + final String derivedTypeName) throws SerializerException { if (derivedTypeName == null || baseType.getFullQualifiedName().getFullQualifiedNameAsString().equals(derivedTypeName)) { return baseType; @@ -299,7 +299,7 @@ public class ODataJsonSerializer implements ODataSerializer { } protected void writeProperties(final EdmStructuredType type, final List<Property> properties, - final SelectOption select, JsonGenerator json) throws IOException, SerializerException { + final SelectOption select, final JsonGenerator json) throws IOException, SerializerException { final boolean all = ExpandSelectHelper.isAll(select); final Set<String> selected = all ? null : ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems()); @@ -342,7 +342,7 @@ public class ODataJsonSerializer implements ODataSerializer { protected void writeExpandedNavigationProperty(final ServiceMetadata metadata, final EdmNavigationProperty property, final Link navigationLink, - final ExpandOption innerExpand, final SelectOption innerSelect, JsonGenerator json) + final ExpandOption innerExpand, final SelectOption innerSelect, final JsonGenerator json) throws IOException, SerializerException { json.writeFieldName(property.getName()); if (property.isCollection()) { @@ -418,7 +418,7 @@ public class ODataJsonSerializer implements ODataSerializer { private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, - JsonGenerator json) throws IOException, EdmPrimitiveTypeException, SerializerException { + final JsonGenerator json) throws IOException, EdmPrimitiveTypeException, SerializerException { json.writeStartArray(); for (Object value : property.asCollection()) { switch (property.getValueType()) { @@ -440,7 +440,7 @@ public class ODataJsonSerializer implements ODataSerializer { } private void writeComplexCollection(final EdmComplexType type, final Property property, - final Set<List<String>> selectedPaths, JsonGenerator json) + final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, EdmPrimitiveTypeException, SerializerException { json.writeStartArray(); for (Object value : property.asCollection()) { @@ -458,7 +458,7 @@ public class ODataJsonSerializer implements ODataSerializer { private void writePrimitive(final EdmPrimitiveType type, final Property property, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, - final Boolean isUnicode, JsonGenerator json) + final Boolean isUnicode, final JsonGenerator json) throws EdmPrimitiveTypeException, IOException, SerializerException { if (property.isPrimitive()) { writePrimitiveValue(type, property.asPrimitive(), @@ -498,7 +498,7 @@ public class ODataJsonSerializer implements ODataSerializer { } protected void writeComplexValue(final EdmComplexType type, final List<Property> properties, - final Set<List<String>> selectedPaths, JsonGenerator json) + final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, EdmPrimitiveTypeException, SerializerException { json.writeStartObject(); for (final String propertyName : type.getPropertyNames()) { @@ -567,7 +567,7 @@ public class ODataJsonSerializer implements ODataSerializer { } EdmComplexType resolvedType = resolveComplexType(metadata, type, property.getType()); if (!resolvedType.equals(type)) { - json.writeStringField(Constants.JSON_TYPE, "#"+property.getType()); + json.writeStringField(Constants.JSON_TYPE, "#" + property.getType()); } final List<Property> values = property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java index 3bf8a7a..8a450d8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java @@ -28,8 +28,8 @@ import java.util.concurrent.LinkedBlockingQueue; /** * Circular stream buffer to write/read into/from one single buffer. * With support of {@link InputStream} and {@link OutputStream} access to buffered data. - * - * + * + * */ public class CircleStreamBuffer { @@ -59,7 +59,7 @@ public class CircleStreamBuffer { /** * Create a {@link CircleStreamBuffer} with given buffer size in bytes. - * + * * @param bufferSize */ public CircleStreamBuffer(final int bufferSize) { @@ -71,7 +71,7 @@ public class CircleStreamBuffer { /** * Get {@link InputStream} for data read access. - * + * * @return the stream */ public InputStream getInputStream() { @@ -80,7 +80,7 @@ public class CircleStreamBuffer { /** * Get {@link OutputStream} for write data. - * + * * @return the stream */ public OutputStream getOutputStream() { @@ -234,7 +234,7 @@ public class CircleStreamBuffer { * Creates a new buffer (per {@link #allocateBuffer(int)}) with the requested capacity as minimum capacity, add the * new allocated * buffer to the {@link #bufferQueue} and set it as {@link #currentWriteBuffer}. - * + * * @param requestedCapacity minimum capacity for new allocated buffer */ private void createNewWriteBuffer(final int requestedCapacity) { @@ -244,7 +244,7 @@ public class CircleStreamBuffer { } /** - * + * * @param requestedCapacity * @return the buffer */ @@ -268,7 +268,7 @@ public class CircleStreamBuffer { // ############################################# /** - * + * */ private static class InternalInputStream extends InputStream { @@ -300,7 +300,7 @@ public class CircleStreamBuffer { } /** - * + * */ private static class InternalOutputStream extends OutputStream { private final CircleStreamBuffer outBuffer; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java index ac33759..e79a295 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java @@ -1,18 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @@ -39,10 +39,10 @@ public final class ContextURLBuilder { result.append(Constants.METADATA); if (contextURL.getEntitySetOrSingletonOrType() != null) { result.append('#'); - if(contextURL.isCollection()) { + if (contextURL.isCollection()) { result.append("Collection(") - .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())) - .append(")"); + .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())) + .append(")"); } else { result.append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())); } @@ -66,11 +66,11 @@ public final class ContextURLBuilder { if (contextURL.getEntitySetOrSingletonOrType() != null) { throw new IllegalArgumentException("ContextURL: $ref with Entity Set"); } - if(contextURL.isCollection()) { + if (contextURL.isCollection()) { result.append('#'); result.append("Collection(") - .append(ContextURL.Suffix.REFERENCE.getRepresentation()) - .append(")"); + .append(ContextURL.Suffix.REFERENCE.getRepresentation()) + .append(")"); } else { result.append('#').append(ContextURL.Suffix.REFERENCE.getRepresentation()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java index e9eb880..421c6eb 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java @@ -1,18 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @@ -36,10 +36,11 @@ import org.apache.olingo.server.api.uri.queryoption.SelectOption; public final class ContextURLHelper { - /** Builds a list of selected Properties for the ContextURL, - * taking care to preserve the order as defined in the EDM; - * returns NULL if no selection has taken place. - * @param type the structured type + /** + * Builds a list of selected Properties for the ContextURL, + * taking care to preserve the order as defined in the EDM; + * returns NULL if no selection has taken place. + * @param type the structured type * @param expand the Expand option (from the URL's $expand query option) * @param select the Select option (from the URL's $select query option) * @return a select-list String @@ -58,7 +59,8 @@ public final class ContextURLHelper { return result.length() == 0 ? null : result.toString(); } - private static void handleSelect(final EdmStructuredType type, final SelectOption select, StringBuilder result) { + private static void handleSelect(final EdmStructuredType type, final SelectOption select, + final StringBuilder result) { if (ExpandSelectHelper.isAll(select)) { result.append('*'); } else { @@ -98,7 +100,7 @@ public final class ContextURLHelper { } } - private static void handleExpand(final EdmStructuredType type, final ExpandOption expand, StringBuilder result) + private static void handleExpand(final EdmStructuredType type, final ExpandOption expand, final StringBuilder result) throws SerializerException { final Set<String> expandedPropertyNames = ExpandSelectHelper.getExpandedPropertyNames(expand.getExpandItems()); for (final String propertyName : type.getNavigationPropertyNames()) { @@ -149,7 +151,7 @@ public final class ContextURLHelper { * @param keys the keys as a list of {@link UriParameter} instances * @return a String with the key predicate */ - public static String buildKeyPredicate(List<UriParameter> keys) throws SerializerException { + public static String buildKeyPredicate(final List<UriParameter> keys) throws SerializerException { if (keys == null || keys.isEmpty()) { return null; } else if (keys.size() == 1) { @@ -164,5 +166,5 @@ public final class ContextURLHelper { } return result.toString(); } - } + } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java index c537fbd..3acdbd3 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java @@ -85,7 +85,6 @@ public abstract class ExpandSelectHelper { return selectedPaths.isEmpty() ? null : selectedPaths; } - public static boolean isSelected(final Set<List<String>> selectedPaths, final String propertyName) { for (final List<String> path : selectedPaths) { if (propertyName.equals(path.get(0))) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java index 14fe147..2957bce 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java @@ -228,7 +228,6 @@ public class MetadataDocumentXmlSerializer { // EntitySets appendEntitySets(writer, container.getEntitySets()); - // ActionImports appendActionImports(writer, container.getActionImports()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerImpl.java index 6763495..ef2d451 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerImpl.java @@ -102,7 +102,7 @@ public class ODataXmlSerializerImpl implements ODataSerializer { } @Override - public SerializerResult error(ClientServerError error) throws SerializerException { + public SerializerResult error(final ClientServerError error) throws SerializerException { throw new SerializerException("error serialization not implemented for XML format", SerializerException.MessageKeys.NOT_IMPLEMENTED); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java index b1b395f..b7330bd 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java @@ -93,11 +93,12 @@ public class UriHelperImpl implements UriHelper { } @Override - public List<UriParameter> getKeyPredicatesFromEntityLink(Edm edm, String entityLink, String rawServiceRoot) - throws DeserializerException { - + public List<UriParameter> getKeyPredicatesFromEntityLink(final Edm edm, final String entityLink, + final String rawServiceRoot) + throws DeserializerException { + String oDataPath = entityLink; - if(rawServiceRoot != null && entityLink.startsWith(rawServiceRoot)) { + if (rawServiceRoot != null && entityLink.startsWith(rawServiceRoot)) { oDataPath = entityLink.substring(rawServiceRoot.length()); } oDataPath = oDataPath.startsWith("/") ? oDataPath : "/" + oDataPath; @@ -107,7 +108,7 @@ public class UriHelperImpl implements UriHelper { .getUriResourceParts(); if (uriResourceParts.size() == 1 && uriResourceParts.get(0).getKind() == UriResourceKind.entitySet) { final UriResourceEntitySet entityUriResource = (UriResourceEntitySet) uriResourceParts.get(0); - + return entityUriResource.getKeyPredicates(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java index 9990da6..ae46328 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java @@ -18,6 +18,13 @@ */ package org.apache.olingo.server.core.uri; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.server.api.uri.UriInfo; @@ -48,13 +55,6 @@ import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl; import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl; import org.apache.olingo.server.core.uri.queryoption.SystemQueryOptionImpl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - public class UriInfoImpl implements UriInfo { private UriInfoKind kind; @@ -137,7 +137,7 @@ public class UriInfoImpl implements UriInfo { } @Override - public String getValueForAlias(String alias) { + public String getValueForAlias(final String alias) { return aliasToValue.get(alias); } @@ -240,11 +240,12 @@ public class UriInfoImpl implements UriInfo { } } - /** Adds system query option. + /** + * Adds system query option. * @param systemOption the option to be added * @return this object for method chaining * @throws ODataRuntimeException if an unsupported option is provided - * or an option of this kind has been added before + * or an option of this kind has been added before */ public UriInfoImpl setSystemQueryOption(final SystemQueryOption systemOption) { final SystemQueryOptionKind kind = systemOption.getKind(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java index 8daa810..6f23d23 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java @@ -18,6 +18,9 @@ */ package org.apache.olingo.server.core.uri; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmType; @@ -25,9 +28,6 @@ import org.apache.olingo.server.api.uri.UriParameter; import org.apache.olingo.server.api.uri.UriResourceFunction; import org.apache.olingo.server.api.uri.UriResourceKind; -import java.util.ArrayList; -import java.util.List; - /** * Covers Function imports and BoundFunction in URI */ http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java index 19d3639..aef5800 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java @@ -18,15 +18,15 @@ */ package org.apache.olingo.server.core.uri; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.server.api.uri.UriParameter; import org.apache.olingo.server.api.uri.UriResourceKind; import org.apache.olingo.server.api.uri.UriResourcePartTyped; -import java.util.ArrayList; -import java.util.List; - public abstract class UriResourceWithKeysImpl extends UriResourceImpl implements UriResourcePartTyped { protected EdmType collectionTypeFilter = null; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java index 2b529bd..cfa5462 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,8 @@ ******************************************************************************/ package org.apache.olingo.server.core.uri.parser; +import java.util.BitSet; + import org.antlr.v4.runtime.DiagnosticErrorListener; import org.antlr.v4.runtime.Parser; import org.antlr.v4.runtime.RecognitionException; @@ -25,8 +27,6 @@ import org.antlr.v4.runtime.Recognizer; import org.antlr.v4.runtime.atn.ATNConfigSet; import org.antlr.v4.runtime.dfa.DFA; -import java.util.BitSet; - class CheckFullContextListener extends DiagnosticErrorListener { @Override http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java index 2af79e6..cc788da 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java @@ -18,6 +18,9 @@ */ package org.apache.olingo.server.core.uri.parser; +import java.util.ArrayList; +import java.util.List; + import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.BailErrorStrategy; import org.antlr.v4.runtime.CommonTokenStream; @@ -61,9 +64,6 @@ import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl; import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl; import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl; -import java.util.ArrayList; -import java.util.List; - public class Parser { int logLevel = 0; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java index b99433d..07eb1d3 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java @@ -6,9 +6,9 @@ * 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 @@ -18,14 +18,14 @@ */ package org.apache.olingo.server.core.uri.parser; +import java.util.Stack; + import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.server.core.uri.UriInfoImpl; import org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor.TypeInformation; import org.apache.olingo.server.core.uri.queryoption.ExpandItemImpl; import org.apache.olingo.server.core.uri.queryoption.SelectItemImpl; -import java.util.Stack; - /** * UriContext object used for holding information for URI parsing. * @@ -52,32 +52,31 @@ public class UriContext { // CHECKSTYLE:OFF (Maven checkstyle) /** * Set within method - * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandItem( - * org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemContext ctx)} - * and {@link - * org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension( - * org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)} to allow nodes + * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandItem(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemContext ctx)} + * and + * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)} + * to allow nodes * deeper in the expand tree at - * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension( - * org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)} + * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)} * appending path * segments to the currently processed {@link ExpandItemImpl}. */ public ExpandItemImpl contextExpandItemPath; // CHECKSTYLE:ON (Maven checkstyle) + // CHECKSTYLE:OFF (Maven checkstyle) /** * Set within method - * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectItem( - * org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectItemContext ctx)} to allow + * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectItem(org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectItemContext ctx)} + * to allow * nodes * deeper in the expand tree at - * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectSegment( - * org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectSegmentContext ctx)} + * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectSegment(org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectSegmentContext ctx)} * appending path segments to the * currently processed {@link SelectItemImpl}. */ public SelectItemImpl contextSelectItem; + // CHECKSTYLE:ON (Maven checkstyle) /** * Stores the currently processed UriInfo objects. There is one URI Info object for the resource path * and one for each new first member access within $filter and $orderBy options. http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java index be7cdbc..5918b6f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java @@ -18,14 +18,14 @@ */ package org.apache.olingo.server.core.uri.parser; -import org.apache.olingo.commons.core.Decoder; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.List; +import org.apache.olingo.commons.core.Decoder; + public class UriDecoder { public static RawUri decodeUri(final String path, final String query, final String fragment, @@ -43,7 +43,7 @@ public class UriDecoder { return rawUri; } - private static void decode(RawUri rawUri) throws UriParserSyntaxException { + private static void decode(final RawUri rawUri) throws UriParserSyntaxException { rawUri.pathSegmentListDecoded = new ArrayList<String>(); for (String segment : rawUri.pathSegmentList) { rawUri.pathSegmentListDecoded.add(decode(segment)); @@ -81,7 +81,7 @@ public class UriDecoder { } } - private static List<String> splitPath(final String path, int skipSegments) { + private static List<String> splitPath(final String path, final int skipSegments) { List<String> list = split(path, '/'); // Empty path segments of the resource path are removed. http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java index a94efbe..a6f50f1 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java @@ -18,6 +18,10 @@ */ package org.apache.olingo.server.core.uri.parser; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import org.antlr.v4.runtime.misc.NotNull; import org.antlr.v4.runtime.misc.ParseCancellationException; import org.antlr.v4.runtime.tree.ParseTree; @@ -181,16 +185,12 @@ import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl; import org.apache.olingo.server.core.uri.queryoption.expression.TypeLiteralImpl; import org.apache.olingo.server.core.uri.queryoption.expression.UnaryImpl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * UriVisitor - * + * * Converts the URI parse tree the generated by ANTLR into an internal representation which maybe is given to the * application. While converting the tree is only validated against the EDM if necessary. - * + * * Attention: * <li> This UriVisitor is at somes point more lax than the original ABNF * <li> It is more tolerable against additional white spaces Currently not supported @@ -406,7 +406,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> { UriParserSemanticException.MessageKeys.RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE, odi)); } - if ((ctx.depth() <= 2 // path evaluation for the resource path + if ((ctx.depth() <= 2 // path evaluation for the resource path || lastResourcePart instanceof UriResourceTypedImpl || lastResourcePart instanceof UriResourceNavigationPropertyImpl) && source.isCollection) { @@ -420,7 +420,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> { if (property == null) { throw wrap(new UriParserSemanticException("Property '" + odi + "' not found in type '" + structType.getFullQualifiedName().getFullQualifiedNameAsString() + "'", - ctx.depth() > 2 ? // path evaluation inside an expression or for the resource path? + ctx.depth() > 2 ? // path evaluation inside an expression or for the resource path? UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE : UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE, structType.getFullQualifiedName().getFullQualifiedNameAsString(), odi)); @@ -2192,17 +2192,17 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> { } @Override - public ExpressionImpl visitAltUnary(@NotNull UriParserParser.AltUnaryContext ctx) { - UnaryImpl unary = new UnaryImpl(); - unary.setOperator(ctx.unary().NOT() == null? UnaryOperatorKind.MINUS: UnaryOperatorKind.NOT); - unary.setOperand((ExpressionImpl) ctx.commonExpr().accept(this)); - return unary; + public ExpressionImpl visitAltUnary(@NotNull final UriParserParser.AltUnaryContext ctx) { + UnaryImpl unary = new UnaryImpl(); + unary.setOperator(ctx.unary().NOT() == null ? UnaryOperatorKind.MINUS : UnaryOperatorKind.NOT); + unary.setOperand((ExpressionImpl) ctx.commonExpr().accept(this)); + return unary; + } + + @Override + public ExpressionImpl visitAltAlias(@NotNull final UriParserParser.AltAliasContext ctx) { + AliasImpl alias = new AliasImpl(); + alias.setParameter("@" + ctx.odataIdentifier().getChild(0).getText()); + return alias; } - - @Override - public ExpressionImpl visitAltAlias(@NotNull UriParserParser.AltAliasContext ctx) { - AliasImpl alias = new AliasImpl(); - alias.setParameter("@"+ctx.odataIdentifier().getChild(0).getText()); - return alias; - } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java index 31804a4..ce38c8f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java @@ -24,12 +24,12 @@ abstract public class UriParserException extends ODataTranslatedException { private static final long serialVersionUID = -6438700016830955949L; - public UriParserException(String developmentMessage, MessageKey messageKey, String... parameters) { + public UriParserException(final String developmentMessage, final MessageKey messageKey, final String... parameters) { super(developmentMessage, messageKey, parameters); } - public UriParserException(String developmentMessage, Throwable cause, MessageKey messageKey, - String... parameters) { + public UriParserException(final String developmentMessage, final Throwable cause, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, cause, messageKey, parameters); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java index 77f975b..c1b171e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java @@ -24,35 +24,56 @@ public class UriParserSemanticException extends UriParserException { private static final long serialVersionUID = 3850285860949809622L; public static enum MessageKeys implements MessageKey { - /** parameters: function-import name, function parameters */ FUNCTION_NOT_FOUND, - /** parameter: resource part */ RESOURCE_PART_ONLY_FOR_TYPED_PARTS, - /** parameter: resource part */ RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE, - /** parameter: property name */ PROPERTY_AFTER_COLLECTION, - /** parameters: type name, property name */ PROPERTY_NOT_IN_TYPE, - /** parameters: type name, property name */ EXPRESSION_PROPERTY_NOT_IN_TYPE, - /** parameter: property name */ UNKNOWN_PROPERTY_TYPE, - /** parameter: type filter */ INCOMPATIBLE_TYPE_FILTER, - /** parameters: previous type filter, last type filter */ TYPE_FILTER_NOT_CHAINABLE, - /** parameter: type filter */ PREVIOUS_PART_NOT_TYPED, - /** parameter: type */ FUNCTION_PARAMETERS_EXPECTED, - /** parameter: resource part */ UNKNOWN_PART, - /** parameter: expression */ ONLY_FOR_TYPED_PARTS, - /** parameter: entity type name */ UNKNOWN_ENTITY_TYPE, - /** parameter: expression */ ONLY_FOR_COLLECTIONS, - /** parameter: expression */ ONLY_FOR_ENTITY_TYPES, - /** parameter: expression */ ONLY_FOR_STRUCTURAL_TYPES, - /** parameter: expression */ ONLY_FOR_TYPED_PROPERTIES, - /** parameter: value */ INVALID_KEY_VALUE, + /** parameters: function-import name, function parameters */ + FUNCTION_NOT_FOUND, + /** parameter: resource part */ + RESOURCE_PART_ONLY_FOR_TYPED_PARTS, + /** parameter: resource part */ + RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE, + /** parameter: property name */ + PROPERTY_AFTER_COLLECTION, + /** parameters: type name, property name */ + PROPERTY_NOT_IN_TYPE, + /** parameters: type name, property name */ + EXPRESSION_PROPERTY_NOT_IN_TYPE, + /** parameter: property name */ + UNKNOWN_PROPERTY_TYPE, + /** parameter: type filter */ + INCOMPATIBLE_TYPE_FILTER, + /** parameters: previous type filter, last type filter */ + TYPE_FILTER_NOT_CHAINABLE, + /** parameter: type filter */ + PREVIOUS_PART_NOT_TYPED, + /** parameter: type */ + FUNCTION_PARAMETERS_EXPECTED, + /** parameter: resource part */ + UNKNOWN_PART, + /** parameter: expression */ + ONLY_FOR_TYPED_PARTS, + /** parameter: entity type name */ + UNKNOWN_ENTITY_TYPE, + /** parameter: expression */ + ONLY_FOR_COLLECTIONS, + /** parameter: expression */ + ONLY_FOR_ENTITY_TYPES, + /** parameter: expression */ + ONLY_FOR_STRUCTURAL_TYPES, + /** parameter: expression */ + ONLY_FOR_TYPED_PROPERTIES, + /** parameter: value */ + INVALID_KEY_VALUE, PARAMETERS_LIST_ONLY_FOR_TYPED_PARTS, - /** parameters: expected number, actual number */ WRONG_NUMBER_OF_KEY_PROPERTIES, + /** parameters: expected number, actual number */ + WRONG_NUMBER_OF_KEY_PROPERTIES, NOT_ENOUGH_REFERENTIAL_CONSTRAINTS, KEY_NOT_ALLOWED, RESOURCE_PATH_NOT_TYPED, ONLY_SIMPLE_AND_COMPLEX_PROPERTIES_IN_SELECT, COMPLEX_PROPERTY_OF_ENTITY_TYPE_EXPECTED, NOT_FOR_ENTITY_TYPE, - PREVIOUS_PART_TYPED, - /** parameter: resource_name */ RESOURCE_NOT_FOUND; + PREVIOUS_PART_TYPED, + /** parameter: resource_name */ + RESOURCE_NOT_FOUND; @Override public String getKey() { @@ -60,12 +81,14 @@ public class UriParserSemanticException extends UriParserException { } } - public UriParserSemanticException(String developmentMessage, MessageKey messageKey, String... parameters) { + public UriParserSemanticException(final String developmentMessage, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, messageKey, parameters); } - public UriParserSemanticException(String developmentMessage, Throwable cause, MessageKey messageKey, - String... parameters) { + public UriParserSemanticException(final String developmentMessage, final Throwable cause, + final MessageKey messageKey, + final String... parameters) { super(developmentMessage, cause, messageKey, parameters); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java index 1d4ce0a..2a18d5a 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java @@ -24,11 +24,16 @@ public class UriParserSyntaxException extends UriParserException { private static final long serialVersionUID = 5887744747812478226L; public static enum MessageKeys implements MessageKey { - /** parameter: segment */ MUST_BE_LAST_SEGMENT, - /** parameter: query-option name */ UNKNOWN_SYSTEM_QUERY_OPTION, - /** parameter: query-option name */ DOUBLE_SYSTEM_QUERY_OPTION, - /** parameters: query-option name, query-option value */ WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION, - /** parameter: $format option value */ WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION_FORMAT, + /** parameter: segment */ + MUST_BE_LAST_SEGMENT, + /** parameter: query-option name */ + UNKNOWN_SYSTEM_QUERY_OPTION, + /** parameter: query-option name */ + DOUBLE_SYSTEM_QUERY_OPTION, + /** parameters: query-option name, query-option value */ + WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION, + /** parameter: $format option value */ + WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION_FORMAT, SYSTEM_QUERY_OPTION_LEVELS_NOT_ALLOWED_HERE, SYNTAX; @@ -38,12 +43,13 @@ public class UriParserSyntaxException extends UriParserException { } } - public UriParserSyntaxException(String developmentMessage, MessageKey messageKey, String... parameters) { + public UriParserSyntaxException(final String developmentMessage, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, messageKey, parameters); } - public UriParserSyntaxException(String developmentMessage, Throwable cause, MessageKey messageKey, - String... parameters) { + public UriParserSyntaxException(final String developmentMessage, final Throwable cause, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, cause, messageKey, parameters); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java index 282a2bf..371377c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java @@ -21,5 +21,5 @@ package org.apache.olingo.server.core.uri.queryoption; import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption; public class CustomQueryOptionImpl extends QueryOptionImpl implements CustomQueryOption { -//No additional methods needed for now. + // No additional methods needed for now. } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java index f5b10e3..12985ee 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java @@ -18,6 +18,8 @@ */ package org.apache.olingo.server.core.uri.queryoption; +import java.util.List; + import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.server.api.uri.UriInfoResource; import org.apache.olingo.server.api.uri.queryoption.CountOption; @@ -32,8 +34,6 @@ import org.apache.olingo.server.api.uri.queryoption.SkipOption; import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind; import org.apache.olingo.server.api.uri.queryoption.TopOption; -import java.util.List; - public class ExpandItemImpl implements ExpandItem { private LevelsExpandOption levelsExpandOption; private FilterOption filterOption; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java index 33dbef5..6cedc15 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java @@ -18,13 +18,13 @@ */ package org.apache.olingo.server.core.uri.queryoption; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.server.api.uri.queryoption.ExpandItem; import org.apache.olingo.server.api.uri.queryoption.ExpandOption; import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind; -import java.util.ArrayList; -import java.util.List; - public class ExpandOptionImpl extends SystemQueryOptionImpl implements ExpandOption { List<ExpandItemImpl> expandItems = new ArrayList<ExpandItemImpl>(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java index c7f5c9f..a278682 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java @@ -18,13 +18,13 @@ */ package org.apache.olingo.server.core.uri.queryoption; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.server.api.uri.queryoption.OrderByItem; import org.apache.olingo.server.api.uri.queryoption.OrderByOption; import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind; -import java.util.ArrayList; -import java.util.List; - public class OrderByOptionImpl extends SystemQueryOptionImpl implements OrderByOption { private List<OrderByItemImpl> orders = new ArrayList<OrderByItemImpl>(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java index 393322f..b7ead9c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java @@ -18,13 +18,13 @@ */ package org.apache.olingo.server.core.uri.queryoption; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.server.api.uri.queryoption.SelectItem; import org.apache.olingo.server.api.uri.queryoption.SelectOption; import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind; -import java.util.ArrayList; -import java.util.List; - public class SelectOptionImpl extends SystemQueryOptionImpl implements SelectOption { private List<SelectItemImpl> selectItems; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java index 5c6250a..8f7df3a 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java @@ -18,15 +18,15 @@ */ package org.apache.olingo.server.core.uri.queryoption.expression; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.uri.queryoption.expression.Enumeration; import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException; import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor; -import java.util.ArrayList; -import java.util.List; - public class EnumerationImpl extends ExpressionImpl implements Enumeration { private EdmEnumType type; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java index ebf7834..c9cc707 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java @@ -21,5 +21,5 @@ package org.apache.olingo.server.core.uri.queryoption.expression; import org.apache.olingo.server.api.uri.queryoption.expression.Expression; public abstract class ExpressionImpl implements Expression { -//No additional methods needed for now. + // No additional methods needed for now. } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java index cd00904..7104a9f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java @@ -18,6 +18,9 @@ */ package org.apache.olingo.server.core.uri.queryoption.expression; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.uri.queryoption.expression.Expression; import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException; @@ -25,9 +28,6 @@ import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor import org.apache.olingo.server.api.uri.queryoption.expression.Method; import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind; -import java.util.ArrayList; -import java.util.List; - public class MethodImpl extends ExpressionImpl implements Method { private MethodKind method; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java index 9bba0c5..1546df4 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java @@ -59,13 +59,14 @@ public class UriValidationException extends ODataTranslatedException { return name(); } } - - public UriValidationException(String developmentMessage, MessageKey messageKey, String... parameters) { + + public UriValidationException(final String developmentMessage, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, messageKey, parameters); } - public UriValidationException(String developmentMessage, Throwable cause, MessageKey messageKey, - String... parameters) { + public UriValidationException(final String developmentMessage, final Throwable cause, final MessageKey messageKey, + final String... parameters) { super(developmentMessage, cause, messageKey, parameters); }
