[OLINGO-841] CleanUp ServerCore
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/371bf9a5 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/371bf9a5 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/371bf9a5 Branch: refs/heads/OLINGO-834_Filter_Parser Commit: 371bf9a55c4c35c80705c828fc5028494004c196 Parents: d4902f7 Author: Christian Amend <[email protected]> Authored: Fri Dec 18 13:44:20 2015 +0100 Committer: Christian Amend <[email protected]> Committed: Fri Dec 18 13:47:48 2015 +0100 ---------------------------------------------------------------------- .../olingo/server/core/ContentNegotiator.java | 18 +- .../server/core/ContentNegotiatorException.java | 4 +- .../server/core/DefaultRedirectProcessor.java | 4 +- .../olingo/server/core/ODataDispatcher.java | 132 +++++----- .../server/core/ODataExceptionHelper.java | 14 +- .../apache/olingo/server/core/ODataHandler.java | 18 +- .../server/core/ODataHandlerException.java | 6 +- .../server/core/ODataHttpHandlerImpl.java | 8 +- .../apache/olingo/server/core/ODataImpl.java | 10 +- .../olingo/server/core/RedirectProcessor.java | 4 +- .../olingo/server/core/ServiceMetadataImpl.java | 8 +- .../core/batchhandler/BatchFacadeImpl.java | 8 +- .../server/core/batchhandler/BatchHandler.java | 4 +- .../core/batchhandler/BatchPartHandler.java | 6 +- .../BatchReferenceRewriter.java | 4 +- .../core/debug/DebugResponseHelperImpl.java | 118 ++++----- .../olingo/server/core/debug/DebugTab.java | 5 +- .../olingo/server/core/debug/DebugTabBody.java | 12 +- .../server/core/debug/DebugTabRequest.java | 28 +-- .../server/core/debug/DebugTabResponse.java | 14 +- .../server/core/debug/DebugTabRuntime.java | 34 +-- .../server/core/debug/DebugTabServer.java | 14 +- .../server/core/debug/DebugTabStacktrace.java | 24 +- .../olingo/server/core/debug/DebugTabUri.java | 49 ++-- .../core/debug/ExpressionJsonVisitor.java | 12 +- .../server/core/debug/ServerCoreDebugger.java | 12 +- .../deserializer/DeserializerResultImpl.java | 4 +- .../FixedFormatDeserializerImpl.java | 10 +- .../core/deserializer/batch/BatchBodyPart.java | 8 +- .../deserializer/batch/BatchChangeSetPart.java | 4 +- .../deserializer/batch/BatchLineReader.java | 44 ++-- .../core/deserializer/batch/BatchParser.java | 10 +- .../deserializer/batch/BatchParserCommon.java | 14 +- .../core/deserializer/batch/BatchPart.java | 4 +- .../deserializer/batch/BatchQueryOperation.java | 4 +- .../batch/BatchRequestTransformator.java | 20 +- .../batch/BatchTransformatorCommon.java | 8 +- .../server/core/deserializer/batch/Header.java | 4 +- .../core/deserializer/batch/HeaderField.java | 4 +- .../batch/HttpRequestStatusLine.java | 6 +- .../server/core/deserializer/batch/Line.java | 4 +- .../deserializer/helper/ExpandTreeBuilder.java | 4 +- .../helper/ExpandTreeBuilderImpl.java | 4 +- .../json/ODataJsonDeserializer.java | 113 ++++----- .../deserializer/xml/ODataXmlDeserializer.java | 34 +-- .../olingo/server/core/etag/ETagHelperImpl.java | 8 +- .../server/core/etag/ETagInformation.java | 4 +- .../olingo/server/core/etag/ETagParser.java | 22 +- .../core/etag/PreconditionsValidator.java | 14 +- .../olingo/server/core/prefer/PreferParser.java | 40 +-- .../server/core/prefer/PreferencesImpl.java | 13 +- .../serializer/AbstractODataSerializer.java | 7 +- .../serializer/AsyncResponseSerializer.java | 18 +- .../serializer/BatchResponseSerializer.java | 45 ++-- .../serializer/FixedFormatSerializerImpl.java | 6 +- .../core/serializer/SerializerResultImpl.java | 4 +- .../serializer/json/ODataErrorSerializer.java | 4 +- .../serializer/json/ODataJsonSerializer.java | 94 +++---- .../json/ServiceDocumentJsonSerializer.java | 12 +- .../serializer/utils/CircleStreamBuffer.java | 4 +- .../serializer/utils/ContentTypeHelper.java | 16 +- .../serializer/utils/ContextURLBuilder.java | 22 +- .../core/serializer/utils/ContextURLHelper.java | 17 +- .../serializer/utils/ExpandSelectHelper.java | 4 +- .../xml/MetadataDocumentXmlSerializer.java | 38 +-- .../core/serializer/xml/ODataXmlSerializer.java | 27 ++- .../xml/ServiceDocumentXmlSerializer.java | 12 +- .../olingo/server/core/uri/UriHelperImpl.java | 8 +- .../olingo/server/core/uri/UriInfoImpl.java | 4 +- .../server/core/uri/UriParameterImpl.java | 4 +- .../server/core/uri/UriResourceActionImpl.java | 12 +- .../uri/UriResourceComplexPropertyImpl.java | 8 +- .../server/core/uri/UriResourceCountImpl.java | 8 +- .../core/uri/UriResourceEntitySetImpl.java | 9 +- .../core/uri/UriResourceFunctionImpl.java | 6 +- .../olingo/server/core/uri/UriResourceImpl.java | 4 +- .../server/core/uri/UriResourceItImpl.java | 8 +- .../core/uri/UriResourceLambdaAllImpl.java | 8 +- .../core/uri/UriResourceLambdaAnyImpl.java | 8 +- .../core/uri/UriResourceLambdaVarImpl.java | 8 +- .../uri/UriResourceNavigationPropertyImpl.java | 8 +- .../uri/UriResourcePrimitivePropertyImpl.java | 10 +- .../server/core/uri/UriResourceRefImpl.java | 7 +- .../server/core/uri/UriResourceRootImpl.java | 8 +- .../core/uri/UriResourceSingletonImpl.java | 8 +- .../uri/UriResourceStartingTypeFilterImpl.java | 8 +- .../server/core/uri/UriResourceTypedImpl.java | 5 +- .../server/core/uri/UriResourceValueImpl.java | 6 +- .../core/uri/UriResourceWithKeysImpl.java | 6 +- .../uri/parser/CheckFullContextListener.java | 4 +- .../olingo/server/core/uri/parser/Parser.java | 18 +- .../olingo/server/core/uri/parser/RawUri.java | 4 +- .../server/core/uri/parser/UriContext.java | 29 +-- .../server/core/uri/parser/UriDecoder.java | 10 +- .../core/uri/parser/UriParseTreeVisitor.java | 242 +++++++++---------- .../core/uri/parser/UriParserException.java | 4 +- .../uri/parser/UriParserSemanticException.java | 10 +- .../uri/parser/UriParserSyntaxException.java | 6 +- .../uri/parser/search/SearchBinaryImpl.java | 7 +- .../uri/parser/search/SearchExpressionImpl.java | 4 +- .../core/uri/parser/search/SearchParser.java | 60 ++--- .../parser/search/SearchParserException.java | 6 +- .../uri/parser/search/SearchQueryToken.java | 9 +- .../core/uri/parser/search/SearchTermImpl.java | 6 +- .../core/uri/parser/search/SearchTokenizer.java | 129 +++++----- .../parser/search/SearchTokenizerException.java | 6 +- .../core/uri/parser/search/SearchUnaryImpl.java | 6 +- .../uri/queryoption/AliasQueryOptionImpl.java | 4 +- .../core/uri/queryoption/CountOptionImpl.java | 4 +- .../uri/queryoption/CustomQueryOptionImpl.java | 4 +- .../core/uri/queryoption/ExpandItemImpl.java | 8 +- .../core/uri/queryoption/ExpandOptionImpl.java | 4 +- .../core/uri/queryoption/FilterOptionImpl.java | 4 +- .../core/uri/queryoption/FormatOptionImpl.java | 4 +- .../core/uri/queryoption/IdOptionImpl.java | 4 +- .../core/uri/queryoption/LevelsOptionImpl.java | 4 +- .../core/uri/queryoption/OrderByItemImpl.java | 4 +- .../core/uri/queryoption/OrderByOptionImpl.java | 4 +- .../core/uri/queryoption/QueryOptionImpl.java | 4 +- .../core/uri/queryoption/SearchOptionImpl.java | 6 +- .../core/uri/queryoption/SelectItemImpl.java | 4 +- .../core/uri/queryoption/SelectOptionImpl.java | 4 +- .../core/uri/queryoption/SkipOptionImpl.java | 4 +- .../uri/queryoption/SkipTokenOptionImpl.java | 4 +- .../uri/queryoption/SystemQueryOptionImpl.java | 4 +- .../core/uri/queryoption/TopOptionImpl.java | 4 +- .../uri/queryoption/expression/AliasImpl.java | 4 +- .../uri/queryoption/expression/BinaryImpl.java | 4 +- .../queryoption/expression/EnumerationImpl.java | 4 +- .../queryoption/expression/ExpressionImpl.java | 4 +- .../queryoption/expression/LambdaRefImpl.java | 4 +- .../uri/queryoption/expression/LiteralImpl.java | 4 +- .../uri/queryoption/expression/MemberImpl.java | 4 +- .../uri/queryoption/expression/MethodImpl.java | 4 +- .../queryoption/expression/TypeLiteralImpl.java | 4 +- .../uri/queryoption/expression/UnaryImpl.java | 4 +- .../uri/validator/UriValidationException.java | 7 +- .../server/core/uri/validator/UriValidator.java | 239 +++++++++--------- .../server/core/ContentNegotiatorTest.java | 8 +- .../olingo/server/core/ExceptionHelperTest.java | 6 +- .../server/core/ODataHttpHandlerImplTest.java | 6 +- .../olingo/server/core/ODataImplTest.java | 4 +- .../core/TranslatedExceptionSubclassesTest.java | 4 +- .../batchhandler/MockedBatchHandlerTest.java | 4 +- .../server/core/debug/AbstractDebugTabTest.java | 8 +- .../server/core/debug/DebugTabBodyTest.java | 4 +- .../server/core/debug/DebugTabRequestTest.java | 4 +- .../server/core/debug/DebugTabResponseTest.java | 4 +- .../server/core/debug/DebugTabServerTest.java | 6 +- .../core/debug/ServerCoreDebuggerTest.java | 6 +- .../FixedFormatDeserializerTest.java | 4 +- .../deserializer/batch/BatchLineReaderTest.java | 4 +- .../batch/BatchParserCommonTest.java | 4 +- .../batch/BatchRequestParserTest.java | 16 +- .../core/deserializer/batch/HeaderTest.java | 4 +- .../batch/HttpRequestStatusLineTest.java | 4 +- .../json/ODataJsonDeserializerBasicTest.java | 4 +- .../olingo/server/core/etag/ETagHelperTest.java | 4 +- .../olingo/server/core/etag/ETagParserTest.java | 4 +- .../server/core/prefer/PreferencesTest.java | 8 +- .../serializer/AsyncResponseSerializerTest.java | 18 +- .../serializer/BatchResponseSerializerTest.java | 20 +- .../serializer/FixedFormatSerializerTest.java | 4 +- .../json/ServerErrorSerializerTest.java | 8 +- .../utils/CircleStreamBufferTest.java | 5 +- .../serializer/utils/ContextURLBuilderTest.java | 4 +- .../xml/MetadataDocumentXmlSerializerTest.java | 205 ++++++++-------- .../xml/ServerErrorXmlSerializerTest.java | 18 +- .../xml/ServiceDocumentXmlSerializerTest.java | 24 +- .../search/SearchParserAndTokenizerTest.java | 119 +++++---- .../uri/parser/search/SearchParserTest.java | 17 +- .../uri/parser/search/SearchTokenizerTest.java | 113 ++++----- 172 files changed, 1550 insertions(+), 1518 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java index e47d864..86697d5 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.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 @@ -65,10 +65,10 @@ public final class ContentNegotiator { private static List<ContentType> getSupportedContentTypes( final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType) - throws ContentNegotiatorException { + throws ContentNegotiatorException { final List<ContentType> defaultSupportedContentTypes = getDefaultSupportedContentTypes(representationType); final List<ContentType> result = customContentTypeSupport == null ? defaultSupportedContentTypes : - customContentTypeSupport.modifySupportedContentTypes(defaultSupportedContentTypes, representationType); + customContentTypeSupport.modifySupportedContentTypes(defaultSupportedContentTypes, representationType); if (result == null || result.isEmpty()) { throw new ContentNegotiatorException("No content type has been specified as supported.", ContentNegotiatorException.MessageKeys.NO_CONTENT_TYPE_SUPPORTED); @@ -79,7 +79,7 @@ public final class ContentNegotiator { public static ContentType doContentNegotiation(final FormatOption formatOption, final ODataRequest request, final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType) - throws ContentNegotiatorException { + throws ContentNegotiatorException { final List<ContentType> supportedContentTypes = getSupportedContentTypes(customContentTypeSupport, representationType); final String acceptHeaderValue = request.getHeader(HttpHeader.ACCEPT); @@ -93,7 +93,7 @@ public final class ContentNegotiator { result = getAcceptedType( AcceptType.fromContentType(contentType == null ? ContentType.create(formatOption.getFormat()) : contentType), - supportedContentTypes); + supportedContentTypes); } catch (final IllegalArgumentException e) { // Exception results in result = null for next check. } @@ -127,8 +127,8 @@ public final class ContentNegotiator { private static ContentType mapContentType(final String formatString) { return JSON.equalsIgnoreCase(formatString) ? ContentType.JSON : - XML.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_XML : - ATOM.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_ATOM_XML : null; + XML.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_XML : + ATOM.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_ATOM_XML : null; } private static ContentType getAcceptedType(final List<AcceptType> acceptedContentTypes, @@ -164,7 +164,7 @@ public final class ContentNegotiator { public static void checkSupport(final ContentType contentType, final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType) - throws ContentNegotiatorException { + throws ContentNegotiatorException { for (ContentType supportedContentType : getSupportedContentTypes(customContentTypeSupport, representationType)) { if (AcceptType.fromContentType(supportedContentType).get(0).matches(contentType)) { return; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java index a76c549..12a0582 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java index efe3e71..a6460fa 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java index bbe73e0..4971c8e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.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 @@ -77,32 +77,32 @@ public class ODataDispatcher { private final UriInfo uriInfo; private final ODataHandler handler; - public ODataDispatcher(UriInfo uriInfo, ODataHandler handler) { + public ODataDispatcher(final UriInfo uriInfo, final ODataHandler handler) { this.uriInfo = uriInfo; this.handler = handler; } - public void dispatch(ODataRequest request, ODataResponse response) throws ODataApplicationException, - ODataLibraryException { + public void dispatch(final ODataRequest request, final ODataResponse response) throws ODataApplicationException, + ODataLibraryException { switch (uriInfo.getKind()) { case metadata: checkMethod(request.getMethod(), HttpMethod.GET); final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.METADATA); handler.selectProcessor(MetadataProcessor.class) - .readMetadata(request, response, uriInfo, requestedContentType); + .readMetadata(request, response, uriInfo, requestedContentType); break; case service: checkMethod(request.getMethod(), HttpMethod.GET); if ("".equals(request.getRawODataPath())) { handler.selectProcessor(RedirectProcessor.class) - .redirect(request, response); + .redirect(request, response); } else { final ContentType serviceContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.SERVICE); handler.selectProcessor(ServiceDocumentProcessor.class) - .readServiceDocument(request, response, uriInfo, serviceContentType); + .readServiceDocument(request, response, uriInfo, serviceContentType); } break; @@ -113,7 +113,7 @@ public class ODataDispatcher { case batch: checkMethod(request.getMethod(), HttpMethod.POST); new BatchHandler(handler, handler.selectProcessor(BatchProcessor.class)) - .process(request, response, true); + .process(request, response, true); break; default: @@ -211,7 +211,7 @@ public class ODataDispatcher { final EdmReturnType returnType = action.getReturnType(); if (returnType == null) { handler.selectProcessor(ActionVoidProcessor.class) - .processActionVoid(request, response, uriInfo, requestFormat); + .processActionVoid(request, response, uriInfo, requestFormat); } else { final boolean isCollection = returnType.isCollection(); ContentType responseFormat; @@ -222,10 +222,10 @@ public class ODataDispatcher { isCollection ? RepresentationType.COLLECTION_ENTITY : RepresentationType.ENTITY); if (isCollection) { handler.selectProcessor(ActionEntityCollectionProcessor.class) - .processActionEntityCollection(request, response, uriInfo, requestFormat, responseFormat); + .processActionEntityCollection(request, response, uriInfo, requestFormat, responseFormat); } else { handler.selectProcessor(ActionEntityProcessor.class) - .processActionEntity(request, response, uriInfo, requestFormat, responseFormat); + .processActionEntity(request, response, uriInfo, requestFormat, responseFormat); } break; @@ -235,10 +235,10 @@ public class ODataDispatcher { isCollection ? RepresentationType.COLLECTION_PRIMITIVE : RepresentationType.PRIMITIVE); if (isCollection) { handler.selectProcessor(ActionPrimitiveCollectionProcessor.class) - .processActionPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); + .processActionPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); } else { handler.selectProcessor(ActionPrimitiveProcessor.class) - .processActionPrimitive(request, response, uriInfo, requestFormat, responseFormat); + .processActionPrimitive(request, response, uriInfo, requestFormat, responseFormat); } break; @@ -248,10 +248,10 @@ public class ODataDispatcher { isCollection ? RepresentationType.COLLECTION_COMPLEX : RepresentationType.COMPLEX); if (isCollection) { handler.selectProcessor(ActionComplexCollectionProcessor.class) - .processActionComplexCollection(request, response, uriInfo, requestFormat, responseFormat); + .processActionComplexCollection(request, response, uriInfo, requestFormat, responseFormat); } else { handler.selectProcessor(ActionComplexProcessor.class) - .processActionComplex(request, response, uriInfo, requestFormat, responseFormat); + .processActionComplex(request, response, uriInfo, requestFormat, responseFormat); } break; @@ -273,13 +273,13 @@ public class ODataDispatcher { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.COLLECTION_REFERENCE); handler.selectProcessor(ReferenceCollectionProcessor.class) - .readReferenceCollection(request, response, uriInfo, responseFormat); + .readReferenceCollection(request, response, uriInfo, responseFormat); } else if (isCollection && httpMethod == HttpMethod.POST) { final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), RepresentationType.REFERENCE, true); handler.selectProcessor(ReferenceProcessor.class) - .createReference(request, response, uriInfo, requestFormat); + .createReference(request, response, uriInfo, requestFormat); } else if (!isCollection && httpMethod == HttpMethod.GET) { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), @@ -290,11 +290,11 @@ public class ODataDispatcher { final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), RepresentationType.REFERENCE, true); handler.selectProcessor(ReferenceProcessor.class) - .updateReference(request, response, uriInfo, requestFormat); + .updateReference(request, response, uriInfo, requestFormat); } else if (httpMethod == HttpMethod.DELETE) { handler.selectProcessor(ReferenceProcessor.class) - .deleteReference(request, response, uriInfo); + .deleteReference(request, response, uriInfo); } else { throwMethodNotAllowed(httpMethod); @@ -310,47 +310,47 @@ public class ODataDispatcher { && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.PRIMITIVE) { final EdmType type = resource instanceof UriResourceProperty ? ((UriResourceProperty) resource).getType() : ((UriResourceFunction) resource).getType(); - final RepresentationType valueRepresentationType = - type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary) ? - RepresentationType.BINARY : RepresentationType.VALUE; - if (method == HttpMethod.GET) { - final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), - request, handler.getCustomContentTypeSupport(), valueRepresentationType); - - handler.selectProcessor(PrimitiveValueProcessor.class) + final RepresentationType valueRepresentationType = + type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary) ? + RepresentationType.BINARY : RepresentationType.VALUE; + if (method == HttpMethod.GET) { + final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), + request, handler.getCustomContentTypeSupport(), valueRepresentationType); + + handler.selectProcessor(PrimitiveValueProcessor.class) .readPrimitiveValue(request, response, uriInfo, requestedContentType); - } else if (method == HttpMethod.PUT && resource instanceof UriResourceProperty) { - validatePreconditions(request, false); - final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), - valueRepresentationType, true); - final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), - request, handler.getCustomContentTypeSupport(), valueRepresentationType); - handler.selectProcessor(PrimitiveValueProcessor.class) + } else if (method == HttpMethod.PUT && resource instanceof UriResourceProperty) { + validatePreconditions(request, false); + final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), + valueRepresentationType, true); + final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), + request, handler.getCustomContentTypeSupport(), valueRepresentationType); + handler.selectProcessor(PrimitiveValueProcessor.class) .updatePrimitiveValue(request, response, uriInfo, requestFormat, responseFormat); - } else if (method == HttpMethod.DELETE && resource instanceof UriResourceProperty) { - validatePreconditions(request, false); - handler.selectProcessor(PrimitiveValueProcessor.class) + } else if (method == HttpMethod.DELETE && resource instanceof UriResourceProperty) { + validatePreconditions(request, false); + handler.selectProcessor(PrimitiveValueProcessor.class) .deletePrimitiveValue(request, response, uriInfo); - } else { - throwMethodNotAllowed(method); - } + } else { + throwMethodNotAllowed(method); + } } else { if (method == HttpMethod.GET) { final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.MEDIA); handler.selectProcessor(MediaEntityProcessor.class) - .readMediaEntity(request, response, uriInfo, requestedContentType); + .readMediaEntity(request, response, uriInfo, requestedContentType); } else if (method == HttpMethod.PUT && resource instanceof UriResourceEntitySet) { validatePreconditions(request, true); final ContentType requestFormat = ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE)); final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY); handler.selectProcessor(MediaEntityProcessor.class) - .updateMediaEntity(request, response, uriInfo, requestFormat, responseFormat); + .updateMediaEntity(request, response, uriInfo, requestFormat, responseFormat); } else if (method == HttpMethod.DELETE && resource instanceof UriResourceEntitySet) { validatePreconditions(request, true); handler.selectProcessor(MediaEntityProcessor.class) - .deleteMediaEntity(request, response, uriInfo); + .deleteMediaEntity(request, response, uriInfo); } else { throwMethodNotAllowed(method); } @@ -367,10 +367,10 @@ public class ODataDispatcher { request, handler.getCustomContentTypeSupport(), complexRepresentationType); if (isCollection) { handler.selectProcessor(ComplexCollectionProcessor.class) - .readComplexCollection(request, response, uriInfo, requestedContentType); + .readComplexCollection(request, response, uriInfo, requestedContentType); } else { handler.selectProcessor(ComplexProcessor.class) - .readComplex(request, response, uriInfo, requestedContentType); + .readComplex(request, response, uriInfo, requestedContentType); } } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) { validatePreconditions(request, false); @@ -380,19 +380,19 @@ public class ODataDispatcher { request, handler.getCustomContentTypeSupport(), complexRepresentationType); if (isCollection) { handler.selectProcessor(ComplexCollectionProcessor.class) - .updateComplexCollection(request, response, uriInfo, requestFormat, responseFormat); + .updateComplexCollection(request, response, uriInfo, requestFormat, responseFormat); } else { handler.selectProcessor(ComplexProcessor.class) - .updateComplex(request, response, uriInfo, requestFormat, responseFormat); + .updateComplex(request, response, uriInfo, requestFormat, responseFormat); } } else if (method == HttpMethod.DELETE) { validatePreconditions(request, false); if (isCollection) { handler.selectProcessor(ComplexCollectionProcessor.class) - .deleteComplexCollection(request, response, uriInfo); + .deleteComplexCollection(request, response, uriInfo); } else { handler.selectProcessor(ComplexProcessor.class) - .deleteComplex(request, response, uriInfo); + .deleteComplex(request, response, uriInfo); } } else { throwMethodNotAllowed(method); @@ -409,10 +409,10 @@ public class ODataDispatcher { request, handler.getCustomContentTypeSupport(), representationType); if (isCollection) { handler.selectProcessor(PrimitiveCollectionProcessor.class) - .readPrimitiveCollection(request, response, uriInfo, requestedContentType); + .readPrimitiveCollection(request, response, uriInfo, requestedContentType); } else { handler.selectProcessor(PrimitiveProcessor.class) - .readPrimitive(request, response, uriInfo, requestedContentType); + .readPrimitive(request, response, uriInfo, requestedContentType); } } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) { validatePreconditions(request, false); @@ -422,19 +422,19 @@ public class ODataDispatcher { request, handler.getCustomContentTypeSupport(), representationType); if (isCollection) { handler.selectProcessor(PrimitiveCollectionProcessor.class) - .updatePrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); + .updatePrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); } else { handler.selectProcessor(PrimitiveProcessor.class) - .updatePrimitive(request, response, uriInfo, requestFormat, responseFormat); + .updatePrimitive(request, response, uriInfo, requestFormat, responseFormat); } } else if (method == HttpMethod.DELETE) { validatePreconditions(request, false); if (isCollection) { handler.selectProcessor(PrimitiveCollectionProcessor.class) - .deletePrimitiveCollection(request, response, uriInfo); + .deletePrimitiveCollection(request, response, uriInfo); } else { handler.selectProcessor(PrimitiveProcessor.class) - .deletePrimitive(request, response, uriInfo); + .deletePrimitive(request, response, uriInfo); } } else { throwMethodNotAllowed(method); @@ -449,15 +449,15 @@ public class ODataDispatcher { || resource instanceof UriResourceFunction && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.ENTITY) { handler.selectProcessor(CountEntityCollectionProcessor.class) - .countEntityCollection(request, response, uriInfo); + .countEntityCollection(request, response, uriInfo); } else if (resource instanceof UriResourcePrimitiveProperty || resource instanceof UriResourceFunction && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.PRIMITIVE) { handler.selectProcessor(CountPrimitiveCollectionProcessor.class) - .countPrimitiveCollection(request, response, uriInfo); + .countPrimitiveCollection(request, response, uriInfo); } else { handler.selectProcessor(CountComplexCollectionProcessor.class) - .countComplexCollection(request, response, uriInfo); + .countComplexCollection(request, response, uriInfo); } } @@ -469,19 +469,19 @@ public class ODataDispatcher { final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.COLLECTION_ENTITY); handler.selectProcessor(EntityCollectionProcessor.class) - .readEntityCollection(request, response, uriInfo, requestedContentType); + .readEntityCollection(request, response, uriInfo, requestedContentType); } else if (method == HttpMethod.POST) { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY); if (isMedia) { final ContentType requestFormat = ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE)); handler.selectProcessor(MediaEntityProcessor.class) - .createMediaEntity(request, response, uriInfo, requestFormat, responseFormat); + .createMediaEntity(request, response, uriInfo, requestFormat, responseFormat); } else { final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), RepresentationType.ENTITY, true); handler.selectProcessor(EntityProcessor.class) - .createEntity(request, response, uriInfo, requestFormat, responseFormat); + .createEntity(request, response, uriInfo, requestFormat, responseFormat); } } else { throwMethodNotAllowed(method); @@ -491,7 +491,7 @@ public class ODataDispatcher { final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY); handler.selectProcessor(EntityProcessor.class) - .readEntity(request, response, uriInfo, requestedContentType); + .readEntity(request, response, uriInfo, requestedContentType); } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) { validatePreconditions(request, false); final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE), @@ -499,11 +499,11 @@ public class ODataDispatcher { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY); handler.selectProcessor(EntityProcessor.class) - .updateEntity(request, response, uriInfo, requestFormat, responseFormat); + .updateEntity(request, response, uriInfo, requestFormat, responseFormat); } else if (method == HttpMethod.DELETE) { validatePreconditions(request, false); handler.selectProcessor(isMedia ? MediaEntityProcessor.class : EntityProcessor.class) - .deleteEntity(request, response, uriInfo); + .deleteEntity(request, response, uriInfo); } else { throwMethodNotAllowed(method); } @@ -537,7 +537,7 @@ public class ODataDispatcher { private ContentType getSupportedContentType(final String contentTypeHeader, final RepresentationType representationType, final boolean mustNotBeNull) - throws ODataHandlerException, ContentNegotiatorException { + throws ODataHandlerException, ContentNegotiatorException { if (contentTypeHeader == null) { if (mustNotBeNull) { throw new ODataHandlerException(contentTypeHeader, ODataHandlerException.MessageKeys.MISSING_CONTENT_TYPE); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java index 2de59d5..47896c9 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.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 @@ -21,10 +21,10 @@ package org.apache.olingo.server.core; import java.util.Locale; import org.apache.olingo.commons.api.http.HttpStatusCode; -import org.apache.olingo.server.api.ODataServerError; import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataLibraryException; import org.apache.olingo.server.api.ODataLibraryException.ODataErrorMessage; +import org.apache.olingo.server.api.ODataServerError; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.etag.PreconditionException; import org.apache.olingo.server.api.serializer.SerializerException; @@ -34,9 +34,9 @@ import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException; import org.apache.olingo.server.core.uri.validator.UriValidationException; public class ODataExceptionHelper { - + private ODataExceptionHelper() { - //Private Constructor + // Private Constructor } public static ODataServerError createServerErrorObject(final UriValidationException e, @@ -52,7 +52,7 @@ public class ODataExceptionHelper { if (UriParserSemanticException.MessageKeys.RESOURCE_NOT_FOUND.equals(e.getMessageKey()) || UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE.equals(e.getMessageKey())) { serverError.setStatusCode(HttpStatusCode.NOT_FOUND.getStatusCode()); - } else if(UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED.equals(e.getMessageKey())) { + } else if (UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED.equals(e.getMessageKey())) { serverError.setStatusCode(HttpStatusCode.NOT_IMPLEMENTED.getStatusCode()); } else { serverError.setStatusCode(HttpStatusCode.BAD_REQUEST.getStatusCode()); @@ -66,7 +66,7 @@ public class ODataExceptionHelper { serverError.setStatusCode( UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION_FORMAT.equals(e.getMessageKey()) ? HttpStatusCode.NOT_ACCEPTABLE.getStatusCode() : - HttpStatusCode.BAD_REQUEST.getStatusCode()); + HttpStatusCode.BAD_REQUEST.getStatusCode()); return serverError; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java index 12f2dfd..52c98d1 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.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 @@ -63,7 +63,7 @@ public class ODataHandler { private UriInfo uriInfo; private Exception lastThrownException; - public ODataHandler(final OData server, final ServiceMetadata serviceMetadata, ServerCoreDebugger debugger) { + public ODataHandler(final OData server, final ServiceMetadata serviceMetadata, final ServerCoreDebugger debugger) { odata = server; this.serviceMetadata = serviceMetadata; this.debugger = debugger; @@ -159,8 +159,8 @@ public class ODataHandler { } public void handleException(final ODataRequest request, final ODataResponse response, - final ODataServerError serverError, Exception exception) { - this.lastThrownException = exception; + final ODataServerError serverError, final Exception exception) { + lastThrownException = exception; ErrorProcessor exceptionProcessor; try { exceptionProcessor = selectProcessor(ErrorProcessor.class); @@ -172,7 +172,7 @@ public class ODataHandler { try { requestedContentType = ContentNegotiator.doContentNegotiation( uriInfo == null ? null : uriInfo.getFormatOption(), request, getCustomContentTypeSupport(), - RepresentationType.ERROR); + RepresentationType.ERROR); } catch (final ContentNegotiatorException e) { requestedContentType = ContentType.JSON; } @@ -184,8 +184,8 @@ public class ODataHandler { private void validateODataVersion(final ODataRequest request) throws ODataHandlerException { final String maxVersion = request.getHeader(HttpHeader.ODATA_MAX_VERSION); if (maxVersion != null && ODataServiceVersion.isBiggerThan(ODataServiceVersion.V40.toString(), maxVersion)) { - throw new ODataHandlerException("ODataVersion not supported: " + maxVersion, - ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED, maxVersion); + throw new ODataHandlerException("ODataVersion not supported: " + maxVersion, + ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED, maxVersion); } } @@ -212,7 +212,7 @@ public class ODataHandler { return customContentTypeSupport; } - public void register(CustomETagSupport customETagSupport) { + public void register(final CustomETagSupport customETagSupport) { this.customETagSupport = customETagSupport; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java index 82afe97..acf7c38 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.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 @@ -59,7 +59,7 @@ public class ODataHandlerException extends ODataLibraryException { final String... parameters) { super(developmentMessage, cause, messageKey, parameters); } - + @Override protected String getBundleName() { return DEFAULT_SERVER_BUNDLE_NAME; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java index 1624943..55c1194 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.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 @@ -98,7 +98,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler { convertToHttp(response, odResponse); } - private Map<String, String> createEnvironmentVariablesMap(HttpServletRequest request) { + private Map<String, String> createEnvironmentVariablesMap(final HttpServletRequest request) { Map<String, String> environment = new LinkedHashMap<String, String>(); environment.put("authType", request.getAuthType()); environment.put("localAddr", request.getLocalAddr()); @@ -184,7 +184,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler { } } - private ODataRequest fillODataRequest(ODataRequest odRequest, final HttpServletRequest httpRequest, + private ODataRequest fillODataRequest(final ODataRequest odRequest, final HttpServletRequest httpRequest, final int split) throws ODataLibraryException { final int requestHandle = debugger.startRuntimeMeasurement("ODataHttpHandlerImpl", "fillODataRequest"); try { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java index ad7d410..4c2642c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.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 @@ -139,9 +139,9 @@ public class ODataImpl extends OData { } @Override - public DebugResponseHelper createDebugResponseHelper(String debugFormat) { - //TODO: What should we do with invalid formats? - //TODO: Support more debug formats + public DebugResponseHelper createDebugResponseHelper(final String debugFormat) { + // TODO: What should we do with invalid formats? + // TODO: Support more debug formats return new DebugResponseHelperImpl(debugFormat); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java index 4e99d31..f5aec43 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java index 9fb080b..4f07af0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.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 @@ -38,8 +38,8 @@ public class ServiceMetadataImpl implements ServiceMetadata { private final List<EdmxReference> references; private final ServiceMetadataETagSupport serviceMetadataETagSupport; - public ServiceMetadataImpl(CsdlEdmProvider edmProvider, List<EdmxReference> references, - ServiceMetadataETagSupport serviceMetadataETagSupport) { + public ServiceMetadataImpl(final CsdlEdmProvider edmProvider, final List<EdmxReference> references, + final ServiceMetadataETagSupport serviceMetadataETagSupport) { edm = new EdmProviderImpl(edmProvider); this.references = new ArrayList<EdmxReference>(); this.references.addAll(references); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java index 9bb042d..9fe52c8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.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 @@ -40,13 +40,13 @@ public class BatchFacadeImpl implements BatchFacade { @Override public ODataResponse handleODataRequest(final ODataRequest request) throws ODataApplicationException, - ODataLibraryException { + ODataLibraryException { return partHandler.handleODataRequest(request); } @Override public ODataResponsePart handleBatchRequest(final BatchRequestPart request) throws ODataApplicationException, - ODataLibraryException { + ODataLibraryException { return partHandler.handleBatchRequest(request); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java index 18cc69b..ca253dc 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java index 653fd5f..712ff3e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.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 @@ -84,7 +84,7 @@ public class BatchPartHandler { } private ODataResponsePart handleChangeSet(final BatchRequestPart request) throws ODataApplicationException, - ODataLibraryException { + ODataLibraryException { return batchProcessor.processChangeSet(batchFacade, request.getRequests()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java index a05b1e9..c4f8d59 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java index 3fc797b..5ee63b8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.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 @@ -52,7 +52,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper { private final DebugFormat requestedFormat; - public DebugResponseHelperImpl(String debugFormat) { + public DebugResponseHelperImpl(final String debugFormat) { if (DebugSupport.ODATA_DEBUG_HTML.equals(debugFormat)) { requestedFormat = DebugFormat.HTML; } else if (DebugSupport.ODATA_DEBUG_DOWNLOAD.equals(debugFormat)) { @@ -181,7 +181,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper { } /** - * Gets version field information for response. Result is never null. + * Gets version field information for response. Result is never null. * @return version field information */ protected static String getVersion() { @@ -196,61 +196,61 @@ public class DebugResponseHelperImpl implements DebugResponseHelper { StringWriter writer = new StringWriter(); writer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n") - .append(" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n") - .append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n") - .append("<head>\n") - .append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n") - .append("<title>") - .append(escapeHtml(title)) - .append("</title>\n") - .append("<style type=\"text/css\">\n") - .append("body { font-family: Arial, sans-serif; font-size: 13px;\n") - .append(" line-height: 16px; margin: 0;\n") - .append(" background-color: #eeeeee; color: #333333; }\n") - .append(".header { float: left; }\n") - .append(".header a { line-height: 22px; padding: 10px 18px;\n") - .append(" text-decoration: none; color: #333333; }\n") - .append(":target, .header:nth-last-child(2) { background-color: #cccccc; }\n") - .append(":target ~ .header:nth-last-child(2) { background-color: inherit; }\n") - .append(".header:focus, .header:hover,\n") - .append(" .header:nth-last-child(2):focus, .header:nth-last-child(2):hover\n") - .append(" { background-color: #999999; }\n") - .append(".section { position: absolute; top: 42px; min-width: 100%;\n") - .append(" padding-top: 18px; border-top: 1px solid #dddddd; }\n") - .append(".section > * { margin-left: 18px; }\n") - .append(":target + .section, .section:last-child { display: block; }\n") - .append(".section, :target + .section ~ .section { display: none; }\n") - .append("h1 { font-size: 18px; font-weight: normal; margin: 10px 0; }\n") - .append("h2 { font-size: 15px; }\n") - .append("h2:not(:first-child) { margin-top: 2em; }\n") - .append("table { border-collapse: collapse; border-spacing: 0;\n") - .append(" margin-top: 1.5em; }\n") - .append("table, thead { border-width: 1px 0; border-style: solid;\n") - .append(" border-color: #dddddd; text-align: left; }\n") - .append("th.name, td.name { padding: 1ex 2em 1ex 0; }\n") - .append("tbody > tr:hover { background-color: #cccccc; }\n") - .append(".code { font-family: \"Courier New\", monospace; }\n") - .append(".code, .tree li { line-height: 15px; }\n") - .append("ul, .tree { padding-left: 0; list-style-type: none; }\n") - .append(".null, .numeric { padding-left: 1.5em; }\n") - .append(".json { white-space: pre-wrap; }\n") - .append("</style>\n") - .append("</head>\n") - .append("<body>\n"); + .append(" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n") + .append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n") + .append("<head>\n") + .append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n") + .append("<title>") + .append(escapeHtml(title)) + .append("</title>\n") + .append("<style type=\"text/css\">\n") + .append("body { font-family: Arial, sans-serif; font-size: 13px;\n") + .append(" line-height: 16px; margin: 0;\n") + .append(" background-color: #eeeeee; color: #333333; }\n") + .append(".header { float: left; }\n") + .append(".header a { line-height: 22px; padding: 10px 18px;\n") + .append(" text-decoration: none; color: #333333; }\n") + .append(":target, .header:nth-last-child(2) { background-color: #cccccc; }\n") + .append(":target ~ .header:nth-last-child(2) { background-color: inherit; }\n") + .append(".header:focus, .header:hover,\n") + .append(" .header:nth-last-child(2):focus, .header:nth-last-child(2):hover\n") + .append(" { background-color: #999999; }\n") + .append(".section { position: absolute; top: 42px; min-width: 100%;\n") + .append(" padding-top: 18px; border-top: 1px solid #dddddd; }\n") + .append(".section > * { margin-left: 18px; }\n") + .append(":target + .section, .section:last-child { display: block; }\n") + .append(".section, :target + .section ~ .section { display: none; }\n") + .append("h1 { font-size: 18px; font-weight: normal; margin: 10px 0; }\n") + .append("h2 { font-size: 15px; }\n") + .append("h2:not(:first-child) { margin-top: 2em; }\n") + .append("table { border-collapse: collapse; border-spacing: 0;\n") + .append(" margin-top: 1.5em; }\n") + .append("table, thead { border-width: 1px 0; border-style: solid;\n") + .append(" border-color: #dddddd; text-align: left; }\n") + .append("th.name, td.name { padding: 1ex 2em 1ex 0; }\n") + .append("tbody > tr:hover { background-color: #cccccc; }\n") + .append(".code { font-family: \"Courier New\", monospace; }\n") + .append(".code, .tree li { line-height: 15px; }\n") + .append("ul, .tree { padding-left: 0; list-style-type: none; }\n") + .append(".null, .numeric { padding-left: 1.5em; }\n") + .append(".json { white-space: pre-wrap; }\n") + .append("</style>\n") + .append("</head>\n") + .append("<body>\n"); char count = '0'; for (final DebugTab part : parts) { writer.append("<div class=\"header\" id=\"sec").append(++count).append("\">\n") - .append("<h1><a href=\"#sec").append(count).append("\">") - .append(part.getName()) - .append("</a></h1>\n") - .append("</div>\n") - .append("<div class=\"section\">\n"); + .append("<h1><a href=\"#sec").append(count).append("\">") + .append(part.getName()) + .append("</a></h1>\n") + .append("</div>\n") + .append("<div class=\"section\">\n"); part.appendHtml(writer); writer.append("</div>\n"); } writer.append("</body>\n") - .append("</html>\n") - .close(); + .append("</html>\n") + .close(); byte[] bytes = writer.toString().getBytes("UTF-8"); return new ByteArrayInputStream(bytes); } @@ -259,7 +259,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper { return value == null ? null : value.replace("&", "&").replace("<", "<").replace(">", ">"); } - protected static void appendJsonTable(JsonGenerator gen, final Map<String, String> entries) + protected static void appendJsonTable(final JsonGenerator gen, final Map<String, String> entries) throws IOException { if (entries == null || entries.isEmpty()) { gen.writeNull(); @@ -277,16 +277,16 @@ public class DebugResponseHelperImpl implements DebugResponseHelper { } } - protected static void appendHtmlTable(Writer writer, final Map<String, String> entries) throws IOException { + protected static void appendHtmlTable(final Writer writer, final Map<String, String> entries) throws IOException { writer.append("<table>\n<thead>\n") - .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n") - .append("</thead>\n<tbody>\n"); + .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n") + .append("</thead>\n<tbody>\n"); if (entries != null && !entries.isEmpty()) { for (final String name : entries.keySet()) { writer.append("<tr><td class=\"name\">").append(name).append("</td>") - .append("<td class=\"value\">") - .append(escapeHtml(entries.get(name))) - .append("</td></tr>\n"); + .append("<td class=\"value\">") + .append(escapeHtml(entries.get(name))) + .append("</td></tr>\n"); } } writer.append("</tbody>\n</table>\n"); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java index 76384b0..ede8f98 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.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 @@ -23,7 +23,6 @@ import java.io.Writer; import com.fasterxml.jackson.core.JsonGenerator; - /** * Debug information. */ http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java index c75b6f6..b0c5314 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.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 @@ -70,7 +70,7 @@ public class DebugTabBody implements DebugTab { return "Body"; } -// + // @Override public void appendJson(final JsonGenerator gen) throws IOException { if (response == null || response.getContent() == null) { @@ -118,8 +118,8 @@ public class DebugTabBody implements DebugTab { break; case IMAGE: writer.append("<img src=\"data:").append(response.getHeader(HttpHeader.CONTENT_TYPE)).append(";base64,") - .append(body) - .append("\" />\n"); + .append(body) + .append("\" />\n"); break; case TEXT: default: @@ -130,7 +130,7 @@ public class DebugTabBody implements DebugTab { } } - private byte[] streamToBytes(InputStream input) { + private byte[] streamToBytes(final InputStream input) { if (input != null) { try { return new FixedFormatDeserializerImpl().binary(input); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java index 4f9bc5c..e208417 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.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 @@ -39,7 +39,7 @@ public class DebugTabRequest implements DebugTab { private final String protocol; private final Map<String, List<String>> headers; - public DebugTabRequest(ODataRequest request) { + public DebugTabRequest(final ODataRequest request) { if (request != null) { method = request.getMethod() == null ? UNKOWN_MSG : request.getMethod().toString(); uri = request.getRawRequestUri() == null ? UNKOWN_MSG : request.getRawRequestUri(); @@ -56,24 +56,24 @@ public class DebugTabRequest implements DebugTab { @Override public void appendHtml(final Writer writer) throws IOException { writer.append("<h2>Request Method</h2>\n") - .append("<p>").append(method).append("</p>\n") - .append("<h2>Request URI</h2>\n") - .append("<p>").append(DebugResponseHelperImpl.escapeHtml(uri)).append("</p>\n") - .append("<h2>Request Protocol</h2>\n") - .append("<p>").append(DebugResponseHelperImpl.escapeHtml(protocol)).append("</p>\n"); + .append("<p>").append(method).append("</p>\n") + .append("<h2>Request URI</h2>\n") + .append("<p>").append(DebugResponseHelperImpl.escapeHtml(uri)).append("</p>\n") + .append("<h2>Request Protocol</h2>\n") + .append("<p>").append(DebugResponseHelperImpl.escapeHtml(protocol)).append("</p>\n"); writer.append("<h2>Request Headers</h2>\n"); writer.append("<table>\n<thead>\n") - .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n") - .append("</thead>\n<tbody>\n"); + .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n") + .append("</thead>\n<tbody>\n"); for (final Map.Entry<String, List<String>> entry : headers.entrySet()) { List<String> headersList = entry.getValue(); if (headersList != null && !headersList.isEmpty()) { for (String headerValue : headersList) { writer.append("<tr><td class=\"name\">").append(entry.getKey()).append("</td>") - .append("<td class=\"value\">") - .append(DebugResponseHelperImpl.escapeHtml(headerValue)) - .append("</td></tr>\n"); + .append("<td class=\"value\">") + .append(DebugResponseHelperImpl.escapeHtml(headerValue)) + .append("</td></tr>\n"); } } } @@ -86,7 +86,7 @@ public class DebugTabRequest implements DebugTab { } @Override - public void appendJson(JsonGenerator gen) throws IOException { + public void appendJson(final JsonGenerator gen) throws IOException { gen.writeStartObject(); gen.writeStringField("method", method); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java index 12ffc00..03ae262 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.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 @@ -40,7 +40,7 @@ public class DebugTabResponse implements DebugTab { private final Map<String, List<String>> headers; public DebugTabResponse(final ODataResponse applicationResponse) { - this.response = applicationResponse; + response = applicationResponse; if (response != null) { status = HttpStatusCode.fromStatusCode(response.getStatusCode()); headers = response.getAllHeaders(); @@ -82,7 +82,7 @@ public class DebugTabResponse implements DebugTab { gen.writeEndObject(); } - private Map<String, String> map(Map<String, List<String>> headers) { + private Map<String, String> map(final Map<String, List<String>> headers) { Map<String, String> result = new HashMap<String, String>(); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { if (entry.getValue().size() == 1) { @@ -97,9 +97,9 @@ public class DebugTabResponse implements DebugTab { @Override public void appendHtml(final Writer writer) throws IOException { writer.append("<h2>Status Code</h2>\n") - .append("<p>").append(Integer.toString(status.getStatusCode())).append(' ') - .append(status.getInfo()).append("</p>\n") - .append("<h2>Response Headers</h2>\n"); + .append("<p>").append(Integer.toString(status.getStatusCode())).append(' ') + .append(status.getInfo()).append("</p>\n") + .append("<h2>Response Headers</h2>\n"); DebugResponseHelperImpl.appendHtmlTable(writer, map(headers)); writer.append("<h2>Response Body</h2>\n"); if (response != null && response.getContent() != null) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java index 757a8b3..5737646 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.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 @@ -35,7 +35,7 @@ public class DebugTabRuntime implements DebugTab { private final RuntimeNode rootNode; - public DebugTabRuntime(List<RuntimeMeasurement> runtimeInformation) { + public DebugTabRuntime(final List<RuntimeMeasurement> runtimeInformation) { rootNode = new RuntimeNode(); for (final RuntimeMeasurement runtimeMeasurement : runtimeInformation) { rootNode.add(runtimeMeasurement); @@ -49,11 +49,11 @@ public class DebugTabRuntime implements DebugTab { } @Override - public void appendJson(JsonGenerator gen) throws IOException { + public void appendJson(final JsonGenerator gen) throws IOException { appendJsonChildren(gen, rootNode); } - private void appendJsonChildren(JsonGenerator gen, RuntimeNode node) throws IOException { + private void appendJsonChildren(final JsonGenerator gen, final RuntimeNode node) throws IOException { gen.writeStartArray(); for (RuntimeNode child : node.children) { appendJsonNode(gen, child); @@ -61,7 +61,7 @@ public class DebugTabRuntime implements DebugTab { gen.writeEndArray(); } - private void appendJsonNode(JsonGenerator gen, RuntimeNode node) throws IOException { + private void appendJsonNode(final JsonGenerator gen, final RuntimeNode node) throws IOException { gen.writeStartObject(); gen.writeStringField("class", node.className); gen.writeStringField("method ", node.methodName); @@ -90,25 +90,25 @@ public class DebugTabRuntime implements DebugTab { throws IOException { if (node.className != null) { writer.append("<li>\n") - .append("<span class=\"code\">") - .append("<span class=\"draw\">").append(draw) - .append(isLast ? "└" : "├").append("─ </span>") - .append("<span class=\"class\">").append(node.className).append("</span>.") - .append("<span class=\"method\">").append(node.methodName).append("(…)") - .append("</span></span>"); + .append("<span class=\"code\">") + .append("<span class=\"draw\">").append(draw) + .append(isLast ? "└" : "├").append("─ </span>") + .append("<span class=\"class\">").append(node.className).append("</span>.") + .append("<span class=\"method\">").append(node.methodName).append("(…)") + .append("</span></span>"); long time = node.timeStopped == 0 ? 0 : (node.timeStopped - node.timeStarted) / 1000; writer.append("<span class=\"").append(time == 0 ? "null" : "numeric") - .append("\" title=\"").append(time == 0 ? "Stop time missing" : "Gross duration") - .append("\">").append(time == 0 ? "unfinished" : Long.toString(time) + " µs") - .append("</span>\n"); + .append("\" title=\"").append(time == 0 ? "Stop time missing" : "Gross duration") + .append("\">").append(time == 0 ? "unfinished" : Long.toString(time) + " µs") + .append("</span>\n"); } if (!node.children.isEmpty()) { writer.append("<ol class=\"tree\">\n"); for (final RuntimeNode childNode : node.children) { appendRuntimeNode(childNode, node.className == null ? draw : draw + (isLast ? " " : "│") + " ", - node.children.indexOf(childNode) == node.children.size() - 1, - writer); + node.children.indexOf(childNode) == node.children.size() - 1, + writer); } writer.append("</ol>\n"); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java index 1601075..9c76246 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.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 @@ -31,7 +31,7 @@ public class DebugTabServer implements DebugTab { private final Map<String, String> serverEnvironmentVariables; - public DebugTabServer(Map<String, String> serverEnvironmentVariables) { + public DebugTabServer(final Map<String, String> serverEnvironmentVariables) { this.serverEnvironmentVariables = serverEnvironmentVariables; } @@ -41,15 +41,15 @@ public class DebugTabServer implements DebugTab { } @Override - public void appendJson(JsonGenerator gen) throws IOException { + public void appendJson(final JsonGenerator gen) throws IOException { DebugResponseHelperImpl.appendJsonTable(gen, serverEnvironmentVariables); } @Override - public void appendHtml(Writer writer) throws IOException { + public void appendHtml(final Writer writer) throws IOException { writer.append("<h2>Library Version</h2>\n") - .append("<p>").append(DebugResponseHelperImpl.getVersion()).append("</p>\n") - .append("<h2>Server Environment</h2>\n"); + .append("<p>").append(DebugResponseHelperImpl.getVersion()).append("</p>\n") + .append("<h2>Server Environment</h2>\n"); DebugResponseHelperImpl.appendHtmlTable(writer, serverEnvironmentVariables); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java index 0d79e85..3cc94b6 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.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 @@ -110,9 +110,9 @@ public class DebugTabStacktrace implements DebugTab { } final StackTraceElement details = throwable.getStackTrace()[0]; writer.append("<h2>").append(throwable.getClass().getCanonicalName()).append("</h2>\n") - .append("<p>") - .append(DebugResponseHelperImpl.escapeHtml(getMessageText(throwable))) - .append("</p>\n"); + .append("<p>") + .append(DebugResponseHelperImpl.escapeHtml(getMessageText(throwable))) + .append("</p>\n"); appendStackTraceElement(details, true, true, writer); } @@ -120,15 +120,15 @@ public class DebugTabStacktrace implements DebugTab { final boolean isFirst, final boolean isLast, final Writer writer) throws IOException { if (isFirst) { writer.append("<table>\n<thead>\n") - .append("<tr>\n<th class=\"name\">Class</th>\n") - .append("<th class=\"name\">Method</th>\n") - .append("<th class=\"value\">Line number in class</th>\n</tr>\n") - .append("</thead>\n<tbody>\n"); + .append("<tr>\n<th class=\"name\">Class</th>\n") + .append("<th class=\"name\">Method</th>\n") + .append("<th class=\"value\">Line number in class</th>\n</tr>\n") + .append("</thead>\n<tbody>\n"); } writer.append("<tr>\n<td class=\"name\">").append(stackTraceElement.getClassName()).append("</td>\n") - .append("<td class=\"name\">").append(stackTraceElement.getMethodName()).append("</td>\n") - .append("<td class=\"value\">").append(Integer.toString(stackTraceElement.getLineNumber())) - .append("</td>\n</tr>\n"); + .append("<td class=\"name\">").append(stackTraceElement.getMethodName()).append("</td>\n") + .append("<td class=\"value\">").append(Integer.toString(stackTraceElement.getLineNumber())) + .append("</td>\n</tr>\n"); if (isLast) { writer.append("</tbody>\n</table>\n"); }
