You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/06/11 14:46:11 UTC

[1/2] [OLINGO-317] Finished DeSerializer refactoring

Repository: olingo-odata4
Updated Branches:
  refs/heads/Olingo-317_DeSerializerRefactoring 46a341782 -> 70afb2acc


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeletedEntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeletedEntityImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeletedEntityImpl.java
index 67ab03b..1e2930f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeletedEntityImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeletedEntityImpl.java
@@ -23,10 +23,7 @@ import org.apache.olingo.commons.api.data.DeletedEntity;
 
 public class DeletedEntityImpl extends AbstractAnnotatedObject implements DeletedEntity {
 
-  private static final long serialVersionUID = 2075093398299488510L;
-
   private URI id;
-
   private Reason reason;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaLinkImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaLinkImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaLinkImpl.java
index 0834b55..7ed1de6 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaLinkImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaLinkImpl.java
@@ -23,12 +23,8 @@ import org.apache.olingo.commons.api.data.DeltaLink;
 
 public class DeltaLinkImpl extends AbstractAnnotatedObject implements DeltaLink {
 
-  private static final long serialVersionUID = 581329273399308799L;
-
   private URI source;
-
   private String relationship;
-
   private URI target;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntityImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntityImpl.java
index 28451a9..003c72d 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntityImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntityImpl.java
@@ -31,20 +31,15 @@ import org.apache.olingo.commons.api.domain.ODataOperation;
  */
 public class EntityImpl extends AbstractODataObject implements Entity {
 
-  private static final long serialVersionUID = 2127764552600969783L;
-
   private String eTag;
 
   private String type;
 
   private Link readLink;
-
   private Link editLink;
 
   private final List<Link> associationLinks = new ArrayList<Link>();
-
   private final List<Link> navigationLinks = new ArrayList<Link>();
-
   private final List<Link> mediaEditLinks = new ArrayList<Link>();
 
   private final List<ODataOperation> operations = new ArrayList<ODataOperation>();
@@ -52,9 +47,7 @@ public class EntityImpl extends AbstractODataObject implements Entity {
   private final List<Property> properties = new ArrayList<Property>();
 
   private URI mediaContentSource;
-
   private String mediaContentType;
-
   private String mediaETag;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntitySetImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntitySetImpl.java
index 1920809..3a985b4 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntitySetImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/EntitySetImpl.java
@@ -26,8 +26,6 @@ import org.apache.olingo.commons.api.data.EntitySet;
 
 public class EntitySetImpl extends AbstractODataObject implements EntitySet {
 
-  private static final long serialVersionUID = -9159884750819150969L;
-
   private Integer count;
 
   private final List<Entity> entities = new ArrayList<Entity>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONLinkCollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONLinkCollectionDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONLinkCollectionDeserializer.java
new file mode 100755
index 0000000..1876b9c
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONLinkCollectionDeserializer.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.core.data;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import org.apache.olingo.commons.api.Constants;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.data.v3.LinkCollection;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
+import org.apache.olingo.commons.core.data.v3.LinkCollectionImpl;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+public class JSONLinkCollectionDeserializer extends JsonDeserializer {
+
+  public JSONLinkCollectionDeserializer(final ODataServiceVersion version, final boolean serverMode) {
+    super(version, serverMode);
+  }
+
+  protected ResWrap<LinkCollection> doDeserialize(final JsonParser parser) throws IOException {
+
+    final ObjectNode tree = parser.getCodec().readTree(parser);
+
+    final LinkCollectionImpl links = new LinkCollectionImpl();
+
+    if (tree.hasNonNull("odata.metadata")) {
+      links.setMetadata(URI.create(tree.get("odata.metadata").textValue()));
+    }
+
+    if (tree.hasNonNull(Constants.JSON_URL)) {
+      links.getLinks().add(URI.create(tree.get(Constants.JSON_URL).textValue()));
+    }
+
+    if (tree.hasNonNull(Constants.VALUE)) {
+      for (final JsonNode item : tree.get(Constants.VALUE)) {
+        final URI uri = URI.create(item.get(Constants.JSON_URL).textValue());
+        links.getLinks().add(uri);
+      }
+    }
+
+    if (tree.hasNonNull(jsonNextLink)) {
+      links.setNext(URI.create(tree.get(jsonNextLink).textValue()));
+    }
+
+    return new ResWrap<LinkCollection>((URI) null, null, links);
+  }
+
+  public ResWrap<LinkCollection> toLinkCollection(InputStream input) throws ODataDeserializerException {
+    try {
+      JsonParser parser = new JsonFactory(new ObjectMapper()).createParser(input);
+      return doDeserialize(parser);
+    } catch (final IOException e) {
+      throw new ODataDeserializerException(e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JsonSerializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JsonSerializer.java
index e067d88..bf1c19e 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JsonSerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JsonSerializer.java
@@ -102,7 +102,7 @@ public class JsonSerializer implements ODataSerializer {
       } else if (obj instanceof Entity) {
         new JSONEntitySerializer(version, serverMode).doContainerSerialize((ResWrap<Entity>) container, json);
       } else if (obj instanceof Property) {
-        new JSONPropertySerializer(version, serverMode).doSerialize((Property) obj, json);
+        new JSONPropertySerializer(version, serverMode).doContainerSerialize((ResWrap<Property>) container, json);
       } else if (obj instanceof Link) {
         link((Link) obj, json);
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
index 85acc8f..72e09cf 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
@@ -24,20 +24,12 @@ import org.apache.olingo.commons.api.data.Link;
 
 public class LinkImpl extends AbstractAnnotatedObject implements Link {
 
-  private static final long serialVersionUID = -3449344217160035501L;
-
   private String title;
-
   private String rel;
-
   private String href;
-
   private String type;
-
   private String mediaETag;
-
   private Entity entity;
-
   private EntitySet entitySet;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/PropertyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/PropertyImpl.java
index 9d9f35c..f98e854 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/PropertyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/PropertyImpl.java
@@ -23,12 +23,8 @@ import org.apache.olingo.commons.api.data.Value;
 
 public class PropertyImpl extends AbstractAnnotatedObject implements Property {
 
-  private static final long serialVersionUID = -7175704800169997060L;
-
   private String name;
-
   private String type;
-
   private Value value;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/JSONLinkCollectionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/JSONLinkCollectionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/JSONLinkCollectionImpl.java
deleted file mode 100644
index edf871b..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/JSONLinkCollectionImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.core.data.v3;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.commons.api.data.v3.LinkCollection;
-import org.apache.olingo.commons.core.data.AbstractPayloadObject;
-
-/**
- * Link from an entity, represented via JSON.
- */
-public class JSONLinkCollectionImpl extends AbstractPayloadObject implements LinkCollection {
-
-  private static final long serialVersionUID = -5006368367235783907L;
-
-  /**
-   * JSON link URL representation.
-   */
-  static class JSONLinkURL extends AbstractPayloadObject {
-
-    private static final long serialVersionUID = 5365055617973271468L;
-
-    private URI url;
-
-    public URI getUrl() {
-      return url;
-    }
-
-    public void setUrl(final URI url) {
-      this.url = url;
-    }
-  }
-
-  @JsonProperty(value = "odata.metadata", required = false)
-  private URI metadata;
-
-  @JsonProperty(required = false)
-  private URI url;
-
-  @JsonProperty(value = "value", required = false)
-  private final List<JSONLinkURL> links = new ArrayList<JSONLinkURL>();
-
-  @JsonProperty(value = "odata.nextLink", required = false)
-  private String next;
-
-  /**
-   * Gets the metadata URI.
-   */
-  public URI getMetadata() {
-    return metadata;
-  }
-
-  /**
-   * Sets the metadata URI.
-   *
-   * @param metadata metadata URI.
-   */
-  public void setMetadata(final URI metadata) {
-    this.metadata = metadata;
-  }
-
-  /**
-   * {@inheritDoc }
-   */
-  @JsonIgnore
-  @Override
-  public List<URI> getLinks() {
-    final List<URI> result = new ArrayList<URI>();
-
-    if (this.url == null) {
-      for (JSONLinkURL link : links) {
-        result.add(link.getUrl());
-      }
-    } else {
-      result.add(this.url);
-    }
-
-    return result;
-  }
-
-  /**
-   * {@inheritDoc }
-   */
-  @JsonIgnore
-  @Override
-  public void setNext(final URI next) {
-    this.next = next == null ? null : next.toASCIIString();
-  }
-
-  /**
-   * {@inheritDoc }
-   */
-  @JsonIgnore
-  @Override
-  public URI getNext() {
-    return next == null ? null : URI.create(next);
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/LinkCollectionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/LinkCollectionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/LinkCollectionImpl.java
index 3310723..f62b423 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/LinkCollectionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v3/LinkCollectionImpl.java
@@ -21,9 +21,11 @@ package org.apache.olingo.commons.core.data.v3;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
+
 import org.apache.olingo.commons.api.data.v3.LinkCollection;
+import org.apache.olingo.commons.core.data.AbstractAnnotatedObject;
 
-public class LinkCollectionImpl implements LinkCollection {
+public class LinkCollectionImpl extends AbstractAnnotatedObject implements LinkCollection {
 
   private final List<URI> links = new ArrayList<URI>();
   private URI next;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java
index 021a77d..d507ebe 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java
@@ -27,12 +27,8 @@ import org.apache.olingo.commons.core.data.EntitySetImpl;
 
 public class DeltaImpl extends EntitySetImpl implements Delta {
 
-  private static final long serialVersionUID = 4576771708961553195L;
-
   private final List<DeletedEntity> deletedEntities = new ArrayList<DeletedEntity>();
-
   private final List<DeltaLink> addedLinks = new ArrayList<DeltaLink>();
-
   private final List<DeltaLink> deletedLinks = new ArrayList<DeltaLink>();
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/op/AbstractODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/op/AbstractODataDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/op/AbstractODataDeserializer.java
index a2ef134..548d79d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/op/AbstractODataDeserializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/op/AbstractODataDeserializer.java
@@ -51,12 +51,12 @@ public abstract class AbstractODataDeserializer {
   protected final ODataServiceVersion version;
   protected final ODataDeserializer deserializer;
 
-  public AbstractODataDeserializer(final ODataServiceVersion version, final Format format) {
+  public AbstractODataDeserializer(final ODataServiceVersion version, final boolean serverMode, final Format format) {
     this.version = version;
     if (format == ODataFormat.XML || format == ODataPubFormat.ATOM) {
       deserializer = new AtomDeserializer(version);
     } else {
-      deserializer = new JsonDeserializer(version, false);
+      deserializer = new JsonDeserializer(version, serverMode);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/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 cf9f3f3..acea9f5 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
@@ -18,52 +18,26 @@
  */
 package org.apache.olingo.server.core;
 
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
 import org.apache.olingo.commons.api.ODataRuntimeException;
-import org.apache.olingo.commons.api.data.ContextURL;
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.data.EntitySet;
-import org.apache.olingo.commons.api.data.Property;
-import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.http.HttpContentType;
-import org.apache.olingo.commons.api.http.HttpMethod;
 import org.apache.olingo.commons.api.http.HttpHeader;
-import org.apache.olingo.commons.core.data.EntityImpl;
-import org.apache.olingo.commons.core.data.EntitySetImpl;
-import org.apache.olingo.commons.core.data.PrimitiveValueImpl;
-import org.apache.olingo.commons.core.data.PropertyImpl;
-import org.apache.olingo.commons.core.op.InjectableSerializerProvider;
+import org.apache.olingo.commons.api.http.HttpMethod;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
-import org.apache.olingo.server.api.processor.DefaultProcessor;
-import org.apache.olingo.server.api.processor.EntityProcessor;
-import org.apache.olingo.server.api.processor.EntitySetProcessor;
-import org.apache.olingo.server.api.processor.MetadataProcessor;
-import org.apache.olingo.server.api.processor.Processor;
-import org.apache.olingo.server.api.processor.ServiceDocumentProcessor;
-import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.apache.olingo.server.api.processor.*;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourceNavigation;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
-import org.apache.olingo.server.core.serializer.utils.CircleStreamBuffer;
 import org.apache.olingo.server.core.uri.parser.Parser;
 import org.apache.olingo.server.core.uri.validator.UriValidator;
 
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.databind.InjectableValues;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public class ODataHandler {
 
@@ -134,39 +108,6 @@ public class ODataHandler {
     UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
     switch (lastPathSegment.getKind()) {
     case entitySet:
-      long time = System.nanoTime();
-      ResWrap<EntitySet> wrap = new ResWrap<EntitySet>(
-          ContextURL.getInstance(URI.create("dummyContextURL")), "dummyMetadataETag",
-          createEntitySet());
-      System.out.println((System.nanoTime() - time) / 1000 + " microseconds");
-      time = System.nanoTime();
-      CircleStreamBuffer buffer = new CircleStreamBuffer();
-      if (false) {
-        ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL);
-        mapper.setInjectableValues(new InjectableValues.Std()
-            .addValue(ODataServiceVersion.class, ODataServiceVersion.V40)
-            .addValue(Boolean.class, Boolean.TRUE));
-        mapper.setSerializerProvider(new InjectableSerializerProvider(mapper.getSerializerProvider(),
-            mapper.getSerializationConfig()
-                .withAttribute(ODataServiceVersion.class, ODataServiceVersion.V40)
-                .withAttribute(Boolean.class, Boolean.TRUE),
-            mapper.getSerializerFactory()));
-        try {
-          mapper.writeValue(buffer.getOutputStream(), wrap);
-        } catch (final IOException e) {}
-        response.setContent(buffer.getInputStream());
-      } else {
-        ODataSerializer serializer = odata.createSerializer(org.apache.olingo.server.api.serializer.ODataFormat.JSON);
-        response.setContent(serializer.entitySet(
-            edm.getEntityContainer(new FullQualifiedName("com.sap.odata.test1", "Container"))
-                .getEntitySet("ESAllPrim"),
-            wrap.getPayload(),
-            ContextURL.getInstance(URI.create("dummyContextURL"))));
-      }
-      System.out.println((System.nanoTime() - time) / 1000 + " microseconds");
-      response.setStatusCode(200);
-      response.setHeader("Content-Type", ContentType.APPLICATION_JSON);
-
       if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
         if (request.getMethod().equals(HttpMethod.GET)) {
           EntitySetProcessor esp = selectProcessor(EntitySetProcessor.class);
@@ -240,34 +181,4 @@ public class ODataHandler {
       }
     }
   }
-
-  protected Entity createEntity() {
-    Entity entity = new EntityImpl();
-    Property property = new PropertyImpl();
-    property.setName("PropertyString");
-    property.setType("String"); //"dummyType");
-    property.setValue(new PrimitiveValueImpl("dummyValue"));
-    entity.getProperties().add(property);
-    Property propertyInt = new PropertyImpl();
-    propertyInt.setName("PropertyInt16");
-    // propertyInt.setType("Edm.Int32");
-    propertyInt.setValue(new PrimitiveValueImpl("042"));
-    entity.getProperties().add(propertyInt);
-    Property propertyGuid = new PropertyImpl();
-    propertyGuid.setName("PropertyGuid");
-    propertyGuid.setType("Edm.Guid");
-    propertyGuid.setValue(new PrimitiveValueImpl(UUID.randomUUID().toString()));
-    entity.getProperties().add(propertyGuid);
-    return entity;
-  }
-
-  protected EntitySet createEntitySet() {
-    EntitySet entitySet = new EntitySetImpl();
-    entitySet.setCount(4242);
-    entitySet.setNext(URI.create("nextLinkURI"));
-    for (int i = 0; i < 1000; i++) {
-      entitySet.getEntities().add(createEntity());
-    }
-    return entitySet;
-  }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/server-tecsvc/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml
index 1371a00..3925fbd 100644
--- a/lib/server-tecsvc/pom.xml
+++ b/lib/server-tecsvc/pom.xml
@@ -122,6 +122,17 @@
     </dependency>
 
     <dependency>
+      <groupId>org.apache.olingo</groupId>
+      <artifactId>olingo-commons-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.olingo</groupId>
+      <artifactId>olingo-commons-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-simple</artifactId>
       <scope>runtime</scope>
@@ -140,6 +151,11 @@
       <artifactId>commons-io</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.olingo</groupId>
+      <artifactId>core</artifactId>
+      <version>0.1.0-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
index ec8a061..9841dd8 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
@@ -29,6 +29,7 @@ import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.ODataHttpHandler;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.tecsvc.data.DataProvider;
+import org.apache.olingo.server.tecsvc.processor.SampleJsonProcessor;
 import org.apache.olingo.server.tecsvc.processor.TechnicalProcessor;
 import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
 import org.slf4j.Logger;
@@ -56,8 +57,9 @@ public class TechnicalServlet extends HttpServlet {
 
     ODataHttpHandler handler = odata.createHandler(edm);
     
-    handler.register(new TechnicalProcessor(dataProvider));
-       
+//    handler.register(new TechnicalProcessor(dataProvider));
+    handler.register(new SampleJsonProcessor());
+
     handler.process(req, resp);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/SampleJsonProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/SampleJsonProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/SampleJsonProcessor.java
new file mode 100644
index 0000000..66e863b
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/SampleJsonProcessor.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.tecsvc.processor;
+
+import org.apache.olingo.commons.api.data.ContextURL;
+import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.EntitySet;
+import org.apache.olingo.commons.api.data.Property;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.commons.core.data.EntityImpl;
+import org.apache.olingo.commons.core.data.EntitySetImpl;
+import org.apache.olingo.commons.core.data.PrimitiveValueImpl;
+import org.apache.olingo.commons.core.data.PropertyImpl;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.ODataRequest;
+import org.apache.olingo.server.api.ODataResponse;
+import org.apache.olingo.server.api.processor.EntityProcessor;
+import org.apache.olingo.server.api.processor.EntitySetProcessor;
+import org.apache.olingo.server.api.serializer.ODataFormat;
+import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.URI;
+import java.util.UUID;
+
+public class SampleJsonProcessor implements EntitySetProcessor, EntityProcessor {
+    private static final Logger LOG = LoggerFactory.getLogger(SampleJsonProcessor.class);
+
+    private OData odata;
+    private Edm edm;
+
+    @Override
+    public void init(OData odata, Edm edm) {
+      this.odata = odata;
+      this.edm = edm;
+    }
+
+    @Override
+    public void readEntitySet(ODataRequest request, ODataResponse response, UriInfo uriInfo, String format) {
+      long time = System.nanoTime();
+
+      EntitySet entitySet = createEntitySet();
+
+      LOG.info((System.nanoTime() - time) / 1000 + " microseconds");
+      time = System.nanoTime();
+      ODataSerializer serializer = odata.createSerializer(ODataFormat.JSON);
+      response.setContent(serializer.entitySet(
+              edm.getEntityContainer(new FullQualifiedName("com.sap.odata.test1", "Container"))
+                      .getEntitySet("ESAllPrim"),
+              entitySet,
+              ContextURL.getInstance(URI.create("dummyContextURL"))));
+      LOG.info("Finished in " + (System.nanoTime() - time) / 1000 + " microseconds");
+
+      response.setStatusCode(200);
+      response.setHeader("Content-Type", ContentType.APPLICATION_JSON);
+    }
+
+    @Override
+    public void readEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, String format) {
+      long time = System.nanoTime();
+      Entity entity = createEntity();
+
+      LOG.info((System.nanoTime() - time) / 1000 + " microseconds");
+      time = System.nanoTime();
+      ODataSerializer serializer = odata.createSerializer(ODataFormat.JSON);
+      response.setContent(serializer.entity(
+              edm.getEntityContainer(new FullQualifiedName("com.sap.odata.test1", "Container"))
+                      .getEntitySet("ESAllPrim").getEntityType(),
+              entity,
+              ContextURL.getInstance(URI.create("dummyContextURL"))));
+      LOG.info("Finished in " + (System.nanoTime() - time) / 1000 + " microseconds");
+
+      response.setStatusCode(200);
+      response.setHeader("Content-Type", ContentType.APPLICATION_JSON);
+    }
+
+    protected Entity createEntity() {
+      Entity entity = new EntityImpl();
+      Property property = new PropertyImpl();
+      property.setName("PropertyString");
+      property.setType("String"); //"dummyType");
+      property.setValue(new PrimitiveValueImpl("dummyValue"));
+      entity.getProperties().add(property);
+      Property propertyInt = new PropertyImpl();
+      propertyInt.setName("PropertyInt16");
+      // propertyInt.setType("Edm.Int32");
+      propertyInt.setValue(new PrimitiveValueImpl("42"));
+      entity.getProperties().add(propertyInt);
+      Property propertyGuid = new PropertyImpl();
+      propertyGuid.setName("PropertyGuid");
+      propertyGuid.setType("Edm.Guid");
+      propertyGuid.setValue(new PrimitiveValueImpl(UUID.randomUUID().toString()));
+      entity.getProperties().add(propertyGuid);
+      return entity;
+    }
+
+    protected EntitySet createEntitySet() {
+      EntitySet entitySet = new EntitySetImpl();
+      entitySet.setCount(4242);
+      entitySet.setNext(URI.create("nextLinkURI"));
+      for (int i = 0; i < 1000; i++) {
+        entitySet.getEntities().add(createEntity());
+      }
+      return entitySet;
+    }
+  }


[2/2] git commit: [OLINGO-317] Finished DeSerializer refactoring

Posted by mi...@apache.org.
[OLINGO-317] Finished DeSerializer refactoring


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/70afb2ac
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/70afb2ac
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/70afb2ac

Branch: refs/heads/Olingo-317_DeSerializerRefactoring
Commit: 70afb2acc50aef1270858bad75eb8dc125b08c3f
Parents: 46a3417
Author: Michael Bolz <mi...@sap.com>
Authored: Wed Jun 11 13:39:53 2014 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Wed Jun 11 14:29:57 2014 +0200

----------------------------------------------------------------------
 .../org/apache/olingo/fit/AbstractServices.java | 114 ++++++++++-------
 .../java/org/apache/olingo/fit/V4Services.java  |   2 +-
 .../olingo/fit/utils/AbstractUtilities.java     |  54 ++++----
 .../org/apache/olingo/fit/utils/Commons.java    |  15 +--
 .../org/apache/olingo/fit/utils/FSManager.java  |  18 +--
 .../apache/olingo/fit/utils/JSONUtilities.java  |  42 +++----
 .../org/apache/olingo/fit/utils/XMLElement.java |  12 +-
 .../olingo/fit/utils/XMLEventReaderWrapper.java |   6 +-
 .../apache/olingo/fit/utils/XMLUtilities.java   |   6 +-
 .../communication/request/AbstractRequest.java  |   4 +-
 .../cud/ODataEntityCreateRequestImpl.java       |  17 ++-
 .../cud/ODataEntityUpdateRequestImpl.java       |  17 ++-
 .../cud/ODataPropertyUpdateRequestImpl.java     |   5 +-
 .../cud/v3/ODataLinkCreateRequestImpl.java      |  11 +-
 .../cud/v3/ODataLinkUpdateRequestImpl.java      |  19 +--
 .../invoke/AbstractODataInvokeRequest.java      |  18 +--
 .../retrieve/ODataEntityRequestImpl.java        |   5 +-
 .../retrieve/ODataEntitySetRequestImpl.java     |   5 +-
 .../retrieve/ODataPropertyRequestImpl.java      |   2 +-
 .../request/retrieve/ODataRawRequestImpl.java   |   7 +-
 .../ODataServiceDocumentRequestImpl.java        |   3 +-
 .../v3/ODataLinkCollectionRequestImpl.java      |   2 +-
 .../retrieve/v4/ODataDeltaRequestImpl.java      |   2 +-
 .../ODataMediaEntityCreateRequestImpl.java      |   7 +-
 .../ODataMediaEntityUpdateRequestImpl.java      |   7 +-
 .../client/core/op/AbstractODataBinder.java     |  34 ++---
 .../core/op/impl/v3/ODataDeserializerImpl.java  |   7 +-
 .../client/core/op/impl/v4/ODataBinderImpl.java |  13 +-
 .../core/op/impl/v4/ODataDeserializerImpl.java  |   4 +-
 .../olingo/client/core/v3/ODataClientImpl.java  |   2 +-
 .../olingo/client/core/v4/ODataClientImpl.java  |   2 +-
 .../core/data/AbstractAnnotatedObject.java      |  23 +++-
 .../commons/core/data/AbstractODataObject.java  |   6 +-
 .../core/data/AbstractPayloadObject.java        |  48 -------
 .../commons/core/data/AnnotationImpl.java       |   4 -
 .../commons/core/data/DeletedEntityImpl.java    |   3 -
 .../olingo/commons/core/data/DeltaLinkImpl.java |   4 -
 .../olingo/commons/core/data/EntityImpl.java    |   7 --
 .../olingo/commons/core/data/EntitySetImpl.java |   2 -
 .../data/JSONLinkCollectionDeserializer.java    |  80 ++++++++++++
 .../commons/core/data/JsonSerializer.java       |   2 +-
 .../olingo/commons/core/data/LinkImpl.java      |   8 --
 .../olingo/commons/core/data/PropertyImpl.java  |   4 -
 .../core/data/v3/JSONLinkCollectionImpl.java    | 118 -----------------
 .../core/data/v3/LinkCollectionImpl.java        |   4 +-
 .../olingo/commons/core/data/v4/DeltaImpl.java  |   4 -
 .../core/op/AbstractODataDeserializer.java      |   4 +-
 .../apache/olingo/server/core/ODataHandler.java | 101 +--------------
 lib/server-tecsvc/pom.xml                       |  16 +++
 .../olingo/server/tecsvc/TechnicalServlet.java  |   6 +-
 .../tecsvc/processor/SampleJsonProcessor.java   | 126 +++++++++++++++++++
 51 files changed, 494 insertions(+), 538 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index 71a7bf5..ad931b9 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -73,6 +73,7 @@ import org.apache.olingo.commons.api.data.EntitySet;
 import org.apache.olingo.commons.api.data.Link;
 import org.apache.olingo.commons.api.data.Property;
 import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.data.Value;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 import org.apache.olingo.commons.api.format.ContentType;
@@ -80,6 +81,7 @@ import org.apache.olingo.commons.api.op.ODataDeserializer;
 import org.apache.olingo.commons.api.op.ODataSerializer;
 import org.apache.olingo.commons.core.data.AtomSerializer;
 import org.apache.olingo.commons.core.data.EntityImpl;
+import org.apache.olingo.commons.core.data.EntitySetImpl;
 import org.apache.olingo.commons.core.data.JsonDeserializer;
 import org.apache.olingo.commons.core.data.JsonSerializer;
 import org.apache.olingo.commons.core.data.LinkImpl;
@@ -201,7 +203,7 @@ public abstract class AbstractServices {
     try {
       final boolean continueOnError = prefer.contains("odata.continue-on-error");
       return xml.createBatchResponse(
-              exploreMultipart(attachment.getAllAttachments(), BOUNDARY, continueOnError), BOUNDARY);
+              exploreMultipart(attachment.getAllAttachments(), BOUNDARY, continueOnError));
     } catch (IOException e) {
       return xml.createFaultResponse(Accept.XML.toString(version), e);
     }
@@ -638,17 +640,11 @@ public abstract class AbstractServices {
         final Accept contentTypeValue = Accept.parse(contentType, version);
         if (Accept.ATOM == contentTypeValue) {
           container = atomDeserializer.toEntity(IOUtils.toInputStream(entity, Constants.ENCODING));
-          entry = container.getPayload();
         } else {
-          final ResWrap<Entity> jcontainer = jsonDeserializer.toEntity(
-              IOUtils.toInputStream(entity, Constants.ENCODING));
-          entry = jcontainer.getPayload();
-
-          container = new ResWrap<Entity>(
-                  jcontainer.getContextURL(),
-                  jcontainer.getMetadataETag(),
-                  entry);
+          container = jsonDeserializer.toEntity(IOUtils.toInputStream(entity, Constants.ENCODING));
         }
+        entry = container.getPayload();
+        updateInlineEntities(entry);
 
         entityKey = xml.getDefaultEntryKey(entitySetName, entry);
       }
@@ -1116,7 +1112,7 @@ public abstract class AbstractServices {
       } catch (Exception e) {
         LOG.error("Error retrieving entity", e);
         return xml.createFaultResponse(accept, e);
-      }
+     }
     } else {
       return internal;
     }
@@ -1348,8 +1344,7 @@ public abstract class AbstractServices {
       } else {
         final Property pchanges = xml.readProperty(
                 Accept.parse(contentType, version),
-                IOUtils.toInputStream(changes, Constants.ENCODING),
-                entry.getType());
+                IOUtils.toInputStream(changes, Constants.ENCODING));
 
         toBeReplaced.setValue(pchanges.getValue());
       }
@@ -1710,26 +1705,16 @@ public abstract class AbstractServices {
           final ByteArrayOutputStream content = new ByteArrayOutputStream();
           final OutputStreamWriter writer = new OutputStreamWriter(content, Constants.ENCODING);
 
-          if (linkInfo.isFeed()) {
-            final ResWrap<EntitySet> container = atomDeserializer.toEntitySet(stream);
-
-            if (acceptType == Accept.ATOM) {
-              atomSerializer.write(writer, container);
-            } else {
-              jsonSerializer.write(writer, container);
-            }
-            writer.flush();
-            writer.close();
+          final ResWrap<?> container = linkInfo.isFeed() ?
+              atomDeserializer.toEntitySet(stream) :
+              atomDeserializer.toEntity(stream);
+          if (acceptType == Accept.ATOM) {
+            atomSerializer.write(writer, container);
           } else {
-            final ResWrap<Entity> container = atomDeserializer.toEntity(stream);
-            if (acceptType == Accept.ATOM) {
-              atomSerializer.write(writer, container);
-            } else {
-              jsonSerializer.write(writer, container);
-            }
-            writer.flush();
-            writer.close();
+            jsonSerializer.write(writer, container);
           }
+          writer.flush();
+          writer.close();
 
           final String basePath = Commons.getEntityBasePath(entitySetName, entityId);
 
@@ -1797,20 +1782,17 @@ public abstract class AbstractServices {
 
     final ResWrap<Property> container = new ResWrap<Property>(
             URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
-            + (version.compareTo(ODataServiceVersion.V40) >= 0
-            ? entitySetName + "(" + entityId + ")/" + path
-            : property.getType())),
+                + (version.compareTo(ODataServiceVersion.V40) >= 0 ?
+                    entitySetName + "(" + entityId + ")/" + path : property.getType())),
             entryContainer.getMetadataETag(),
             property);
 
-    return xml.createResponse(
-            null,
-            searchForValue
-            ? IOUtils.toInputStream(
-            container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
-            ? StringUtils.EMPTY
-            : container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
-            : utils.writeProperty(acceptType, container),
+    return xml.createResponse(null,
+            searchForValue ?
+                IOUtils.toInputStream(container.getPayload().getValue() == null
+                || container.getPayload().getValue().isNull() ? StringUtils.EMPTY :
+                  container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING) :
+                utils.writeProperty(acceptType, container),
             Commons.getETag(Commons.getEntityBasePath(entitySetName, entityId), version),
             acceptType);
   }
@@ -1871,6 +1853,54 @@ public abstract class AbstractServices {
     return utils;
   }
 
+  protected void updateInlineEntities(Entity entity) {
+    final String type = entity.getType();
+    EntityType entityType;
+    Map<String, NavigationProperty> navProperties = Collections.emptyMap();
+    if (type != null && type.length() > 0) {
+      entityType = metadata.getEntityOrComplexType(type);
+      navProperties = entityType.getNavigationPropertyMap();
+    }
+
+    for (Property property : entity.getProperties()) {
+      if (navProperties.containsKey(property.getName())) {
+        Link alink = new LinkImpl();
+        alink.setTitle(property.getName());
+        alink.getAnnotations().addAll(property.getAnnotations());
+
+        alink.setType(navProperties.get(property.getName()).isEntitySet()
+                ? Constants.get(version, ConstantKey.ATOM_LINK_FEED)
+                : Constants.get(version, ConstantKey.ATOM_LINK_ENTRY));
+
+        alink.setRel(Constants.get(version, ConstantKey.ATOM_LINK_REL) + property.getName());
+
+        if (property.getValue().isComplex()) {
+          Entity inline = new EntityImpl();
+          inline.setType(navProperties.get(property.getName()).getType());
+          for (Property prop : property.getValue().asComplex().get()) {
+            inline.getProperties().add(prop);
+          }
+          alink.setInlineEntity(inline);
+
+        } else if (property.getValue().isCollection()) {
+          EntitySet inline = new EntitySetImpl();
+          for (Value value : property.getValue().asCollection().get()) {
+            Entity inlineEntity = new EntityImpl();
+            inlineEntity.setType(navProperties.get(property.getName()).getType());
+            for (Property prop : value.asComplex().get()) {
+              inlineEntity.getProperties().add(prop);
+            }
+            inline.getEntities().add(inlineEntity);
+          }
+          alink.setInlineEntitySet(inline);
+        } else {
+          throw new IllegalStateException("Invalid navigation property " + property);
+        }
+        entity.getNavigationLinks().add(alink);
+      }
+    }
+  }
+
   protected void normalizeAtomEntry(final Entity entry, final String entitySetName, final String entityKey) {
     final org.apache.olingo.fit.metadata.EntitySet entitySet = metadata.getEntitySet(entitySetName);
     final EntityType entityType = metadata.getEntityOrComplexType(entitySet.getType());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/V4Services.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Services.java b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
index 81f70ee..eaa66d0 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V4Services.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
@@ -134,7 +134,7 @@ public class V4Services extends AbstractServices {
 
         return xml.createResponse(feed, null, Accept.JSON_FULLMETA);
       } else {
-        throw new Exception("Unexpected crossjoin pattern");
+        throw new IOException("Unexpected crossjoin pattern");
       }
     } catch (Exception e) {
       return xml.createFaultResponse(Accept.JSON.toString(version), e);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
index 99a3320..4706aa4 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
@@ -100,7 +100,7 @@ public abstract class AbstractUtilities {
     this.fsManager = FSManager.instance(version);
     atomDeserializer = new FITAtomDeserializer(version);
     jsonDeserializer = new JsonDeserializer(version, true);
-    atomSerializer = new AtomSerializer(version);
+    atomSerializer = new AtomSerializer(version, true);
     jsonSerializer = new JsonSerializer(version, true);
   }
 
@@ -116,7 +116,6 @@ public abstract class AbstractUtilities {
    * @param is
    * @param links links to be added.
    * @return
-   * @throws IOException
    */
   protected abstract InputStream addLinks(
       final String entitySetName, final String entitykey, final InputStream is, final Set<String> links)
@@ -128,6 +127,7 @@ public abstract class AbstractUtilities {
    * @param is
    * @return
    * @throws IOException
+   * @throws XMLStreamException 
    */
   protected abstract Set<String> retrieveAllLinkNames(final InputStream is) throws Exception;
 
@@ -137,10 +137,8 @@ public abstract class AbstractUtilities {
    * @param entitySetName
    * @param is
    * @return
-   * @throws IOException
    */
-  protected abstract NavigationLinks retrieveNavigationInfo(
-      final String entitySetName, final InputStream is)
+  protected abstract NavigationLinks retrieveNavigationInfo(final String entitySetName, final InputStream is)
       throws Exception;
 
   /**
@@ -151,7 +149,6 @@ public abstract class AbstractUtilities {
    * @param is
    * @param links
    * @return
-   * @throws IOException
    */
   protected abstract InputStream normalizeLinks(
       final String entitySetName, final String entityKey, final InputStream is, final NavigationLinks links)
@@ -219,13 +216,13 @@ public abstract class AbstractUtilities {
     Set<String> linksToBeKept;
     try {
       linksToBeKept = new HashSet<String>(navigationProperties.keySet());
-    } catch (Exception e) {
+    } catch (NullPointerException e) {
       linksToBeKept = Collections.<String> emptySet();
     }
 
     for (String availableLink : new HashSet<String>(linksToBeKept)) {
       try {
-        fsManager.resolve(Commons.getLinksPath(version, entitySetName, key, availableLink, Accept.JSON_FULLMETA));
+        fsManager.resolve(Commons.getLinksPath(entitySetName, key, availableLink, Accept.JSON_FULLMETA));
       } catch (Exception e) {
         linksToBeKept.remove(availableLink);
       }
@@ -350,7 +347,7 @@ public abstract class AbstractUtilities {
       final String entitySetName,
       final String entityKey,
       final String linkName,
-      final Collection<String> links) throws IOException {
+      final Collection<String> links) throws Exception {
 
     final HashSet<String> uris = new HashSet<String>();
 
@@ -371,7 +368,7 @@ public abstract class AbstractUtilities {
 
   public void putLinksInMemory(
       final String basePath, final String entitySetName, final String linkName, final Collection<String> uris)
-      throws IOException {
+      throws Exception {
 
     fsManager.putInMemory(
         Commons.getLinksAsJSON(version, entitySetName, new SimpleEntry<String, Collection<String>>(linkName, uris)),
@@ -416,7 +413,7 @@ public abstract class AbstractUtilities {
     return createResponse(null, entity, etag, accept, null);
   }
 
-  public Response createBatchResponse(final InputStream stream, final String boundary) {
+  public Response createBatchResponse(final InputStream stream) {
     final Response.ResponseBuilder builder = version.compareTo(ODataServiceVersion.V30) <= 0
         ? Response.accepted(stream)
         : Response.ok(stream);
@@ -590,8 +587,7 @@ public abstract class AbstractUtilities {
     return IOUtils.toInputStream(writer.toString(), Constants.ENCODING);
   }
 
-  public Property readProperty(final Accept accept, final InputStream property, final String entryType)
-      throws ODataDeserializerException {
+  public Property readProperty(final Accept accept, final InputStream property) throws ODataDeserializerException {
     return (Accept.ATOM == accept || Accept.XML == accept ?
         atomDeserializer.toProperty(property) : jsonDeserializer.toProperty(property))
         .getPayload();
@@ -611,14 +607,14 @@ public abstract class AbstractUtilities {
   }
 
   private String getDefaultEntryKey(final String entitySetName, final Entity entry, final String propertyName)
-      throws Exception {
+      throws IOException {
 
     String res;
     if (entry.getProperty(propertyName) == null) {
       if (Commons.SEQUENCE.containsKey(entitySetName)) {
         res = String.valueOf(Commons.SEQUENCE.get(entitySetName) + 1);
       } else {
-        throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
+        throw new IOException(String.format("Unable to retrieve entity key value for %s", entitySetName));
       }
     } else {
       res = entry.getProperty(propertyName).getValue().asPrimitive().get();
@@ -639,7 +635,7 @@ public abstract class AbstractUtilities {
             productID = Commons.SEQUENCE.get(entitySetName) + 1;
             res = "OrderID=1" + ",ProductID=" + String.valueOf(productID);
           } else {
-            throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
+            throw new IOException(String.format("Unable to retrieve entity key value for %s", entitySetName));
           }
         } else {
           productID = Integer.valueOf(entity.getProperty("OrderID").getValue().asPrimitive().get());
@@ -654,7 +650,7 @@ public abstract class AbstractUtilities {
             messageId = Commons.SEQUENCE.get(entitySetName) + 1;
             res = "FromUsername=1" + ",MessageId=" + String.valueOf(messageId);
           } else {
-            throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
+            throw new IOException(String.format("Unable to retrieve entity key value for %s", entitySetName));
           }
         } else {
           messageId = Integer.valueOf(entity.getProperty("MessageId").getValue().asPrimitive().get());
@@ -697,7 +693,7 @@ public abstract class AbstractUtilities {
             productDetailId = Commons.SEQUENCE.get(entitySetName) + 1;
             res = "ProductID=" + String.valueOf(productId) + ",ProductDetailID=" + String.valueOf(productDetailId);
           } else {
-            throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
+            throw new IOException(String.format("Unable to retrieve entity key value for %s", entitySetName));
           }
           Commons.SEQUENCE.put(entitySetName, productDetailId);
         } else {
@@ -715,7 +711,7 @@ public abstract class AbstractUtilities {
       } else if ("People".equals(entitySetName)) {
         res = getDefaultEntryKey(entitySetName, entity, "PersonID");
       } else {
-        throw new Exception(String.format("EntitySet '%s' not found", entitySetName));
+        throw new IOException(String.format("EntitySet '%s' not found", entitySetName));
       }
 
       return res;
@@ -740,7 +736,7 @@ public abstract class AbstractUtilities {
    */
   public LinkInfo readLinks(
       final String entitySetName, final String entityId, final String linkName, final Accept accept)
-      throws Exception {
+          throws Exception {
 
     final String basePath = getLinksBasePath(entitySetName, entityId);
 
@@ -857,9 +853,11 @@ public abstract class AbstractUtilities {
       throws Exception;
 
   protected abstract InputStream replaceLink(
-      final InputStream toBeChanged, final String linkName, final InputStream replacement) throws Exception;
+      final InputStream toBeChanged, final String linkName, final InputStream replacement)
+          throws Exception;
 
-  public abstract InputStream selectEntity(final InputStream entity, final String[] propertyNames) throws Exception;
+  public abstract InputStream selectEntity(final InputStream entity, final String[] propertyNames)
+      throws Exception;
 
   protected abstract Accept getDefaultFormat();
 
@@ -869,16 +867,20 @@ public abstract class AbstractUtilities {
       final InputStream content, final String title, final String href) throws Exception;
 
   public abstract InputStream addOperation(
-      final InputStream content, final String name, final String metaAnchor, final String href) throws Exception;
+      final InputStream content, final String name, final String metaAnchor, final String href)
+      throws Exception;
 
   protected abstract InputStream replaceProperty(
       final InputStream src, final InputStream replacement, final List<String> path, final boolean justValue)
       throws Exception;
 
-  protected abstract InputStream deleteProperty(final InputStream src, final List<String> path) throws Exception;
+  protected abstract InputStream deleteProperty(final InputStream src, final List<String> path)
+      throws Exception;
 
-  public abstract Map.Entry<String, List<String>> extractLinkURIs(final InputStream is) throws Exception;
+  public abstract Map.Entry<String, List<String>> extractLinkURIs(final InputStream is)
+      throws Exception;
 
   public abstract Map.Entry<String, List<String>> extractLinkURIs(
-      final String entitySetName, final String entityId, final String linkName) throws Exception;
+      final String entitySetName, final String entityId, final String linkName)
+          throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
index c9f4128..16d984c 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
@@ -122,20 +122,13 @@ public abstract class Commons {
             + (StringUtils.isNotBlank(entityKey) ? getEntityKey(entityKey) + File.separatorChar : "");
   }
 
-  public static String getLinksURI(
-          final ODataServiceVersion version,
-          final String entitySetName,
-          final String entityId,
-          final String linkName) throws IOException {
+  public static String getLinksURI(final String entitySetName, final String entityId, final String linkName)
+      throws IOException {
     return getEntityURI(entitySetName, entityId) + "/" + linkName;
   }
 
-  public static String getLinksPath(
-          final ODataServiceVersion version,
-          final String entitySetName,
-          final String entityId,
-          final String linkName,
-          final Accept accept) throws IOException {
+  public static String getLinksPath(final String entitySetName, final String entityId,
+      final String linkName, final Accept accept) throws IOException {
     return getLinksPath(ODataServiceVersion.V30, getEntityBasePath(entitySetName, entityId), linkName, accept);
 
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
index 374d0f5..650a98f 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
@@ -65,14 +65,14 @@ public class FSManager {
 
   private final ODataServiceVersion version;
 
-  public static FSManager instance(final ODataServiceVersion version) throws Exception {
+  public static FSManager instance(final ODataServiceVersion version) throws IOException {
     if (!instance.containsKey(version)) {
       instance.put(version, new FSManager(version));
     }
     return instance.get(version);
   }
 
-  private FSManager(final ODataServiceVersion version) throws Exception {
+  private FSManager(final ODataServiceVersion version) throws IOException {
     this.version = version;
     fsManager = VFS.getManager();
 
@@ -150,15 +150,15 @@ public class FSManager {
     try {
       final FileObject fileObject = fsManager.resolveFile(fs + path);
 
-      if (!fileObject.exists()) {
+      if (fileObject.exists()) {
+        // return new in-memory content
+        return fileObject.getContent().getInputStream();
+      } else {
         LOG.warn("In-memory path '{}' not found", path);
         throw new NotFoundException();
       }
-
-      // return new in-memory content
-      return fileObject.getContent().getInputStream();
-    } catch (IOException e) {
-      throw new NotFoundException(e);
+    } catch (FileSystemException e) {
+      throw new NotFoundException();
     }
   }
 
@@ -227,4 +227,4 @@ public class FSManager {
       }
     });
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java
index fe3f511..23a95cd 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.utils;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.AbstractMap.SimpleEntry;
 import java.util.ArrayList;
@@ -73,21 +74,21 @@ public class JSONUtilities extends AbstractUtilities {
   @Override
   protected InputStream addLinks(
           final String entitySetName, final String entitykey, final InputStream is, final Set<String> links)
-          throws Exception {
+          throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(is);
     IOUtils.closeQuietly(is);
 
     for (String link : links) {
       srcNode.set(link + Constants.get(version, ConstantKey.JSON_NAVIGATION_SUFFIX),
-              new TextNode(Commons.getLinksURI(version, entitySetName, entitykey, link)));
+              new TextNode(Commons.getLinksURI(entitySetName, entitykey, link)));
     }
 
     return IOUtils.toInputStream(srcNode.toString(), Constants.ENCODING);
   }
 
   @Override
-  protected Set<String> retrieveAllLinkNames(InputStream is) throws Exception {
+  protected Set<String> retrieveAllLinkNames(InputStream is) throws IOException {
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(is);
     IOUtils.closeQuietly(is);
 
@@ -115,7 +116,7 @@ public class JSONUtilities extends AbstractUtilities {
 
   @Override
   protected NavigationLinks retrieveNavigationInfo(final String entitySetName, final InputStream is)
-          throws Exception {
+          throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(is);
     IOUtils.closeQuietly(is);
@@ -150,13 +151,10 @@ public class JSONUtilities extends AbstractUtilities {
     return links;
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   protected InputStream normalizeLinks(
           final String entitySetName, final String entityKey, final InputStream is, final NavigationLinks links)
-          throws Exception {
+          throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(is);
 
@@ -191,9 +189,7 @@ public class JSONUtilities extends AbstractUtilities {
     return IOUtils.toInputStream(srcNode.toString(), Constants.ENCODING);
   }
 
-  public InputStream addJsonInlinecount(
-          final InputStream src, final int count, final Accept accept)
-          throws Exception {
+  public InputStream addJsonInlinecount(final InputStream src, final int count) throws Exception {
 
     final JsonNode srcNode = mapper.readTree(src);
 
@@ -208,7 +204,7 @@ public class JSONUtilities extends AbstractUtilities {
     return res;
   }
 
-  public InputStream wrapJsonEntities(final InputStream entities) throws Exception {
+  public InputStream wrapJsonEntities(final InputStream entities) throws IOException {
 
     final JsonNode node = mapper.readTree(entities);
 
@@ -237,7 +233,7 @@ public class JSONUtilities extends AbstractUtilities {
   }
 
   @Override
-  public InputStream selectEntity(final InputStream src, final String[] propertyNames) throws Exception {
+  public InputStream selectEntity(final InputStream src, final String[] propertyNames) throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(src);
 
@@ -264,7 +260,7 @@ public class JSONUtilities extends AbstractUtilities {
   @Override
   public InputStream readEntities(
           final List<String> links, final String linkName, final String next, final boolean forceFeed)
-          throws Exception {
+          throws IOException {
 
     if (links.isEmpty()) {
       throw new NotFoundException();
@@ -312,7 +308,7 @@ public class JSONUtilities extends AbstractUtilities {
   @Override
   protected InputStream replaceLink(
           final InputStream toBeChanged, final String linkName, final InputStream replacement)
-          throws Exception {
+          throws IOException {
 
     final ObjectNode toBeChangedNode = (ObjectNode) mapper.readTree(toBeChanged);
     final ObjectNode replacementNode = (ObjectNode) mapper.readTree(replacement);
@@ -332,7 +328,7 @@ public class JSONUtilities extends AbstractUtilities {
   }
 
   @Override
-  protected Map<String, InputStream> getChanges(final InputStream src) throws Exception {
+  protected Map<String, InputStream> getChanges(final InputStream src) throws IOException {
     final Map<String, InputStream> res = new HashMap<String, InputStream>();
 
     final JsonNode srcObject = mapper.readTree(src);
@@ -348,15 +344,13 @@ public class JSONUtilities extends AbstractUtilities {
 
   @Override
   public Map.Entry<String, List<String>> extractLinkURIs(
-          final String entitySetName, final String entityId, final String linkName)
-          throws Exception {
+          final String entitySetName, final String entityId, final String linkName) throws Exception {
     final LinkInfo links = readLinks(entitySetName, entityId, linkName, Accept.JSON_FULLMETA);
     return extractLinkURIs(links.getLinks());
   }
 
   @Override
-  public Map.Entry<String, List<String>> extractLinkURIs(final InputStream is)
-          throws Exception {
+  public Map.Entry<String, List<String>> extractLinkURIs(final InputStream is) throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(is);
     IOUtils.closeQuietly(is);
@@ -383,7 +377,7 @@ public class JSONUtilities extends AbstractUtilities {
 
   @Override
   public InputStream addEditLink(
-          final InputStream content, final String title, final String href) throws Exception {
+          final InputStream content, final String title, final String href) throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(content);
     IOUtils.closeQuietly(content);
@@ -394,7 +388,7 @@ public class JSONUtilities extends AbstractUtilities {
 
   @Override
   public InputStream addOperation(final InputStream content, final String name, final String metaAnchor,
-          final String href) throws Exception {
+          final String href) throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(content);
     IOUtils.closeQuietly(content);
@@ -410,7 +404,7 @@ public class JSONUtilities extends AbstractUtilities {
   @Override
   public InputStream replaceProperty(
           final InputStream src, final InputStream replacement, final List<String> path, final boolean justValue)
-          throws Exception {
+          throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(src);
     IOUtils.closeQuietly(src);
@@ -440,7 +434,7 @@ public class JSONUtilities extends AbstractUtilities {
   }
 
   @Override
-  public InputStream deleteProperty(final InputStream src, final List<String> path) throws Exception {
+  public InputStream deleteProperty(final InputStream src, final List<String> path) throws IOException {
 
     final ObjectNode srcNode = (ObjectNode) mapper.readTree(src);
     IOUtils.closeQuietly(src);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/XMLElement.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/XMLElement.java b/fit/src/main/java/org/apache/olingo/fit/utils/XMLElement.java
index b412ba3..c8a0ee8 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/XMLElement.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/XMLElement.java
@@ -24,10 +24,12 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
+
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.EndElement;
 import javax.xml.stream.events.StartElement;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 import org.slf4j.Logger;
@@ -66,7 +68,8 @@ public class XMLElement {
     return new ByteArrayInputStream(content.toByteArray());
   }
 
-  public XMLEventReader getContentReader(final ODataServiceVersion version) throws Exception {
+  public XMLEventReader getContentReader(final ODataServiceVersion version)
+      throws XMLStreamException, IOException {
     return new XMLEventReaderWrapper(getContent(), version);
   }
 
@@ -83,7 +86,7 @@ public class XMLElement {
     IOUtils.closeQuietly(content);
   }
 
-  public InputStream toStream() throws Exception {
+  public InputStream toStream() {
     InputStream res;
     try {
       final ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -98,7 +101,10 @@ public class XMLElement {
       osw.close();
 
       res = new ByteArrayInputStream(bos.toByteArray());
-    } catch (Exception e) {
+    } catch (IOException e) {
+      LOG.error("Error serializing element", e);
+      res = null;
+    } catch (XMLStreamException e) {
       LOG.error("Error serializing element", e);
       res = null;
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/XMLEventReaderWrapper.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/XMLEventReaderWrapper.java b/fit/src/main/java/org/apache/olingo/fit/utils/XMLEventReaderWrapper.java
index 7bae6d8..1774f0c 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/XMLEventReaderWrapper.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/XMLEventReaderWrapper.java
@@ -19,13 +19,16 @@
 package org.apache.olingo.fit.utils;
 
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.Charset;
+
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 
@@ -43,7 +46,8 @@ public class XMLEventReaderWrapper implements XMLEventReader {
 
   private XMLEvent nextGivenEvent = null;
 
-  public XMLEventReaderWrapper(final InputStream stream, final ODataServiceVersion version) throws Exception {
+  public XMLEventReaderWrapper(final InputStream stream, final ODataServiceVersion version)
+      throws IOException, XMLStreamException {
     final StringBuilder startBuilder = new StringBuilder();
     startBuilder.append("<").append(CONTENT).
             append(" xmlns:m").append("=\"").append(Constants.get(version, ConstantKey.METADATA_NS)).append("\"").

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java
index 84a6cd2..f5ba1c1 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java
@@ -155,7 +155,7 @@ public class XMLUtilities extends AbstractUtilities {
       final Set<Attribute> attributes = new HashSet<Attribute>();
       attributes.add(eventFactory.createAttribute(new QName("title"), link));
       attributes.add(eventFactory.createAttribute(new QName("href"),
-              Commons.getLinksURI(version, entitySetName, entitykey, link)));
+              Commons.getLinksURI(entitySetName, entitykey, link)));
       attributes.add(eventFactory.createAttribute(new QName("rel"),
               Constants.get(version, ConstantKey.ATOM_LINK_REL) + link));
       attributes.add(eventFactory.createAttribute(new QName("type"),
@@ -727,9 +727,7 @@ public class XMLUtilities extends AbstractUtilities {
     return new SimpleEntry<Integer, XMLElement>(Integer.valueOf(depth - 1), getXmlElement(start, reader));
   }
 
-  public InputStream addAtomInlinecount(
-          final InputStream feed, final int count, final Accept accept)
-          throws Exception {
+  public InputStream addAtomInlinecount(final InputStream feed, final int count) throws Exception {
     final XMLEventReader reader = getEventReader(feed);
 
     final ByteArrayOutputStream bos = new ByteArrayOutputStream();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
index da9b40f..d86f599 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
@@ -50,12 +50,12 @@ public abstract class AbstractRequest {
     // If using and Edm enabled client, checks that the cached service root matches the request URI
     if (odataClient instanceof CommonEdmEnabledODataClient
         && !request.getURI().toASCIIString().startsWith(
-            ((CommonEdmEnabledODataClient) odataClient).getServiceRoot())) {
+            ((CommonEdmEnabledODataClient<?>) odataClient).getServiceRoot())) {
 
       throw new IllegalArgumentException(
           String.format("The current request URI %s does not match the configured service root %s",
               request.getURI().toASCIIString(),
-              ((CommonEdmEnabledODataClient) odataClient).getServiceRoot()));
+              ((CommonEdmEnabledODataClient<?>) odataClient).getServiceRoot()));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
index 10236e0..67a6950 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityCreateRequestImpl.java
@@ -28,17 +28,16 @@ import org.apache.http.client.methods.HttpPost;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
 import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.commons.api.op.ODataDeserializerException;
-import org.apache.olingo.commons.api.op.ODataSerializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
-import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
-import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 
 /**
  * This class implements an OData create request.
@@ -74,7 +73,7 @@ public class ODataEntityCreateRequestImpl<E extends CommonODataEntity>
     try {
       return odataClient.getWriter().writeEntity(entity, ODataPubFormat.fromString(getContentType()));
     } catch (final ODataSerializerException e) {
-      throw new HttpClientException(e);
+      throw new IllegalArgumentException(e);
     }
   }
 
@@ -132,7 +131,7 @@ public class ODataEntityCreateRequestImpl<E extends CommonODataEntity>
           
           entity = (E) odataClient.getBinder().getODataEntity(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityUpdateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityUpdateRequestImpl.java
index acbe764..1165042 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityUpdateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataEntityUpdateRequestImpl.java
@@ -28,17 +28,16 @@ import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
 import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.commons.api.op.ODataDeserializerException;
-import org.apache.olingo.commons.api.op.ODataSerializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
-import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
-import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 
 /**
  * This class implements an OData update request.
@@ -89,7 +88,7 @@ public class ODataEntityUpdateRequestImpl<E extends CommonODataEntity>
     try {
       return odataClient.getWriter().writeEntity(changes, ODataPubFormat.fromString(getContentType()));
     } catch (final ODataSerializerException e) {
-      throw new HttpClientException(e);
+      throw new IllegalArgumentException(e);
     }
   }
 
@@ -130,7 +129,7 @@ public class ODataEntityUpdateRequestImpl<E extends CommonODataEntity>
 
           entity = (E) odataClient.getBinder().getODataEntity(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
index 759ebbb..5f9014d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/ODataPropertyUpdateRequestImpl.java
@@ -28,7 +28,6 @@ import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
 import org.apache.olingo.client.api.communication.response.ODataPropertyUpdateResponse;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
 import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
@@ -84,7 +83,7 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
     try {
       return odataClient.getWriter().writeProperty(property, ODataFormat.fromString(getContentType()));
     } catch (final ODataSerializerException e) {
-      throw new HttpClientException(e);
+      throw new IllegalArgumentException(e);
     }
   }
 
@@ -122,7 +121,7 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
 
           property = odataClient.getBinder().getODataProperty(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkCreateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkCreateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkCreateRequestImpl.java
index df31813..293908a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkCreateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkCreateRequestImpl.java
@@ -28,14 +28,13 @@ import org.apache.http.client.methods.HttpPost;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.cud.v3.ODataLinkCreateRequest;
 import org.apache.olingo.client.api.communication.response.ODataLinkOperationResponse;
-import org.apache.olingo.commons.api.domain.ODataLink;
-import org.apache.olingo.commons.api.format.ODataFormat;
-import org.apache.olingo.commons.api.op.ODataSerializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
-import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
+import org.apache.olingo.client.core.uri.URIUtils;
+import org.apache.olingo.commons.api.domain.ODataLink;
+import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 
 /**
  * This class implements an insert link OData request.
@@ -81,7 +80,7 @@ public class ODataLinkCreateRequestImpl extends AbstractODataBasicRequest<ODataL
     try {
       return odataClient.getWriter().writeLink(link, ODataFormat.fromString(getContentType()));
     } catch (final ODataSerializerException e) {
-      throw new HttpClientException(e);
+      throw new IllegalArgumentException(e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkUpdateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkUpdateRequestImpl.java
index ae1756c..5392ac6 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkUpdateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v3/ODataLinkUpdateRequestImpl.java
@@ -28,14 +28,13 @@ import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.cud.v3.ODataLinkUpdateRequest;
 import org.apache.olingo.client.api.communication.response.ODataLinkOperationResponse;
-import org.apache.olingo.commons.api.domain.ODataLink;
-import org.apache.olingo.commons.api.format.ODataFormat;
-import org.apache.olingo.commons.api.op.ODataSerializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
-import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
+import org.apache.olingo.client.core.uri.URIUtils;
+import org.apache.olingo.commons.api.domain.ODataLink;
+import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 
 /**
  * This class implements an update link OData request.
@@ -81,7 +80,7 @@ public class ODataLinkUpdateRequestImpl extends AbstractODataBasicRequest<ODataL
     try {
       return odataClient.getWriter().writeLink(link, ODataFormat.fromString(getContentType()));
     } catch (final ODataSerializerException e) {
-      throw new HttpClientException(e);
+      throw new IllegalArgumentException(e);
     }
   }
 
@@ -92,14 +91,6 @@ public class ODataLinkUpdateRequestImpl extends AbstractODataBasicRequest<ODataL
 
     /**
      * Constructor.
-     * <p>
-     * Just to create response templates to be initialized from batch.
-     */
-    private ODataLinkUpdateResponseImpl() {
-    }
-
-    /**
-     * Constructor.
      *
      * @param client HTTP client.
      * @param res HTTP response.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/invoke/AbstractODataInvokeRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/invoke/AbstractODataInvokeRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/invoke/AbstractODataInvokeRequest.java
index 8ecd827..7fcaa65 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/invoke/AbstractODataInvokeRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/invoke/AbstractODataInvokeRequest.java
@@ -34,21 +34,21 @@ import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
 import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest;
 import org.apache.olingo.client.api.communication.request.invoke.ODataNoContent;
 import org.apache.olingo.client.api.communication.response.ODataInvokeResponse;
+import org.apache.olingo.client.api.http.HttpClientException;
+import org.apache.olingo.client.api.http.HttpMethod;
+import org.apache.olingo.client.api.v4.ODataClient;
+import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
+import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
+import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
-import org.apache.olingo.commons.api.domain.ODataInvokeResult;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
+import org.apache.olingo.commons.api.domain.ODataInvokeResult;
 import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.commons.api.op.ODataSerializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
-import org.apache.olingo.client.api.http.HttpMethod;
-import org.apache.olingo.client.api.v4.ODataClient;
-import org.apache.olingo.client.core.uri.URIUtils;
-import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
-import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
 
 /**
  * This class implements an OData invoke operation request.
@@ -143,7 +143,7 @@ public abstract class AbstractODataInvokeRequest<T extends ODataInvokeResult>
       try {
         return odataClient.getWriter().writeEntity(tmp, getPOSTParameterFormat());
       } catch (final ODataSerializerException e) {
-        throw new HttpClientException(e);
+        throw new IllegalArgumentException(e);
       }
     }
 
@@ -228,7 +228,7 @@ public abstract class AbstractODataInvokeRequest<T extends ODataInvokeResult>
         } catch (IOException e) {
           throw new HttpClientException(e);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntityRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntityRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntityRequestImpl.java
index 2904577..cecbcd1 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntityRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntityRequestImpl.java
@@ -25,9 +25,8 @@ import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
-import org.apache.olingo.client.api.http.HttpClientException;
-import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
@@ -89,7 +88,7 @@ public class ODataEntityRequestImpl<E extends CommonODataEntity>
 
           entity = (E) odataClient.getBinder().getODataEntity(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntitySetRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntitySetRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntitySetRequestImpl.java
index 90df1e2..6e7df50 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntitySetRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataEntitySetRequestImpl.java
@@ -25,9 +25,8 @@ import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
-import org.apache.olingo.client.api.http.HttpClientException;
-import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.data.EntitySet;
+import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
@@ -98,7 +97,7 @@ public class ODataEntitySetRequestImpl<ES extends CommonODataEntitySet>
 
           entitySet = (ES) odataClient.getBinder().getODataEntitySet(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataPropertyRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataPropertyRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataPropertyRequestImpl.java
index 0be7920..c409d99 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataPropertyRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataPropertyRequestImpl.java
@@ -89,7 +89,7 @@ public class ODataPropertyRequestImpl<T extends CommonODataProperty>
         } catch (IOException e) {
           throw new HttpClientException(e);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataRawRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataRawRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataRawRequestImpl.java
index faa8a28..b2632b7 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataRawRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataRawRequestImpl.java
@@ -28,13 +28,12 @@ import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest;
 import org.apache.olingo.client.api.communication.response.ODataRawResponse;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.commons.api.op.ODataDeserializerException;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
 import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
 import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 
 /**
  * This class implements a generic OData request.
@@ -101,7 +100,7 @@ public class ODataRawRequestImpl extends AbstractODataRequest<ODataPubFormat>
         return odataClient.getReader().
                 read(new ByteArrayInputStream(obj), getContentType(), reference);
       } catch (final ODataDeserializerException e) {
-        throw new HttpClientException(e);
+        throw new IllegalArgumentException(e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataServiceDocumentRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataServiceDocumentRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataServiceDocumentRequestImpl.java
index b8605f9..cd11e91 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataServiceDocumentRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/ODataServiceDocumentRequestImpl.java
@@ -26,7 +26,6 @@ import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
 import org.apache.olingo.client.api.data.ServiceDocument;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.domain.ODataServiceDocument;
 import org.apache.olingo.commons.api.format.ODataFormat;
@@ -91,7 +90,7 @@ public class ODataServiceDocumentRequestImpl extends AbstractODataRetrieveReques
 
           serviceDocument = odataClient.getBinder().getODataServiceDocument(resource.getPayload());
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v3/ODataLinkCollectionRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v3/ODataLinkCollectionRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v3/ODataLinkCollectionRequestImpl.java
index 9cd5419..8c5ef8c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v3/ODataLinkCollectionRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v3/ODataLinkCollectionRequestImpl.java
@@ -89,7 +89,7 @@ public class ODataLinkCollectionRequestImpl extends AbstractODataRetrieveRequest
         } catch (IOException e) {
           throw new HttpClientException(e);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/ODataDeltaRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/ODataDeltaRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/ODataDeltaRequestImpl.java
index 00a61cc..41708b9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/ODataDeltaRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/ODataDeltaRequestImpl.java
@@ -74,7 +74,7 @@ public class ODataDeltaRequestImpl extends AbstractODataRetrieveRequest<ODataDel
         } catch (IOException e) {
           throw new HttpClientException(e);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityCreateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityCreateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityCreateRequestImpl.java
index 4e27bea..d669129 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityCreateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityCreateRequestImpl.java
@@ -28,13 +28,12 @@ import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.streamed.MediaEntityCreateStreamManager;
 import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityCreateRequest;
 import org.apache.olingo.client.api.communication.response.ODataMediaEntityCreateResponse;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
 import org.apache.olingo.client.core.communication.request.AbstractODataStreamManager;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
-import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
 
 /**
@@ -128,7 +127,7 @@ public class ODataMediaEntityCreateRequestImpl<E extends CommonODataEntity>
 
           entity = (E) odataClient.getBinder().getODataEntity(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityUpdateRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityUpdateRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityUpdateRequestImpl.java
index f06bed2..87a6fdb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityUpdateRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/ODataMediaEntityUpdateRequestImpl.java
@@ -28,13 +28,12 @@ import org.apache.olingo.client.api.CommonODataClient;
 import org.apache.olingo.client.api.communication.request.streamed.MediaEntityUpdateStreamManager;
 import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityUpdateRequest;
 import org.apache.olingo.client.api.communication.response.ODataMediaEntityUpdateResponse;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.http.HttpMethod;
 import org.apache.olingo.client.core.communication.request.AbstractODataStreamManager;
 import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
-import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
 
 /**
@@ -129,7 +128,7 @@ public class ODataMediaEntityUpdateRequestImpl<E extends CommonODataEntity>
 
           entity = (E) odataClient.getBinder().getODataEntity(resource);
         } catch (final ODataDeserializerException e) {
-          throw new HttpClientException(e);
+          throw new IllegalArgumentException(e);
         } finally {
           this.close();
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
index 5b0376b..1327e43 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
@@ -347,23 +347,23 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
       if (contextURL.getDerivedEntity() == null) {
         for (EdmSchema schema : edm.getSchemas()) {
           final EdmEntityContainer container = schema.getEntityContainer();
-          if(container != null) {
-	          EdmBindingTarget bindingTarget = container.getEntitySet(contextURL.getEntitySetOrSingletonOrType());
-	          if (bindingTarget == null) {
-	            bindingTarget = container.getSingleton(contextURL.getEntitySetOrSingletonOrType());
-	          }
-	          if (bindingTarget != null) {
-	            if (contextURL.getNavOrPropertyPath() == null) {
-	              type = bindingTarget.getEntityType();
-	            } else {
-	              final EdmNavigationProperty navProp = bindingTarget.getEntityType().
-	                      getNavigationProperty(contextURL.getNavOrPropertyPath());
-	
-	              type = navProp == null
-	                      ? bindingTarget.getEntityType()
-	                      : navProp.getType();
-	            }
-	          }
+          if (container != null) {
+            EdmBindingTarget bindingTarget = container.getEntitySet(contextURL.getEntitySetOrSingletonOrType());
+            if (bindingTarget == null) {
+              bindingTarget = container.getSingleton(contextURL.getEntitySetOrSingletonOrType());
+            }
+            if (bindingTarget != null) {
+              if (contextURL.getNavOrPropertyPath() == null) {
+                type = bindingTarget.getEntityType();
+              } else {
+                final EdmNavigationProperty navProp = bindingTarget.getEntityType().
+                    getNavigationProperty(contextURL.getNavOrPropertyPath());
+
+                type = navProp == null
+                    ? bindingTarget.getEntityType()
+                    : navProp.getType();
+              }
+            }
           }
         }
         if (type == null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v3/ODataDeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v3/ODataDeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v3/ODataDeserializerImpl.java
index d238a75..348d524 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v3/ODataDeserializerImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v3/ODataDeserializerImpl.java
@@ -36,14 +36,15 @@ import org.apache.olingo.commons.api.format.Format;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.commons.core.data.AtomDeserializer;
+import org.apache.olingo.commons.core.data.JSONLinkCollectionDeserializer;
 import org.apache.olingo.commons.core.op.AbstractODataDeserializer;
 
 public class ODataDeserializerImpl extends AbstractODataDeserializer implements ODataDeserializer {
 
   private final Format format;
 
-  public ODataDeserializerImpl(final ODataServiceVersion version, final Format format) {
-    super(version, format);
+  public ODataDeserializerImpl(final ODataServiceVersion version, final boolean serverMode, final Format format) {
+    super(version, serverMode, format);
     this.format = format;
   }
 
@@ -68,7 +69,7 @@ public class ODataDeserializerImpl extends AbstractODataDeserializer implements
     try {
       return format == ODataFormat.XML ?
           new AtomDeserializer(version).linkCollection(input) :
-          null; //json(input, LinkCollection.class);
+          new JSONLinkCollectionDeserializer(version, false).toLinkCollection(input);
     } catch (final XMLStreamException e) {
       throw new ODataDeserializerException(e);
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
index 0d3631a..9151b74 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
@@ -279,15 +279,14 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder
 
   @Override
   public ODataProperty getODataProperty(final ResWrap<Property> resource) {
+    final Property payload = resource.getPayload();
     final EdmTypeInfo typeInfo = buildTypeInfo(resource.getContextURL(), resource.getMetadataETag(),
-            resource.getPayload().getName(), resource.getPayload().getType());
+        payload.getName(), payload.getType());
 
-    final ODataProperty property = new ODataPropertyImpl(resource.getPayload().getName(),
-            getODataValue(typeInfo == null
-                    ? null
-                    : typeInfo.getFullQualifiedName(),
-                    resource.getPayload(), resource.getContextURL(), resource.getMetadataETag()));
-    odataAnnotations(resource.getPayload(), property);
+    final ODataProperty property = new ODataPropertyImpl(payload.getName(),
+        getODataValue(typeInfo == null ? null : typeInfo.getFullQualifiedName(),
+            payload, resource.getContextURL(), resource.getMetadataETag()));
+    odataAnnotations(payload, property);
 
     return property;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataDeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataDeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataDeserializerImpl.java
index 445db39..61e6ac6 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataDeserializerImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataDeserializerImpl.java
@@ -44,8 +44,8 @@ public class ODataDeserializerImpl extends AbstractODataDeserializer implements
 
   private final Format format;
 
-  public ODataDeserializerImpl(final ODataServiceVersion version, final Format format) {
-    super(version, format);
+  public ODataDeserializerImpl(final ODataServiceVersion version, final boolean serverMode, final Format format) {
+    super(version, serverMode, format);
     this.format = format;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
index 2042a9a..a0813eb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
@@ -104,7 +104,7 @@ public class ODataClientImpl extends AbstractODataClient<UpdateType> implements
 
   @Override
   public ODataDeserializer getDeserializer(final Format format) {
-    return new ODataDeserializerImpl(getServiceVersion(), format);
+    return new ODataDeserializerImpl(getServiceVersion(), false, format);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java
index 9f38353..4907a0b 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java
@@ -115,7 +115,7 @@ public class ODataClientImpl extends AbstractODataClient<UpdateType> implements
 
   @Override
   public ODataDeserializer getDeserializer(final Format format) {
-    return new ODataDeserializerImpl(getServiceVersion(), format);
+    return new ODataDeserializerImpl(getServiceVersion(), false, format);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
index 6383c80..a265f5c 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
@@ -20,12 +20,15 @@ package org.apache.olingo.commons.core.data;
 
 import java.util.ArrayList;
 import java.util.List;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.olingo.commons.api.data.Annotatable;
 import org.apache.olingo.commons.api.data.Annotation;
 
-public abstract class AbstractAnnotatedObject extends AbstractPayloadObject implements Annotatable {
-
-  private static final long serialVersionUID = 4163841499530412213L;
+public abstract class AbstractAnnotatedObject implements Annotatable {
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
@@ -34,4 +37,18 @@ public abstract class AbstractAnnotatedObject extends AbstractPayloadObject impl
     return annotations;
   }
 
+  @Override
+  public boolean equals(final Object obj) {
+    return EqualsBuilder.reflectionEquals(this, obj);
+  }
+
+  @Override
+  public int hashCode() {
+    return HashCodeBuilder.reflectionHashCode(this);
+  }
+
+  @Override
+  public String toString() {
+    return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
index b3eb7f9..e768417 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
@@ -21,14 +21,10 @@ package org.apache.olingo.commons.core.data;
 import java.net.URI;
 import java.text.ParseException;
 
-abstract class AbstractODataObject extends AbstractAnnotatedObject {
-
-  private static final long serialVersionUID = -4391162864875546927L;
+public abstract class AbstractODataObject extends AbstractAnnotatedObject {
 
   private URI baseURI;
-
   private URI id;
-
   private String title;
 
   public URI getBaseURI() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractPayloadObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractPayloadObject.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractPayloadObject.java
deleted file mode 100644
index bad009d..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractPayloadObject.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.core.data;
-
-import java.io.Serializable;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
-/**
- * Abstract representation of a payload (Atom, JSON) object.
- */
-public abstract class AbstractPayloadObject implements Serializable {
-
-  private static final long serialVersionUID = 1634654241914156675L;
-
-  @Override
-  public boolean equals(final Object obj) {
-    return EqualsBuilder.reflectionEquals(this, obj);
-  }
-
-  @Override
-  public int hashCode() {
-    return HashCodeBuilder.reflectionHashCode(this);
-  }
-
-  @Override
-  public String toString() {
-    return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70afb2ac/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AnnotationImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AnnotationImpl.java
index e6a277e..626c00e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AnnotationImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AnnotationImpl.java
@@ -23,12 +23,8 @@ import org.apache.olingo.commons.api.data.Value;
 
 public class AnnotationImpl extends AbstractAnnotatedObject implements Annotation {
 
-  private static final long serialVersionUID = -2532246000091187020L;
-
   private String term;
-
   private String type;
-
   private Value value;
 
   @Override